• James Morse's avatar
    KVM: arm64: Allow indirect vectors to be used without SPECTRE_V3A · 5bdf3437
    James Morse authored
    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: default avatarCatalin Marinas <catalin.marinas@arm.com>
    Signed-off-by: default avatarJames Morse <james.morse@arm.com>
    5bdf3437
kvm_host.h 24.9 KB