summaryrefslogtreecommitdiffstats
path: root/arch/x86/xen/xen-head.S
diff options
context:
space:
mode:
authorJuergen Gross <jgross@suse.com>2022-11-25 07:32:47 +0100
committerJuergen Gross <jgross@suse.com>2023-02-13 06:53:19 +0100
commit336f560a8917fd60bcdb71b97263257611411453 (patch)
treeba662f8f2eee6e9dc22f99f1dde34ab7e32dfe7e /arch/x86/xen/xen-head.S
parent415dab3c179632d098aadc756b39cebceb977978 (diff)
downloadlinux-336f560a8917fd60bcdb71b97263257611411453.tar.gz
linux-336f560a8917fd60bcdb71b97263257611411453.tar.bz2
linux-336f560a8917fd60bcdb71b97263257611411453.zip
x86/xen: don't let xen_pv_play_dead() return
A function called via the paravirt play_dead() hook should not return to the caller. xen_pv_play_dead() has a problem in this regard, as it currently will return in case an offlined cpu is brought to life again. This can be changed only by doing basically a longjmp() to cpu_bringup_and_idle(), as the hypercall for bringing down the cpu will just return when the cpu is coming up again. Just re-initializing the cpu isn't possible, as the Xen hypervisor will deny that operation. So introduce xen_cpu_bringup_again() resetting the stack and calling cpu_bringup_and_idle(), which can be called after HYPERVISOR_vcpu_op() in xen_pv_play_dead(). Signed-off-by: Juergen Gross <jgross@suse.com> Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lore.kernel.org/r/20221125063248.30256-2-jgross@suse.com Signed-off-by: Juergen Gross <jgross@suse.com>
Diffstat (limited to 'arch/x86/xen/xen-head.S')
-rw-r--r--arch/x86/xen/xen-head.S7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/x86/xen/xen-head.S b/arch/x86/xen/xen-head.S
index ffaa62167f6e..e36ea4268bd2 100644
--- a/arch/x86/xen/xen-head.S
+++ b/arch/x86/xen/xen-head.S
@@ -76,6 +76,13 @@ SYM_CODE_START(asm_cpu_bringup_and_idle)
call cpu_bringup_and_idle
SYM_CODE_END(asm_cpu_bringup_and_idle)
+
+SYM_CODE_START(xen_cpu_bringup_again)
+ UNWIND_HINT_FUNC
+ mov %rdi, %rsp
+ UNWIND_HINT_REGS
+ call cpu_bringup_and_idle
+SYM_CODE_END(xen_cpu_bringup_again)
.popsection
#endif
#endif