All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Wei Liu" <wl@xen.org>, "Roger Pau Monné" <roger.pau@citrix.com>
Subject: [PATCH v2 6/7] x86: move cpu_{up,down}_helper()
Date: Fri, 7 Aug 2020 13:34:33 +0200	[thread overview]
Message-ID: <d9f8c767-f6a1-d0d3-01db-5e5f850997d0@suse.com> (raw)
In-Reply-To: <3a8356a9-313c-6de8-f409-977eae1fbfa5@suse.com>

This is in preparation of making the building of sysctl.c conditional.

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

--- a/xen/arch/x86/smp.c
+++ b/xen/arch/x86/smp.c
@@ -22,6 +22,7 @@
 #include <asm/hardirq.h>
 #include <asm/hpet.h>
 #include <asm/hvm/support.h>
+#include <asm/setup.h>
 #include <irq_vectors.h>
 #include <mach_apic.h>
 
@@ -396,3 +397,36 @@ void call_function_interrupt(struct cpu_
     perfc_incr(ipis);
     smp_call_function_interrupt();
 }
+
+long cpu_up_helper(void *data)
+{
+    unsigned int cpu = (unsigned long)data;
+    int ret = cpu_up(cpu);
+
+    /* Have one more go on EBUSY. */
+    if ( ret == -EBUSY )
+        ret = cpu_up(cpu);
+
+    if ( !ret && !opt_smt &&
+         cpu_data[cpu].compute_unit_id == INVALID_CUID &&
+         cpumask_weight(per_cpu(cpu_sibling_mask, cpu)) > 1 )
+    {
+        ret = cpu_down_helper(data);
+        if ( ret )
+            printk("Could not re-offline CPU%u (%d)\n", cpu, ret);
+        else
+            ret = -EPERM;
+    }
+
+    return ret;
+}
+
+long cpu_down_helper(void *data)
+{
+    int cpu = (unsigned long)data;
+    int ret = cpu_down(cpu);
+    /* Have one more go on EBUSY. */
+    if ( ret == -EBUSY )
+        ret = cpu_down(cpu);
+    return ret;
+}
--- a/xen/arch/x86/sysctl.c
+++ b/xen/arch/x86/sysctl.c
@@ -79,39 +79,6 @@ static void l3_cache_get(void *arg)
         l3_info->size = info.size / 1024; /* in KB unit */
 }
 
-long cpu_up_helper(void *data)
-{
-    unsigned int cpu = (unsigned long)data;
-    int ret = cpu_up(cpu);
-
-    /* Have one more go on EBUSY. */
-    if ( ret == -EBUSY )
-        ret = cpu_up(cpu);
-
-    if ( !ret && !opt_smt &&
-         cpu_data[cpu].compute_unit_id == INVALID_CUID &&
-         cpumask_weight(per_cpu(cpu_sibling_mask, cpu)) > 1 )
-    {
-        ret = cpu_down_helper(data);
-        if ( ret )
-            printk("Could not re-offline CPU%u (%d)\n", cpu, ret);
-        else
-            ret = -EPERM;
-    }
-
-    return ret;
-}
-
-long cpu_down_helper(void *data)
-{
-    int cpu = (unsigned long)data;
-    int ret = cpu_down(cpu);
-    /* Have one more go on EBUSY. */
-    if ( ret == -EBUSY )
-        ret = cpu_down(cpu);
-    return ret;
-}
-
 static long smt_up_down_helper(void *data)
 {
     bool up = (bool)data;



  parent reply	other threads:[~2020-08-07 11:34 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-07 11:30 [PATCH v2 0/7] x86: build adjustments Jan Beulich
2020-08-07 11:32 ` [PATCH v2 1/7] x86/EFI: sanitize build logic Jan Beulich
2020-08-07 16:33   ` Andrew Cooper
2020-08-10 14:38     ` Andrew Cooper
2020-08-17 15:20       ` Jan Beulich
2020-08-07 11:32 ` [PATCH v2 2/7] x86: don't build with EFI support in shim-exclusive mode Jan Beulich
2020-08-18 13:00   ` Roger Pau Monné
2020-08-19  7:33     ` Jan Beulich
2020-08-19  7:59       ` Roger Pau Monné
2020-08-07 11:33 ` [PATCH v2 3/7] x86: shrink struct arch_{vcpu,domain} when !HVM Jan Beulich
2020-08-07 17:14   ` Andrew Cooper
2020-08-19  8:35     ` Jan Beulich
2020-08-07 11:33 ` [PATCH v2 4/7] bitmap: move to/from xenctl_bitmap conversion helpers Jan Beulich
2020-08-07 17:50   ` Andrew Cooper
2020-08-19  8:45     ` Jan Beulich
2020-08-10 15:44   ` Julien Grall
2020-08-07 11:34 ` [PATCH v2 5/7] x86: move domain_cpu_policy_changed() Jan Beulich
2020-08-07 17:53   ` Andrew Cooper
2020-08-07 11:34 ` Jan Beulich [this message]
2020-08-07 17:55   ` [PATCH v2 6/7] x86: move cpu_{up,down}_helper() Andrew Cooper
2020-08-07 11:35 ` [PATCH v2 7/7] x86: don't include domctl and alike in shim-exclusive builds Jan Beulich
2020-08-18 13:08   ` Roger Pau Monné
2020-08-19  7:37     ` 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=d9f8c767-f6a1-d0d3-01db-5e5f850997d0@suse.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=roger.pau@citrix.com \
    --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.