Repository navigation
Commit 2da33f7
arm/arm64: KVM: vgic: move reset initialization into vgic_init_maps()
commit 6d3cfbe upstream.
VGIC initialization currently happens in three phases:
(1) kvm_vgic_create() (triggered by userspace GIC creation)
(2) vgic_init_maps() (triggered by userspace GIC register read/write
requests, or from kvm_vgic_init() if not already run)
(3) kvm_vgic_init() (triggered by first VM run)
We were doing initialization of some state to correspond with the
state of a freshly-reset GIC in kvm_vgic_init(); this is too late,
since it will overwrite changes made by userspace using the
register access APIs before the VM is run. Move this initialization
earlier, into the vgic_init_maps() phase.
This fixes a bug where QEMU could successfully restore a saved
VM state snapshot into a VM that had already been run, but could
not restore it "from cold" using the -loadvm command line option
(the symptoms being that the restored VM would run but interrupts
were ignored).
Finally rename vgic_init_maps to vgic_init and renamed kvm_vgic_init to
kvm_vgic_map_resources.
[ This patch is originally written by Peter Maydell, but I have
modified it somewhat heavily, renaming various bits and moving code
around. If something is broken, I am to be blamed. - Christoffer ]
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Reviewed-by: Eric Auger <eric.auger@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>1 parent 63d4dc9 commit 2da33f7
3 files changed
Lines changed: 37 additions & 50 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
427 | 427 | | |
428 | 428 | | |
429 | 429 | | |
430 | | - | |
431 | | - | |
| 430 | + | |
| 431 | + | |
432 | 432 | | |
433 | 433 | | |
434 | | - | |
| 434 | + | |
435 | 435 | | |
436 | 436 | | |
437 | 437 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
277 | | - | |
| 277 | + | |
278 | 278 | | |
279 | 279 | | |
280 | 280 | | |
| |||
321 | 321 | | |
322 | 322 | | |
323 | 323 | | |
324 | | - | |
| 324 | + | |
325 | 325 | | |
326 | 326 | | |
327 | 327 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| 94 | + | |
94 | 95 | | |
95 | 96 | | |
96 | 97 | | |
| |||
1726 | 1727 | | |
1727 | 1728 | | |
1728 | 1729 | | |
1729 | | - | |
| 1730 | + | |
1730 | 1731 | | |
1731 | 1732 | | |
1732 | 1733 | | |
1733 | 1734 | | |
1734 | 1735 | | |
1735 | 1736 | | |
1736 | | - | |
1737 | | - | |
1738 | | - | |
1739 | | - | |
1740 | | - | |
1741 | | - | |
1742 | | - | |
1743 | | - | |
1744 | | - | |
1745 | | - | |
1746 | | - | |
1747 | | - | |
1748 | | - | |
1749 | | - | |
1750 | | - | |
1751 | | - | |
1752 | | - | |
1753 | | - | |
1754 | | - | |
1755 | | - | |
1756 | | - | |
1757 | | - | |
1758 | | - | |
1759 | | - | |
1760 | | - | |
1761 | | - | |
| 1737 | + | |
1762 | 1738 | | |
1763 | 1739 | | |
1764 | 1740 | | |
| |||
1767 | 1743 | | |
1768 | 1744 | | |
1769 | 1745 | | |
1770 | | - | |
| 1746 | + | |
1771 | 1747 | | |
1772 | 1748 | | |
1773 | 1749 | | |
| |||
1804 | 1780 | | |
1805 | 1781 | | |
1806 | 1782 | | |
1807 | | - | |
| 1783 | + | |
1808 | 1784 | | |
1809 | 1785 | | |
1810 | 1786 | | |
1811 | 1787 | | |
1812 | | - | |
| 1788 | + | |
1813 | 1789 | | |
1814 | 1790 | | |
1815 | 1791 | | |
| |||
1859 | 1835 | | |
1860 | 1836 | | |
1861 | 1837 | | |
1862 | | - | |
| 1838 | + | |
| 1839 | + | |
| 1840 | + | |
| 1841 | + | |
1863 | 1842 | | |
1864 | 1843 | | |
1865 | 1844 | | |
1866 | 1845 | | |
1867 | 1846 | | |
1868 | | - | |
1869 | 1847 | | |
1870 | | - | |
1871 | | - | |
| 1848 | + | |
| 1849 | + | |
| 1850 | + | |
| 1851 | + | |
| 1852 | + | |
| 1853 | + | |
| 1854 | + | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
| 1859 | + | |
1872 | 1860 | | |
1873 | 1861 | | |
1874 | 1862 | | |
| |||
1878 | 1866 | | |
1879 | 1867 | | |
1880 | 1868 | | |
1881 | | - | |
| 1869 | + | |
1882 | 1870 | | |
1883 | 1871 | | |
1884 | 1872 | | |
1885 | 1873 | | |
1886 | | - | |
1887 | | - | |
| 1874 | + | |
1888 | 1875 | | |
1889 | | - | |
| 1876 | + | |
1890 | 1877 | | |
1891 | | - | |
1892 | | - | |
| 1878 | + | |
1893 | 1879 | | |
1894 | 1880 | | |
1895 | 1881 | | |
| |||
1906 | 1892 | | |
1907 | 1893 | | |
1908 | 1894 | | |
1909 | | - | |
| 1895 | + | |
| 1896 | + | |
| 1897 | + | |
| 1898 | + | |
| 1899 | + | |
1910 | 1900 | | |
1911 | 1901 | | |
1912 | 1902 | | |
| |||
1920 | 1910 | | |
1921 | 1911 | | |
1922 | 1912 | | |
1923 | | - | |
1924 | | - | |
1925 | | - | |
1926 | 1913 | | |
1927 | 1914 | | |
1928 | 1915 | | |
| |||
2167 | 2154 | | |
2168 | 2155 | | |
2169 | 2156 | | |
2170 | | - | |
| 2157 | + | |
2171 | 2158 | | |
2172 | 2159 | | |
2173 | 2160 | | |
| |||
0 commit comments