From patchwork Wed Oct 4 21:00:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Volodymyr Babchuk X-Patchwork-Id: 9985455 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 472BD602B8 for ; Wed, 4 Oct 2017 21:03:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 38D9028C22 for ; Wed, 4 Oct 2017 21:03:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2D97C28C24; Wed, 4 Oct 2017 21:03:26 +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 5A08628C23 for ; Wed, 4 Oct 2017 21:03:23 +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 1dzqn7-00085j-HG; Wed, 04 Oct 2017 21:01:17 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dzqn6-00085A-4C for xen-devel@lists.xen.org; Wed, 04 Oct 2017 21:01:16 +0000 Received: from [85.158.139.211] by server-13.bemta-5.messagelabs.com id 32/0C-01784-B1C45D95; Wed, 04 Oct 2017 21:01:15 +0000 X-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epam.com X-Msg-Ref: server-10.tower-206.messagelabs.com!1507150874!86176917!1 X-Originating-IP: [40.107.3.40] 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 39862 invoked from network); 4 Oct 2017 21:01:14 -0000 Received: from mail-eopbgr30040.outbound.protection.outlook.com (HELO EUR03-AM5-obe.outbound.protection.outlook.com) (40.107.3.40) by server-10.tower-206.messagelabs.com with AES256-SHA256 encrypted SMTP; 4 Oct 2017 21:01:14 -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=X3/EQsbG9JtuZzdct3WMeHYEeJt8M3bbJ0bOM8yIEd4dzqZz98Nv2mSyXJtVZ3xuwPF2nb3mhSXgo7dlpCKIdUnGiT9HGsWGLF/UBb11nVNSBu6PKgpBNQDgqB1OeeI4cK+kHiwju8J58jIOolcz9Vkm1OeIBIciUFoi27hNW/Q= Received: from EPUAKYIW2556.kyiv.epam.com (85.223.209.53) by VI1PR0301MB2143.eurprd03.prod.outlook.com (2603:10a6:800:26::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Wed, 4 Oct 2017 21:01:11 +0000 Received: by EPUAKYIW2556.kyiv.epam.com (sSMTP sendmail emulation); Thu, 05 Oct 2017 00:01:07 +0300 From: Volodymyr Babchuk To: xen-devel@lists.xen.org Date: Thu, 5 Oct 2017 00:00:19 +0300 Message-Id: <1507150827-7858-4-git-send-email-volodymyr_babchuk@epam.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1507150827-7858-1-git-send-email-volodymyr_babchuk@epam.com> References: <1507150827-7858-1-git-send-email-volodymyr_babchuk@epam.com> MIME-Version: 1.0 X-Originating-IP: [85.223.209.53] X-ClientProxiedBy: AM5PR0102CA0004.eurprd01.prod.exchangelabs.com (2603:10a6:206::17) To VI1PR0301MB2143.eurprd03.prod.outlook.com (2603:10a6:800:26::16) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f2e4c4d7-3b4c-4ffa-b3fb-08d50b6b0b66 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:VI1PR0301MB2143; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0301MB2143; 3:KPwHmoJZbZbUIAqllAN3OI8mB7Nh3AxRtxvracvw9vm6OMvaPIcmYSr3JtCYla8f3rORpDndRavle+Um3L1rwxchPDWY6ycTi8+z4dEDjXGEvKPqYls/ffw/OOQLoKhwHdjk0oNx+UUss6/wx9ytHRZno33StlQgd6D32f92vpzSwFW+G5VrhNKLOfIyuwR0WRGFqUcmjQxwSStatoyaAW7TFRe62ltk4aSYX+dWEc59zcZRAcSmXk20kNanZj6M; 25:FHCKMAm/kiSWmmxvLJtbfdrnz7wSHOa6BZ85y6BbB5T0fFci20PKlnSaaXbuDA0lQGPucdCHL+OH6k4rrIRKuY3/VNpbhScP4yI3tNYhRCKenrOCxmEGuASrKzVC4GLgKWhgK83XuFjUSxYY0qZkLT80Qa12jwZhWCEU3fcmXW5TckM1/xiELZgEVKV3PfcgHbNfp2hJ/691XwDaljb5k0pZXp35ZL0Qom8GHwKEpAYV1nTB7yO8W0qSAT+qjYFXUR4IWo0jt8xlRDocw/vmWcy+XjuytycZttmJH3YxwnlEebILRbb63Ip8/JcbBbAgTDpVtNLbIACbmmZrHkpO3A==; 31:bG4joF7XO8x/ricO0VSzvz0myKRAgM4D4K0PKgCvTBA8sUnv2CjZq6dlqJ00yDj1l32kvYC7hIYFCaLzMf6rQK4kzGD2H/dGk1HGu+o+1oD+n+6E/AHdxiDoe1L8Xabet1PM88W/gmoU8IrqgfmEJfQM7t6tlU1GU3tef7BSRHx4kee6XV+iG2SRXO/f+SWnEJdHs/7R/HZYFEhNntLE15QtR2f2WVTg68VPs5I6y4Y= X-MS-TrafficTypeDiagnostic: VI1PR0301MB2143: X-Microsoft-Exchange-Diagnostics: 1; VI1PR0301MB2143; 20:HNmn1g3KJKgxbOQgT6E9jIwOlXBaY4xiUz9pS6PlGjB0O/p+DyyIGDJMST+aqwxDv4Q5jupW76xOd00bVya+yPzhNfKQ9bUVINdSkYZkarOUp5fh5xyzb8vjgHPQVEipebxW/M+jgxlsh66t9WKoPS/fAJsgFwjcQBA0rzEtgvviPVb8dFclo03H/cc/j8PqREnCzgHLaQ0ntTirB7buYc2DdOvMC/CPxxAC2LePLgS0aWwPEdlfLtYpELnL4Qb79VlRwTAHf8ix1DJ5fzHDQC5nTwETC912X4kom85UDwM11T7X4/hh1TUt1HykkLHP79MZi3lhPjId+CS0BgS1P6iPlkbcFBM1KoO/I0hxwbDDK/OPlWNdULqbdz00aY+jYge03KyOF1mAkc2fCnBHlvdnyhlu7W4vaeFa1V0QsqQIDWXGe3gM7+SCE1SQbybXRmZrS0U+CQGEoabnyXMUdmIITDkftYSnNzlnRsaQD52QNuIVcCFRQrntYK37/UHl; 4:rfPrj6wfKmkfxnxgfOp2jTpI2uDeCcGY03Sy+x8Bf3D9TvtQnAZMIa5VH8uq6L+AJPkB89hsx2vXdkMYFcCykERwAL2miFri5rIK6NoX2Wv430hQ4lEug5Mp5L30nnr7XNFHzvf2icKzM3+SE0gywllKBABe5alf3MqnAVm2etniNnvRa9df8pfne2BYjVOiK1DYpNjsze2tiSpcUB7MOVJMUlnqBvC9LxXrFMQK5W85auvepJSeZCBDalX7IC2VpXq0/wrhIn8TTrLKyB1x+H9x3EL4JqqTZWD3uXeGt2ZyQ8so0YD+KHBavdicrf+31PeGC7JKSgjklNd5UB44+w== 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)(5005006)(8121501046)(10201501046)(100000703101)(100105400095)(93006095)(93001095)(3002001)(6041248)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123564025)(20161123555025)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:VI1PR0301MB2143; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:VI1PR0301MB2143; X-Forefront-PRVS: 0450A714CB X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(376002)(346002)(39860400002)(189002)(199003)(305945005)(16586007)(8936002)(8656003)(68736007)(81156014)(189998001)(478600001)(4326008)(101416001)(86362001)(7736002)(36756003)(6666003)(47776003)(2906002)(54906003)(50226002)(66066001)(8676002)(42186006)(2950100002)(6116002)(81166006)(3846002)(316002)(5660300001)(6916009)(5003940100001)(105586002)(50466002)(33646002)(50986999)(97736004)(53936002)(106356001)(8666007)(80792005)(122856001)(76176999)(2361001)(48376002)(72206003)(2351001); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0301MB2143; 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; VI1PR0301MB2143; 23:kVURP3JDr/8P4IXbXcrFj4BCHxMil75ECWffTcv?= =?us-ascii?Q?Zk7rbbY42hHuB7TbkkRDUvA6w1YLS0AOdw62qtfSHswgMsJeRXZ4ONtMl1Df?= =?us-ascii?Q?LJRTpKB0DDuyHztoMJ4zycLzmczjTt6jCLpojJwIDnv4OTuPM0Aqov4jurmm?= =?us-ascii?Q?UOD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agnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2017 21:01:11.9104 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b41b72d0-4e9f-4c26-8a69-f949f367c91d X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0301MB2143 Cc: "Edgar E . Iglesias" , Julien Grall , Stefano Stabellini , Volodymyr Babchuk Subject: [Xen-devel] [PATCH v7 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();