linux/arch/x86/kvm
Avi Kivity d3c422bd33 KVM: MMU: Fix incorrect direct page write protection due to ro host page
If KVM sees a read-only host page, it will map it as read-only to prevent
breaking a COW.  However, if the page was part of a large guest page, KVM
incorrectly extends the write protection to the entire large page frame
instead of limiting it to the normal host page.

This results in the instantiation of a new shadow page with read-only access.

If this happens for a MOVS instruction that moves memory between two normal
pages, within a single large page frame, and mapped within the guest as a
large page, and if, in addition, the source operand is not writeable in the
host (perhaps due to KSM), then KVM will instantiate a read-only direct
shadow page, instantiate an spte for the source operand, then instantiate
a new read/write direct shadow page and instantiate an spte for the
destination operand.  Since these two sptes are in different shadow pages,
MOVS will never see them at the same time and the guest will not make
progress.

Fix by mapping the direct shadow page read/write, and only marking the
host page read-only.

Signed-off-by: Avi Kivity <avi@redhat.com>
2011-01-12 11:30:51 +02:00
..
emulate.c KVM: x86 emulator: simplify exception generation 2011-01-12 11:29:58 +02:00
i8254.c KVM: fix typo in copyright notice 2010-10-24 10:53:14 +02:00
i8254.h KVM: x86: Introduce a workqueue to deliver PIT timer interrupts 2010-08-01 10:46:49 +03:00
i8259.c KVM: i8259: initialize isr_ack 2011-01-02 11:52:48 +02:00
irq.c KVM: fix typo in copyright notice 2010-10-24 10:53:14 +02:00
irq.h KVM: Convert PIC lock from raw spinlock to ordinary spinlock 2010-10-24 10:52:56 +02:00
Kconfig KVM: Halt vcpu if page it tries to access is swapped out 2011-01-12 11:21:39 +02:00
kvm_cache_regs.h KVM: X86: Introduce generic guest-mode representation 2011-01-12 11:30:04 +02:00
kvm_timer.h KVM: arch/x86/kvm/kvm_timer.h checkpatch cleanup 2010-05-17 12:14:42 +03:00
lapic.c KVM: Avoid double interrupt injection with vapic 2011-01-12 11:23:36 +02:00
lapic.h KVM: Add HYPER-V apic access MSRs 2010-03-01 12:36:00 -03:00
Makefile KVM: x86: Makefile clean up 2011-01-12 11:29:08 +02:00
mmu_audit.c KVM: fix typo in copyright notice 2010-10-24 10:53:14 +02:00
mmu.c KVM: MMU: Make the way of accessing lpage_info more generic 2011-01-12 11:30:47 +02:00
mmu.h KVM: MMU: Don't track nested fault info in error-code 2010-10-24 10:52:55 +02:00
mmutrace.h KVM: MMU: support disable/enable mmu audit dynamicly 2010-10-24 10:51:56 +02:00
paging_tmpl.h KVM: MMU: Fix incorrect direct page write protection due to ro host page 2011-01-12 11:30:51 +02:00
svm.c KVM: SVM: Add xsetbv intercept 2011-01-12 11:30:49 +02:00
timer.c KVM: fix typo in copyright notice 2010-10-24 10:53:14 +02:00
trace.h KVM: Add instruction-set-specific exit qualifications to kvm_exit trace 2011-01-12 11:29:41 +02:00
tss.h KVM: x86: hardware task switching support 2008-04-27 12:00:39 +03:00
vmx.c KVM: VMX: add module parameter to avoid trapping HLT instructions (v5) 2011-01-12 11:30:46 +02:00
x86.c KVM: MMU: retry #PF for softmmu 2011-01-12 11:30:41 +02:00
x86.h KVM: SVM: Do not report xsave in supported cpuid 2010-12-08 17:28:37 +02:00