From mboxrd@z Thu Jan 1 00:00:00 1970 From: Laurent Vivier Subject: [PATCH 6/6] Consolidate the various functions that read and write guest memory Date: Mon, 30 Jul 2007 11:38:09 +0200 Message-ID: <46ADB181.2060103@bull.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1770012262==" To: kvm-devel Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --===============1770012262== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig8B23A6DC34B1E7CFCFDA9570" This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig8B23A6DC34B1E7CFCFDA9570 Content-Type: multipart/mixed; boundary="------------050506050301080605030306" This is a multi-part message in MIME format. --------------050506050301080605030306 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable emulator_cmpxchr_emulated() uses struct kvm_vcpu instead of x86_emulate_c= txt to be consistency with other memops. Signed-off-by: Laurent Vivier --=20 ------------- Laurent.Vivier-6ktuUTfB/bM@public.gmane.org -------------- "Software is hard" - Donald Knuth --------------050506050301080605030306 Content-Type: text/plain; name="cmpxchg_emulated-vcpu" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename="cmpxchg_emulated-vcpu" Index: kvm/drivers/kvm/kvm_main.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kvm.orig/drivers/kvm/kvm_main.c 2007-07-30 10:50:51.000000000 +0200 +++ kvm/drivers/kvm/kvm_main.c 2007-07-30 10:50:59.000000000 +0200 @@ -1082,7 +1082,7 @@ const void *old, const void *new, unsigned int bytes, - struct x86_emulate_ctxt *ctxt) + struct kvm_vcpu *vcpu) { static int reported; =20 @@ -1090,7 +1090,7 @@ reported =3D 1; printk(KERN_WARNING "kvm: emulating exchange as write\n"); } - return emulator_write_emulated(addr, new, bytes, ctxt->vcpu); + return emulator_write_emulated(addr, new, bytes, vcpu); } =20 static unsigned long get_segment_base(struct kvm_vcpu *vcpu, int seg) Index: kvm/drivers/kvm/x86_emulate.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kvm.orig/drivers/kvm/x86_emulate.c 2007-07-30 10:50:51.000000000 +020= 0 +++ kvm/drivers/kvm/x86_emulate.c 2007-07-30 10:50:59.000000000 +0200 @@ -1093,7 +1093,7 @@ rc =3D ops->cmpxchg_emulated((unsigned long)dst. ptr, &dst.orig_val, &dst.val, dst.bytes, - ctxt); + ctxt->vcpu); else rc =3D ops->write_emulated((unsigned long)dst.ptr, &dst.val, dst.bytes, @@ -1392,7 +1392,7 @@ new =3D ((u64)_regs[VCPU_REGS_RCX] << 32) | (u32) _regs[VCPU_REGS_RBX]; if ((rc =3D ops->cmpxchg_emulated(cr2, &old, - &new, 8, ctxt)) !=3D 0) + &new, 8, ctxt->vcpu)) !=3D 0) goto done; _eflags |=3D EFLG_ZF; } Index: kvm/drivers/kvm/x86_emulate.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- kvm.orig/drivers/kvm/x86_emulate.h 2007-07-30 10:50:51.000000000 +020= 0 +++ kvm/drivers/kvm/x86_emulate.h 2007-07-30 10:50:59.000000000 +0200 @@ -108,7 +108,7 @@ const void *old, const void *new, unsigned int bytes, - struct x86_emulate_ctxt * ctxt); + struct kvm_vcpu *vcpu); =20 }; =20 --------------050506050301080605030306-- --------------enig8B23A6DC34B1E7CFCFDA9570 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.7 (GNU/Linux) iD8DBQFGrbGB9Kffa9pFVzwRAto6AJ9CJTE55oczEn6f35v9ets4+jfrHwCfQq9v +Nwy39sQ38fogfEWzP2/l+E= =j/Vw -----END PGP SIGNATURE----- --------------enig8B23A6DC34B1E7CFCFDA9570-- --===============1770012262== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ --===============1770012262== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kvm-devel mailing list kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/kvm-devel --===============1770012262==--