Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp4076583rwe; Mon, 17 Apr 2023 07:39:39 -0700 (PDT) X-Google-Smtp-Source: AKy350aOrNJAZJV1xWPtgj2rDy0/MGOSPDgnG9lbjFbIMzgRw05xtEbsdXZrrROvKMjTTy4Vq0Om X-Received: by 2002:a05:6a20:394f:b0:ef:b02a:b35b with SMTP id r15-20020a056a20394f00b000efb02ab35bmr5480345pzg.0.1681742378902; Mon, 17 Apr 2023 07:39:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681742378; cv=none; d=google.com; s=arc-20160816; b=g0KKvwbrdFkMMZgmAuyLDqqqEpxAfnRaYrH10ilJHB+3+FUL6PUwYVbUw498FKmAHY Ul4sPr8y8BRYlhTVHW5lLSTzd2y8NkipuuJ0KeSM/MWcYI6et7JTwDTv9eOTsgbHVMT4 JNHpS5P9B/IrZW3rgAquRFbQ82wSeGu0hdhoJ/yybCiA+qowwE0qBl29fevswygHtVX4 OS727wl51n3hCIx21sv9D4ocqErMA4rZnBvtTzAo4QEvcrjsWr9pcYilaAh41jtjNPy8 5qOtDGGEMduQPlKvTxK4fuO0KDV1HA+JvFrbP9FLidp1VAnwEgqbwODcovJx7Mq/QxQc dYQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=mVim0z1DiCgBns1osOcUtdJjvCoH2r3nmj3gXg1NX4c=; b=faWglM+B1yXWUl8r5ly4aNl+9Pex3tZowhzA/S/sDQw1v+0NEbkNaH435rfIqdVEOa 3jEwKI4dOq/VAF+egzhXwSYFmNl+HQ0j/GuH/ejwhKMnTpwcbXmtVbDh/DIziQePg8pV RlKIVUfvvKkc6RsQd3m1OOfKXmWFchiUWdSHUH7kONxsVPXt2ztN5mtV+S6AbPNMz8VG 6mAEFLH8CWL2gsLFCP9uSbwgfq7cagUgP7yjNCEIINOCHb+PVvBRKdXbUBIRbdijmgId i6wMXAq5fTWgaVj+QI+dEH/3LpTu96EV3JWcbZQjlPTdNeP/A60DkujPLsBf3ALWl8Y2 1FcQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 12-20020a63194c000000b0051a8a22a42dsi11794823pgz.268.2023.04.17.07.39.27; Mon, 17 Apr 2023 07:39:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229825AbjDQOeA (ORCPT + 99 others); Mon, 17 Apr 2023 10:34:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229643AbjDQOd6 (ORCPT ); Mon, 17 Apr 2023 10:33:58 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 66E1A92 for ; Mon, 17 Apr 2023 07:33:57 -0700 (PDT) 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 DA0611063; Mon, 17 Apr 2023 07:34:40 -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 8ACD33F5A1; Mon, 17 Apr 2023 07:33:55 -0700 (PDT) Message-ID: Date: Mon, 17 Apr 2023 15:33:53 +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 Cc: linux-kernel@vger.kernel.org, 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: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.5 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 17/04/2023 15:30, Ard Biesheuvel wrote: > On Mon, 17 Apr 2023 at 16:28, Ryan Roberts wrote: >> >> 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? >> > > This (ab)uses the CPU feature framework, which is based on 4-bit > quantities. I don't remember if it matters or not, but IIRC the > default macros use 4-bit wide values. OK, thanks.