]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: fix use of L1 MMIO areas in nested guests
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 17 Aug 2017 16:36:58 +0000 (18:36 +0200)
committerRadim Krčmář <rkrcmar@redhat.com>
Fri, 18 Aug 2017 12:37:49 +0000 (14:37 +0200)
commitfc89e10737416fe718a319a7c6c0ddae64534ba1
treee23bf95f2a0463e93a7fd04268819759cf53ff09
parent7769325665910606ae3db83da434ef740cee5608
KVM: x86: fix use of L1 MMIO areas in nested guests

There is currently some confusion between nested and L1 GPAs.  The
assignment to "direct" in kvm_mmu_page_fault tries to fix that, but
it is not enough.  What this patch does is fence off the MMIO cache
completely when using shadow nested page tables, since we have neither
a GVA nor an L1 GPA to put in the cache.  This also allows some
simplifications in kvm_mmu_page_fault and FNAME(page_fault).

The EPT misconfig likewise does not have an L1 GPA to pass to
kvm_io_bus_write, so that must be skipped for guest mode.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
[Changed comment to say "GPAs" instead of "L1's physical addresses", as
 per David's review. - Radim]
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
arch/x86/kvm/mmu.c
arch/x86/kvm/paging_tmpl.h
arch/x86/kvm/vmx.c
arch/x86/kvm/x86.h