diff options
author | Sean Christopherson <seanjc@google.com> | 2021-08-24 03:58:24 +0300 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2021-09-06 12:56:38 +0300 |
commit | a717a780fc4e1dddd3fbf9ad08f180eec2a78194 (patch) | |
tree | 7eeb7a6e4ffb8e8686152dcb91d1ff88f4721a11 /tools/perf/scripts/python/exported-sql-viewer.py | |
parent | 43e540cc9f2ca12a2364ddf64e5ef929a546550d (diff) | |
download | linux-a717a780fc4e1dddd3fbf9ad08f180eec2a78194.tar.xz |
KVM: x86/mmu: Don't freak out if pml5_root is NULL on 4-level host
Include pml5_root in the set of special roots if and only if the host,
and thus NPT, is using 5-level paging. mmu_alloc_special_roots() expects
special roots to be allocated as a bundle, i.e. they're either all valid
or all NULL. But for pml5_root, that expectation only holds true if the
host uses 5-level paging, which causes KVM to WARN about pml5_root being
NULL when the other special roots are valid.
The silver lining of 4-level vs. 5-level NPT being tied to the host
kernel's paging level is that KVM's shadow root level is constant; unlike
VMX's EPT, KVM can't choose 4-level NPT based on guest.MAXPHYADDR. That
means KVM can still expect pml5_root to be bundled with the other special
roots, it just needs to be conditioned on the shadow root level.
Fixes: cb0f722aff6e ("KVM: x86/mmu: Support shadowing NPT when 5-level paging is enabled in host")
Reported-by: Maxim Levitsky <mlevitsk@redhat.com>
Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20210824005824.205536-1-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tools/perf/scripts/python/exported-sql-viewer.py')
0 files changed, 0 insertions, 0 deletions