@@ -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.
@@ -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) {
@@ -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
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(-)