From: Steffen Eiden Define sae_entry and sae_exit boundary labels in entry.S around the SAE instruction and declare sae_exit in asm/kvm_host.h alongside sie_exit. This allows interrupt handlers, machine checks, and perf to identify when the CPU was interrupted during SAE guest execution. Signed-off-by: Steffen Eiden Signed-off-by: Andreas Grapentin Acked-by: Heiko Carstens --- arch/s390/include/asm/kvm_host.h | 3 +++ arch/s390/include/asm/kvm_host_s390.h | 2 -- arch/s390/kernel/entry.S | 3 +++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/s390/include/asm/kvm_host.h b/arch/s390/include/asm/kvm_host.h index ac3440a617c1..e689abac5b32 100644 --- a/arch/s390/include/asm/kvm_host.h +++ b/arch/s390/include/asm/kvm_host.h @@ -9,6 +9,9 @@ #include #endif +extern char sie_exit; +extern char sae_exit; + #define PGM_OPERATION 0x01 #define PGM_PRIVILEGED_OP 0x02 #define PGM_EXECUTE 0x03 diff --git a/arch/s390/include/asm/kvm_host_s390.h b/arch/s390/include/asm/kvm_host_s390.h index f7802600b3fb..6fc38813bac5 100644 --- a/arch/s390/include/asm/kvm_host_s390.h +++ b/arch/s390/include/asm/kvm_host_s390.h @@ -701,8 +701,6 @@ static inline int sie64a(struct kvm_s390_sie_block *sie_block, u64 *rsa, unsigne return __sie64a(virt_to_phys(sie_block), sie_block, rsa, gasce); } -extern char sie_exit; - bool kvm_s390_pv_is_protected(struct kvm *kvm); bool kvm_s390_pv_cpu_is_protected(struct kvm_vcpu *vcpu); diff --git a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S index 14dea207b30e..8ef6fc13fc08 100644 --- a/arch/s390/kernel/entry.S +++ b/arch/s390/kernel/entry.S @@ -258,10 +258,12 @@ SYM_FUNC_START(sae) stg %r3,__SF_SAE_BLOCK(%r15) # save sae block for perf stg %r4,__SF_SAE_VCPU(%r15) # save vcpu ptr for interrupt handling stosm __SF_SAE_IRQ(%r15),0x03 +SYM_INNER_LABEL(sae_entry, SYM_L_LOCAL) .insn rre,0xb9a50000,%r2,0 # Start Arm Execution # Let the next instruction be NOP to avoid triggering a machine check # and handling it in a guest as result of the instruction execution. nopr 7 +SYM_INNER_LABEL(sae_exit, SYM_L_GLOBAL) stnsm __SF_SAE_IRQ(%r15),0xfc LBEAR __SF_SAE_BEAR(%r15) # restore breaking event address register lmg %r6,%r14,__SF_GPRS(%r15) # restore kernel registers @@ -274,6 +276,7 @@ SYM_FUNC_START(sae) BR_EX %r14 SYM_FUNC_END(sae) EXPORT_SYMBOL(sae) +EXPORT_SYMBOL(sae_exit) #endif /* -- 2.55.0