From patchwork Tue May 30 14:04:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Russell King (Oracle)" X-Patchwork-Id: 13260145 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 23C0BC77B7A for ; Tue, 30 May 2023 14:05:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Date:Message-Id:MIME-Version:Subject:Cc :To:From:References:In-Reply-To:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yU8H6Itvs9SFbbSD2yxx/QDh6OEnO/KXHImUri2/A2g=; b=2Hzs5CNxIPR2J6 pK2xGtzsKc30vlSVPnQ2AeB74GpfJDqzONrXyZ01I+hMg1gazsg9AKLtMlk2dc4qh77uqmRAlOOhJ jSAD0BqYgtA3XZXQnb8hzb1L7N+/QN8Ow29g6U1VP3vsvnpKgPHImopCqVx++BCtzf+vSXPPPipLm /VZUVre9kPFN3VR5VTikahAdkOzgP7h44YOF2n9EyA97NTyORbjUxq/SvJggOjZWTScWS11/XNqVm YfN437WbIVaqmOc4K9iWEh06miuVDUBZeSWc8gLLY9CTQ8694xgKLH8Fs8wZP1HH9BnooDAdV59+P DCjjkNHdN2lw90iacpwg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q3zyM-00E9Jf-1D; Tue, 30 May 2023 14:05:14 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q3zy0-00E9BG-1E for linux-arm-kernel@lists.infradead.org; Tue, 30 May 2023 14:04:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Date:Sender:Message-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Subject:Cc:To:From:References: In-Reply-To:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=1EnzjEtF1WYDn+TvglRvqTszcMqj93hsj/tUGVubobk=; b=iYWbHOiKblNGqcX2ob/VU4iK47 bXycuM9Y1G4L1mnuZjhe5FNdcZpUsdYtA9rdStSvIqyQYG7nTK/saBzT+dWRLLqHtsUmtvBHmG2ey OdIFzLqvY+gQ2o6eddRD1ZcYhmge+22JTmY81k+kN86TKMTUmCM8BSSRNsUMPUeBeru2ebcNq8z/M oQJOdGe/tbIJTeI4z4RmK2YhScMSJNEhIC7ePMzHANwqh/6lBE7AEExJoVuqVJTmQdymC/RF9K3+g wAJ9P0iEujyKbpcoVzTjkZUjj0gR878PCdeY2ry6uDCmrspTdFYy5TZvHnLS5FUDc1eNBMMhNtZUb jhMdxrLQ==; Received: from e0022681537dd.dyn.armlinux.org.uk ([fd8f:7570:feb6:1:222:68ff:fe15:37dd]:50828 helo=rmk-PC.armlinux.org.uk) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1q3zxz-0002qI-22; Tue, 30 May 2023 15:04:51 +0100 Received: from rmk by rmk-PC.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1q3zxy-00A5KE-Ft; Tue, 30 May 2023 15:04:50 +0100 In-Reply-To: References: From: "Russell King (Oracle)" To: Catalin Marinas , Jonathan Corbet , Will Deacon Cc: linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org Subject: [PATCH RFC 04/17] arm64: make clean_dcache_range_nopatch() visible MIME-Version: 1.0 Content-Disposition: inline Message-Id: Date: Tue, 30 May 2023 15:04:50 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230530_070452_421332_CB467B07 X-CRM114-Status: GOOD ( 12.75 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org When we hook into the kernel text patching code, we will need to call clean_dcache_range_nopatch() to ensure that the patching of the replicated kernel text is properly visible to other CPUs. Make this function available to the replication code. Signed-off-by: Russell King (Oracle) --- arch/arm64/include/asm/cacheflush.h | 2 ++ arch/arm64/kernel/alternative.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/cacheflush.h b/arch/arm64/include/asm/cacheflush.h index 37185e978aeb..ac9ad56d5212 100644 --- a/arch/arm64/include/asm/cacheflush.h +++ b/arch/arm64/include/asm/cacheflush.h @@ -104,6 +104,8 @@ static inline void flush_icache_range(unsigned long start, unsigned long end) } #define flush_icache_range flush_icache_range +void clean_dcache_range_nopatch(u64 start, u64 end); + /* * Copy user data from/to a page which is mapped into a different * processes address space. Really, we want to allow our "user diff --git a/arch/arm64/kernel/alternative.c b/arch/arm64/kernel/alternative.c index d32d4ed5519b..df9a73458a85 100644 --- a/arch/arm64/kernel/alternative.c +++ b/arch/arm64/kernel/alternative.c @@ -121,7 +121,7 @@ static noinstr void patch_alternative(struct alt_instr *alt, * accidentally call into the cache.S code, which is patched by us at * runtime. */ -static void clean_dcache_range_nopatch(u64 start, u64 end) +void clean_dcache_range_nopatch(u64 start, u64 end) { u64 cur, d_size, ctr_el0;