[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kvm-commits
Subject:    [COMMIT master] Revert "KVM: x86: ignore access permissions for
From:       Avi Kivity <avi () redhat ! com>
Date:       2010-03-21 17:02:28
Message-ID: 20100321170228.0A2E9A029F () cleopatra ! tlv ! redhat ! com
[Download RAW message or body]

From: Marcelo Tosatti <mtosatti@redhat.com>

Its safer to disable the only problematic user of hypercall patching,
pvmmu.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 68e8c89..bb9a24a 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -3243,17 +3243,12 @@ static int emulator_write_emulated_onepage(unsigned long addr,
 					   const void *val,
 					   unsigned int bytes,
 					   struct kvm_vcpu *vcpu,
-					   bool guest_initiated,
 					   bool mmu_only)
 {
 	gpa_t                 gpa;
 	u32 error_code;
 
-
-	if (guest_initiated)
-		gpa = kvm_mmu_gva_to_gpa_write(vcpu, addr, &error_code);
-	else
-		gpa = kvm_mmu_gva_to_gpa_system(vcpu, addr, &error_code);
+	gpa = kvm_mmu_gva_to_gpa_write(vcpu, addr, &error_code);
 
 	if (gpa == UNMAPPED_GVA) {
 		kvm_inject_page_fault(vcpu, addr, error_code);
@@ -3292,7 +3287,6 @@ int __emulator_write_emulated(unsigned long addr,
 				   const void *val,
 				   unsigned int bytes,
 				   struct kvm_vcpu *vcpu,
-				   bool guest_initiated,
 				   bool mmu_only)
 {
 	/* Crossing a page boundary? */
@@ -3301,7 +3295,7 @@ int __emulator_write_emulated(unsigned long addr,
 
 		now = -addr & ~PAGE_MASK;
 		rc = emulator_write_emulated_onepage(addr, val, now, vcpu,
-						     guest_initiated, mmu_only);
+						     mmu_only);
 		if (rc != X86EMUL_CONTINUE)
 			return rc;
 		addr += now;
@@ -3309,7 +3303,7 @@ int __emulator_write_emulated(unsigned long addr,
 		bytes -= now;
 	}
 	return emulator_write_emulated_onepage(addr, val, bytes, vcpu,
-					       guest_initiated, mmu_only);
+					       mmu_only);
 }
 
 int emulator_write_emulated(unsigned long addr,
@@ -3317,7 +3311,7 @@ int emulator_write_emulated(unsigned long addr,
 				   unsigned int bytes,
 				   struct kvm_vcpu *vcpu)
 {
-	return __emulator_write_emulated(addr, val, bytes, vcpu, true, false);
+	return __emulator_write_emulated(addr, val, bytes, vcpu, false);
 }
 EXPORT_SYMBOL_GPL(emulator_write_emulated);
 
@@ -3381,7 +3375,7 @@ static int emulator_cmpxchg_emulated(unsigned long addr,
 	if (!exchanged)
 		return X86EMUL_CMPXCHG_FAILED;
 
-	return __emulator_write_emulated(addr, new, bytes, vcpu, true, true);
+	return __emulator_write_emulated(addr, new, bytes, vcpu, true);
 
 emul_write:
 	printk_once(KERN_WARNING "kvm: emulating exchange as write\n");
@@ -4083,8 +4077,7 @@ int kvm_fix_hypercall(struct kvm_vcpu *vcpu)
 
 	kvm_x86_ops->patch_hypercall(vcpu, instruction);
 
-	return __emulator_write_emulated(rip, instruction, 3, vcpu,
-					 false, false);
+	return __emulator_write_emulated(rip, instruction, 3, vcpu, false);
 }
 
 void realmode_lgdt(struct kvm_vcpu *vcpu, u16 limit, unsigned long base)
--
To unsubscribe from this list: send the line "unsubscribe kvm-commits" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic