diff options
author | Jiří Paleček <[email protected]> | 2019-06-22 19:42:04 +0200 |
---|---|---|
committer | Paolo Bonzini <[email protected]> | 2019-09-11 18:02:25 +0200 |
commit | 1cfff4d9a5d01fa61e5768a6afffc81ae1c8ecb9 (patch) | |
tree | ad001f9f8d93352135c5ff979ce09cd9db301dbc /tools/perf/util/c++/clang-test.cpp | |
parent | c8848cee74ff05638e913582a476bde879c968ad (diff) |
kvm: Nested KVM MMUs need PAE root too
On AMD processors, in PAE 32bit mode, nested KVM instances don't
work. The L0 host get a kernel OOPS, which is related to
arch.mmu->pae_root being NULL.
The reason for this is that when setting up nested KVM instance,
arch.mmu is set to &arch.guest_mmu (while normally, it would be
&arch.root_mmu). However, the initialization and allocation of
pae_root only creates it in root_mmu. KVM code (ie. in
mmu_alloc_shadow_roots) then accesses arch.mmu->pae_root, which is the
unallocated arch.guest_mmu->pae_root.
This fix just allocates (and frees) pae_root in both guest_mmu and
root_mmu (and also lm_root if it was allocated). The allocation is
subject to previous restrictions ie. it won't allocate anything on
64-bit and AFAIK not on Intel.
Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=203923
Fixes: 14c07ad89f4d ("x86/kvm/mmu: introduce guest_mmu")
Signed-off-by: Jiri Palecek <[email protected]>
Tested-by: Jiri Palecek <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
Diffstat (limited to 'tools/perf/util/c++/clang-test.cpp')
0 files changed, 0 insertions, 0 deletions