From patchwork Fri Nov 11 17:11:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 13040640 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 8D6B1C433FE for ; Fri, 11 Nov 2022 17:27:21 +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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=mB9rurDSkfnIb5ZmLbTAbyZIUNROBKBgPqXgBfIWCaY=; b=lAJIk6l5iaiQZ1 q70De08bQ4b9cYxO0XubNolNQuPZ9QEgqUhM46U7HE97Ow4uBwIJs4zmxPCXmsOjVRO96oRDgcGQ5 8xiSwPaeYNRk5VUDF5O0SZNVGj1gMFkYwyVaAOuU0WmWzfMODZtXi4w+HHpQwFpYF6tWuiCUuz8Uz hldnizC/2YJni9CJ/kMzosCceS20jlrxcJy7X6QaMm5xAbVzG8PhiMp9JwYlZ9NuNYiZ1R4TOI/wA WoMEyRDUmrAtr1y4wf1qea0u8SMEcNQPSyd/rrTHmUeyOZtuu86MmrCvYGEiJpj5xNgrBeGcEcl6n vuwLB2LZiaYkHKgRLIVQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1otXnG-00HEux-VC; Fri, 11 Nov 2022 17:26:19 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1otXaT-00H7tp-EL for linux-arm-kernel@lists.infradead.org; Fri, 11 Nov 2022 17:13:06 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 02F3162066; Fri, 11 Nov 2022 17:13:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 866D3C43143; Fri, 11 Nov 2022 17:13:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668186784; bh=Bz7DmxM0QyWxMPOZV5SEwQziNrpV/7poJwrAfXfKW4k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=THaOnaEMFhlLxQtp033zb+rvGgfTbTdJI8W+fQco/ow/oV3qOyv6f3vHRm4ZPMtYz YVTKubmiE2qwI1TrVe87WyIL1jIx6nqikaaT19tfoSqRttG85Zv0pabpvxMxZFbihq ThDH79C29a4GaehZ7znTru1GBjpxnhgDzdTtt2gtyoOxPeKHPNEbtr71483V9xwzoM OVoraXwIJ4CVPcmMm9n4gq6JHOIk0Kl8tAgD0faf7JzE9RbmyMoNGtxuSoOzI0STtm vSKBWvk/IlJs4vIwKh7GVYnrB8NMxE0jsAUz1xdC3iPl7zvnNlYzFdnoMZ1He96saj RkKA1PjaDz6GQ== From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org Cc: Ard Biesheuvel , Marc Zyngier , Will Deacon , Mark Rutland , Kees Cook , Catalin Marinas , Mark Brown , Anshuman Khandual Subject: [PATCH v7 20/33] arm64: Move feature overrides into the BSS section Date: Fri, 11 Nov 2022 18:11:48 +0100 Message-Id: <20221111171201.2088501-21-ardb@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221111171201.2088501-1-ardb@kernel.org> References: <20221111171201.2088501-1-ardb@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1664; i=ardb@kernel.org; h=from:subject; bh=Bz7DmxM0QyWxMPOZV5SEwQziNrpV/7poJwrAfXfKW4k=; b=owEB7QES/pANAwAKAcNPIjmS2Y8kAcsmYgBjboJK5gpkGhmIOcURr17g+CBraJNrGoW+j/BW4eeT MctXkQ6JAbMEAAEKAB0WIQT72WJ8QGnJQhU3VynDTyI5ktmPJAUCY26CSgAKCRDDTyI5ktmPJNcIC/ 4mbOU5Ha+njblnGHJGZIhL/BM6zBh5bomY1wwiVvjycu6br5EcaIgjcF2w5HtDHvb0sWPzjPp1kgfR PHm/nIdJDYFfbxJGpX1ZJVEYtGnVmX2/OICQFfuTRu4UA5U67RjnmBuEm137RI8iU1k2NyB+vrVWes urrdHk/COZs+3rB8KylxzRwEggTGdPzYO/nQSvpuDcMWZEBWiH42VWc/llDLY040J5MpicGqho0Mis CJjMDfJIcK3id+cvDtyNv6nODaXiB8sL+6T9B0wO8joQIRVmhgst7hTPIUsDl8tfih79Z2qLDpfOBO F9m3WZse0uJcuWhkkw8C1nQDreLWRf9me6b8Qj1Wlb8JSbsy2dRLO9bO1nxA0QNQta7AcdM5H2MXFN MJP29tOm+kIuGpA/eQ7+IieDJY37qmWMe15vt2m6/HU5/hLn4UGUciD4LjLxWoQVFjuDIfd5VIsJ6a uAC0BYel0YGYOTQrdMyQc/925lTK5Xwjz8kUwevsfNMBs= X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221111_091305_589487_6EEEFE36 X-CRM114-Status: GOOD ( 12.29 ) 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 In order to allow the CPU feature override detection code to run even earlier, move the feature override global variables into BSS, which is the only part of the static kernel image that is mapped read-write in the initial ID map. Signed-off-by: Ard Biesheuvel --- arch/arm64/kernel/cpufeature.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index ebd8cabffb105e15..08ab04dc9393652a 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -636,13 +636,13 @@ static const struct arm64_ftr_bits ftr_raz[] = { #define ARM64_FTR_REG(id, table) \ __ARM64_FTR_REG_OVERRIDE(#id, id, table, &no_override) -struct arm64_ftr_override __ro_after_init id_aa64mmfr1_override; -struct arm64_ftr_override __ro_after_init id_aa64pfr0_override; -struct arm64_ftr_override __ro_after_init id_aa64pfr1_override; -struct arm64_ftr_override __ro_after_init id_aa64zfr0_override; -struct arm64_ftr_override __ro_after_init id_aa64smfr0_override; -struct arm64_ftr_override __ro_after_init id_aa64isar1_override; -struct arm64_ftr_override __ro_after_init id_aa64isar2_override; +struct arm64_ftr_override id_aa64mmfr1_override; +struct arm64_ftr_override id_aa64pfr0_override; +struct arm64_ftr_override id_aa64pfr1_override; +struct arm64_ftr_override id_aa64zfr0_override; +struct arm64_ftr_override id_aa64smfr0_override; +struct arm64_ftr_override id_aa64isar1_override; +struct arm64_ftr_override id_aa64isar2_override; struct arm64_ftr_override arm64_sw_feature_override;