From patchwork Wed Nov 2 16:12:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 9409463 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 77F18601C2 for ; Wed, 2 Nov 2016 16:14:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 646572A455 for ; Wed, 2 Nov 2016 16:14:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 55E662A458; Wed, 2 Nov 2016 16:14:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C88322A455 for ; Wed, 2 Nov 2016 16:14:37 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c1y9W-0001ST-R2; Wed, 02 Nov 2016 16:12:38 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c1y9V-0001SN-Gj for xen-devel@lists.xenproject.org; Wed, 02 Nov 2016 16:12:37 +0000 Received: from [85.158.137.68] by server-16.bemta-3.messagelabs.com id 8E/B4-12362-4701A185; Wed, 02 Nov 2016 16:12:36 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrHIsWRWlGSWpSXmKPExsXS6fjDS7dEQCr C4G8Pj8X3LZOZHBg9Dn+4whLAGMWamZeUX5HAmtF/rJ+t4J1ExcZeoQbGRUJdjBwcQgJ5Ej+W eXQxcnLwCthJLF6wkxHElhAwlHj6/jobiM0ioCpx9WkrmM0moC7R9mw7K0iriICBxLmjSSBhZ oFAiVv3Z4C1CguESNx6MReshFdAUOLvDmGIEjuJyV3drBMYuWYhZGYhyUDYWhIPf91igbC1JZ YtfM0MUs4sIC2x/B8HTHn7vTesmEo8JTp/JSxg5FjFqFGcWlSWWqRrZKCXVJSZnlGSm5iZo2t oYKyXm1pcnJiempOYVKyXnJ+7iREYdvUMDIw7GJtP+B1ilORgUhLl/fxUMkKILyk/pTIjsTgj vqg0J7X4EKMMB4eSBG8Bv1SEkGBRanpqRVpmDjACYNISHDxKIryb+IDSvMUFibnFmekQqVOMu hxvdr18wCTEkpeflyolzqsAMkMApCijNA9uBCwaLzHKSgnzMjIwMAjxFKQW5WaWoMq/YhTnYF QS5tUFmcKTmVcCt+kV0BFMQEeYJ0mAHFGSiJCSamDUa5XgLnFM/iFqKbV3c1Lqrk833yptP5t 0W+jx5Ssn5uxg8X25zedcxWrW+i3ctiYHKgUeXmd1PpkV9EvwOpfJYeXi19+P32z/yOB4fmtP p3zzmhkS89Y/XCy313lC4ZnDf3W/hkc5cVUcO81XU/mvd+uTjnJdLZVve64L30xVSK8IS7tyc X2PEktxRqKhFnNRcSIACFDgVcECAAA= X-Env-Sender: JBeulich@suse.com X-Msg-Ref: server-4.tower-31.messagelabs.com!1478103154!11794523!1 X-Originating-IP: [137.65.248.74] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.0.13; banners=-,-,- X-VirusChecked: Checked Received: (qmail 32003 invoked from network); 2 Nov 2016 16:12:35 -0000 Received: from prv-mh.provo.novell.com (HELO prv-mh.provo.novell.com) (137.65.248.74) by server-4.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 2 Nov 2016 16:12:35 -0000 Received: from INET-PRV-MTA by prv-mh.provo.novell.com with Novell_GroupWise; Wed, 02 Nov 2016 10:12:33 -0600 Message-Id: <581A1E7E020000780011BB7B@prv-mh.provo.novell.com> X-Mailer: Novell GroupWise Internet Agent 14.2.1 Date: Wed, 02 Nov 2016 10:12:30 -0600 From: "Jan Beulich" To: "xen-devel" Mime-Version: 1.0 Cc: Andrew Cooper , Wei Liu Subject: [Xen-devel] [PATCH] x86emul: {L, S}{G, I}DT ignore operand size overrides in 64-bit mode X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP This affects not only the layout of the data (always 2+8 bytes), but also the contents (no truncation to 24 bits occurs). Signed-off-by: Jan Beulich Reviewed-by: Andrew Cooper , although --- This will only apply cleanly on top of https://lists.xenproject.org/archives/html/xen-devel/2016-11/msg00170.html. x86emul: {L,S}{G,I}DT ignore operand size overrides in 64-bit mode This affects not only the layout of the data (always 2+8 bytes), but also the contents (no truncation to 24 bits occurs). Signed-off-by: Jan Beulich --- This will only apply cleanly on top of https://lists.xenproject.org/archives/html/xen-devel/2016-11/msg00170.html. --- a/xen/arch/x86/x86_emulate/x86_emulate.c +++ b/xen/arch/x86/x86_emulate/x86_emulate.c @@ -4424,7 +4424,7 @@ x86_emulate( fail_if(ops->read_segment == NULL); if ( (rc = ops->read_segment(seg, &sreg, ctxt)) ) goto done; - if ( op_bytes == 2 ) + if ( !mode_64bit() && op_bytes == 2 ) sreg.base &= 0xffffff; if ( (rc = ops->write(ea.mem.seg, ea.mem.off+0, &sreg.limit, 2, ctxt)) || @@ -4447,7 +4447,7 @@ x86_emulate( !is_canonical_address(base), EXC_GP, 0); sreg.base = base; sreg.limit = limit; - if ( op_bytes == 2 ) + if ( !mode_64bit() && op_bytes == 2 ) sreg.base &= 0xffffff; if ( (rc = ops->write_segment(seg, &sreg, ctxt)) ) goto done; --- a/xen/arch/x86/x86_emulate/x86_emulate.c +++ b/xen/arch/x86/x86_emulate/x86_emulate.c @@ -4424,7 +4424,7 @@ x86_emulate( fail_if(ops->read_segment == NULL); if ( (rc = ops->read_segment(seg, &sreg, ctxt)) ) goto done; - if ( op_bytes == 2 ) + if ( !mode_64bit() && op_bytes == 2 ) sreg.base &= 0xffffff; if ( (rc = ops->write(ea.mem.seg, ea.mem.off+0, &sreg.limit, 2, ctxt)) || @@ -4447,7 +4447,7 @@ x86_emulate( !is_canonical_address(base), EXC_GP, 0); sreg.base = base; sreg.limit = limit; - if ( op_bytes == 2 ) + if ( !mode_64bit() && op_bytes == 2 ) sreg.base &= 0xffffff; if ( (rc = ops->write_segment(seg, &sreg, ctxt)) ) goto done;