Linux s390 Architecture development
 help / color / mirror / Atom feed
From: Matthew Rosato <mjrosato@linux.ibm.com>
To: Heiko Carstens <hca@linux.ibm.com>,
	Douglas Freimuth <freimuth@linux.ibm.com>
Cc: borntraeger@linux.ibm.com, imbrenda@linux.ibm.com,
	frankja@linux.ibm.com, david@kernel.org, gor@linux.ibm.com,
	agordeev@linux.ibm.com, svens@linux.ibm.com, kvm@vger.kernel.org,
	linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 3/4] KVM: s390: Change the fi->lock to a raw_spinlock for RT case
Date: Thu, 7 May 2026 09:17:00 -0400	[thread overview]
Message-ID: <191a1272-1f8c-4a67-a01d-abfdb89fcaf5@linux.ibm.com> (raw)
In-Reply-To: <20260507095630.10395Aa0-hca@linux.ibm.com>

On 5/7/26 5:56 AM, Heiko Carstens wrote:
> On Wed, May 06, 2026 at 10:50:52AM -0400, Douglas Freimuth wrote:
>> On 5/6/26 12:57 AM, Heiko Carstens wrote:
>>> On Tue, May 05, 2026 at 07:37:27PM +0200, Douglas Freimuth wrote:
>>>> s390 needs to maintain support for an RT kernel. This requires the
>>>> floating interrupt lock, fi->lock to be changed to a raw spin lock
>>>> since the fi->lock maybe called with interrupts disabled in __inject_io.
>>>>
>>>> Signed-off-by: Douglas Freimuth <freimuth@linux.ibm.com>
>>>> ---
>>>>   arch/s390/include/asm/kvm_host.h |  2 +-
>>>>   arch/s390/kvm/intercept.c        |  4 +-
>>>>   arch/s390/kvm/interrupt.c        | 68 ++++++++++++++++----------------
>>>>   arch/s390/kvm/kvm-s390.c         |  2 +-
>>>>   4 files changed, 38 insertions(+), 38 deletions(-)
>>>
>>> s390 does not support RT, but I guess you are referring to a lockdep splat
>>> which you would see without doing this change, similar like we have seen at
>>> other places.
>>>
>>> Can you include the relevant parts of the splat for reference, please?
>>
>> Heiko, thank you for you response. I dont recall trapping it with lockdep
>> (while it was on) but discussion on the mailing list in an earlier version
>> made us look closer (and we saw it across the AI models that reviewed the
>> patch.) It appears that while RT isn't supported it can still be compiled in
>> to the kernel so we wanted to mitigate the issues we would add to if someone
>> does that while not impacting non-RT environments, the main use case.
> 
> RT support cannot be compiled in for s390, because of the missing
> "select ARCH_SUPPORTS_RT", however you can still enable lockdep checks
> for raw_spinlock vs spinlock nesting, which this seems to appear about?
> 
> See PROVE_RAW_LOCK_NESTING config option for a more detailed description.
> 
> Therefore my question about a lockdep splat. However I don't see why
> using spin_lock() instead of raw_spin_lock() alone in irq disabled
> context could be problematic. On the other hand this patch does

Hi Heiko,

AFAIU it is only problematic if we (s390) should ever want to support RT
in the future.

As the name implies, the point of kvm_arch_set_irq_inatomic() is to
inject the interrupt without the possibility of sleeping, or
alternatively recognizing the need to sleep and fall back to a queued
"slow path" that can safely sleep while delivering it.

My original thinking was 'well, it won't hurt to use the raw spinlocks
in the new code' so I set Doug down this road with my review comments --
I did not consider that there would be a need for additional fallout
like this patch, which means increased chance of regressions (see below)
to accomodate a feature that we don't support today.

If you are saying it's OK to simply not care about RT for s390 now, then
AFAICT it should be fine to just use s/raw_spin_)lock/spin_lock/ for
this whole series, drop this patch and then ignore the subsequent
Sashiko complaints about RT.

What do you think?

> introduce a
> 
>       raw_spin_lock();
>       spin_lock();
>       spin_unlock();
>       raw_spin_unlock();
> 
> sequence in __deliver_machine_check() which seems to be incorrect and
> indeed should generate a lockdep splat iff PROVE_RAW_LOCK_NESTING is
> enabled.

+1
Doug, I know you've run with lockdep enabled before on this series --
please make sure to test with lockdep for next version

Thanks,
Matt




  reply	other threads:[~2026-05-07 13:17 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-05 17:37 [PATCH v5 0/4] KVM: s390: Introducing kvm_arch_set_irq_inatomic Fast Inject Douglas Freimuth
2026-05-05 17:37 ` [PATCH v5 1/4] KVM: s390: Add map/unmap ioctl and clean mappings post-guest Douglas Freimuth
2026-05-05 17:37 ` [PATCH v5 2/4] KVM: s390: Enable adapter_indicators_set to use mapped pages Douglas Freimuth
2026-05-05 17:37 ` [PATCH v5 3/4] KVM: s390: Change the fi->lock to a raw_spinlock for RT case Douglas Freimuth
2026-05-06  4:57   ` Heiko Carstens
2026-05-06 14:50     ` Douglas Freimuth
2026-05-07  9:56       ` Heiko Carstens
2026-05-07 13:17         ` Matthew Rosato [this message]
2026-05-07 14:45           ` Heiko Carstens
2026-05-07 14:49             ` Peter Zijlstra
2026-05-08  2:46             ` Douglas Freimuth
2026-05-08 10:27               ` Heiko Carstens
2026-05-05 17:37 ` [PATCH v5 4/4] KVM: s390: Introducing kvm_arch_set_irq_inatomic fast inject Douglas Freimuth

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=191a1272-1f8c-4a67-a01d-abfdb89fcaf5@linux.ibm.com \
    --to=mjrosato@linux.ibm.com \
    --cc=agordeev@linux.ibm.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=david@kernel.org \
    --cc=frankja@linux.ibm.com \
    --cc=freimuth@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=svens@linux.ibm.com \
    /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