From mboxrd@z Thu Jan 1 00:00:00 1970 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 CE23DC77B76 for ; Mon, 17 Apr 2023 14:29:50 +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:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1SA96xBxujA4Hgnh4fkTv6apTUtSb8wfSIEuyjzxsw8=; b=yupE8sTvcofB4K Pzpinj9al+aK/QLPUbDhgvWFP55vUIkUAgRf2TZkXX3qa9GC5AZp38+Sm7UJQ93/fyRWE+kR2ZUmg fukg6ZN4V4CpA+NBkriTfaKKp3Pe0DM+TxkM7FmWpYiy6VgIvP1IDIIHWDev3OFdO7jsjr6Be7271 iqspfSYgLU1aY/+LiPxvp7oNpF/H0WRCCysYOSMP/UjU5YfoEcRLZ35AFGydot5nIQXHa/zYsFlFY qB3t6CQPegOOxqgAWayiuTfJzqxTkljqzYdVzA//CO6GvajQVdAEzlsasYZMJNue8CK/5G1IUVPvz JgWWY9lLXR93/SyY4ONA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1poPqh-00Gczs-2B; Mon, 17 Apr 2023 14:28:55 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1poPqe-00GczB-1Q for linux-arm-kernel@lists.infradead.org; Mon, 17 Apr 2023 14:28:53 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EDA7B1063; Mon, 17 Apr 2023 07:29:33 -0700 (PDT) Received: from [10.57.68.227] (unknown [10.57.68.227]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 08EBE3F5A1; Mon, 17 Apr 2023 07:28:48 -0700 (PDT) Message-ID: Date: Mon, 17 Apr 2023 15:28:47 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: [PATCH v3 30/60] arm64: idreg-override: Create a pseudo feature for rodata=off Content-Language: en-US To: Ard Biesheuvel , linux-kernel@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, Catalin Marinas , Will Deacon , Marc Zyngier , Mark Rutland , Anshuman Khandual , Kees Cook References: <20230307140522.2311461-1-ardb@kernel.org> <20230307140522.2311461-31-ardb@kernel.org> From: Ryan Roberts In-Reply-To: <20230307140522.2311461-31-ardb@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230417_072852_525879_D6876AC1 X-CRM114-Status: GOOD ( 17.57 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 07/03/2023 14:04, Ard Biesheuvel wrote: > Add rodata=off to the set of kernel command line options that is parsed > early using the CPU feature override detection code, so we can easily > refer to it when creating the kernel mapping. > > Signed-off-by: Ard Biesheuvel > --- > arch/arm64/include/asm/cpufeature.h | 1 + > arch/arm64/kernel/pi/idreg-override.c | 2 ++ > 2 files changed, 3 insertions(+) > > diff --git a/arch/arm64/include/asm/cpufeature.h b/arch/arm64/include/asm/cpufeature.h > index bc10098901808c00..edc7733aa49846b2 100644 > --- a/arch/arm64/include/asm/cpufeature.h > +++ b/arch/arm64/include/asm/cpufeature.h > @@ -16,6 +16,7 @@ > #define cpu_feature(x) KERNEL_HWCAP_ ## x > > #define ARM64_SW_FEATURE_OVERRIDE_NOKASLR 0 > +#define ARM64_SW_FEATURE_OVERRIDE_RODATA_OFF 4 I assume these are bit numbers? Why not just use the next available bit (bit 1) for this new flag? > > #ifndef __ASSEMBLY__ > > diff --git a/arch/arm64/kernel/pi/idreg-override.c b/arch/arm64/kernel/pi/idreg-override.c > index 4e76db6eb72c2087..6c547cccaf6a9e9c 100644 > --- a/arch/arm64/kernel/pi/idreg-override.c > +++ b/arch/arm64/kernel/pi/idreg-override.c > @@ -151,6 +151,7 @@ static const struct ftr_set_desc sw_features __prel64_initconst = { > .override = &arm64_sw_feature_override, > .fields = { > FIELD("nokaslr", ARM64_SW_FEATURE_OVERRIDE_NOKASLR, NULL), > + FIELD("rodataoff", ARM64_SW_FEATURE_OVERRIDE_RODATA_OFF, NULL), > {} > }, > }; > @@ -183,6 +184,7 @@ static const struct { > "id_aa64isar2.gpa3=0 id_aa64isar2.apa3=0" }, > { "arm64.nomte", "id_aa64pfr1.mte=0" }, > { "nokaslr", "arm64_sw.nokaslr=1" }, > + { "rodata=off", "arm64_sw.rodataoff=1" }, > }; > > static int __init parse_hexdigit(const char *p, u64 *v) _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel