public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland@arm.com>
To: Christian Borntraeger <borntraeger@linux.ibm.com>
Cc: linux-kernel@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>,
	Michael Ellerman <mpe@ellerman.id.au>,
	aleksandar.qemu.devel@gmail.com, alexandru.elisei@arm.com,
	anup.patel@wdc.com, aou@eecs.berkeley.edu, atish.patra@wdc.com,
	bp@alien8.de, catalin.marinas@arm.com, chenhuacai@kernel.org,
	dave.hansen@linux.intel.com, frankja@linux.ibm.com,
	frederic@kernel.org, gor@linux.ibm.com, hca@linux.ibm.com,
	james.morse@arm.com, jmattson@google.com, joro@8bytes.org,
	luto@kernel.org, maz@kernel.org, mingo@redhat.com,
	nsaenzju@redhat.com, palmer@dabbelt.com, paulmck@kernel.org,
	paul.walmsley@sifive.com, peterz@infradead.org,
	seanjc@google.com, suzuki.poulose@arm.com, svens@linux.ibm.com,
	tglx@linutronix.de, tsbogend@alpha.franken.de,
	vkuznets@redhat.com, wanpengli@tencent.com, will@kernel.org,
	Anup Patel <anup@brainfault.org>,
	Atish Patra <atishp@atishpatra.org>
Subject: Re: [PATCH v2 0/7] kvm: fix latent guest entry/exit bugs
Date: Thu, 20 Jan 2022 11:57:14 +0000	[thread overview]
Message-ID: <YelOGjuRsMfUb3e7@FVFF77S0Q05N> (raw)
In-Reply-To: <0654e667-1cfa-5147-6661-b3b63288be0b@linux.ibm.com>

On Wed, Jan 19, 2022 at 08:30:17PM +0100, Christian Borntraeger wrote:
> 
> 
> Am 19.01.22 um 20:22 schrieb Mark Rutland:
> > On Wed, Jan 19, 2022 at 07:25:20PM +0100, Christian Borntraeger wrote:
> > > Am 19.01.22 um 11:58 schrieb Mark Rutland:
> > > 
> > > 
> > > CCing new emails for Anup and Atish so that they are aware of this thread.
> > 
> > Ah; whoops. I'd meant to fix the Ccs on the patches.
> > 
> > Thanks!
> > 
> > [...]
> > 
> > > I just gave this a spin on s390 with debugging on and I got the following:
> > > 
> > > [  457.151295] ------------[ cut here ]------------
> > > [  457.151311] WARNING: CPU: 14 PID: 0 at kernel/rcu/tree.c:613 rcu_eqs_enter.constprop.0+0xf8/0x118
> > 
> > Hmm, so IIUC that's:
> > 
> > 	WARN_ON_ONCE(rdp->dynticks_nmi_nesting != DYNTICK_IRQ_NONIDLE);
> > 
> > ... and we're clearly in the idle thread here.
> > 
> > I wonder, is the s390 guest entry/exit *preemptible* ?
> 
> Looks like debug_defconfig is indeed using preemption:
> 
> CONFIG_PREEMPT_BUILD=y
> # CONFIG_PREEMPT_NONE is not set
> # CONFIG_PREEMPT_VOLUNTARY is not set
> CONFIG_PREEMPT=y
> CONFIG_PREEMPT_COUNT=y
> CONFIG_PREEMPTION=y
> CONFIG_PREEMPT_RCU=y
> CONFIG_PREEMPT_NOTIFIERS=y
> CONFIG_DEBUG_PREEMPT=y
> CONFIG_PREEMPTIRQ_TRACEPOINTS=y
> CONFIG_TRACE_PREEMPT_TOGGLE=y
> CONFIG_PREEMPT_TRACER=y
> # CONFIG_PREEMPTIRQ_DELAY_TEST is not set

Thanks for confirming!

Could you try with CONFIG_PROVE_RCU=y ? That can't be selected directly, but
selecting PROVE_LOCKING=y will enable it.

If I'm right, with that we should get a splat out of
rcu_irq_exit_check_preempt().

If so, I think we can solve this with preempt_{disable,enable}() around the
guest_timing_{enter,exit}_irqoff() calls. We'll also need to add some more
comments around arch_in_rcu_eqs() that arch-specific EQSs should be
non-preemptible.

