diff options
author | Avi Kivity <avi@qumranet.com> | 2007-01-05 19:36:44 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2007-01-06 02:55:25 -0500 |
commit | da4a00f002239f72b0d7d0eeaa3b60100e2b1438 (patch) | |
tree | 7c7e72ea1fd48025c029429b413e127a3a580c10 /drivers/kvm/mmu.c | |
parent | 815af8d42ee3f844c0ceaf2104bd9c6a0bb1e26c (diff) |
[PATCH] KVM: MMU: Support emulated writes into RAM
As the mmu write protects guest page table, we emulate those writes. Since
they are not mmio, there is no need to go to userspace to perform them.
So, perform the writes in the kernel if possible, and notify the mmu about
them so it can take the approriate action.
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/mmu.c')
-rw-r--r-- | drivers/kvm/mmu.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/kvm/mmu.c b/drivers/kvm/mmu.c index ceae25bfd4b5..bce7eb21f739 100644 --- a/drivers/kvm/mmu.c +++ b/drivers/kvm/mmu.c | |||
@@ -956,6 +956,15 @@ int kvm_mmu_reset_context(struct kvm_vcpu *vcpu) | |||
956 | return init_kvm_mmu(vcpu); | 956 | return init_kvm_mmu(vcpu); |
957 | } | 957 | } |
958 | 958 | ||
959 | void kvm_mmu_pre_write(struct kvm_vcpu *vcpu, gpa_t gpa, int bytes) | ||
960 | { | ||
961 | pgprintk("%s: gpa %llx bytes %d\n", __FUNCTION__, gpa, bytes); | ||
962 | } | ||
963 | |||
964 | void kvm_mmu_post_write(struct kvm_vcpu *vcpu, gpa_t gpa, int bytes) | ||
965 | { | ||
966 | } | ||
967 | |||
959 | static void free_mmu_pages(struct kvm_vcpu *vcpu) | 968 | static void free_mmu_pages(struct kvm_vcpu *vcpu) |
960 | { | 969 | { |
961 | while (!list_empty(&vcpu->free_pages)) { | 970 | while (!list_empty(&vcpu->free_pages)) { |