]> xenbits.xensource.com Git - people/iwj/xen.git/commitdiff
x86/suspend: Sanity check more properties in enter_state()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 12 Aug 2019 14:14:13 +0000 (15:14 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 28 Aug 2019 17:48:44 +0000 (18:48 +0100)
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 <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/acpi/power.c

index aecc754fdb96f745de72b0bfd8fc4a8902934473..d83e8cdd5293bdf63b29de491fa024c402250bd5 100644 (file)
@@ -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);