From: "Jan Beulich" Subject: [PATCH] x86: don't clear high 32 bits of RAX on sub-word guest I/O port reads Date: Fri, 08 May 2015 13:08:05 +0100 Message-ID: <554CC34502000078000783A3@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__PartE3D7F735.1__=" Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Yqh4X-0002s9-WF for xen-devel@lists.xenproject.org; Fri, 08 May 2015 12:08:06 +0000 List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel Cc: Andrew Cooper , Keir Fraser List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__PartE3D7F735.1__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 1- or 2-byte operations never alter the high halves of registers. Signed-off-by: Jan Beulich --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -2234,7 +2234,7 @@ static int emulate_privileged_op(struct=20 if ( op_bytes =3D=3D 4 ) regs->eax =3D 0; else - regs->eax &=3D ~((1u << (op_bytes * 8)) - 1); + regs->eax &=3D ~((1 << (op_bytes * 8)) - 1); regs->eax |=3D guest_io_read(port, op_bytes, v, regs); } bpmatch =3D check_guest_io_breakpoint(v, port, op_bytes); --=__PartE3D7F735.1__= Content-Type: text/plain; name="x86-PV-IO-read-high-bits.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86-PV-IO-read-high-bits.patch" x86: don't clear high 32 bits of RAX on sub-word guest I/O port reads=0A=0A= 1- or 2-byte operations never alter the high halves of registers.=0A=0ASign= ed-off-by: Jan Beulich =0A=0A--- a/xen/arch/x86/traps.c= =0A+++ b/xen/arch/x86/traps.c=0A@@ -2234,7 +2234,7 @@ static int emulate_pr= ivileged_op(struct =0A if ( op_bytes =3D=3D 4 )=0A = regs->eax =3D 0;=0A else=0A- regs->eax &=3D = ~((1u << (op_bytes * 8)) - 1);=0A+ regs->eax &=3D ~((1 << = (op_bytes * 8)) - 1);=0A regs->eax |=3D guest_io_read(port, = op_bytes, v, regs);=0A }=0A bpmatch =3D check_guest_io_brea= kpoint(v, port, op_bytes);=0A --=__PartE3D7F735.1__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --=__PartE3D7F735.1__=--