All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: "xen-devel" <xen-devel@lists.xenproject.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, Tim Deegan <tim@xen.org>,
	Julien Grall <julien.grall@arm.com>
Subject: [Xen-devel] [PATCH 1/3] x86/ACPI: re-park previously parked CPUs upon resume from S3
Date: Fri, 14 Jun 2019 05:37:00 -0600	[thread overview]
Message-ID: <5D0386DC0200007800238470@prv1-mh.provo.novell.com> (raw)
In-Reply-To: <5D03853F0200007800238448@prv1-mh.provo.novell.com>

Aiui when resuming from S3, CPUs come back out of RESET/INIT. Therefore
they need to undergo the same procedure as was added elsewhere by
commits d8f974f1a6 ("x86: command line option to avoid use of secondary
hyper-threads") and 8797d20a6e ("x86: possibly bring up all CPUs even
if not all are supposed to be used").

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/common/cpu.c
+++ b/xen/common/cpu.c
@@ -105,7 +105,7 @@ int cpu_down(unsigned int cpu)
     if ( err )
         goto fail;
 
-    if ( unlikely(system_state < SYS_STATE_active) )
+    if ( system_state < SYS_STATE_active || system_state == SYS_STATE_resume )
         on_selected_cpus(cpumask_of(cpu), _take_cpu_down, NULL, true);
     else if ( (err = stop_machine_run(take_cpu_down, NULL, cpu)) < 0 )
         goto fail;
@@ -207,15 +207,19 @@ void enable_nonboot_cpus(void)
 
     printk("Enabling non-boot CPUs  ...\n");
 
-    for_each_cpu ( cpu, &frozen_cpus )
+    for_each_present_cpu ( cpu )
     {
+        if ( park_offline_cpus ? cpu == smp_processor_id()
+                               : !cpumask_test_cpu(cpu, &frozen_cpus) )
+            continue;
         if ( (error = cpu_up(cpu)) )
         {
             printk("Error bringing CPU%d up: %d\n", cpu, error);
             BUG_ON(error == -EBUSY);
         }
-        else
-            __cpumask_clear_cpu(cpu, &frozen_cpus);
+        else if ( !__cpumask_test_and_clear_cpu(cpu, &frozen_cpus) &&
+                  (error = cpu_down(cpu)) )
+            printk("Error re-offlining CPU%d: %d\n", cpu, error);
     }
 
     for_each_cpu ( cpu, &frozen_cpus )





_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2019-06-14 11:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-14 11:30 [Xen-devel] [PATCH 0/3] x86: S3 resume adjustments Jan Beulich
2019-06-14 11:37 ` Jan Beulich [this message]
2019-06-14 16:52   ` [Xen-devel] [PATCH 1/3] x86/ACPI: re-park previously parked CPUs upon resume from S3 Julien Grall
2019-06-17  6:40     ` Jan Beulich
2019-06-17  8:12       ` Julien Grall
2019-08-29 13:37   ` Andrew Cooper
2019-06-14 11:37 ` [Xen-devel] [PATCH RFC 2/3] x86/ACPI: restore VESA mode " Jan Beulich
2019-08-29 14:45   ` Andrew Cooper
2019-08-29 15:18     ` Jan Beulich
2019-06-14 11:38 ` [Xen-devel] [PATCH 3/3] x86: a little bit of 16-bit video mode setting code cleanup Jan Beulich
2019-08-29 14:08   ` Andrew Cooper
2019-08-29 14:23     ` Jan Beulich
2019-08-29 14:38       ` Andrew Cooper
2019-08-29 15:07         ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5D0386DC0200007800238470@prv1-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=julien.grall@arm.com \
    --cc=konrad.wilk@oracle.com \
    --cc=sstabellini@kernel.org \
    --cc=tim@xen.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.