From patchwork Thu Jan 5 12:00:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 9498951 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 C830A606B5 for ; Thu, 5 Jan 2017 12:02:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A3B852003F for ; Thu, 5 Jan 2017 12:02:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 978F72832D; Thu, 5 Jan 2017 12:02:15 +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 324602003F for ; Thu, 5 Jan 2017 12:02:14 +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 1cP6iM-0004eh-TL; Thu, 05 Jan 2017 12:00:14 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cP6iL-0004eO-LC for xen-devel@lists.xen.org; Thu, 05 Jan 2017 12:00:13 +0000 Received: from [193.109.254.147] by server-11.bemta-6.messagelabs.com id EF/E2-25337-C453E685; Thu, 05 Jan 2017 12:00:12 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrDLMWRWlGSWpSXmKPExsXitHSDva6PaV6 EwbSXShZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa8bN+/fYCx5wVNzrf8TawLibrYuRk0NCwF/i 3pW3YDabgL7E7hefmEBsEQF1idMdF1m7GDk4mAX8JA498AUJCwuESUxa9YIdxGYRUJFY8q2dE cTmFfCQ2DFpERPESDmJ88d/MoPYQgJqEtf6L7FD1AhKnJz5hAXEZhaQkDj44gXzBEbuWUhSs5 CkFjAyrWLUKE4tKkst0jU21ksqykzPKMlNzMzRNTQw08tNLS5OTE/NSUwq1kvOz93ECAwFBiD YwbhzfeAhRkkOJiVRXutvuRFCfEn5KZUZicUZ8UWlOanFhxhlODiUJHjvGudFCAkWpaanVqRl 5gCDEiYtwcGjJMJ7DiTNW1yQmFucmQ6ROsWoKCXOy20ClBAASWSU5sG1wSLhEqOslDAvI9AhQ jwFqUW5mSWo8q8YxTkYlYR5xUGm8GTmlcBNfwW0mAlo8faAbJDFJYkIKakGxgsPmby6pis0Wt VKTZrNqpa0dWOrk6GH+p6J1a/Ez7CH2M+9Ltimee16yrTgvLfJkq/aG9lEKjVPu30RVw64Vvf 55j353bWFRY8mvyjv9T9xYJtgWN7i//cSvDvXHXl9dm3kxpoZpiqi29eJFiXuVzypHr5zwde2 HDPH3yaTXdoq9POecD6NVWIpzkg01GIuKk4EAL8cWuN/AgAA X-Env-Sender: prvs=1717c234d=Andrew.Cooper3@citrix.com X-Msg-Ref: server-15.tower-27.messagelabs.com!1483617611!27577462!1 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 9.1.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 42643 invoked from network); 5 Jan 2017 12:00:12 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-15.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 5 Jan 2017 12:00:12 -0000 X-IronPort-AV: E=Sophos;i="5.33,321,1477958400"; d="scan'208";a="406939812" From: Andrew Cooper To: Xen-devel Date: Thu, 5 Jan 2017 12:00:03 +0000 Message-ID: <1483617604-4990-1-git-send-email-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 Cc: Andrew Cooper , Jan Beulich Subject: [Xen-devel] [PATCH 1/2] x86/pv: Fix determination of 64bit mode in emulate_privilege_op() 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 ctxt->addr_size is expressed in bits rather than bytes, and has the value 16, 32 or 64. Comparing < 8 made the intended non-64bit paths dead. Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich Tested-by: Jan Beulich --- CC: Jan Beulich --- xen/arch/x86/traps.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index 2d211d1..a33109d 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -2100,7 +2100,7 @@ static int pv_emul_virt_to_linear(unsigned long base, unsigned long offset, *addr = base + offset; - if ( ctxt->addr_size < 8 ) + if ( ctxt->addr_size < 64 ) { if ( limit < bytes - 1 || offset > limit - bytes + 1 ) rc = X86EMUL_EXCEPTION; @@ -2169,7 +2169,7 @@ static int priv_op_read_segment(enum x86_segment seg, struct segment_register *reg, struct x86_emulate_ctxt *ctxt) { - if ( ctxt->addr_size < 8 ) + if ( ctxt->addr_size < 64 ) { unsigned long limit; unsigned int sel, ar;