From patchwork Thu Aug 31 20:09:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Volodymyr Babchuk X-Patchwork-Id: 9932795 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 5809460362 for ; Thu, 31 Aug 2017 20:12:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4D8F61FEB1 for ; Thu, 31 Aug 2017 20:12:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 426A31FF13; Thu, 31 Aug 2017 20:12:32 +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 E3A1F1FF26 for ; Thu, 31 Aug 2017 20:12:31 +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 1dnVmr-00085p-FA; Thu, 31 Aug 2017 20:10:01 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dnVmq-00085i-Mm for xen-devel@lists.xen.org; Thu, 31 Aug 2017 20:10:00 +0000 Received: from [85.158.139.211] by server-13.bemta-5.messagelabs.com id DD/A4-01777-71D68A95; Thu, 31 Aug 2017 20:09:59 +0000 X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Msg-Ref: server-15.tower-206.messagelabs.com!1504210198!95793243!1 X-Originating-IP: [104.47.2.63] 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 12124 invoked from network); 31 Aug 2017 20:09:59 -0000 Received: from mail-db5eur01on0063.outbound.protection.outlook.com (HELO EUR01-DB5-obe.outbound.protection.outlook.com) (104.47.2.63) by server-15.tower-206.messagelabs.com with AES256-SHA256 encrypted SMTP; 31 Aug 2017 20:09:59 -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=lCcjpW+LiB9nC1rX1zlr7iip8qU0o8mYp+J6hHGn0wg=; b=bwMz2H1ppFEqal+jKtKosOgdMXPQJG8rkTFANLi+L3yqz7UvcPZtMRi8Zi6HghmeGtTguSrzTAJhKBbya5bd044+uSxEyGke9vU8XlRy8cDvx5wDjr9GulJLd3tQs1oHV1CCEpYhZhxGmUJZaYMtO0dVhBZrk9h9A/rGRMxz9Ag= Received: from EPUAKYIW2556.kyiv.epam.com (85.223.209.51) by DB6PR0301MB2136.eurprd03.prod.outlook.com (2603:10a6:4:46::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1385.9; Thu, 31 Aug 2017 20:09:56 +0000 Received: by EPUAKYIW2556.kyiv.epam.com (sSMTP sendmail emulation); Thu, 31 Aug 2017 23:09:51 +0300 From: Volodymyr Babchuk To: xen-devel@lists.xen.org Date: Thu, 31 Aug 2017 23:09:24 +0300 Message-Id: <1504210172-27234-3-git-send-email-volodymyr_babchuk@epam.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1504210172-27234-1-git-send-email-volodymyr_babchuk@epam.com> References: <1504210172-27234-1-git-send-email-volodymyr_babchuk@epam.com> MIME-Version: 1.0 X-Originating-IP: [85.223.209.51] X-ClientProxiedBy: VI1P190CA0022.EURP190.PROD.OUTLOOK.COM (2603:10a6:802:2b::35) To DB6PR0301MB2136.eurprd03.prod.outlook.com (2603:10a6:4:46::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 403cd6b7-2e5d-403f-5f78-08d4f0ac4033 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:DB6PR0301MB2136; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0301MB2136; 3:M03NFYEbiJQ8YXnAzUiAIqDRb3yFT99Dssk+FEo1KhEfQsbEHUxx1krkZwOOMs1jI416wlBLo4cQn81Gmq4PKW5j2bmbJ7V7vEWhaznzvollvxcv7jNmVQdg15wy4qaPg1ZpmHIDhZaR+Yne1f2iCsjjymtpqrdwzdrAbZsUq4sxUviFKLrKVF3g+8ukGvcTNA6UlhNbnl8O8TEZ0b343rqJsIUdJRayyBluFTgenCCKOKY1LanavzuSgDG37k6T; 25:vpd0cKmEOUCNkMAKhf2v/cElvhO+KhL3vAlNYsldOKC9GX6lt44FnI+F31LwUt4+A8p6G/YPaVmug1AiL9bPHPIld+530bbd/d2o938MGj/gb+sDF3nq+Cl1LkvPjCybjf1rYoqyNKHtQBQR+e0fS8cjh8iVXrB7lRrSCcnBuzix5AIP1S1p4WEVFEE0PRckZGuwmBT/5yo342A1XW8f6VrDXgNELVKBYymFiXNs6j4M5SsFrTVKT7wPdZGaUwUeutfHCXl1I7NPjUwC9AYJ5lYMISqaSBc5QgT1J9OHujf9Vl3x8Dgx3Q1uPwZ80Xcak6Ntu9rTHQvFNLMgVk72zg==; 31:rObibIdK4hnIKl+qPxG87B0yQqT2gxic2Vuvyrkn3d3zou9AmJbl2Riqnm2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deff/OxjO9MjHDd8JYwpwQ== 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)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(100000703101)(100105400095)(93006095)(93001095)(6041248)(20161123555025)(20161123558100)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DB6PR0301MB2136; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DB6PR0301MB2136; X-Forefront-PRVS: 04163EF38A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(7370300001)(6009001)(199003)(189002)(50226002)(8666007)(8676002)(110136004)(81166006)(81156014)(47776003)(122856001)(80792005)(33646002)(6916009)(106356001)(105586002)(42186005)(2950100002)(6116002)(6666003)(2906002)(66066001)(2351001)(2361001)(189998001)(5660300001)(478600001)(7350300001)(53936002)(8656003)(48376002)(50466002)(36756003)(3846002)(97736004)(72206003)(5003940100001)(68736007)(54906002)(7736002)(76176999)(50986999)(305945005)(86362001)(4326008)(101416001); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0301MB2136; H:EPUAKYIW2556.kyiv.epam.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX: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; DB6PR0301MB2136; 23:tMEU0nntGjBEhd4tEVYwoKPuFMLW4P1M8ipSMKW?= =?us-ascii?Q?xDWOD3aMw1rMDBQia81xWvAVptAu38HWb6CvkfiXdrQZiuhgeypCfnXaFLw5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giMsfNOoWIoYe97iXc2VY/uRhBxN02ZVNZgs589U290UyNzbDt8hfA7IQhXJQz742hX5k= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2017 20:09:56.2294 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0301MB2136 Cc: "Edgar E . Iglesias" , Julien Grall , Stefano Stabellini , Volodymyr Babchuk Subject: [Xen-devel] [PATCH v5 02/10] 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 --- * added Julien's R-b tag --- 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 4569c62..9132fe1 100644 --- a/xen/arch/arm/traps.c +++ b/xen/arch/arm/traps.c @@ -2159,6 +2159,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();