2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-19 10:44:14 +08:00
linux-next/arch/x86/kvm
Avi Kivity f7d9c7b7b9 KVM: MMU: Fix race when instantiating a shadow pte
For improved concurrency, the guest walk is performed concurrently with other
vcpus.  This means that we need to revalidate the guest ptes once we have
write-protected the guest page tables, at which point they can no longer be
modified.

The current code attempts to avoid this check if the shadow page table is not
new, on the assumption that if it has existed before, the guest could not have
modified the pte without the shadow lock.  However the assumption is incorrect,
as the racing vcpu could have modified the pte, then instantiated the shadow
page, before our vcpu regains control:

  vcpu0        vcpu1

  fault
  walk pte

               modify pte
               fault in same pagetable
               instantiate shadow page

  lookup shadow page
  conclude it is old
  instantiate spte based on stale guest pte

We could do something clever with generation counters, but a test run by
Marcelo suggests this is unnecessary and we can just do the revalidation
unconditionally.  The pte will be in the processor cache and the check can
be quite fast.

Signed-off-by: Avi Kivity <avi@qumranet.com>
2008-03-04 15:19:49 +02:00
..
i8259.c KVM: Move arch dependent files to new directory arch/x86/kvm/ 2008-01-30 18:01:18 +02:00
irq.c KVM: Move kvm_vcpu_kick() to x86.c 2008-01-30 18:01:19 +02:00
irq.h KVM: Move apic timer migration away from critical section 2008-01-30 18:01:22 +02:00
Kconfig virtio: Put the virtio under the virtualization menu 2008-02-04 23:50:05 +11:00
kvm_svm.h KVM: Move arch dependent files to new directory arch/x86/kvm/ 2008-01-30 18:01:18 +02:00
lapic.c KVM: Avoid infinite-frequency local apic timer 2008-03-04 15:19:48 +02:00
lapic.h KVM: Accelerated apic support 2008-01-30 18:01:20 +02:00
Makefile KVM: Move ioapic code to common directory. 2008-01-30 18:01:19 +02:00
mmu.c KVM: MMU: Fix race when instantiating a shadow pte 2008-03-04 15:19:49 +02:00
mmu.h KVM: Move arch dependent files to new directory arch/x86/kvm/ 2008-01-30 18:01:18 +02:00
paging_tmpl.h KVM: MMU: Fix race when instantiating a shadow pte 2008-03-04 15:19:49 +02:00
segment_descriptor.h KVM: Move arch dependent files to new directory arch/x86/kvm/ 2008-01-30 18:01:18 +02:00
svm.c KVM: SVM: fix Windows XP 64 bit installation crash 2008-03-04 15:19:45 +02:00
svm.h KVM: Move arch dependent files to new directory arch/x86/kvm/ 2008-01-30 18:01:18 +02:00
vmx.c KVM: move alloc_apic_access_page() outside of non-preemptable region 2008-03-04 15:19:46 +02:00
vmx.h KVM: Move arch dependent files to new directory arch/x86/kvm/ 2008-01-30 18:01:18 +02:00
x86_emulate.c KVM: Move arch dependent files to new directory arch/x86/kvm/ 2008-01-30 18:01:18 +02:00
x86.c KVM: remove the usage of the mmap_sem for the protection of the memory slots. 2008-03-04 15:19:40 +02:00