diff options
author | Avi Kivity <avi@qumranet.com> | 2007-01-05 19:36:45 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2007-01-06 02:55:25 -0500 |
commit | a436036baf331703b4d2c8e8a45f02c597bf6913 (patch) | |
tree | ba134b0b42ca42c53e818073af8d51d73771c56b /drivers/kvm/kvm_main.c | |
parent | 9b7a032567ee1128daeebebfc14d3acedfe28c8c (diff) |
[PATCH] KVM: MMU: If emulating an instruction fails, try unprotecting the page
A page table may have been recycled into a regular page, and so any
instruction can be executed on it. Unprotect the page and let the cpu do its
thing.
Signed-off-by: Avi Kivity <avi@qumranet.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/kvm/kvm_main.c')
-rw-r--r-- | drivers/kvm/kvm_main.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c index 047f6f6ed3f6..79032438dd16 100644 --- a/drivers/kvm/kvm_main.c +++ b/drivers/kvm/kvm_main.c | |||
@@ -1063,6 +1063,8 @@ int emulate_instruction(struct kvm_vcpu *vcpu, | |||
1063 | } | 1063 | } |
1064 | 1064 | ||
1065 | if (r) { | 1065 | if (r) { |
1066 | if (kvm_mmu_unprotect_page_virt(vcpu, cr2)) | ||
1067 | return EMULATE_DONE; | ||
1066 | if (!vcpu->mmio_needed) { | 1068 | if (!vcpu->mmio_needed) { |
1067 | report_emulation_failure(&emulate_ctxt); | 1069 | report_emulation_failure(&emulate_ctxt); |
1068 | return EMULATE_FAIL; | 1070 | return EMULATE_FAIL; |