Skip to content
  • James Morse's avatar
    KVM: arm64: Abstract the size of the HYP vectors pre-amble · 3dbf100b
    James Morse authored
    
    
    The EL2 vector hardening feature causes KVM to generate vectors for
    each type of CPU present in the system. The generated sequences already
    do some of the early guest-exit work (i.e. saving registers). To avoid
    duplication the generated vectors branch to the original vector just
    after the preamble. This size is hard coded.
    
    Adding new instructions to the HYP vector causes strange side effects,
    which are difficult to debug as the affected code is patched in at
    runtime.
    
    Add KVM_VECTOR_PREAMBLE to tell kvm_patch_vector_branch() how big
    the preamble is. The valid_vect macro can then validate this at
    build time.
    
    Reviewed-by: default avatarJulien Thierry <julien.thierry@arm.com>
    Signed-off-by: default avatarJames Morse <james.morse@arm.com>
    Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
    3dbf100b