From patchwork Mon Aug 22 13:41:07 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avi Kivity X-Patchwork-Id: 1085342 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p7MDfeFd013492 for ; Mon, 22 Aug 2011 13:41:40 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752797Ab1HVNli (ORCPT ); Mon, 22 Aug 2011 09:41:38 -0400 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 Received: from s01.tlv.redhat.com (s01.tlv.redhat.com [10.35.255.8]) by cleopatra.tlv.redhat.com (Postfix) with ESMTP id EC94A250B4C; Mon, 22 Aug 2011 16:41:11 +0300 (IDT) From: Avi Kivity To: Marcelo Tosatti , lmr@redhat.com Cc: kvm@vger.kernel.org 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> In-Reply-To: <1314020469-30882-1-git-send-email-avi@redhat.com> References: <1314020469-30882-1-git-send-email-avi@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 22 Aug 2011 13:41:40 +0000 (UTC) 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