All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>
Cc: "Peter Zijlstra" <peterz@infradead.org>,
	"Frederic Weisbecker" <fweisbec@gmail.com>,
	"Frederic Weisbecker" <frederic@kernel.org>,
	"Steven Rostedt" <rostedt@goodmis.org>,
	qemu-ppc@nongnu.org, "Nicholas Piggin" <npiggin@gmail.com>,
	"Suraj Jitindar Singh" <sjitindarsingh@gmail.com>,
	"Paul Mackerras" <paulus@samba.org>,
	tglx@linutronix.de, "David? Gibson" <david@gibson.dropbear.id.au>,
	linuxppc-dev@lists.ozlabs.org, "Cédric Le Goater" <clg@kaod.org>
Subject: Re: [Qemu-ppc] pseries on qemu-system-ppc64le crashes in doorbell_core_ipi()
Date: Thu, 19 Dec 2019 12:13:19 +0100	[thread overview]
Message-ID: <20191219111319.hes3fhpqpvn7nklg@linutronix.de> (raw)
In-Reply-To: <7a5b63a0-2bf5-60bb-8678-b7b36671a29c@zx2c4.com>

On 2019-12-19 11:41:21 [+0100], Jason A. Donenfeld wrote:
> Hi folks,
Hi,

so this should duct tape it:

diff --git a/arch/powerpc/kernel/dbell.c b/arch/powerpc/kernel/dbell.c
index f17ff1200eaae..ec044bdf362a1 100644
--- a/arch/powerpc/kernel/dbell.c
+++ b/arch/powerpc/kernel/dbell.c
@@ -60,16 +60,8 @@ void doorbell_core_ipi(int cpu)
  */
 int doorbell_try_core_ipi(int cpu)
 {
-	int this_cpu = get_cpu();
 	int ret = 0;
 
-	if (cpumask_test_cpu(cpu, cpu_sibling_mask(this_cpu))) {
-		doorbell_core_ipi(cpu);
-		ret = 1;
-	}
-
-	put_cpu();
-
 	return ret;
 }
 

> This is with "qemu-system-ppc64 -smp 4 -machine pseries" on QEMU 4.0.0.

Interesting. I didn't get v5.4 to boot a while ago and didn't have the
time to look into it.

> I'm not totally sure what's going on here. I'm emulating a pseries, and
> using that with qemu's pseries model, and I see that selecting the pseries
> forces the selection of 'config PPC_DOORBELL' (twice in the same section,
> actually). Then inside the kernel there appears to be some runtime CPU check
> for doorbell support. Is this a case in which QEMU is advertising doorbell
> support that TCG doesn't have? Or is something else happening here?

Based on my understanding is that the doorbell feature is part of the
architecture. It can be used to signal other siblings on the same CPU.
qemu TCG doesn't support that and does not allow to announce multiple
siblings on the same CPU. However, the kernel uses this interface if it
tries to send an interrupt to itself (the same CPU) so everything
matches.
Last time I run into this, the interface was change so the kernel das
not send an IPI to itself. This changed now for another function…

> Thanks,
> Jason

Sebastian

  reply	other threads:[~2019-12-19 11:16 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-27 12:36 pseries on qemu-system-ppc64le crashes in doorbell_core_ipi() Sebastian Andrzej Siewior
2019-03-27 16:37 ` [Qemu-ppc] " Cédric Le Goater
2019-03-27 16:51   ` Cédric Le Goater
2019-03-29  5:20     ` Suraj Jitindar Singh
2019-03-29  8:32       ` Sebastian Andrzej Siewior
2019-03-29  9:13       ` Nicholas Piggin
2019-03-29 15:31         ` Steven Rostedt
2019-03-30  3:10           ` Nicholas Piggin
2019-04-01  8:38             ` Peter Zijlstra
2019-04-04 16:25               ` Nicholas Piggin
2019-04-05 14:47                 ` Sebastian Andrzej Siewior
2019-04-06  0:06               ` Frederic Weisbecker
2019-04-09  9:25                 ` Nicholas Piggin
2019-12-19 10:41                   ` Jason A. Donenfeld
2019-12-19 11:13                     ` Sebastian Andrzej Siewior [this message]
2019-12-19 11:19                       ` Jason A. Donenfeld
2019-12-19 12:45                     ` Michael Ellerman
2019-12-19 13:08                       ` Cédric Le Goater
2019-12-20  0:22                         ` David? Gibson
2019-12-20 11:32                         ` Jason A. Donenfeld
2019-12-20 12:21                           ` David? Gibson
2019-12-20 15:59                           ` Cédric Le Goater
2019-12-20  0:53                       ` Jason A. Donenfeld

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=20191219111319.hes3fhpqpvn7nklg@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=Jason@zx2c4.com \
    --cc=clg@kaod.org \
    --cc=david@gibson.dropbear.id.au \
    --cc=frederic@kernel.org \
    --cc=fweisbec@gmail.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=npiggin@gmail.com \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=rostedt@goodmis.org \
    --cc=sjitindarsingh@gmail.com \
    --cc=tglx@linutronix.de \
    /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.