All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland@arm.com>
To: linux-arm-kernel@lists.infradead.org
Cc: ardb@kernel.org, catalin.marinas@arm.com, james.morse@arm.com,
	joey.gouly@arm.com, mark.rutland@arm.com, maz@kernel.org,
	will@kernel.org
Subject: [PATCH v2 3/8] arm64: alternatives: proton-pack: prepare for cap changes
Date: Mon, 12 Sep 2022 17:22:05 +0100	[thread overview]
Message-ID: <20220912162210.3626215-4-mark.rutland@arm.com> (raw)
In-Reply-To: <20220912162210.3626215-1-mark.rutland@arm.com>

The spectre patching callbacks use cpus_have_final_cap(), and subsequent
patches will make it invalid to call cpus_have_final_cap() before
alternatives patching has completed.

In preparation for said change, this patch modifies the spectre patching
callbacks use cpus_have_cap(). This is not subject to patching, and will
dynamically check the cpu_hwcaps array, which is functionally equivalent
to the existing behaviour.

There should be no functional change as a result of this patch.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Joey Gouly <joey.gouly@arm.com>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: James Morse <james.morse@arm.com>
Cc: Marc Zyngier <maz@kernel.org>
Cc: Will Deacon <will@kernel.org>
---
 arch/arm64/kernel/proton-pack.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/kernel/proton-pack.c b/arch/arm64/kernel/proton-pack.c
index 40be3a7c2c531..8010b2e573fac 100644
--- a/arch/arm64/kernel/proton-pack.c
+++ b/arch/arm64/kernel/proton-pack.c
@@ -586,7 +586,7 @@ void __init spectre_v4_patch_fw_mitigation_enable(struct alt_instr *alt,
 	if (spectre_v4_mitigations_off())
 		return;
 
-	if (cpus_have_final_cap(ARM64_SSBS))
+	if (cpus_have_cap(ARM64_SSBS))
 		return;
 
 	if (spectre_v4_mitigations_dynamic())
-- 
2.30.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2022-09-12 16:25 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-12 16:22 [PATCH v2 0/8] arm64: alternatives: improvements Mark Rutland
2022-09-12 16:22 ` [PATCH v2 1/8] arm64: cpufeature: make cpus_have_cap() noinstr-safe Mark Rutland
2022-09-12 16:22 ` [PATCH v2 2/8] arm64: alternatives: kvm: prepare for cap changes Mark Rutland
2022-09-12 16:22 ` Mark Rutland [this message]
2022-09-12 16:22 ` [PATCH v2 4/8] arm64: alternatives: hoist print out of __apply_alternatives() Mark Rutland
2022-09-12 16:22 ` [PATCH v2 5/8] arm64: alternatives: make alt_region const Mark Rutland
2022-09-12 16:22 ` [PATCH v2 6/8] arm64: alternatives: have callbacks take a cap Mark Rutland
2022-09-27  9:31   ` Jon Hunter
2022-09-27  9:31     ` Jon Hunter
2022-09-29  9:53     ` Jon Hunter
2022-09-29  9:53       ` Jon Hunter
2022-09-29 10:10       ` Ard Biesheuvel
2022-09-29 10:10         ` Ard Biesheuvel
2022-09-29 10:48         ` Jon Hunter
2022-09-29 10:48           ` Jon Hunter
2022-09-29 10:47       ` Mark Rutland
2022-09-29 10:47         ` Mark Rutland
2022-09-29 11:01         ` Jon Hunter
2022-09-29 11:01           ` Jon Hunter
2022-09-29 11:09           ` Mark Rutland
2022-09-29 11:09             ` Mark Rutland
2022-09-29 13:37             ` Jon Hunter
2022-09-29 13:37               ` Jon Hunter
2022-09-29 14:38               ` Mark Rutland
2022-09-29 14:38                 ` Mark Rutland
2022-09-12 16:22 ` [PATCH v2 7/8] arm64: alternatives: add alternative_has_feature_*() Mark Rutland
2022-09-16 11:13   ` Catalin Marinas
2022-09-17 12:52     ` Mark Rutland
2022-09-19 17:01   ` Nathan Chancellor
2022-09-19 17:01     ` Nathan Chancellor
2022-09-20 12:09     ` Mark Rutland
2022-09-20 12:09       ` Mark Rutland
2022-09-20 13:31       ` Nathan Chancellor
2022-09-20 13:31         ` Nathan Chancellor
2022-09-12 16:22 ` [PATCH v2 8/8] arm64: alternatives: add shared NOP callback Mark Rutland
2022-09-13 13:36 ` [PATCH v2 0/8] arm64: alternatives: improvements Ard Biesheuvel
2022-09-16 17:46 ` Catalin Marinas
2022-09-17 12:46   ` Mark Rutland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220912162210.3626215-4-mark.rutland@arm.com \
    --to=mark.rutland@arm.com \
    --cc=ardb@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=james.morse@arm.com \
    --cc=joey.gouly@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=maz@kernel.org \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.