From nobody Fri Apr 17 10:34:47 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3CCC0215F7D for ; Sat, 21 Feb 2026 02:57:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771642636; cv=none; b=irbiKCnjJpDD6eMtZE9cHQM1UUnf2sBYgGyUcYZ9JUt7fwKD4Faksy/9qe9W5mNQStLMEws1qOUs3fsGvFRsWugYQHAbtxDCC/EA1QwPS8rei06S/t+Bn74n2TSZs5qOWVQT36XIzeTZ7JWGhenHQXmMh4KK+HSAaGvoQREO2No= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771642636; c=relaxed/simple; bh=buzl7XCbiE0HKuN/EHltr1H5QGDZ7uUTl2HJnM9XAIs=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=TurFdyFLEiv5p/bpXmhE6jUhaONpHeTz3+mU6RvP62JEmi517XKOjsldyGHQzLwy6KKKykJHPo6Lm3rpaXRnxMvYoX7Tm46Qj2dfKyhz9eCqo8hRYKOoZbFfnCTdaIIa73ppUXc7z8vwHlBi/2MPpTT1UxkoP/KueVV6r9MnQyw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=K4NpRXAx; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="K4NpRXAx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C14ACC116C6; Sat, 21 Feb 2026 02:57:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771642635; bh=buzl7XCbiE0HKuN/EHltr1H5QGDZ7uUTl2HJnM9XAIs=; h=From:To:Cc:Subject:Date:From; b=K4NpRXAxaBntZBzb+6eLLRghUZ1jM/GNerPhzwztJlCbfcw2P96P8o03n4bA5i1Vp NEZEk3n81qY39+5mN1B1gweV7EKao0fiDRhXUAhg/6cITGj8APVUGG3dbql57Q3QDQ qfimMB8hCHpLH7i0J6T5OVwW3O2nIISzj+cfd17J5oM15UinyOWIrv5X6xmbrSFdoU yYa8ovpCJHn1v8wyTIe/In25jdGIgMeRezUgNStPZcv/OQugqzstNfuhS8FdFqktgP WCoUMTLCMTHUv+LaKQNoCK3EbI+Y5cgywPLMW55zFOUQQuRqZACM3u9ZJKQHSSL/S6 RIAXJHtB7t+Fw== From: Jisheng Zhang To: Catalin Marinas , Will Deacon Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] arm64: make runtime const not usable by modules Date: Sat, 21 Feb 2026 10:38:47 +0800 Message-ID: <20260221023847.3506-1-jszhang@kernel.org> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Similar as commit 284922f4c563 ("x86: uaccess: don't use runtime-const rewriting in modules") does, make arm64's runtime const not usable by modules too, to "make sure this doesn't get forgotten the next time somebody wants to do runtime constant optimizations". The reason is well explained in the above commit: "The runtime-const infrastructure was never designed to handle the modular case, because the constant fixup is only done at boot time for core kernel code." Signed-off-by: Jisheng Zhang --- arch/arm64/include/asm/runtime-const.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm64/include/asm/runtime-const.h b/arch/arm64/include/as= m/runtime-const.h index be5915669d23..c3dbd3ae68f6 100644 --- a/arch/arm64/include/asm/runtime-const.h +++ b/arch/arm64/include/asm/runtime-const.h @@ -2,6 +2,10 @@ #ifndef _ASM_RUNTIME_CONST_H #define _ASM_RUNTIME_CONST_H =20 +#ifdef MODULE + #error "Cannot use runtime-const infrastructure from modules" +#endif + #include =20 /* Sigh. You can still run arm64 in BE mode */ --=20 2.51.0