Linux-S390 Archive mirror
 help / color / mirror / Atom feed
From: Gerd Bayer <gbayer@linux.ibm.com>
To: Alex Williamson <alex.williamson@redhat.com>,
	Jason Gunthorpe <jgg@ziepe.ca>
Cc: Niklas Schnelle <schnelle@linux.ibm.com>,
	Ankit Agrawal <ankita@nvidia.com>,
	Yishai Hadas <yishaih@nvidia.com>,
	kvm@vger.kernel.org, linux-s390@vger.kernel.org,
	Halil Pasic <pasic@linux.ibm.com>, Ben Segal <bpsegal@us.ibm.com>
Subject: Re: [PATCH] vfio/pci: Support 8-byte PCI loads and stores
Date: Mon, 22 Apr 2024 13:08:23 +0200	[thread overview]
Message-ID: <5fe2171422c4ca388e351cd55c14ec3bd8aefe40.camel@linux.ibm.com> (raw)
In-Reply-To: <20240419104745.01ebb96f.alex.williamson@redhat.com>

On Fri, 2024-04-19 at 10:47 -0600, Alex Williamson wrote:
> On Fri, 19 Apr 2024 13:11:35 -0300
> Jason Gunthorpe <jgg@ziepe.ca> wrote:
> 
> > On Fri, Apr 19, 2024 at 05:57:52PM +0200, Niklas Schnelle wrote:
> > > On Fri, 2024-04-19 at 10:58 -0300, Jason Gunthorpe wrote:  
> > > > On Fri, Apr 19, 2024 at 03:53:23PM +0200, Gerd Bayer wrote:  
> > > > > From: Ben Segal <bpsegal@us.ibm.com>
> > > > > 
> > > > > Many PCI adapters can benefit or even require full 64bit read
> > > > > and write access to their registers. In order to enable work
> > > > > on
> > > > > user-space drivers for these devices add two new variations
> > > > > vfio_pci_core_io{read|write}64 of the existing access methods
> > > > > when the architecture supports 64-bit ioreads and iowrites.
> > > > > 
> > > > > Signed-off-by: Ben Segal <bpsegal@us.ibm.com>
> > > > > Co-developed-by: Gerd Bayer <gbayer@linux.ibm.com>
> > > > > Signed-off-by: Gerd Bayer <gbayer@linux.ibm.com>
> > > > > ---
> > > > > 
> > > > > Hi all,
> > > > > 
> > > > > we've successfully used this patch with a user-mode driver
> > > > > for a PCI device that requires 64bit register read/writes on
> > > > > s390.  
> > > > 
> > > > But why? S390 already has a system call for userspace to do the
> > > > 64 bit write, and newer S390 has a userspace instruction to do
> > > > it.
> > > > 
> > > > Why would you want to use a VFIO system call on the mmio
> > > > emulation path?
> > > > 
> > > > mmap the registers and access them normally?  
> > > 
> > > It's a very good point and digging into why this wasn't used by
> > > Benjamin. It turns out VFIO_PCI_MMAP is disabled for S390 which
> > > it really shouldn't be especially now that we have the user-space
> > > instructions. Before that though Benjamin turned to this
> > > interface which then lead him to this limitation. So yeah we'll
> > > definitely verify that it also works via VFIO_PCI_MMAP and send a
> > > patch to enable that.  
> > 
> > Make sense to me!
> > 
> > > That said I still think it's odd not to have the 8 byte case
> > > working here even if it isn't the right approach. Could still be
> > > useful for debug/testing without having to add the MIO
> > > instructions or the our special syscall.  
> > 
> > Yes, this also makes sense, but this patch needs some adjusting
> 
> Yes, I think so too, falling back to 4-byte accesses of course if
> 8-byte is not available.  Thanks,

So I'll rework this to simply fall back to 32-bit if 64-bit is not
available in a v2. And we'll investigate the VFIO_PCI_MMAP case
separately.

Thank you,
Gerd

      reply	other threads:[~2024-04-22 11:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-19 13:53 [PATCH] vfio/pci: Support 8-byte PCI loads and stores Gerd Bayer
2024-04-19 13:58 ` Jason Gunthorpe
2024-04-19 15:57   ` Niklas Schnelle
2024-04-19 16:11     ` Jason Gunthorpe
2024-04-19 16:47       ` Alex Williamson
2024-04-22 11:08         ` Gerd Bayer [this message]

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=5fe2171422c4ca388e351cd55c14ec3bd8aefe40.camel@linux.ibm.com \
    --to=gbayer@linux.ibm.com \
    --cc=alex.williamson@redhat.com \
    --cc=ankita@nvidia.com \
    --cc=bpsegal@us.ibm.com \
    --cc=jgg@ziepe.ca \
    --cc=kvm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=pasic@linux.ibm.com \
    --cc=schnelle@linux.ibm.com \
    --cc=yishaih@nvidia.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).