mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-02 16:16:41 +07:00
arm64/kvm: use alternative auto-nop
Make use of the new alternative_if and alternative_else_nop_endif and get rid of our open-coded NOP sleds, making the code simpler to read. Note that for __kvm_call_hyp the branch to __vhe_hyp_call has been moved out of the alternative sequence, and in the default case there will be four additional NOPs executed. Cc: Marc Zyngier <marc.zyngier@arm.com> Cc: kvmarm@lists.cs.columbia.edu Acked-by: Christoffer Dall <christoffer.dall@linaro.org> Signed-off-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
This commit is contained in:
parent
6ba3b554f5
commit
e506236a7b
@ -99,14 +99,10 @@
|
|||||||
.macro kern_hyp_va reg
|
.macro kern_hyp_va reg
|
||||||
alternative_if_not ARM64_HAS_VIRT_HOST_EXTN
|
alternative_if_not ARM64_HAS_VIRT_HOST_EXTN
|
||||||
and \reg, \reg, #HYP_PAGE_OFFSET_HIGH_MASK
|
and \reg, \reg, #HYP_PAGE_OFFSET_HIGH_MASK
|
||||||
alternative_else
|
alternative_else_nop_endif
|
||||||
nop
|
alternative_if ARM64_HYP_OFFSET_LOW
|
||||||
alternative_endif
|
|
||||||
alternative_if_not ARM64_HYP_OFFSET_LOW
|
|
||||||
nop
|
|
||||||
alternative_else
|
|
||||||
and \reg, \reg, #HYP_PAGE_OFFSET_LOW_MASK
|
and \reg, \reg, #HYP_PAGE_OFFSET_LOW_MASK
|
||||||
alternative_endif
|
alternative_else_nop_endif
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
@ -46,10 +46,6 @@ alternative_if_not ARM64_HAS_VIRT_HOST_EXTN
|
|||||||
hvc #0
|
hvc #0
|
||||||
ldr lr, [sp], #16
|
ldr lr, [sp], #16
|
||||||
ret
|
ret
|
||||||
alternative_else
|
alternative_else_nop_endif
|
||||||
b __vhe_hyp_call
|
b __vhe_hyp_call
|
||||||
nop
|
|
||||||
nop
|
|
||||||
nop
|
|
||||||
alternative_endif
|
|
||||||
ENDPROC(__kvm_call_hyp)
|
ENDPROC(__kvm_call_hyp)
|
||||||
|
Loading…
Reference in New Issue
Block a user