From patchwork Wed Jan 25 20:02:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tamas Lengyel X-Patchwork-Id: 9537855 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 BB18B6042B for ; Wed, 25 Jan 2017 20:07:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AC9AF27F99 for ; Wed, 25 Jan 2017 20:07:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A000E27FA6; Wed, 25 Jan 2017 20:07:44 +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=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RCVD_IN_SORBS_SPAM,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 1A1F927F99 for ; Wed, 25 Jan 2017 20:07:44 +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 1cWTmj-0002Ox-3P; Wed, 25 Jan 2017 20:03:13 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cWTmh-0002Or-7I for xen-devel@lists.xenproject.org; Wed, 25 Jan 2017 20:03:11 +0000 Received: from [193.109.254.147] by server-1.bemta-6.messagelabs.com id 2B/E8-27678-E7409885; Wed, 25 Jan 2017 20:03:10 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprAIsWRWlGSWpSXmKPExsXiVRvsqFvL0hl hsOywkcX3LZOZHBg9Dn+4whLAGMWamZeUX5HAmvHz2XH2giXsFZteX2BqYOxm62Lk4hASmMEo 8XflWkYQh0XgDYvExeWzWEEcCYF3LBLf/x9k6mLkBHJiJNY/PsYOYVdJXFq0FCwuJKApcXDDG WaIUROZJH6f3csCkmATMJK4erWHDcQWEVCSuLdqMhNIEbPAJkaJ9es2gSWEBewlur5vAZvEIq AqseHwUrA4L1B84slZUNvkJXa1XWSdwMi3gJFhFaNGcWpRWWqRrpGlXlJRZnpGSW5iZo6uoYG ZXm5qcXFiempOYlKxXnJ+7iZGYLgwAMEOxgOLAg8xSnIwKYnynjrVESHEl5SfUpmRWJwRX1Sa k1p8iFGGg0NJgteMuTNCSLAoNT21Ii0zBxi4MGkJDh4lEd50JqA0b3FBYm5xZjpE6hSjMcepT xdeMnHs2nX5JZMQS15+XqqUOG8IyCQBkNKM0jy4QbCIusQoKyXMywh0mhBPQWpRbmYJqvwrRn EORiVh3m8gC3ky80rg9r0COoUJ6JQLzO0gp5QkIqSkGhhTGQrUvHZueRF8pLFH1Sxr/90vmke /B8dFSrn7TTKdIRGWs+qvb9OunHVLZH0/rb7IdUHthoKyvbd61PNs8VsxgRN2XXjQ9Icvtkjq 4f/PkmoRapVSV2Ku3fm+bqdFwLv1/S9TM7gvvfdsu9M94Ztq3Mx3al8Ywvhsj/kK1r7oP7ahZ OK5DxFKLMUZiYZazEXFiQDqtiRQowIAAA== X-Env-Sender: tamas.lengyel@zentific.com X-Msg-Ref: server-11.tower-27.messagelabs.com!1485374588!53276732!1 X-Originating-IP: [74.125.83.65] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.1.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 39509 invoked from network); 25 Jan 2017 20:03:09 -0000 Received: from mail-pg0-f65.google.com (HELO mail-pg0-f65.google.com) (74.125.83.65) by server-11.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 25 Jan 2017 20:03:09 -0000 Received: by mail-pg0-f65.google.com with SMTP id 194so20536510pgd.0 for ; Wed, 25 Jan 2017 12:03:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zentific-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=jqYWUyvRdzmSDiI2+KJiENrDFHhl1lfV5tVZnoCwOWY=; b=iyuk0zDCfNfLcceZahZRbjPZJh4EsYn46peMaiT/ITdP8HJ2Szg5Gxs0AbNqU7Bw3+ 1Rg5CGNDtJR+PlB5sGFadUMiAuOyhn68SaFmlQVttAPfCujKHOFjCREodjHfU+tit/tK 1pM0e2IJ/57l/zYlcXKusjDEDFKKYcaBxc267GL6QnuNb7vf/+tR3qtkNI3dyOCeZxmw R0xecbphGMU+adFXDaBpd3Dfp7VCF7HopFldnjjjXJGARYaxH/iHDlNHnih+GkJJIaN0 RsdnSiw3vnQ6S2TMr1sFjfK7NiNv7EeJbR9NYxZvJFVkfyEKM8C/f/Z8TB4XTDk8yWkV oguA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=jqYWUyvRdzmSDiI2+KJiENrDFHhl1lfV5tVZnoCwOWY=; b=AP/UIFuXziMG4LXsQYX3lihkKpLxGNs5S4Yo22fespf1ovpa2MMSnHOifEq/xjWq6d 8OA9oEQmsbXuNk9DUhuZzGxZYHAuaLMeNDPxUsZUefdZN47iNz+oDKkAZLYVjbcaRNR8 X2AyJi+jmzN0ySWcMndXYHl5jlTWT4XWrQIdvu0NSssEyWU/yMSvcSF0oqYDLVsAxUQB rGUlKck2xTmTrjsekg8BbNZNVP2F1FR+POq8shDPEufkonH5KyP+Ixvq/OOsIuq9Bx7o RDE3gziAOPIuJqBh/wMpt/U4R4IVkb30nYu4vBLDkBTGVKlM7QDHp2flPV7emvWqFE1T BnMg== X-Gm-Message-State: AIkVDXIL22WEdyKdhtwmfy8GImCOn8bBi5qjI0nmhXzPEp3T2KQI6k7SYxNKQ6qzi6cNHA== X-Received: by 10.84.238.205 with SMTP id l13mr6214644pln.168.1485374588003; Wed, 25 Jan 2017 12:03:08 -0800 (PST) Received: from l1.lan (c-73-14-35-59.hsd1.co.comcast.net. [73.14.35.59]) by smtp.gmail.com with ESMTPSA id r16sm3059356pfg.76.2017.01.25.12.03.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Jan 2017 12:03:07 -0800 (PST) From: Tamas K Lengyel To: xen-devel@lists.xenproject.org Date: Wed, 25 Jan 2017 13:02:55 -0700 Message-Id: <20170125200255.15467-1-tamas.lengyel@zentific.com> X-Mailer: git-send-email 2.11.0 Cc: Tamas K Lengyel , Julien Grall , Stefano Stabellini , Razvan Cojocaru Subject: [Xen-devel] [PATCH] arm/monitor: flush the icache during SMC traps 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: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP During an SMC trap it is possible that the user may change the memory from where the SMC was fetched. However, without flushing the icache the SMC may still trigger if the pCPU was idle during the trap. Flush the icache to ensure consistency. Signed-off-by: Tamas K Lengyel Acked-by: Razvan Cojocaru --- Cc: Razvan Cojocaru Cc: Stefano Stabellini Cc: Julien Grall --- xen/arch/arm/monitor.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xen/arch/arm/monitor.c b/xen/arch/arm/monitor.c index 59ce8f635f..ae1b97993f 100644 --- a/xen/arch/arm/monitor.c +++ b/xen/arch/arm/monitor.c @@ -63,6 +63,9 @@ int monitor_smc(void) .reason = VM_EVENT_REASON_PRIVILEGED_CALL }; + /* Nuke the icache as the memory may get changed underneath us. */ + invalidate_icache(); + return monitor_traps(current, 1, &req); }