From patchwork Tue Aug 8 20:08:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Volodymyr Babchuk X-Patchwork-Id: 9889025 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 1A90B60352 for ; Tue, 8 Aug 2017 20:11:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0CFCE28746 for ; Tue, 8 Aug 2017 20:11:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 018B8287C0; Tue, 8 Aug 2017 20:11:45 +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 04F4C28746 for ; Tue, 8 Aug 2017 20:11:43 +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 1dfAoa-0000bZ-Bd; Tue, 08 Aug 2017 20:09:20 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dfAoZ-0000bF-3L for xen-devel@lists.xen.org; Tue, 08 Aug 2017 20:09:19 +0000 Received: from [85.158.139.211] by server-1.bemta-5.messagelabs.com id 34/8A-01993-E6A1A895; Tue, 08 Aug 2017 20:09:18 +0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: server-8.tower-206.messagelabs.com!1502222957!106280843!1 X-Originating-IP: [104.47.1.41] 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 41015 invoked from network); 8 Aug 2017 20:09:17 -0000 Received: from mail-ve1eur01on0041.outbound.protection.outlook.com (HELO EUR01-VE1-obe.outbound.protection.outlook.com) (104.47.1.41) by server-8.tower-206.messagelabs.com with AES256-SHA256 encrypted SMTP; 8 Aug 2017 20:09:17 -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=V7U8pTfHsrXDyDbJSPt64ZYolu+EfMJcUlaKXfYOtcI=; b=hHh1YwAY185/svI0JPpBqGPP+7FyKMayfeznlBaooPDE2m8JSdATLu5b50Dza1xvnNnOe5Btffjuw9fpFFFo1B4qhHVBHYheJgl7tSyKu45lGMQzYsRxYOQcyavog3jRKfRrNUiwAXHiTclV5sHGhkxFt1diNbWNuYN66K3UTzM= Received: from EPUAKYIW2556.kyiv.epam.com (85.223.209.58) by VI1PR0301MB2142.eurprd03.prod.outlook.com (2603:10a6:800:26::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1320.16; Tue, 8 Aug 2017 20:09:14 +0000 Received: by EPUAKYIW2556.kyiv.epam.com (sSMTP sendmail emulation); Tue, 08 Aug 2017 23:09:09 +0300 From: Volodymyr Babchuk To: xen-devel@lists.xen.org Date: Tue, 8 Aug 2017 23:08:38 +0300 Message-Id: <1502222922-25821-4-git-send-email-volodymyr_babchuk@epam.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1502222922-25821-1-git-send-email-volodymyr_babchuk@epam.com> References: <1502222922-25821-1-git-send-email-volodymyr_babchuk@epam.com> MIME-Version: 1.0 X-Originating-IP: [85.223.209.58] X-ClientProxiedBy: AM5PR0701CA0015.eurprd07.prod.outlook.com (2603:10a6:203:51::25) To VI1PR0301MB2142.eurprd03.prod.outlook.com (2603:10a6:800:26::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f9200c37-f4d6-4b6e-1828-08d4de9957f4 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:VI1PR0301MB2142; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0301MB2142; 3:z7vsdQFwBWADNVUaaOtkjy3KW5zlKUfwfnmM92gyfLO0X0h5pM3eef8bPYZC+S/CDLfGxbCGFzuEnvtNcKW/wKdmc3ol03tzpD1ER1vkP78SSCziqMpdX0MOVsRgVi1jo6crm0PHNggmv2Bm7TZfgXwjWHDrp+94J6psj9QvMyhGDdBGEkH3oPqlTBoSuwCCsiFqp/NVa3TSGDEKacwFLPqnKTCQ7rLFIiydf3Is651CSqBWEjp3bk8+xs4Y0OqK; 25:DyCwLGDQRuI4DixVL2KLsiuf8SfSV4FaE3y6Parm0TLNfncFuLb6Zypd715zGTTKVU2D/g529aHYgM1qRfkV9CjBEdpJQUzG0+8LJcnWwVhIkkUVWBFh3O58LK8JLVXMl/mrUyheat5Q49etaTHqA148yWwfHcpT93M/HJ9u6hahscuOUJMjGiaOv079LrIIBYvdaDyI0/8W3gLTQLjdJcLSPOZwEVZAndF91Q0/1+7oJ5BFGP0MPO3ctkPgk4T8FhWrIwOfvpqIyRP7uF70K99PSUm9+qiheCqZ9DZfYhIp1sfhR0cFycp6/5EtLtVACok6ATmsyJ4KM+8YMCDnRQ==; 31:uG0zTcZAaSWE70vjPykrPHQ9GleRDtchkKfhBKQFsrmXFpd6UsnTO++PGGsIqhHolQtILwxmnFpbPspxUXyJ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951738403); 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)(10201501046)(100000703101)(100105400095)(3002001)(93006095)(93001095)(6041248)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123555025)(20161123562025)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:VI1PR0301MB2142; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:VI1PR0301MB2142; X-Forefront-PRVS: 03932714EB X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(7370300001)(4630300001)(6009001)(39850400002)(39400400002)(39410400002)(39840400002)(39450400003)(199003)(189002)(54906002)(81166006)(81156014)(101416001)(72206003)(7736002)(5660300001)(305945005)(48376002)(2351001)(68736007)(2361001)(50466002)(105586002)(97736004)(106356001)(42186005)(8676002)(122856001)(50226002)(66066001)(86362001)(47776003)(33646002)(4326008)(8666007)(6116002)(3846002)(189998001)(107886003)(2950100002)(110136004)(38730400002)(36756003)(8656003)(7350300001)(6916009)(2906002)(53936002)(80792005)(478600001)(76176999)(6666003)(50986999)(5003940100001); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0301MB2142; 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; VI1PR0301MB2142; 23:pF2n+/QtOPXMY/E9LfT4eJGWZYBtv8G3jE58ihn?= =?us-ascii?Q?PQVSWIBT+Nuq30ZYq48Tcel063T5/81fCXGKQ/2uPKbNO4fLDkVr8nvdE1pJ?= =?us-ascii?Q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H03dDbu8mRLxIvEuw4O87/GN8prDd69y/jCBe5TrQuFqwX51NxTOZ2Pj7lbC2T6BtMie214c4Aw=; 7:axSn1biHO+sTQ/7+uVhuU7uNus+RYv4+FFoNaciNisx6UlulBRi16n9CH7pK/ldGScZHEjfobTnUlxqcbLVUMDo1W8F6DnSdui+mtGtFWttSoCvtiJs2d+Akn+35hH7UGymvosBFXEUUgUNnwKFAeJddSfB5+fxlv3G3FYq2wTsHkJFopm1HQT6Wpz7Idx6j1kvmyDbZ4F2hQHgr5KPSVkKusDYdj1XhZtyBtuCgzJQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2017 20:09:14.8528 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0301MB2142 Cc: "Edgar E . Iglesias" , Julien Grall , Stefano Stabellini , Volodymyr Babchuk Subject: [Xen-devel] [PATCH 3/7] 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 On certain ARM arhcitectures SMC instruction can be conditional (ARM DDI 0487A.k page D7-1949) and we need to check if that conditional was meet. Signed-off-by: Volodymyr Babchuk --- This patch was separated from the next one --- 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 0171c1c..e14e7c0 100644 --- a/xen/arch/arm/traps.c +++ b/xen/arch/arm/traps.c @@ -2773,6 +2773,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();