From: Niklas Schnelle <schnelle@linux.ibm.com>
To: Omar Elghoul <oelghoul@linux.ibm.com>,
linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org,
kvm@vger.kernel.org
Cc: hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com,
borntraeger@linux.ibm.com, svens@linux.ibm.com,
mjrosato@linux.ibm.com, alifm@linux.ibm.com,
farman@linux.ibm.com, gbayer@linux.ibm.com, alex@shazbot.org
Subject: Re: [PATCH v1 1/3] s390/pci: Preserve FMB state in device re-enablement
Date: Tue, 05 May 2026 22:07:43 +0200 [thread overview]
Message-ID: <5d3ab0fc1893c145b320e532db309b0f18bfa98c.camel@linux.ibm.com> (raw)
In-Reply-To: <642e1e814aa8050ea2bb21fa2e5b10b83145ba43.camel@linux.ibm.com>
On Tue, 2026-05-05 at 17:48 +0200, Niklas Schnelle wrote:
> On Tue, 2026-05-05 at 17:41 +0200, Niklas Schnelle wrote:
> > On Fri, 2026-05-01 at 15:25 -0400, Omar Elghoul wrote:
> > > Introduce a function zpci_fmb_reenable_device() that checks for the state
> > > of the FMB and reuses the same buffer where appropriate. If FMB was not
> > > previously enabled, it enables it for the device. Call this function during
> > > a zPCI device re-enablement, which in turn implicitly ensures that the FMB
> > > is enabled for host devices during their KVM registration.
> > >
> > > This function also clears out the software counters, so that a program
> > > resetting an FMB would see all its counters restart from zero as expected.
> > > The function to clear the software counters is also separated into a static
> > > function as it is now reused in both zpci_fmb_enable_device() and
> > > zpci_fmb_reenable_device().
> > >
> > > Signed-off-by: Omar Elghoul <oelghoul@linux.ibm.com>
> > > ---
> > > arch/s390/include/asm/pci.h | 1 +
> > > arch/s390/pci/pci.c | 71 ++++++++++++++++++++++++++++++-------
> > > 2 files changed, 59 insertions(+), 13 deletions(-)
> > >
> >
> > Looks good to me. I also gave this a quick sniff test on an LPAR but
> > still have to test with the FMB handling for KVM that this enabled so
> > not enough for a Tested-by yet.
> >
> > Still feel free to add my:
> >
> > Reviewed-by: Niklas Schnelle <schnelle@linux.ibm.com>
> >
> > Thanks,
> > Niklas
>
> Ah, missed one thing, the kernel-test-robot is of course right in that
> with this patch flags and ctrs are now unused in
> zpci_fmb_enable_device() so the declarations should be dropped. The
> same is also true in zpci_fmb_reenable_device() which the test robot
> did miss!
>
> Thanks,
> Niklas
Missed another issue which thankfully Sashiko found. The use of
zpci_fmb_reenable_device() in zpci_reenable_device() leads to the new
call chain:
recover_store()
_do_recover()
zpci_reenable_device()
zpci_fmb_reenable_device()
Where we don't take the zdev->fmb_lock. I think it makes sense to add a
lockdep_assert_held() to zpci_fmb_reenable_device().
Thanks,
Niklas
next prev parent reply other threads:[~2026-05-05 20:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-01 19:25 [PATCH v1 0/3] vfio-pci/zdev: Improved zPCI Function Measurement Support Omar Elghoul
2026-05-01 19:25 ` [PATCH v1 1/3] s390/pci: Preserve FMB state in device re-enablement Omar Elghoul
2026-05-05 15:41 ` Niklas Schnelle
2026-05-05 15:48 ` Niklas Schnelle
2026-05-05 20:07 ` Niklas Schnelle [this message]
2026-05-01 19:25 ` [PATCH v1 2/3] vfio-pci/zdev: Add VFIO FMB device feature Omar Elghoul
2026-05-01 19:25 ` [PATCH v1 3/3] s390/pci: Fence FMB enable/disable via sysfs for passthrough devices Omar Elghoul
2026-05-03 1:11 ` kernel test robot
2026-05-01 20:17 ` [PATCH v1 0/3] vfio-pci/zdev: Improved zPCI Function Measurement Support Omar Elghoul
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=5d3ab0fc1893c145b320e532db309b0f18bfa98c.camel@linux.ibm.com \
--to=schnelle@linux.ibm.com \
--cc=agordeev@linux.ibm.com \
--cc=alex@shazbot.org \
--cc=alifm@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=farman@linux.ibm.com \
--cc=gbayer@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=mjrosato@linux.ibm.com \
--cc=oelghoul@linux.ibm.com \
--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