From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: [PATCH 1/3] KVM: x86 emulator: make prototype of ->write_std() the same as ->write_emulated Date: Mon, 22 Aug 2011 16:41:07 +0300 Message-ID: <1314020469-30882-2-git-send-email-avi@redhat.com> References: <1314020469-30882-1-git-send-email-avi@redhat.com> Cc: kvm@vger.kernel.org To: Marcelo Tosatti , lmr@redhat.com Return-path: Received: from mx1.redhat.com ([209.132.183.28]:21012 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752635Ab1HVNlh (ORCPT ); Mon, 22 Aug 2011 09:41:37 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p7MDfbfT012655 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 22 Aug 2011 09:41:37 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p7MDfChv022739 for ; Mon, 22 Aug 2011 09:41:12 -0400 In-Reply-To: <1314020469-30882-1-git-send-email-avi@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: This allows implementations to reuse code. Signed-off-by: Avi Kivity --- 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