From patchwork Fri May 26 11:14:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Punit Agrawal X-Patchwork-Id: 9750395 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 ACB2F60390 for ; Fri, 26 May 2017 11:18:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A457527C2D for ; Fri, 26 May 2017 11:18:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 990B728380; Fri, 26 May 2017 11:18:33 +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 486F4283AF for ; Fri, 26 May 2017 11:18:33 +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 1dEDER-0006Dc-PB; Fri, 26 May 2017 11:16:35 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dEDEQ-0006DG-HN for xen-devel@lists.xen.org; Fri, 26 May 2017 11:16:34 +0000 Received: from [85.158.143.35] by server-8.bemta-6.messagelabs.com id F3/C3-03696-19E08295; Fri, 26 May 2017 11:16:33 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrMLMWRWlGSWpSXmKPExsVysyfVTXcin0a kwb6tshZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa0bnprfsBT85KqauN2lg7GLvYuTiEBLYzCjx e9cXFghnO6PEh4b1rF2MnBxsAtoSU39PZAaxRQSkJa59vswIUsQs0MAk0TStmxEkISzgL3Gnt 5UNxGYRUJXoPtIPFucVsJJYtmczWFxCQF5iV9tFsKGcAtYSjx7NZgGxhYBqmh7/ZoWokZTYc/ I74wRGngWMDKsYNYpTi8pSi3QNjfSSijLTM0pyEzNzdA0NzPRyU4uLE9NTcxKTivWS83M3MQI 9zwAEOxgvbww4xCjJwaQkyjt9nXqkEF9SfkplRmJxRnxRaU5q8SFGGQ4OJQneRzwakUKCRanp qRVpmTnAEIRJS3DwKInwfgJJ8xYXJOYWZ6ZDpE4xKkqJ8/bzAiUEQBIZpXlwbbCwv8QoKyXMy wh0iBBPQWpRbmYJqvwrRnEORiVh3pUgU3gy80rgpr8CWswEtNj3nDrI4pJEhJRUA6OaWlWrp5 3M9NnH1K48zQvlnCKm+bTskN+CqfyqTncqXWY8q+8JNVu97eenyRw+kRNnetgGTbnw888h1Zt tzhvnrrGtP/3G+7jzyY+CvgbcCVyfroVo82x82XnLu3PmxIpq7nPTuD63l01bvXZH7bzeK11v D+R61h0PUFjfk6R48Ny+U1HvpxYqsRRnJBpqMRcVJwIAe/psLnYCAAA= X-Env-Sender: punit.agrawal@arm.com X-Msg-Ref: server-9.tower-21.messagelabs.com!1495797393!70717910!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.4.19; banners=-,-,- X-VirusChecked: Checked Received: (qmail 51501 invoked from network); 26 May 2017 11:16:33 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-9.tower-21.messagelabs.com with SMTP; 26 May 2017 11:16:33 -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 9E09B1596; Fri, 26 May 2017 04:16:32 -0700 (PDT) Received: from localhost (e105922-lin.cambridge.arm.com [10.1.207.56]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6AA323F41F; Fri, 26 May 2017 04:16:32 -0700 (PDT) From: Punit Agrawal To: xen-devel@lists.xen.org Date: Fri, 26 May 2017 12:14:06 +0100 Message-Id: <20170526111407.13537-3-punit.agrawal@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170526111407.13537-1-punit.agrawal@arm.com> References: <20170526111407.13537-1-punit.agrawal@arm.com> X-ARM-No-Footer: FoSSMail 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 PATCH v2 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 291998938e..b7bbea1d81 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -1398,13 +1398,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;