From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=37331 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PXEVD-0006rA-J7 for qemu-devel@nongnu.org; Mon, 27 Dec 2010 09:56:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PXEVC-0004sw-G2 for qemu-devel@nongnu.org; Mon, 27 Dec 2010 09:56:47 -0500 Received: from fmmailgate03.web.de ([217.72.192.234]:37712) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PXEVC-0004sr-42 for qemu-devel@nongnu.org; Mon, 27 Dec 2010 09:56:46 -0500 Message-ID: <4D18A92C.5000303@web.de> Date: Mon, 27 Dec 2010 15:56:44 +0100 From: Jan Kiszka MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigC334BFBE41425A03EAF75C54" Sender: jan.kiszka@web.de Subject: [Qemu-devel] [PATCH] kvm: x86: Fix DPL write back of segment registers List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity , Marcelo Tosatti Cc: qemu-devel , kvm This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigC334BFBE41425A03EAF75C54 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable From: Jan Kiszka The DPL is stored in the flags and not in the selector. In fact, the RPL may differ from the DPL at some point in time, and so we were corrupting the guest state so far. Signed-off-by: Jan Kiszka --- target-i386/kvm.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/target-i386/kvm.c b/target-i386/kvm.c index 218812a..b3d7c54 100644 --- a/target-i386/kvm.c +++ b/target-i386/kvm.c @@ -602,7 +602,7 @@ static void set_seg(struct kvm_segment *lhs, const Se= gmentCache *rhs) lhs->limit =3D rhs->limit; lhs->type =3D (flags >> DESC_TYPE_SHIFT) & 15; lhs->present =3D (flags & DESC_P_MASK) !=3D 0; - lhs->dpl =3D rhs->selector & 3; + lhs->dpl =3D (flags >> DESC_DPL_SHIFT) & 3; lhs->db =3D (flags >> DESC_B_SHIFT) & 1; lhs->s =3D (flags & DESC_S_MASK) !=3D 0; lhs->l =3D (flags >> DESC_L_SHIFT) & 1; --=20 1.7.1 --------------enigC334BFBE41425A03EAF75C54 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.15 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/ iEYEARECAAYFAk0YqSwACgkQitSsb3rl5xTyPQCfRycqEqE2OicaJOMFO02vqd6c 1+MAnjv2u+CgDrMKMfcWbD+KwxJVl84t =Am8e -----END PGP SIGNATURE----- --------------enigC334BFBE41425A03EAF75C54--