From patchwork Mon Oct 16 12:32:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 10008215 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 15FE660230 for ; Mon, 16 Oct 2017 12:35:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0A71A28437 for ; Mon, 16 Oct 2017 12:35:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F32632846F; Mon, 16 Oct 2017 12:35:07 +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 86C4C28437 for ; Mon, 16 Oct 2017 12:35:07 +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 1e44ZM-0002lS-MH; Mon, 16 Oct 2017 12:32:32 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e44ZL-0002lM-MQ for xen-devel@lists.xenproject.org; Mon, 16 Oct 2017 12:32:31 +0000 Received: from [85.158.139.211] by server-15.bemta-5.messagelabs.com id BD/54-23912-ED6A4E95; Mon, 16 Oct 2017 12:32:30 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprDIsWRWlGSWpSXmKPExsXS6fjDS/fesie RBt0ThS2+b5nM5MDocfjDFZYAxijWzLyk/IoE1oyjExczF3RwVFx+6NrA+Jqti5GTQ0ggT6Jl 5jPmLkYODl4BO4lzvRYgYQkBQ4nTC2+ygNgsAqoSDXP/MYPYbALqEm3PtrOClIsIGEicO5oEE mYWaGeUmDwhE8QWFvCTmHTnJSvEREGJvzuEIUq0JB7+usUCYWtLLFv4Gmwps4C0xPJ/HBMYeW YhNMxC0jALScMshIYFjCyrGDWKU4vKUot0jQ30kooy0zNKchMzc3QNDUz1clOLixPTU3MSk4r 1kvNzNzECw6iegYFxB+OEVX6HGCU5mJREeZ0Nn0QK8SXlp1RmJBZnxBeV5qQWH2KU4eBQkuD9 vxQoJ1iUmp5akZaZAwxomLQEB4+SCG8eSJq3uCAxtzgzHSJ1itGY49imy3+YODpu3v3DJMSSl 5+XKiXOewukVACkNKM0D24QLNIuMcpKCfMyMjAwCPEUpBblZpagyr9iFOdgVBLmPQ4yhSczrw Ru3yugU5iATlnnBHZKSSJCSqqBcaO2V4JHh8y7FrsJmgd/6tR/cT2/+pnfws+lJ51yXEVeSJz wmnu+7ce1b/vvtDV+yTbkzP6/n3Hj26nbK9XasyP+3WnI3zVL5K7yzXAnxjaRsN+Scp4mrsy1 LOeLH0guKZzIeKXYI39+/oQHsosfl5mu1Lz93HAH+8wzfL+PuUS5XlBXXfXuihJLcUaioRZzU XEiAOPsr8SvAgAA X-Env-Sender: JBeulich@suse.com X-Msg-Ref: server-14.tower-206.messagelabs.com!1508157148!68328597!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.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 7132 invoked from network); 16 Oct 2017 12:32:30 -0000 Received: from prv-mh.provo.novell.com (HELO prv-mh.provo.novell.com) (137.65.248.74) by server-14.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 16 Oct 2017 12:32:30 -0000 Received: from INET-PRV-MTA by prv-mh.provo.novell.com with Novell_GroupWise; Mon, 16 Oct 2017 06:32:27 -0600 Message-Id: <59E4C2F80200007800186B29@prv-mh.provo.novell.com> X-Mailer: Novell GroupWise Internet Agent 14.2.2 Date: Mon, 16 Oct 2017 06:32:24 -0600 From: "Jan Beulich" To: "xen-devel" Mime-Version: 1.0 Content-Disposition: inline Cc: George Dunlap , Andrew Cooper , Julien Grall Subject: [Xen-devel] [PATCH] x86emul: keep compiler from using {x, y, z}mm registers itself 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 Since the emulator acts on the live hardware registers, we need to prevent the compiler from using them e.g. for inlined memcpy() / memset() (as gcc7 does). We can't, however, set this from the command line, as otherwise the 64-bit build would face issues with functions returning floating point values and being declared in standard headers. As the pragma isn't available prior to gcc6, we need to invoke it conditionally. Luckily up to gcc6 we haven't seen generated code access SIMD registers beyond what our asm()s do. Reported-by: George Dunlap Signed-off-by: Jan Beulich Acked-by: Andrew Cooper --- While this doesn't affect core functionality, I think it would still be nice for it to be allowed in for 4.10. --- a/tools/tests/x86_emulator/x86-emulate.h +++ b/tools/tests/x86_emulator/x86-emulate.h @@ -4,6 +4,11 @@ #include #include #include + +#if __GNUC__ >= 6 +#pragma GCC target("no-sse") +#endif + #include #include