diff mbox

[1/3] KVM: x86 emulator: make prototype of ->write_std() the same as ->write_emulated

Message ID 1314020469-30882-2-git-send-email-avi@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Avi Kivity Aug. 22, 2011, 1:41 p.m. UTC
This allows implementations to reuse code.

Signed-off-by: Avi Kivity <avi@redhat.com>
---
 arch/x86/include/asm/kvm_emulate.h |    3 ++-
 arch/x86/kvm/x86.c                 |    4 ++--
 arch/x86/kvm/x86.h                 |    2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)
diff mbox

Patch

diff --git a/arch/x86/include/asm/kvm_emulate.h b/arch/x86/include/asm/kvm_emulate.h
index 6040d11..31d2d80 100644
--- a/arch/x86/include/asm/kvm_emulate.h
+++ b/arch/x86/include/asm/kvm_emulate.h
@@ -105,7 +105,8 @@  struct x86_emulate_ops {
 	 *  @bytes: [IN ] Number of bytes to write to memory.
 	 */
 	int (*write_std)(struct x86_emulate_ctxt *ctxt,
-			 unsigned long addr, void *val, unsigned int bytes,
+			 unsigned long addr, const void *val,
+			 unsigned int bytes,
 			 struct x86_exception *fault);
 	/*
 	 * fetch: Read bytes of standard (non-emulated/special) memory.
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 6b37f18..cb7b825 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -3989,12 +3989,12 @@  static int kvm_read_guest_virt_system(struct x86_emulate_ctxt *ctxt,
 }
 
 int kvm_write_guest_virt_system(struct x86_emulate_ctxt *ctxt,
-				       gva_t addr, void *val,
+				       gva_t addr, const void *val,
 				       unsigned int bytes,
 				       struct x86_exception *exception)
 {
 	struct kvm_vcpu *vcpu = emul_to_vcpu(ctxt);
-	void *data = val;
+	const void *data = val;
 	int r = X86EMUL_CONTINUE;
 
 	while (bytes) {
diff --git a/arch/x86/kvm/x86.h b/arch/x86/kvm/x86.h
index d36fe23..a1a0a9b 100644
--- a/arch/x86/kvm/x86.h
+++ b/arch/x86/kvm/x86.h
@@ -122,7 +122,7 @@  int kvm_read_guest_virt(struct x86_emulate_ctxt *ctxt,
 	struct x86_exception *exception);
 
 int kvm_write_guest_virt_system(struct x86_emulate_ctxt *ctxt,
-	gva_t addr, void *val, unsigned int bytes,
+	gva_t addr, const void *val, unsigned int bytes,
 	struct x86_exception *exception);
 
 #endif