From patchwork Mon Mar 14 07:50:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 8576981 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 236EDC0553 for ; Mon, 14 Mar 2016 07:53:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3691520445 for ; Mon, 14 Mar 2016 07:53:16 +0000 (UTC) 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.kernel.org (Postfix) with ESMTPS id 4E1E2203A9 for ; Mon, 14 Mar 2016 07:53:15 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xen.org with esmtp (Exim 4.84) (envelope-from ) id 1afNGV-00073h-9m; Mon, 14 Mar 2016 07:50:11 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.84) (envelope-from ) id 1afNGT-00071X-Oq for xen-devel@lists.xenproject.org; Mon, 14 Mar 2016 07:50:09 +0000 Received: from [85.158.137.68] by server-3.bemta-3.messagelabs.com id C8/93-03294-13D66E65; Mon, 14 Mar 2016 07:50:09 +0000 X-Env-Sender: JBeulich@suse.com X-Msg-Ref: server-2.tower-31.messagelabs.com!1457941806!28794848!1 X-Originating-IP: [137.65.248.74] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.11; banners=-,-,- X-VirusChecked: Checked Received: (qmail 5257 invoked from network); 14 Mar 2016 07:50:08 -0000 Received: from prv-mh.provo.novell.com (HELO prv-mh.provo.novell.com) (137.65.248.74) by server-2.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 14 Mar 2016 07:50:08 -0000 Received: from INET-PRV-MTA by prv-mh.provo.novell.com with Novell_GroupWise; Mon, 14 Mar 2016 01:50:05 -0600 Message-Id: <56E67B3A02000078000DBE94@prv-mh.provo.novell.com> X-Mailer: Novell GroupWise Internet Agent 14.2.0 Date: Mon, 14 Mar 2016 01:50:02 -0600 From: "Jan Beulich" To: "xen-devel" Mime-Version: 1.0 Cc: Andrew Cooper , Keir Fraser Subject: [Xen-devel] [PATCH] x86emul: fix 32-bit test build 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-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Commit 5644ce0142 ("x86emul: relax asm() constraints") introduced a 64-bit only instruction suffix, which breaks running the emulator test on a 32-bit system. Mirror __OS (and _OP for completeness) to the test wrapper source file. Signed-off-by: Jan Beulich x86emul: fix 32-bit test build Commit 5644ce0142 ("x86emul: relax asm() constraints") introduced a 64-bit only instruction suffix, which breaks running the emulator test on a 32-bit system. Mirror __OS (and _OP for completeness) to the test wrapper source file. Signed-off-by: Jan Beulich --- a/tools/tests/x86_emulator/x86_emulate.c +++ b/tools/tests/x86_emulator/x86_emulate.c @@ -18,6 +18,15 @@ typedef bool bool_t; #define __packed __attribute__((packed)) +/* For generic assembly code: use macros to define operation/operand sizes. */ +#ifdef __i386__ +# define __OS "l" /* Operation Suffix */ +# define __OP "e" /* Operand Prefix */ +#else +# define __OS "q" /* Operation Suffix */ +# define __OP "r" /* Operand Prefix */ +#endif + #include "x86_emulate/x86_emulate.h" #define get_stub(stb) ((void *)((stb).addr = (uintptr_t)(stb).buf)) --- a/xen/arch/x86/x86_emulate/x86_emulate.c +++ b/xen/arch/x86/x86_emulate/x86_emulate.c @@ -853,7 +853,7 @@ static bool_t div_dbl(unsigned long u[2] { if ( (v == 0) || (u[1] >= v) ) return 1; - asm ( "divq %2" : "+a" (u[0]), "+d" (u[1]) : "rm" (v) ); + asm ( "div"__OS" %2" : "+a" (u[0]), "+d" (u[1]) : "rm" (v) ); return 0; } Reviewed-by: Andrew Cooper --- a/tools/tests/x86_emulator/x86_emulate.c +++ b/tools/tests/x86_emulator/x86_emulate.c @@ -18,6 +18,15 @@ typedef bool bool_t; #define __packed __attribute__((packed)) +/* For generic assembly code: use macros to define operation/operand sizes. */ +#ifdef __i386__ +# define __OS "l" /* Operation Suffix */ +# define __OP "e" /* Operand Prefix */ +#else +# define __OS "q" /* Operation Suffix */ +# define __OP "r" /* Operand Prefix */ +#endif + #include "x86_emulate/x86_emulate.h" #define get_stub(stb) ((void *)((stb).addr = (uintptr_t)(stb).buf)) --- a/xen/arch/x86/x86_emulate/x86_emulate.c +++ b/xen/arch/x86/x86_emulate/x86_emulate.c @@ -853,7 +853,7 @@ static bool_t div_dbl(unsigned long u[2] { if ( (v == 0) || (u[1] >= v) ) return 1; - asm ( "divq %2" : "+a" (u[0]), "+d" (u[1]) : "rm" (v) ); + asm ( "div"__OS" %2" : "+a" (u[0]), "+d" (u[1]) : "rm" (v) ); return 0; }