mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: linux-kernel@vger.kernel.org, tglx@linutronix.de,
	jgross@suse.com, torvalds@linux-foundation.org, mingo@kernel.org,
	hpa@zytor.com, peterz@infradead.org, anna-maria@linutronix.de
Subject: Re: [tip:smp/hotplug] cpu/hotplug: Prevent alloc/free of irq descriptors during CPU up/down (again)
Date: Thu, 11 Aug 2016 17:12:34 +0200	[thread overview]
Message-ID: <20160811151234.nbdzzfefnvamqc3m@linutronix.de> (raw)
In-Reply-To: <b1260236-1f66-42e5-7641-a9e4eca843d6@oracle.com>

On 2016-08-11 11:06:29 [-0400], Boris Ostrovsky wrote:
> I was actually looking for arch/x86/xen/enlighten.c patch but if you
> don't have it I can do it myself.

I'm sorry. I had it but it got removed by accident during the refresh.
This is an older version so you have an idea :)

From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Wed, 4 Nov 2015 21:06:01 +0100
Subject: [PATCH] x86: xen: Convert to hotplug state machine

Install the callbacks via the state machine.

Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 arch/x86/xen/enlighten.c   |   28 +++++++++-------------------
 include/linux/cpuhotplug.h |    1 +
 2 files changed, 10 insertions(+), 19 deletions(-)

--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -1802,28 +1802,16 @@ static void __init init_hvm_pv_info(void
 	xen_domain_type = XEN_HVM_DOMAIN;
 }
 
-static int xen_hvm_cpu_notify(struct notifier_block *self, unsigned long action,
-			      void *hcpu)
+static int xen_hvm_cpu_up_prepare(unsigned int cpu)
 {
-	int cpu = (long)hcpu;
-	switch (action) {
-	case CPU_UP_PREPARE:
-		xen_vcpu_setup(cpu);
-		if (xen_have_vector_callback) {
-			if (xen_feature(XENFEAT_hvm_safe_pvclock))
-				xen_setup_timer(cpu);
-		}
-		break;
-	default:
-		break;
+	xen_vcpu_setup(cpu);
+	if (xen_have_vector_callback) {
+		if (xen_feature(XENFEAT_hvm_safe_pvclock))
+			xen_setup_timer(cpu);
 	}
-	return NOTIFY_OK;
+	return 0;
 }
 
-static struct notifier_block xen_hvm_cpu_notifier = {
-	.notifier_call	= xen_hvm_cpu_notify,
-};
-
 #ifdef CONFIG_KEXEC_CORE
 static void xen_hvm_shutdown(void)
 {
@@ -1853,7 +1841,9 @@ static void __init xen_hvm_guest_init(vo
 	if (xen_feature(XENFEAT_hvm_callback_vector))
 		xen_have_vector_callback = 1;
 	xen_hvm_smp_init();
-	register_cpu_notifier(&xen_hvm_cpu_notifier);
+	cpuhp_setup_state_nocalls(CPUHP_XEN_HVM_GUEST_PREPARE,
+				  "XEN_HVM_GUEST_PREPARE",
+				  xen_hvm_cpu_up_prepare, NULL);
 	xen_unplug_emulated_devices();
 	x86_init.irqs.intr_init = xen_init_IRQ;
 	xen_hvm_init_time_ops();
--- a/include/linux/cpuhotplug.h
+++ b/include/linux/cpuhotplug.h
@@ -24,6 +24,7 @@ enum cpuhp_state {
 	CPUHP_RELAY_PREPARE,
 	CPUHP_SLAB_PREPARE,
 	CPUHP_XEN_EV_PREPEARE,
+	CPUHP_XEN_HVM_GUEST_PREPARE,
 	CPUHP_MD_RAID5_PREPARE,
 	CPUHP_CPUIDLE_COUPLED_PREPARE,
 	CPUHP_TIMERS_DEAD,

Sebastian

  reply	other threads:[~2016-08-11 15:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-03 17:22 [PATCH v2 0/2] Reinstate irq alloc/dealloc locking patch Boris Ostrovsky
2016-08-03 17:22 ` [PATCH v2 1/2] xen/x86: Move irq allocation from Xen smp_op.cpu_up() Boris Ostrovsky
2016-08-05  6:40   ` Juergen Gross
2016-08-03 17:22 ` [PATCH v2 2/2] hotplug: Prevent alloc/free of irq descriptors during cpu up/down (again) Boris Ostrovsky
2016-08-05  6:41   ` Juergen Gross
2016-08-10 18:10   ` [tip:smp/hotplug] cpu/hotplug: Prevent alloc/free of irq descriptors during CPU " tip-bot for Boris Ostrovsky
2016-08-11 12:53     ` Boris Ostrovsky
2016-08-11 13:20       ` Sebastian Andrzej Siewior
2016-08-11 14:11         ` Boris Ostrovsky
2016-08-11 14:17           ` Sebastian Andrzej Siewior
2016-08-11 14:30             ` Boris Ostrovsky
2016-08-11 14:44               ` Sebastian Andrzej Siewior
2016-08-11 15:06                 ` Boris Ostrovsky
2016-08-11 15:12                   ` Sebastian Andrzej Siewior [this message]
2016-08-24 17:46 ` [Xen-devel] [PATCH v2 0/2] Reinstate irq alloc/dealloc locking patch David Vrabel

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=20160811151234.nbdzzfefnvamqc3m@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=anna-maria@linutronix.de \
    --cc=boris.ostrovsky@oracle.com \
    --cc=hpa@zytor.com \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®