Thanks,
Mark.

  reply	other threads:[~2022-01-20 11:57 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-19 10:58 [PATCH v2 0/7] kvm: fix latent guest entry/exit bugs Mark Rutland
2022-01-19 10:58 ` [PATCH v2 1/7] entry: add arch_in_rcu_eqs() Mark Rutland
2022-01-19 17:35   ` Christian Borntraeger
2022-01-21 17:34   ` Nicolas Saenz Julienne
2022-01-19 10:58 ` [PATCH v2 2/7] kvm: add guest_state_{enter,exit}_irqoff() Mark Rutland
2022-01-20 11:00   ` Paolo Bonzini
2022-01-21 17:35   ` Nicolas Saenz Julienne
2022-01-19 10:58 ` [PATCH v2 3/7] kvm/arm64: rework guest entry logic Mark Rutland
2022-01-21 17:37   ` Nicolas Saenz Julienne
2022-01-19 10:58 ` [PATCH v2 4/7] kvm/mips: " Mark Rutland
2022-01-20 11:10   ` Paolo Bonzini
2022-01-20 13:33     ` Mark Rutland
2022-01-20 16:44   ` Mark Rutland
2022-01-20 16:57     ` Paolo Bonzini
2022-01-20 17:15       ` Mark Rutland
2022-01-20 17:17         ` Sean Christopherson
2022-01-20 17:29         ` Paolo Bonzini
2022-01-21 12:44           ` Mark Rutland
2022-01-19 10:58 ` [PATCH v2 5/7] kvm/riscv: " Mark Rutland
2022-01-20 11:18   ` Paolo Bonzini
2022-01-20 12:56     ` Mark Rutland
2022-01-20 13:13       ` Paolo Bonzini
2022-01-19 10:58 ` [PATCH v2 6/7] kvm/s390: " Mark Rutland
2022-01-19 10:58 ` [PATCH v2 7/7] kvm/x86: " Mark Rutland
2022-01-20 11:20   ` Paolo Bonzini
2022-01-21 17:40   ` Nicolas Saenz Julienne
2022-01-19 18:25 ` [PATCH v2 0/7] kvm: fix latent guest entry/exit bugs Christian Borntraeger
2022-01-19 18:28   ` Christian Borntraeger
2022-01-19 19:22   ` Mark Rutland
2022-01-19 19:30     ` Christian Borntraeger
2022-01-20 11:57       ` Mark Rutland [this message]
2022-01-20 12:02         ` Christian Borntraeger
2022-01-20 11:28     ` Paolo Bonzini
2022-01-20 12:03       ` Mark Rutland
2022-01-20 15:14         ` Christian Borntraeger
2022-01-21  9:53           ` Christian Borntraeger
2022-01-21 14:17             ` Christian Borntraeger
2022-01-21 14:30               ` Mark Rutland
2022-01-21 14:42                 ` Christian Borntraeger
2022-01-21 15:29                   ` Mark Rutland
2022-01-21 15:40                     ` Christian Borntraeger

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=YelOGjuRsMfUb3e7@FVFF77S0Q05N \
    --to=mark.rutland@arm.com \
    --cc=aleksandar.qemu.devel@gmail.com \
    --cc=alexandru.elisei@arm.com \
    --cc=anup.patel@wdc.com \
    --cc=anup@brainfault.org \
    --cc=aou@eecs.berkeley.edu \
    --cc=atish.patra@wdc.com \
    --cc=atishp@atishpatra.org \
    --cc=borntraeger@linux.ibm.com \
    --cc=bp@alien8.de \
    --cc=catalin.marinas@arm.com \
    --cc=chenhuacai@kernel.org \
    --cc=dave.hansen@linux.intel.com \
    --cc=frankja@linux.ibm.com \
    --cc=frederic@kernel.org \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=james.morse@arm.com \
    --cc=jmattson@google.com \
    --cc=joro@8bytes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=maz@kernel.org \
    --cc=mingo@redhat.com \
    --cc=mpe@ellerman.id.au \
    --cc=nsaenzju@redhat.com \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=paulmck@kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=peterz@infradead.org \
    --cc=seanjc@google.com \
    --cc=suzuki.poulose@arm.com \
    --cc=svens@linux.ibm.com \
    --cc=tglx@linutronix.de \
    --cc=tsbogend@alpha.franken.de \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.com \
    --cc=will@kernel.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