From: Andrew Cooper Date: Mon, 12 Aug 2019 14:14:13 +0000 (+0100) Subject: x86/suspend: Sanity check more properties in enter_state() X-Git-Tag: archive/raspbian/4.14.0+80-gd101b417b7-1+rpi1^2~63^2~1696 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=87e7b4d5b0e60fe6d224d3074149833cde32334f;p=xen.git x86/suspend: Sanity check more properties in enter_state() The logic depends on being run on CPU0, and in IDLE context. Having this explicitly identified allows for simplification of the whole S3 path. Signed-off-by: Andrew Cooper Acked-by: Jan Beulich --- diff --git a/xen/arch/x86/acpi/power.c b/xen/arch/x86/acpi/power.c index aecc754fdb..d83e8cdd52 100644 --- a/xen/arch/x86/acpi/power.c +++ b/xen/arch/x86/acpi/power.c @@ -174,6 +174,8 @@ static int enter_state(u32 state) return -EBUSY; BUG_ON(system_state != SYS_STATE_active); + BUG_ON(!is_idle_vcpu(current)); + BUG_ON(smp_processor_id() != 0); system_state = SYS_STATE_suspend; printk(XENLOG_INFO "Preparing system for ACPI S%d state.\n", state);