From patchwork Wed Jul 11 23:18:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Hutchings X-Patchwork-Id: 10520683 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 8E8D1600CA for ; Wed, 11 Jul 2018 23:18:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 74604298E9 for ; Wed, 11 Jul 2018 23:18:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 684E7298FE; Wed, 11 Jul 2018 23:18:46 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6ACD0298E9 for ; Wed, 11 Jul 2018 23:18:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:Message-ID:To:From :Date:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=Rq2iX5lSnhXKOWOeqOxLO0DXiC9P8WueC/mCrzyYNhM=; b=AGar1BQbvbJxRE SyTjc+sg25kizVupQ5zGPrcYmg0bLC4i4q8Zs+DHFf+ZPLkClllat1nXNL45685ehnB11vBJOgVQc s9e+32Wbqx/gpZrfPmGfiG/Gt4rOiI6dLYS8x99Rl2H94VJP/DVOkqOrzTalmbQ5LlT5HSFfB4uru 5z1zUkX5bwrWqK8PbzcyVgHZfLKJ6w8anUkjFvffuzqAA8knQTJWKZiEDwHNktSxivP49Qk5+Ue53 nW/fMHFukpAWOjftK05+/WIl8L8xQr/E1hypMGsAtYh4x7A/JGdNYpklIuiq1C3Y2oavuKtaUp/5k Bx7ku8McTIZeS63gpUzw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fdONd-00044i-Hv; Wed, 11 Jul 2018 23:18:41 +0000 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fdONa-00043a-93 for linux-arm-kernel@lists.infradead.org; Wed, 11 Jul 2018 23:18:39 +0000 Received: from ben by shadbolt.decadent.org.uk with local (Exim 4.84_2) (envelope-from ) id 1fdONK-0006AA-KW for linux-arm-kernel@lists.infradead.org; Thu, 12 Jul 2018 00:18:25 +0100 Date: Thu, 12 Jul 2018 00:18:22 +0100 From: Ben Hutchings To: linux-arm-kernel@lists.infradead.org Message-ID: <20180711231822.GG14131@decadent.org.uk> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: ben@decadent.org.uk Subject: [RFC PATCH] arm64: mm: Export __sync_icache_dcache() for xen-privcmd X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on shadbolt.decadent.org.uk) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180711_161838_465714_9FB028BB X-CRM114-Status: GOOD ( 12.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The xen-privcmd driver, which can be modular, calls set_pte_at() which in turn may call __sync_icache_dcache(). The call to __sync_icache_dcache() may be optimised out because it is conditional on !pte_special(), and xen-privcmd calls pte_mkspecial(). But it seems unwise to rely on this optimisation. Fixes: 3ad0876554ca ("xen/privcmd: add IOCTL_PRIVCMD_MMAP_RESOURCE") Signed-off-by: Ben Hutchings Acked-by: Catalin Marinas --- This is an RFC since I haven't found an actual build failure. Using Debian's gcc 7.3 with either CC_OPTIMIZE_FOR_PERFORMANCE or CC_OPTIMIZE_FOR_SIZE, the call *is* optimised away. Ben. arch/arm64/mm/flush.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/mm/flush.c b/arch/arm64/mm/flush.c index 1059884f9a6f..a76f0b983294 100644 --- a/arch/arm64/mm/flush.c +++ b/arch/arm64/mm/flush.c @@ -66,6 +66,7 @@ void __sync_icache_dcache(pte_t pte) sync_icache_aliases(page_address(page), PAGE_SIZE << compound_order(page)); } +EXPORT_SYMBOL_GPL(__sync_icache_dcache); /* * This function is called when a page has been modified by the kernel. Mark