mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alex Williamson <alex@shazbot.org>
To: Omar Elghoul <oelghoul@linux.ibm.com>
Cc: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org,
	kvm@vger.kernel.org, hca@linux.ibm.com, gor@linux.ibm.com,
	agordeev@linux.ibm.com, borntraeger@linux.ibm.com,
	svens@linux.ibm.com, schnelle@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 v2 2/3] vfio-pci/zdev: Add VFIO FMB device feature
Date: Wed, 3 Jun 2026 09:55:38 -0600	[thread overview]
Message-ID: <20260603095538.65b07206@shazbot.org> (raw)
In-Reply-To: <395b0d85-3057-4bd5-b8cc-10ceea2d978a@linux.ibm.com>

On Wed, 3 Jun 2026 08:35:43 -0400
Omar Elghoul <oelghoul@linux.ibm.com> wrote:

> On 6/2/26 6:24 PM, Alex Williamson wrote:
> >
> > Why does the user need to be able to control these?  
> We want the user (e.g. QEMU) to be able to control these so that when a
> guest enables or disables the FMB, this state gets cascaded to the host and
> all the way to the firmware.
> >
> > Doesn't allowing the user to disable FMB remove guaranteed host-based
> > monitoring?  
> Yes it does, but this one isn't an oversight and is intentional behavior
> to achieve the functionality mentioned above. The host-based monitoring is
> not necessarily guaranteed and is treated as a device-specific state, so it
> makes sense in the case of passthrough to have that state reflect the state
> of the guest that is actually using the device.

If we really need a SET for enable/disable, I think it should be a
separate feature.  It really makes no sense to pass a giant structure
into a SET operation to look at the state of one flag bit.

> > Since this is already provided via debugfs, why not make this a
> > userspace problem to interact with the existing interface?  
> It might be possible but it would undoubtedly be really ugly and harder to
> maintain. I think what we'd dislike most about using debugfs is parsing
> text data into the FMB structure. If any of the text representations of the
> fields were to change, we would need to update them anywhere that uses them
> (e.g., in QEMU or any other user driver). The ABI would be super fragile.
> >
> > Alternatively, couldn't the existing zpci mediation be extended to
> > support the guest registering a fmb buffer to be written at regular
> > intervals (the interface here seems to drop the reporting interval).  
> The firmware only writes the FMB into one buffer every firmware-specified
> interval. If we wanted to write the FMB directly into guest memory, we
> would either 1) lose host access to the FMB or 2) have to run a periodic
> worker in the kernel to copy the host FMB into the guest-provided buffer
> every time the firmware does an update. I don't believe either of these
> approaches are favorable.
> 
> WRT reporting interval, I intentionally dropped that one as it is already
> provided by VFIO_DEVICE_INFO_CAP_ZPCI_GROUP.

Hmm, I also see fmb_length in VFIO_DEVICE_INFO_CAP_ZPCI_BASE.  If we
have that, do we really need structured data in the GET feature?  Maybe
GET just provides a user pointer and the raw fmb data is copied to it.
Thanks,

Alex

  parent reply	other threads:[~2026-06-03 15:55 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-19 22:42 [PATCH v2 0/3] vfio-pci/zdev: Improved zPCI Function Measurement Support Omar Elghoul
2026-05-19 22:42 ` [PATCH v2 1/3] s390/pci: Preserve FMB state in device re-enablement Omar Elghoul
2026-06-03 10:50   ` Niklas Schnelle
2026-06-03 12:52     ` Omar Elghoul
2026-05-19 22:42 ` [PATCH v2 2/3] vfio-pci/zdev: Add VFIO FMB device feature Omar Elghoul
2026-06-02 22:24   ` Alex Williamson
2026-06-03 12:35     ` Omar Elghoul
2026-06-03 13:56       ` Niklas Schnelle
2026-06-03 15:55       ` Alex Williamson [this message]
2026-06-03 18:26         ` Omar Elghoul
2026-06-03 19:24           ` Alex Williamson
2026-06-03 21:20             ` Omar Elghoul
2026-05-19 22:42 ` [PATCH v2 3/3] s390/pci: Fence FMB enable/disable via sysfs for passthrough devices Omar Elghoul
2026-06-03 12:15   ` Niklas Schnelle
2026-06-03 13:02     ` Omar Elghoul
2026-06-02 19:36 ` [PATCH v2 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=20260603095538.65b07206@shazbot.org \
    --to=alex@shazbot.org \
    --cc=agordeev@linux.ibm.com \
    --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=schnelle@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

all inboxes | Powered by JetHome®