From bff7f83d3941c12f1c090528a1e669ca21147797 Mon Sep 17 00:00:00 2001 From: Andriy Gapon Date: Thu, 7 Nov 2019 21:14:59 +0000 Subject: [PATCH] IPI_TRACE is not really supported on xen x86 stack_save_td_running() can work safely only if IPI_TRACE is a non-maskable interrupt. But at the moment FreeBSD/Xen does not provide support for the NMI delivery mode. So, mark the functionality as unsupported similarly to other platforms without NMI. Maybe there is a way to provide a Xen-specific working stack_save_td_running(), but I couldn't figure it out. MFC after: 3 weeks Sponsored by: Panzura --- sys/x86/x86/stack_machdep.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/x86/x86/stack_machdep.c b/sys/x86/x86/stack_machdep.c index a7e248832daa..11ccbba770cb 100644 --- a/sys/x86/x86/stack_machdep.c +++ b/sys/x86/x86/stack_machdep.c @@ -135,6 +135,13 @@ int stack_save_td_running(struct stack *st, struct thread *td) { +#ifdef XENHVM + /* + * There is no NMI support on Xen, so this code can lead to + * an inter-processor deadlock. + */ + return (EOPNOTSUPP); +#endif /* XENHVM */ #ifdef STACK THREAD_LOCK_ASSERT(td, MA_OWNED); MPASS(TD_IS_RUNNING(td));