Repository navigation
Commit 6d3cfbe
arm/arm64: KVM: vgic: move reset initialization into vgic_init_maps()
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>1 parent 957db10 commit 6d3cfbe
3 files changed
Lines changed: 37 additions & 50 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
428 | 428 | | |
429 | 429 | | |
430 | 430 | | |
431 | | - | |
432 | | - | |
| 431 | + | |
| 432 | + | |
433 | 433 | | |
434 | 434 | | |
435 | | - | |
| 435 | + | |
436 | 436 | | |
437 | 437 | | |
438 | 438 | | |
| |||
| 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 | | |
| |||
1732 | 1733 | | |
1733 | 1734 | | |
1734 | 1735 | | |
1735 | | - | |
| 1736 | + | |
1736 | 1737 | | |
1737 | 1738 | | |
1738 | 1739 | | |
1739 | 1740 | | |
1740 | 1741 | | |
1741 | 1742 | | |
1742 | | - | |
1743 | | - | |
1744 | | - | |
1745 | | - | |
1746 | | - | |
1747 | | - | |
1748 | | - | |
1749 | | - | |
1750 | | - | |
1751 | | - | |
1752 | | - | |
1753 | | - | |
1754 | | - | |
1755 | | - | |
1756 | | - | |
1757 | | - | |
1758 | | - | |
1759 | | - | |
1760 | | - | |
1761 | | - | |
1762 | | - | |
1763 | | - | |
1764 | | - | |
1765 | | - | |
1766 | | - | |
1767 | | - | |
| 1743 | + | |
1768 | 1744 | | |
1769 | 1745 | | |
1770 | 1746 | | |
| |||
1773 | 1749 | | |
1774 | 1750 | | |
1775 | 1751 | | |
1776 | | - | |
| 1752 | + | |
1777 | 1753 | | |
1778 | 1754 | | |
1779 | 1755 | | |
| |||
1810 | 1786 | | |
1811 | 1787 | | |
1812 | 1788 | | |
1813 | | - | |
| 1789 | + | |
1814 | 1790 | | |
1815 | 1791 | | |
1816 | 1792 | | |
1817 | 1793 | | |
1818 | | - | |
| 1794 | + | |
1819 | 1795 | | |
1820 | 1796 | | |
1821 | 1797 | | |
| |||
1865 | 1841 | | |
1866 | 1842 | | |
1867 | 1843 | | |
1868 | | - | |
| 1844 | + | |
| 1845 | + | |
| 1846 | + | |
| 1847 | + | |
1869 | 1848 | | |
1870 | 1849 | | |
1871 | 1850 | | |
1872 | 1851 | | |
1873 | 1852 | | |
1874 | | - | |
1875 | 1853 | | |
1876 | | - | |
1877 | | - | |
| 1854 | + | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
| 1859 | + | |
| 1860 | + | |
| 1861 | + | |
| 1862 | + | |
| 1863 | + | |
| 1864 | + | |
| 1865 | + | |
1878 | 1866 | | |
1879 | 1867 | | |
1880 | 1868 | | |
| |||
1884 | 1872 | | |
1885 | 1873 | | |
1886 | 1874 | | |
1887 | | - | |
| 1875 | + | |
1888 | 1876 | | |
1889 | 1877 | | |
1890 | 1878 | | |
1891 | 1879 | | |
1892 | | - | |
1893 | | - | |
| 1880 | + | |
1894 | 1881 | | |
1895 | | - | |
| 1882 | + | |
1896 | 1883 | | |
1897 | | - | |
1898 | | - | |
| 1884 | + | |
1899 | 1885 | | |
1900 | 1886 | | |
1901 | 1887 | | |
| |||
1912 | 1898 | | |
1913 | 1899 | | |
1914 | 1900 | | |
1915 | | - | |
| 1901 | + | |
| 1902 | + | |
| 1903 | + | |
| 1904 | + | |
| 1905 | + | |
1916 | 1906 | | |
1917 | 1907 | | |
1918 | 1908 | | |
| |||
1926 | 1916 | | |
1927 | 1917 | | |
1928 | 1918 | | |
1929 | | - | |
1930 | | - | |
1931 | | - | |
1932 | 1919 | | |
1933 | 1920 | | |
1934 | 1921 | | |
| |||
2173 | 2160 | | |
2174 | 2161 | | |
2175 | 2162 | | |
2176 | | - | |
| 2163 | + | |
2177 | 2164 | | |
2178 | 2165 | | |
2179 | 2166 | | |
| |||
0 commit comments