From patchwork Tue Oct 10 15:52:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Volodymyr Babchuk X-Patchwork-Id: 9996647 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 E668960216 for ; Tue, 10 Oct 2017 15:55:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D7FF928676 for ; Tue, 10 Oct 2017 15:55:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CCB5D2867F; Tue, 10 Oct 2017 15:55:52 +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.1 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID 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 733BE28676 for ; Tue, 10 Oct 2017 15:55:52 +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 1e1wqe-0002lR-4I; Tue, 10 Oct 2017 15:53:36 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e1wqc-0002l1-Pp for xen-devel@lists.xen.org; Tue, 10 Oct 2017 15:53:34 +0000 Received: from [85.158.143.35] (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256 bits)) by server-2.bemta-6.messagelabs.com id E6/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dAwAA X-Env-Sender: Volodymyr_Babchuk@epam.com X-Msg-Ref: server-6.tower-21.messagelabs.com!1507650812!53483966!1 X-Originating-IP: [40.107.5.80] 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 7879 invoked from network); 10 Oct 2017 15:53:33 -0000 Received: from mail-eopbgr50080.outbound.protection.outlook.com (HELO EUR03-VE1-obe.outbound.protection.outlook.com) (40.107.5.80) by server-6.tower-21.messagelabs.com with AES256-SHA256 encrypted SMTP; 10 Oct 2017 15:53:33 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=EPAM.onmicrosoft.com; s=selector1-epam-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=RUQZHJ3FzrJx06fW9f3kANt1HssI5020uLpTy+rPhCI=; b=OjWQ2VSEdktYYHx0nMfMWoEEPen7lRxhd76qi6VUUTUNeZHdNBA91528sascUKEAiNHYSRvWPtNsTegONAQZ170W1bxUYE66JnJyWEi2mua0WqQFUzDWFZa9U3uKHkdnRi8b1VwltO8HAt3A1K9I/bQoYkHPHAWNR72YTK6IXCw= Received: from EPUAKYIW2556.kyiv.epam.com (85.223.209.56) by HE1PR0301MB2139.eurprd03.prod.outlook.com (2603:10a6:3:21::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Tue, 10 Oct 2017 15:53:22 +0000 Received: by EPUAKYIW2556.kyiv.epam.com (sSMTP sendmail emulation); Tue, 10 Oct 2017 18:53:19 +0300 From: Volodymyr Babchuk To: xen-devel@lists.xen.org Date: Tue, 10 Oct 2017 18:52:43 +0300 Message-Id: <1507650771-16631-4-git-send-email-volodymyr_babchuk@epam.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1507650771-16631-1-git-send-email-volodymyr_babchuk@epam.com> References: <1507650771-16631-1-git-send-email-volodymyr_babchuk@epam.com> MIME-Version: 1.0 X-Originating-IP: [85.223.209.56] X-ClientProxiedBy: AM5PR0602CA0023.eurprd06.prod.outlook.com (2603:10a6:203:a3::33) To HE1PR0301MB2139.eurprd03.prod.outlook.com (2603:10a6:3:21::16) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2fd146f0-e3cb-4cb0-dbaf-08d50ff70dc3 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:HE1PR0301MB2139; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0301MB2139; 3:B9OYSwh00bDBRspBG8QEtDabNqpRbv6hXwcJsW850nPFiTy8cWnEAj2EzSO/+Xi0wywP6GH3WWZBFEt67LTIZWEEx5E82nhI6cTsvyy42wXos9DqU2Cp7rg4HskDzIlD/GTZAYUR8yepytnzZIV3Jp/DViqNLzKOtP/WNYLzPwfuj9Jxh8I81L6WnW0CINqIbCVmy9MffBm2EF/iVD4R0wQX18hCa13ILCW9TUGCeZ/5rydfpM8jYRAI1QEZQt/U; 25:JeQVts9gtOAgStA1LNTfnircmfYKYAdskdR7ZHiJ9PAIrXDNIIEgGgEGiPX8z4F/QYeu2kFHofwlIZ720Zue5AgV/ifb1FRfQRg3M91+aWvmwgl7u08BuQNhI7lmi3Xoe/CFdFiV4ISKJLuy6YVtVCorMK21BNLV/CGpOIegjaUBLferG310rP5KDKKNFuROOXEZZzo/o/VKPlxL07HEYmIqgZ1GfA5zau4fS5rWiWM0loEwexKypB9vrHsQ9V2JQnJjuBh70lOLbsOg8Nq9aUhSFxmTd3PjY+zZFq0A6K43MGKyFUwnFH+dvg5I0WzVEBldLjbwHyuXIg2Fe2UCDw==; 31:Q0y89mpS2NfJGplCOfF6tWB+JeNq9fAsNzC7P5tRNhOmp5DjGw9jCCUr3j0yFk4apJGk+OSx/5mT0+ipze+LT7y79ZXbH+VBWTqRFyuRbMqr7+pBrMjHdWlBmhWger++sGVnRcRrl0BQJ2CWMgDrjYnz90WwHmk58VQOn7O7QxiQc5xTahnai1CYGKgUGegXmJDYRfL0DZnXOzDynwTNsta0zC4uX0WVARm9CUkuGqs= X-MS-TrafficTypeDiagnostic: HE1PR0301MB2139: X-Microsoft-Exchange-Diagnostics: 1; HE1PR0301MB2139; 20:ViqN5yPqw73t02a1l5MDxS1XhrFqDzU8vqOUbN5JnAS23qyHZda0qg4XBBlBYGbBa1g+Vp+LiPHfw6slbiVWlskQsZsTT80WOeHIV1Cc3BjuNAKJipn6tjqxFagxGtF06KCkJJpuWpM2p9QULZnCH5jV/uSZsfReFUy3QP2gGJKvqHreNy0hhEa3LTS20OozrlDV1j20O3+xO5V4MBIxi1fF+ltW//Ym87xROOv2ZOffvYSqKvdaTlL6hSi+pCVXElq6ImU4j60WMNhW/3EEhHDtT8GGKSmFpMOC7nQX54XqIKv2FADaOb8S5wzdd9p98oVMJzf9Kx2QugKhwaUV+WCCfEGPGCr5W1G+aHqp6muLy460vV3N0X3FsBGA6Z5wNpSAtLXQsjndDtF48KyLKHmGuav/jhyGi6niwWkPYOiT6w0xGuM446e9CwaVhb4Ge6A+f6yDQrkDo7Oc/wlJeFX3jB1oVMJEd1kU+9miKYDdMkxQoUvwJRTsFXZPHbU0; 4:PWGRAfNPzTVNQpxg9DMuHTcbKWOg7KJBivIb5GM5ZsJjNerinhlGliDNSXdEmxwxgQSGvrMXZNWIOvJyzPpBXsKpLLDEAjNMmkAKlN+KwIxaS3d6hREnJDW3fUkoZkiVMD9BUXJgg16FZjFpgjAgC2yIrijX5+Am9SzdL5109PsMu1a9EW3BuyLDjZqESwaZfoB3ALjVXKgANd90YsRqtE3ml5mhoe6f6OpnF/yYZ35S8gr6lyIdbwuCh/+sMDUEJl6Ep6ZNAO6uPSfK9g0jq2Tb6LClraZrkK4mu2rP7RsoHE+kKQfVha0O3B8nYNUnnlVT8qBpoEZd1mTvoDdshA== X-Exchange-Antispam-Report-Test: UriScan:(180628864354917)(4114951738403); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(6041248)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123560025)(20161123562025)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:HE1PR0301MB2139; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:HE1PR0301MB2139; X-Forefront-PRVS: 04569283F9 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(376002)(346002)(189002)(199003)(50226002)(305945005)(101416001)(7736002)(6916009)(48376002)(86362001)(6666003)(2950100002)(50986999)(76176999)(478600001)(2906002)(8936002)(122856001)(106356001)(33646002)(72206003)(47776003)(105586002)(50466002)(316002)(16586007)(5660300001)(2351001)(8676002)(54906003)(36756003)(2361001)(42186006)(68736007)(81156014)(8666007)(80792005)(8656003)(66066001)(97736004)(189998001)(53936002)(5003940100001)(4326008)(81166006)(6116002)(3846002); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0301MB2139; H:EPUAKYIW2556.kyiv.epam.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: epam.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0301MB2139; 23:e8Jy9q7RvyOYbli+fIcskLX80Usa7fEptZqkGfn?= =?us-ascii?Q?39kcX7CQPLX7JU58+Fjpn6HE49hWsL4lXPSztikgCFzotCjIDESOqGildCuo?= =?us-ascii?Q?7yYaFTfuY0klbwMSEznpWtydppnlH6lLaTdy/y8hShO6BeJy6oEd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Metadata: NSPM X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Oct 2017 15:53:22.8507 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b41b72d0-4e9f-4c26-8a69-f949f367c91d X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0301MB2139 Cc: "Edgar E . Iglesias" , Julien Grall , Stefano Stabellini , Volodymyr Babchuk Subject: [Xen-devel] [PATCH v8 03/11] arm: traps: check if SMC was conditional before handling it 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 Trapped SMC instruction can fail condition check on ARMv8 architecture (ARM DDI 0487B.a page D7-2271). So we need to check if condition was meet. Signed-off-by: Volodymyr Babchuk Reviewed-by: Julien Grall --- xen/arch/arm/traps.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c index ace5a43..5b91e6c 100644 --- a/xen/arch/arm/traps.c +++ b/xen/arch/arm/traps.c @@ -2199,6 +2199,12 @@ static void do_trap_smc(struct cpu_user_regs *regs, const union hsr hsr) { int rc = 0; + if ( !check_conditional_instr(regs, hsr) ) + { + advance_pc(regs, hsr); + return; + } + if ( current->domain->arch.monitor.privileged_call_enabled ) rc = monitor_smc();