]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
x86/xen: fix migration when ACPI suspend is not available
authorRoger Pau Monné <royger@FreeBSD.org>
Tue, 6 Feb 2024 08:16:44 +0000 (09:16 +0100)
committerRoger Pau Monné <royger@FreeBSD.org>
Fri, 16 Feb 2024 13:16:18 +0000 (14:16 +0100)
commite7e2431586a4f1d81fc37410f1ca1a9ae794857b
treeb2d9bdaa32e182ae79d06f204e865aeffca90694
parent17d5b027c1921d0c6ba2de7993dd808dbf4df078
x86/xen: fix migration when ACPI suspend is not available

Xen PVH guests expose a very minimal set of ACPI tables, and due to the lack of
SCI interrupt FreeBSD doesn't allocate the suspend stacks for saving CPU and
FPU contexts.

Lack of allocated stacks would lead to a page-fault in cpususpend_handler() when
CPUs attempted to use the save context area as a result of a Xen suspend
request.  However there's no need to save the CPU or the FPU registers in the
Xen case, as that's all handled by the hypervisor.  Hence avoid saving all this
state if the suspend stacks are not allocated.

Note that this will currently only apply to PVH guests, HVM ones will still get
the stack allocated and the context saved even when not strictly required.  I
find it easier rather that having to provide cpususpend_handler() with extra
information whether the context needs to be saved or not.

Sponsored by: Cloud Software Group
Reviewed by: markj
Differential revision: https://reviews.freebsd.org/D43765
sys/x86/x86/mp_x86.c