From patchwork Mon May 15 14:10:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Punit Agrawal X-Patchwork-Id: 9727101 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 1BD2160386 for ; Mon, 15 May 2017 14:12:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0ED50289A8 for ; Mon, 15 May 2017 14:12:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 03A49289A6; Mon, 15 May 2017 14:12:56 +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 7574C289A5 for ; Mon, 15 May 2017 14:12:56 +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 1dAGiC-00067z-FD; Mon, 15 May 2017 14:11:00 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dAGiB-00067Q-AH for xen-devel@lists.xen.org; Mon, 15 May 2017 14:10:59 +0000 Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id 05/A0-11537-2F6B9195; Mon, 15 May 2017 14:10:58 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrELMWRWlGSWpSXmKPExsVysyfVTffTNsl IgyeHmS2WfFzM4sDocXT3b6YAxijWzLyk/IoE1oy+s5fYC35yVCy+NZ+tgbGLvYuRi0NIYDOj xJL2g2wQznZGiQeP/jJ3MXJysAloS0z9PRHMFhGQlrj2+TIjiM0s0MAk8XGZCYgtLBAssX3fD 7A4i4CqxOwti4EGcXDwClhKNN71AQlLCMhL7Gq7yApicwpYSVz8dBqsXAiopHXVNSaIGkmJPS e/M05g5FnAyLCKUaM4tagstUjXyFIvqSgzPaMkNzEzR9fQwFgvN7W4ODE9NScxqVgvOT93EyP Q7/UMDIw7GJv2+h1ilORgUhLldX0pHinEl5SfUpmRWJwRX1Sak1p8iFGGg0NJgvf+VslIIcGi 1PTUirTMHGAAwqQlOHiURHgXgaR5iwsSc4sz0yFSpxgVpcR5fUESAiCJjNI8uDZY0F9ilJUS5 mVkYGAQ4ilILcrNLEGVf8UozsGoJMwrBYwhIZ7MvBK46a+AFjMBLQ4DuZm3uCQRISXVwJixrr 5doNDBZNLWpULv1QPajZoml5z0KIs8FtV9Iy31DJOUSt7NZb5e6ypkraNWvFD8cG1igP5llYK 8FfNPatzqmvxMrPriii35c20uJxw0FxW9PDcuqTt5SYiG79vlHhyVAW37t3Ps1IjbyNGpVBv2 yC2y47jjrerX/e+O/n5dZVydGiLir8RSnJFoqMVcVJwIAEkAjwJ1AgAA X-Env-Sender: punit.agrawal@arm.com X-Msg-Ref: server-14.tower-31.messagelabs.com!1494857457!100429667!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 39622 invoked from network); 15 May 2017 14:10:57 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-14.tower-31.messagelabs.com with SMTP; 15 May 2017 14:10:57 -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 4BC1D1435; Mon, 15 May 2017 07:10:57 -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 1B0323F41F; Mon, 15 May 2017 07:10:57 -0700 (PDT) From: Punit Agrawal To: xen-devel@lists.xen.org Date: Mon, 15 May 2017 15:10:11 +0100 Message-Id: <20170515141012.6612-3-punit.agrawal@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170515141012.6612-1-punit.agrawal@arm.com> References: <20170515141012.6612-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 Resend 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;