This allows implementations to reuse code.

Signed-off-by: Avi Kivity <a...@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 --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
-- 
1.7.5.3

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to