linux/arch/arm64/kvm/hyp
James Morse 368a1fd8c4 KVM: arm64: Allow indirect vectors to be used without SPECTRE_V3A
commit 5bdf343760 upstream.

CPUs vulnerable to Spectre-BHB either need to make an SMC-CC firmware
call from the vectors, or run a sequence of branches. This gets added
to the hyp vectors. If there is no support for arch-workaround-1 in
firmware, the indirect vector will be used.

kvm_init_vector_slots() only initialises the two indirect slots if
the platform is vulnerable to Spectre-v3a. pKVM's hyp_map_vectors()
only initialises __hyp_bp_vect_base if the platform is vulnerable to
Spectre-v3a.

As there are about to more users of the indirect vectors, ensure
their entries in hyp_spectre_vector_selector[] are always initialised,
and __hyp_bp_vect_base defaults to the regular VA mapping.

The Spectre-v3a check is moved to a helper
kvm_system_needs_idmapped_vectors(), and merged with the code
that creates the hyp mappings.

Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: James Morse <james.morse@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-03-11 12:22:33 +01:00
..
include KVM: arm64: Avoid consuming a stale esr value when SError occur 2022-02-08 18:34:06 +01:00
nvhe KVM: arm64: Allow indirect vectors to be used without SPECTRE_V3A 2022-03-11 12:22:33 +01:00
vhe Merge branch kvm-arm64/pkvm-fixed-features-prologue into kvmarm-master/next 2021-08-20 12:23:53 +01:00
aarch32.c KVM: arm64: Move kvm_vcpu_trap_il_is32bit into kvm_skip_instr32() 2020-11-10 08:34:24 +00:00
entry.S KVM: arm64: Save/restore MTE registers 2021-06-22 14:08:05 +01:00
exception.c KVM: arm64: Use shadow SPSR_EL1 when injecting exceptions on !VHE 2022-02-01 17:26:59 +01:00
fpsimd.S KVM: arm64: Rework SVE host-save/guest-restore 2021-03-18 13:57:37 +00:00
hyp-entry.S KVM: arm64: Extract ESR_ELx.EC only 2021-11-18 19:16:02 +01:00
Makefile KVM: arm64: Prepare the creation of s1 mappings at EL2 2021-03-19 12:01:21 +00:00
pgtable.c KVM: arm64: pkvm: Use the mm_ops indirection for cache maintenance 2022-02-01 17:27:09 +01:00
reserved_mem.c memblock: make memblock_find_in_range method private 2021-09-03 09:58:17 -07:00
vgic-v2-cpuif-proxy.c KVM: arm64: Remove hyp_symbol_addr 2021-01-23 14:01:00 +00:00
vgic-v3-sr.c KVM: arm64: Fix CPU interface MMIO compatibility detection 2021-03-24 17:26:38 +00:00