diff options
author | Mark Rutland <mark.rutland@arm.com> | 2020-10-26 14:49:31 +0100 |
---|---|---|
committer | Marc Zyngier <maz@kernel.org> | 2020-10-30 09:53:10 +0100 |
commit | d86de40decaa14e6613af1b2783bf4d589d0f38b (patch) | |
tree | b2403210b1625e1a829a5c43249a2a4f61a409ba /arch/arm64/kernel/image-vars.h | |
parent | arm64: cpufeature: reorder cpus_have_{const, final}_cap() (diff) | |
download | linux-d86de40decaa14e6613af1b2783bf4d589d0f38b.tar.xz linux-d86de40decaa14e6613af1b2783bf4d589d0f38b.zip |
arm64: cpufeature: upgrade hyp caps to final
We finalize caps before initializing kvm hyp code, and any use of
cpus_have_const_cap() in kvm hyp code generates redundant and
potentially unsound code to read the cpu_hwcaps array.
A number of helper functions used in both hyp context and regular kernel
context use cpus_have_const_cap(), as some regular kernel code runs
before the capabilities are finalized. It's tedious and error-prone to
write separate copies of these for hyp and non-hyp code.
So that we can avoid the redundant code, let's automatically upgrade
cpus_have_const_cap() to cpus_have_final_cap() when used in hyp context.
With this change, there's never a reason to access to cpu_hwcaps array
from hyp code, and we don't need to create an NVHE alias for this.
This should have no effect on non-hyp code.
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Acked-by: Will Deacon <will@kernel.org>
Cc: David Brazdil <dbrazdil@google.com>
Cc: Marc Zyngier <maz@kernel.org>
Cc: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20201026134931.28246-4-mark.rutland@arm.com
Diffstat (limited to 'arch/arm64/kernel/image-vars.h')
-rw-r--r-- | arch/arm64/kernel/image-vars.h | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/arch/arm64/kernel/image-vars.h b/arch/arm64/kernel/image-vars.h index fbd4b6b1fde5..ad8432251733 100644 --- a/arch/arm64/kernel/image-vars.h +++ b/arch/arm64/kernel/image-vars.h @@ -87,7 +87,6 @@ KVM_NVHE_ALIAS(__icache_flags); /* Kernel symbols needed for cpus_have_final/const_caps checks. */ KVM_NVHE_ALIAS(arm64_const_caps_ready); KVM_NVHE_ALIAS(cpu_hwcap_keys); -KVM_NVHE_ALIAS(cpu_hwcaps); /* Static keys which are set if a vGIC trap should be handled in hyp. */ KVM_NVHE_ALIAS(vgic_v2_cpuif_trap); |