From patchwork Mon May 15 14:05:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Punit Agrawal X-Patchwork-Id: 9727083 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 3BC5A60380 for ; Mon, 15 May 2017 14:07:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2DD992885A for ; Mon, 15 May 2017 14:07:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2222228918; Mon, 15 May 2017 14:07:48 +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 6F9642885A for ; Mon, 15 May 2017 14:07:46 +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 1dAGcu-0004um-LW; Mon, 15 May 2017 14:05:32 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dAGcu-0004uR-4j for xen-devel@lists.xen.org; Mon, 15 May 2017 14:05:32 +0000 Received: from [85.158.137.68] by server-9.bemta-3.messagelabs.com id 0D/3D-26749-BA5B9195; Mon, 15 May 2017 14:05:31 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrMLMWRWlGSWpSXmKPExsVysyfVTXfVVsl Ig1uXTC2WfFzM4sDocXT3b6YAxijWzLyk/IoE1oy+s5fYC35yVCy+NZ+tgbGLvYuRi0NIYDOj xKfvexkhnO2MEj0TPrF1MXJysAloS0z9PZEZxBYRkJa49vkyWBGzwH9GiW1Xe5i6GDk4hAV8J NqviIHUsAioSnQtAJnKycErYClx5ddCFhBbQkBeYlfbRVYQm1PASmLRxldgNUJANR8n34CqkZ TYc/I74wRGngWMDKsYNYpTi8pSi3QNjfSSijLTM0pyEzNzdA0NjPVyU4uLE9NTcxKTivWS83M 3MQI9zwAEOxhfdTsfYpTkYFIS5XV9KR4pxJeUn1KZkVicEV9UmpNafIhRhoNDSYK3YItkpJBg UWp6akVaZg4wBGHSEhw8SiK8FiBp3uKCxNzizHSI1ClGRSlx3hKQhABIIqM0D64NFvaXGGWlh HkZgQ4R4ilILcrNLEGVf8UozsGoJMy7GWQKT2ZeCdz0V0CLmYAWh4HczFtckoiQkmpgbKrlr2 iNbDm2VODGiRP3rDcdPP2xLGjvp+zo/Hcf2tjm/SjO4dwdZGxguoH90Pwt1Ttkvx7yntIxt1T xicD6wjV7BQ7If2JU/T/1+1I2nZsTf+x24/J9IhgTee9zUvEmfhOrSWwbIotazCpYemSPZHj7 3Nh6vdet8ZNk665ZxkUflz+Mr9npq8RSnJFoqMVcVJwIAJwe5YR2AgAA X-Env-Sender: punit.agrawal@arm.com X-Msg-Ref: server-6.tower-31.messagelabs.com!1494857130!61894555!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.12; banners=-,-,- X-VirusChecked: Checked Received: (qmail 40411 invoked from network); 15 May 2017 14:05:30 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-6.tower-31.messagelabs.com with SMTP; 15 May 2017 14:05:30 -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 20DE01516; Mon, 15 May 2017 07:05:30 -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 E3FEA3F41F; Mon, 15 May 2017 07:05:29 -0700 (PDT) From: Punit Agrawal To: xen-devel@lists.xen.org Date: Mon, 15 May 2017 15:05:03 +0100 Message-Id: <20170515140504.6461-3-punit.agrawal@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170515140504.6461-1-punit.agrawal@arm.com> References: <20170515140504.6461-1-punit.agrawal@arm.com> X-ARM-No-Footer: FoSSMail Cc: sstabellini@kernel.org, wei.liu2@citrix.com, konrad.wil@oracle.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 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 29f2e2fad3..07357bce7d 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -1392,13 +1392,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;