From patchwork Fri Mar 31 10:24:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Punit Agrawal X-Patchwork-Id: 9655885 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 B1CF260350 for ; Fri, 31 Mar 2017 10:27:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A2CC524DA2 for ; Fri, 31 Mar 2017 10:27:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 96BF026E48; Fri, 31 Mar 2017 10:27:16 +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.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED 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 5371324DA2 for ; Fri, 31 Mar 2017 10:27:16 +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 1cttk4-0002CD-K0; Fri, 31 Mar 2017 10:25:16 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cttk4-0002Bu-05 for xen-devel@lists.xen.org; Fri, 31 Mar 2017 10:25:16 +0000 Received: from [193.109.254.147] by server-3.bemta-6.messagelabs.com id CC/8E-27751-B8E2ED85; Fri, 31 Mar 2017 10:25:15 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrOLMWRWlGSWpSXmKPExsVysyfVTbdL716 EwelN7BZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa8aMGV8YCw5wVPz+dJmxgfEqWxcjF4eQwCZG ib/7XzNCONsZJa6ue8TcxcjJwSagLTH190QwW0RAWuLa58tgRcwCDUwSTdO6GUESwgIBEivmP gCzWQRUJf7Muw00loODV8BKYuEcHpCwhIC8xK62i6wgNqeAtcSjrc1sILYQUMnDE4dZJzByL2 BkWMWoUZxaVJZapGtkpJdUlJmeUZKbmJmja2hgppebWlycmJ6ak5hUrJecn7uJEehhBiDYwbh mfuAhRkkOJiVR3u+P70YI8SXlp1RmJBZnxBeV5qQWH2KU4eBQkuDN0r0XISRYlJqeWpGWmQMM NZi0BAePkghvMEiat7ggMbc4Mx0idYpRUUqc9wtIQgAkkVGaB9cGC+9LjLJSwryMQIcI8RSkF uVmlqDKv2IU52BUEuadATKFJzOvBG76K6DFTECLLb7eBVlckoiQkmpglHKf4cwq111VMdXpRG 6e4Dolr72f519YuGJj8J3HW7le1N6xeu7abPhpapHHCvmHnx80qj9qmuBz6GFr6N2IXquWpz1 hW5bFZH858PmbyaYr3IoZ53vXLbkq3Hos0ogr6PXHnt1bhGs5XCu7aotFn0RuilcpecD4S7Qs VMvX6Udk8OYb+xPclViKMxINtZiLihMByhp+UmoCAAA= X-Env-Sender: punit.agrawal@arm.com X-Msg-Ref: server-7.tower-27.messagelabs.com!1490955913!90225391!1 X-Originating-IP: [217.140.101.70] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.2.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 18679 invoked from network); 31 Mar 2017 10:25:13 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-7.tower-27.messagelabs.com with SMTP; 31 Mar 2017 10:25:13 -0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 692DB80D; Fri, 31 Mar 2017 03:25:13 -0700 (PDT) Received: from localhost (e105922-lin.cambridge.arm.com [10.1.195.42]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 38ABC3F59A; Fri, 31 Mar 2017 03:25:13 -0700 (PDT) From: Punit Agrawal To: xen-devel@lists.xen.org Date: Fri, 31 Mar 2017 11:24:23 +0100 Message-Id: <20170331102424.11869-3-punit.agrawal@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170331102424.11869-1-punit.agrawal@arm.com> References: <20170331102424.11869-1-punit.agrawal@arm.com> Cc: sstabellini@kernel.org, wei.liu2@citrix.com, George.Dunlap@eu.citrix.com, andrew.cooper3@citrix.com, Punit Agrawal , tim@xen.org, julien.grall@arm.com, jbeulich@suse.com, ian.jackson@eu.citrix.com Subject: [Xen-devel] [For Xen-4.10 RFC PATCH 2/3] arm: p2m: Prevent redundant icache flushes 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 When toolstack requests flushing the caches, flush_page_to_ram() is called for each page of the requested domain. This needs to unnecessary icache invalidation operations. Let's take the responsibility of performing icache operations and use the recently introduced flag to prevent redundant icache operations by flush_page_to_ram(). Signed-off-by: Punit Agrawal Reviewed-by: Stefano Stabellini --- xen/arch/arm/p2m.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index 76cd1c34f3..8136522ed8 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -1400,13 +1400,15 @@ int p2m_cache_flush(struct domain *d, gfn_t start, unsigned long nr) /* XXX: Implement preemption */ while ( gfn_x(start) < gfn_x(next_gfn) ) { - flush_page_to_ram(mfn_x(mfn), true); + flush_page_to_ram(mfn_x(mfn), false); start = gfn_add(start, 1); mfn = mfn_add(mfn, 1); } } + invalidate_icache(); + p2m_read_unlock(p2m); return 0;