Re: [PATCH v2 0/3] s390x/pci: fix ISM reset

2024-01-22 Thread Matthew Rosato
On 1/22/24 5:49 AM, Thomas Huth wrote: > On 22/01/2024 11.31, Michael Tokarev wrote: >> 22.01.2024 13:18, Michael Tokarev : >> .. >>> Is it this a material for -stable, or there's no need to bother? >> >> Actually it's been Cc'd to qemu-stable@ already, I haven't noticed. >> Still there's a

Re: [PATCH v2 3/3] s390x/pci: drive ISM reset from subsystem reset

2024-01-22 Thread Matthew Rosato
On 1/19/24 4:07 PM, Halil Pasic wrote: > On Thu, 18 Jan 2024 13:51:51 -0500 > Matthew Rosato wrote: > >> diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c >> index eaf61d3640..c99682b07d 100644 >> --- a/hw/s390x/s390-virtio-ccw.c >>

[PATCH v2 2/3] s390x/pci: refresh fh before disabling aif

2024-01-18 Thread Matthew Rosato
reset ISM passthrough devices on shutdown and system reset") Reported-by: Cédric Le Goater Reviewed-by: Eric Farman Signed-off-by: Matthew Rosato --- hw/s390x/s390-pci-kvm.c | 9 + 1 file changed, 9 insertions(+) diff --git a/hw/s390x/s390-pci-kvm.c b/hw/s390x/s390-pci-kvm.c index

[PATCH v2 3/3] s390x/pci: drive ISM reset from subsystem reset

2024-01-18 Thread Matthew Rosato
ISM passthrough devices on shutdown and system reset") Reported-by: Cédric Le Goater Signed-off-by: Matthew Rosato --- hw/s390x/s390-pci-bus.c | 26 +- hw/s390x/s390-virtio-ccw.c | 8 include/hw/s390x/s390-pci-bus.h | 1 + 3 files changed,

[PATCH v2 1/3] s390x/pci: avoid double enable/disable of aif

2024-01-18 Thread Matthew Rosato
reted devices") Reported-by: Cédric Le Goater Reviewed-by: Eric Farman Signed-off-by: Matthew Rosato --- hw/s390x/s390-pci-kvm.c | 25 +++-- include/hw/s390x/s390-pci-bus.h | 1 + 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/hw/s390x/s390-pci-

[PATCH v2 0/3] s390x/pci: fix ISM reset

2024-01-18 Thread Matthew Rosato
not detect and issue a warning for this scenario. Changes for v2: - Fold a typo fix from patch 2 into patch 1 where it belongs - Add block comment re: timing of ISM reset - Add review tags Matthew Rosato (3): s390x/pci: avoid double enable/disable of aif s390x/pci: refresh fh before

Re: [PATCH 3/3] s390x/pci: drive ISM reset from subsystem reset

2024-01-17 Thread Matthew Rosato
On 1/17/24 10:19 AM, Matthew Rosato wrote: > On 1/17/24 6:01 AM, Cédric Le Goater wrote: >> Adding Alex, >> >> On 1/16/24 23:31, Matthew Rosato wrote: >>> ISM devices are sensitive to manipulation of the IOMMU, so the ISM device >>> needs to be reset before t

Re: [PATCH 2/3] s390x/pci: refresh fh before disabling aif

2024-01-17 Thread Matthew Rosato
On 1/17/24 5:31 AM, Cédric Le Goater wrote: > Hello Matthew, > > On 1/16/24 23:31, Matthew Rosato wrote: >> Typically we refresh the host fh during CLP enable, however it's possible >> that the device goes through multiple reset events before the guest >> performs

Re: [PATCH 3/3] s390x/pci: drive ISM reset from subsystem reset

2024-01-17 Thread Matthew Rosato
On 1/17/24 6:01 AM, Cédric Le Goater wrote: > Adding Alex, > > On 1/16/24 23:31, Matthew Rosato wrote: >> ISM devices are sensitive to manipulation of the IOMMU, so the ISM device >> needs to be reset before the vfio-pci device is reset (triggering a full >>

Re: [PATCH 2/3] s390x/pci: refresh fh before disabling aif

2024-01-17 Thread Matthew Rosato
On 1/17/24 5:40 AM, Cédric Le Goater wrote: > On 1/16/24 23:31, Matthew Rosato wrote: >> Typically we refresh the host fh during CLP enable, however it's possible >> that the device goes through multiple reset events before the guest >> performs another CLP enable.  Let'

Re: [PATCH 1/3] s390x/pci: avoid double enable/disable of aif

2024-01-17 Thread Matthew Rosato
On 1/17/24 5:54 AM, Cédric Le Goater wrote: > On 1/16/24 23:31, Matthew Rosato wrote: >> Use a flag to keep track of whether AIF is currently enabled.  This can be >> used to avoid enabling/disabling AIF multiple times as well as to determine >> whether or not it should be

Re: [PATCH 1/3] s390x/pci: avoid double enable/disable of aif

2024-01-17 Thread Matthew Rosato
>> -    return kvm_vm_ioctl(kvm_state, KVM_S390_ZPCI_OP, ); >> +    if (!pbdev->aif) { >> +    return -EINVAL; >> +    } >> + >> +    rc = kvm_vm_ioctl(kvm_state, KVM_S390_ZPCI_OP, ); >> +    if (rc == 0) { >> +    pbev->aif = false; > > s/pbev/pbdev/ > > You fix this in patch 2. :) >

Re: [PATCH 3/3] s390x/pci: drive ISM reset from subsystem reset

2024-01-17 Thread Matthew Rosato
On 1/16/24 10:01 PM, Eric Farman wrote: > On Tue, 2024-01-16 at 17:31 -0500, Matthew Rosato wrote: >>   >> +void s390_pci_ism_reset(void) >> +{ >> +    S390pciState *s = s390_get_phb(); >> + >> +    S390PCIBusDevice *pbdev, *next; >> + >> +

[PATCH 2/3] s390x/pci: refresh fh before disabling aif

2024-01-16 Thread Matthew Rosato
reset ISM passthrough devices on shutdown and system reset") Reported-by: Cédric Le Goater Signed-off-by: Matthew Rosato --- hw/s390x/s390-pci-kvm.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/hw/s390x/s390-pci-kvm.c b/hw/s390x/s390-pci-kvm.c index

[PATCH 0/3] s390x/pci: fix ISM reset

2024-01-16 Thread Matthew Rosato
not detect and issue a warning for this scenario. Matthew Rosato (3): s390x/pci: avoid double enable/disable of aif s390x/pci: refresh fh before disabling aif s390x/pci: drive ISM reset from subsystem reset hw/s390x/s390-pci-bus.c | 26 - hw/s390x/s390-pci

[PATCH 1/3] s390x/pci: avoid double enable/disable of aif

2024-01-16 Thread Matthew Rosato
reted devices") Reported-by: Cédric Le Goater Signed-off-by: Matthew Rosato --- hw/s390x/s390-pci-kvm.c | 25 +++-- include/hw/s390x/s390-pci-bus.h | 1 + 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/hw/s390x/s390-pci-kvm.c b/hw/s390x/s390-pci-k

[PATCH 3/3] s390x/pci: drive ISM reset from subsystem reset

2024-01-16 Thread Matthew Rosato
ISM passthrough devices on shutdown and system reset") Reported-by: Cédric Le Goater Signed-off-by: Matthew Rosato --- hw/s390x/s390-pci-bus.c | 26 +- hw/s390x/s390-virtio-ccw.c | 2 ++ include/hw/s390x/s390-pci-bus.h | 1 + 3 files changed, 20 insert

Re: [PULL 2/7] s390x: do a subsystem reset before the unprotect on reboot

2024-01-11 Thread Matthew Rosato
On 1/11/24 4:43 AM, Cédric Le Goater wrote: > OK. this condition is considered serious enough to be reported to a > management level. This seems a bit excessive since the recovery can be > handled by software, but manually. Are there any plans to address this > problem ? Yes, eventually.

Re: [PULL 2/7] s390x: do a subsystem reset before the unprotect on reboot

2024-01-11 Thread Matthew Rosato
On 1/11/24 5:18 AM, Christian Borntraeger wrote: > > > Am 11.01.24 um 10:43 schrieb Cédric Le Goater: > [...] >> >> >> On a side note, I am also seeing : > > Michael? > Hmm, it looks like this warning is tripping because we have a path in PCI passthrough where we don't unregister the gisc.

Re: [PULL 2/7] s390x: do a subsystem reset before the unprotect on reboot

2024-01-10 Thread Matthew Rosato
On 1/10/24 1:30 PM, Cédric Le Goater wrote: > On 9/12/23 13:41, Thomas Huth wrote: >> From: Janosch Frank >> >> Bound APQNs have to be reset before tearing down the secure config via >> s390_machine_unprotect(). Otherwise the Ultravisor will return a error >> code. >> >> So let's do a

Re: [PATCH v2 2/2] s390x/pci: only limit DMA aperture if vfio DMA limit reported

2023-11-13 Thread Matthew Rosato
On 11/13/23 4:24 PM, Michael Tokarev wrote: > 10.11.2023 20:51, Matthew Rosato wrote: >> If the host kernel lacks vfio DMA limit reporting, do not attempt >> to shrink the guest DMA aperture. >> >> Fixes: df202e3ff3 ("s390x/pci: shrink DMA aperture to be bound by vf

[PATCH v2 0/2] s390x/pci: small set of fixes

2023-11-10 Thread Matthew Rosato
for an older host kernel to be missing this support today; so ideally this one should be targeted for 8.2 regardless. Changes for v2: - minor style changes (Phil, Thomas) Matthew Rosato (2): s390x/pci: bypass vfio DMA counting when using cdev s390x/pci: only limit DMA aperture if vfio DMA

[PATCH v2 2/2] s390x/pci: only limit DMA aperture if vfio DMA limit reported

2023-11-10 Thread Matthew Rosato
If the host kernel lacks vfio DMA limit reporting, do not attempt to shrink the guest DMA aperture. Fixes: df202e3ff3 ("s390x/pci: shrink DMA aperture to be bound by vfio DMA limit") Signed-off-by: Matthew Rosato --- hw/s390x/s390-pci-vfio.c | 2 +- 1 file changed, 1 insertion(+),

[PATCH v2 1/2] s390x/pci: bypass vfio DMA counting when using cdev

2023-11-10 Thread Matthew Rosato
The current code assumes that there is always a vfio group, but that's no longer guaranteed with the iommufd backend when using cdev. In this case, we don't need to track the vfio dma limit anyway. Signed-off-by: Matthew Rosato --- hw/s390x/s390-pci-vfio.c | 4 1 file changed, 4

Re: [PATCH v5 19/20] kconfig: Activate IOMMUFD for s390x machines

2023-11-09 Thread Matthew Rosato
4c068d7960..26ad104485 100644 > --- a/hw/s390x/Kconfig > +++ b/hw/s390x/Kconfig > @@ -6,6 +6,7 @@ config S390_CCW_VIRTIO > imply VFIO_CCW > imply WDT_DIAG288 > imply PCIE_DEVICES > +imply IOMMUFD > select PCI_EXPRESS > select S390_FLIC >

Re: [PATCH v5 16/20] vfio/ccw: Make vfio cdev pre-openable by passing a file handle

2023-11-09 Thread Matthew Rosato
On 11/9/23 6:45 AM, Zhenzhong Duan wrote: > This gives management tools like libvirt a chance to open the vfio > cdev with privilege and pass FD to qemu. This way qemu never needs > to have privilege to open a VFIO or iommu cdev node. > > Signed-off-by: Zhenzhong Duan Revie

Re: [PATCH v5 15/20] vfio/ccw: Allow the selection of a given iommu backend

2023-11-09 Thread Matthew Rosato
evice options: > > -object iommufd,id=iommufd0 > -device vfio-ccw,sysfsdev=/sys/bus/mdev/devices/XXX,iommufd=iommufd0 > > Suggested-by: Alex Williamson > Signed-off-by: Zhenzhong Duan Reviewed-by: Matthew Rosato

Re: [PATCH v5 13/20] vfio/ap: Allow the selection of a given iommu backend

2023-11-09 Thread Matthew Rosato
evice options: > > -object iommufd,id=iommufd0 > -device vfio-ap,sysfsdev=/sys/bus/mdev/devices/XXX,iommufd=iommufd0 > > Suggested-by: Alex Williamson > Signed-off-by: Zhenzhong Duan Reviewed-by: Matthew Rosato

Re: [PATCH v5 14/20] vfio/ap: Make vfio cdev pre-openable by passing a file handle

2023-11-09 Thread Matthew Rosato
On 11/9/23 6:45 AM, Zhenzhong Duan wrote: > This gives management tools like libvirt a chance to open the vfio > cdev with privilege and pass FD to qemu. This way qemu never needs > to have privilege to open a VFIO or iommu cdev node. > > Signed-off-by: Zhenzhong Duan Revie

[PATCH 2/2] s390x/pci: only limit DMA aperture if vfio DMA limit reported

2023-11-09 Thread Matthew Rosato
If the host kernel lacks vfio DMA limit reporting, do not attempt to shrink the guest DMA aperture. Fixes: df202e3ff3 ("s390x/pci: shrink DMA aperture to be bound by vfio DMA limit") Signed-off-by: Matthew Rosato --- hw/s390x/s390-pci-vfio.c | 2 +- 1 file changed, 1 insertion(+),

[PATCH 1/2] s390x/pci: bypass vfio DMA counting when using cdev

2023-11-09 Thread Matthew Rosato
The current code assumes that there is always a vfio group, but that's no longer guaranteed with the iommufd backend when using cdev. In this case, we don't need to track the vfio dma limit anyway. Signed-off-by: Matthew Rosato --- hw/s390x/s390-pci-vfio.c | 6 +- 1 file changed, 5

[PATCH 0/2] s390x/pci: small set of fixes

2023-11-09 Thread Matthew Rosato
for an older host kernel to be missing this support today; so ideally this one should be targeted for 8.2 regardless. Matthew Rosato (2): s390x/pci: bypass vfio DMA counting when using cdev s390x/pci: only limit DMA aperture if vfio DMA limit reported hw/s390x/s390-pci-vfio.c | 8 ++-- 1

Re: [PATCH v4 00/41] vfio: Adopt iommufd

2023-11-07 Thread Matthew Rosato
On 11/7/23 1:28 PM, Cédric Le Goater wrote: > On 11/2/23 08:12, Zhenzhong Duan wrote: >> Hi, >> >> Thanks all for giving guides and comments on previous series, here is >> the v4 of pure iommufd support part. >> >> Based on Cédric's suggestion, this series includes an effort to remove >> spapr

Re: [PATCH v4 28/41] vfio/iommufd: Implement the iommufd backend

2023-11-07 Thread Matthew Rosato
On 11/2/23 3:12 AM, Zhenzhong Duan wrote: > From: Yi Liu > > Add the iommufd backend. The IOMMUFD container class is implemented > based on the new /dev/iommu user API. This backend obviously depends > on CONFIG_IOMMUFD. > > So far, the iommufd backend doesn't support dirty page sync yet due >

Re: [PATCH v3 09/15] vfio/ap: Use vfio_[attach/detach]_device

2023-10-04 Thread Matthew Rosato
't get the dc->unrealize() later. Device wasn't attached, but we did allocate memory for vbasedev->name already so we need to undo that part ourselves. That could be inline (as you do already in this patch) or, if you choose to add the VFIO_MSG_PREFIX it might make sense to put it in an e

Re: [PATCH v3 10/15] vfio/ccw: Use vfio_[attach/detach]_device

2023-10-03 Thread Matthew Rosato
igned-off-by: Eric Auger > Signed-off-by: Yi Liu > Signed-off-by: Zhenzhong Duan > > --- > v2 -> v3: > - Hopefully fix confusion beteen vbasedev->name, mdevid and sysfsdev > while keeping into account Matthew's comment > > https://lore.kernel.org/qemu-devel/6

Re: [PATCH v3 09/15] vfio/ap: Use vfio_[attach/detach]_device

2023-10-03 Thread Matthew Rosato
On 10/3/23 11:25 AM, Cédric Le Goater wrote: > On 10/3/23 12:14, Eric Auger wrote: >> Let the vfio-ap device use vfio_attach_device() and >> vfio_detach_device(), hence hiding the details of the used >> IOMMU backend. >> >> We take the opportunity to use g_path_get_basename() which >> is prefered,

Re: [PATCH v2 09/12] vfio/ccw: Use vfio_[attach/detach]_device

2023-09-27 Thread Matthew Rosato
On 9/27/23 8:09 AM, Duan, Zhenzhong wrote: > > >> -Original Message- >> From: Eric Auger >> Sent: Wednesday, September 27, 2023 6:00 PM >> Subject: Re: [PATCH v2 09/12] vfio/ccw: Use vfio_[attach/detach]_device >> >> >> >> On 9/26/23 13:32, Zhenzhong Duan wrote: >>> From: Eric Auger

Re: [PATCH for-8.2] s390x: Convert DPRINTF to trace events

2023-08-22 Thread Matthew Rosato
been on my todo list for a while. Message contents look fine, so with Thomas's minor nit: Reviewed-by: Matthew Rosato

Re: [PATCH 1/2] block/file-posix: fix g_file_get_contents return path

2023-07-27 Thread Matthew Rosato
On 7/5/23 10:54 AM, Matthew Rosato wrote: > On 6/4/23 2:16 AM, Sam Li wrote: >> The g_file_get_contents() function returns a g_boolean. If it fails, the >> returned value will be 0 instead of -1. Solve the issue by skipping >> assigning ret value. >> >> This issue

Re: [PATCH v3] kconfig: Add PCIe devices to s390x machines

2023-07-05 Thread Matthew Rosato
oller, which all support MSI-X. Devices only supporting > INTx won't work on s390x. > > Signed-off-by: Cédric Le Goater Acked-by: Matthew Rosato > --- > > v3: PCI -> PCI_EXPRESS > v2: select -> imply > > hw/s390x/Kconfig | 5 - > 1 file changed, 4 i

Re: [PATCH 1/2] block/file-posix: fix g_file_get_contents return path

2023-07-05 Thread Matthew Rosato
On 6/4/23 2:16 AM, Sam Li wrote: > The g_file_get_contents() function returns a g_boolean. If it fails, the > returned value will be 0 instead of -1. Solve the issue by skipping > assigning ret value. > > This issue was found by Matthew Rosato using virtio-blk-{pci,ccw} back

Re: [PATCH v2] kconfig: Add PCIe devices to s390x machines

2023-07-05 Thread Matthew Rosato
On 7/4/23 9:33 AM, Philippe Mathieu-Daudé wrote: > On 4/7/23 14:32, Cédric Le Goater wrote: >> On 7/4/23 14:09, Philippe Mathieu-Daudé wrote: >>> On 4/7/23 14:01, Cédric Le Goater wrote: It is useful to extend the number of available PCI devices to KVM guests for passthrough scenarios

Re: [PATCH 1/2] block/file-posix: fix g_file_get_contents return path

2023-06-07 Thread Matthew Rosato
On 6/4/23 2:16 AM, Sam Li wrote: > The g_file_get_contents() function returns a g_boolean. If it fails, the > returned value will be 0 instead of -1. Solve the issue by skipping > assigning ret value. > > This issue was found by Matthew Rosato using virtio-blk-{pci,ccw} back

Re: [PULL v2 02/16] block/file-posix: introduce helper functions for sysfs attributes

2023-06-02 Thread Matthew Rosato
On 6/2/23 2:18 PM, Sam Li wrote: > Matthew Rosato 于2023年6月1日周四 02:21写道: >> >> On 5/15/23 12:04 PM, Stefan Hajnoczi wrote: >>> From: Sam Li >>> >>> Use get_sysfs_str_val() to get the string value of device >>> zoned model. Then get_sysfs_zone

Re: [PULL v2 02/16] block/file-posix: introduce helper functions for sysfs attributes

2023-05-31 Thread Matthew Rosato
On 5/15/23 12:04 PM, Stefan Hajnoczi wrote: > From: Sam Li > > Use get_sysfs_str_val() to get the string value of device > zoned model. Then get_sysfs_zoned_model() can convert it to > BlockZoneModel type of QEMU. > > Use get_sysfs_long_val() to get the long value of zoned device > information.

Re: [PATCH 1/2] linux-headers: Update with vfio_ap IRQ index mapping

2023-05-31 Thread Matthew Rosato
On 5/31/23 8:52 AM, Anthony Krowiak wrote: > > > On 5/30/23 8:56 PM, Matthew Rosato wrote: >> On 5/30/23 6:55 PM, Tony Krowiak wrote: >>> Signed-off-by: Tony Krowiak >>> --- >>>   linux-headers/linux/vfio.h | 9 + >>>   1 file changed,

Re: [PATCH 1/2] linux-headers: Update with vfio_ap IRQ index mapping

2023-05-30 Thread Matthew Rosato
On 5/30/23 6:55 PM, Tony Krowiak wrote: > Signed-off-by: Tony Krowiak > --- > linux-headers/linux/vfio.h | 9 + > 1 file changed, 9 insertions(+) Worth nothing here that linux-headers patches should be generated using scripts/update-linux-headers.sh. Since this linux-headers update

Re: [PATCH v2] vfio/pci: Fix a use-after-free issue

2023-05-23 Thread Matthew Rosato
: Alex Williamson > Signed-off-by: Zhenzhong Duan Reviewed-by: Matthew Rosato Also verified that this resolves an issue seen on s390, as we were seeing not just garbage logs but QEMU crashes in certain cases e.g. during device unplug. Thanks! > --- > v2: "toke" -> &q

Re: [PULL 1/3] vfio/pci: add support for VF token

2023-05-23 Thread Matthew Rosato
On 5/9/23 5:59 PM, Alex Williamson wrote: > From: Minwoo Im > > VF token was introduced [1] to kernel vfio-pci along with SR-IOV > support [2]. This patch adds support VF token among PF and VF(s). To > passthu PCIe VF to a VM, kernel >= v5.7 needs this. > > It can be configured with UUID like:

Re: [RFC v3 11/18] vfio/ccw: Use vfio_[attach/detach]_device

2023-03-03 Thread Matthew Rosato
On 1/31/23 3:52 PM, Eric Auger wrote: > Let the vfio-ccw device use vfio_attach_device() and > vfio_detach_device(), hence hiding the details of the used > IOMMU backend. > > Also now all the devices have been migrated to use the new > vfio_attach_device/vfio_detach_device API, let's turn the >

Re: [PATCH] s390x/pci: reset ISM passthrough devices on shutdown and system reset

2022-12-12 Thread Matthew Rosato
On 12/12/22 6:34 AM, Thomas Huth wrote: > On 09/12/2022 20.57, Matthew Rosato wrote: >> ISM device firmware stores unique state information that can >> can cause a wholesale unmap of the associated IOMMU (e.g. when >> we get a termination signal for QEMU) to trigger firmw

[PATCH] s390x/pci: reset ISM passthrough devices on shutdown and system reset

2022-12-09 Thread Matthew Rosato
; this is enough to indicate to firmware that the IOMMU is no longer in-use by the guest OS, making it safe to invalidate any associated IOMMU entries. Fixes: 15d0e7942d3b ("s390x/pci: don't fence interpreted devices without MSI-X") Signed-off-by: Matthew Rosato --- hw/s390x/s390

Re: [PATCH for 7.2 0/2] s390x/s390-virtio-ccw:

2022-11-07 Thread Matthew Rosato
> Thanks, > > C. Thanks Cedric. For the series: Reviewed-by: Matthew Rosato Also did a quick test on top of https://gitlab.com/thuth/qemu.git tags/pull-request-2022-11-06 to verify that zPCI interpretation/forwarding is available as expected with machine 7.2 and off by default

Re: [PATCH v2] s390x/css: revert SCSW ctrl/flag bits on error

2022-10-31 Thread Matthew Rosato
: Peter Jin > > We've talked previously about clearing this within the > do_subchannel_work_passthrough routine in order to keep the _virtual > paths untouched, but this seems like a reasonable approach to me. > > The commit message is probably fine either way, but as far as the co

[PATCH 0/3] s390x/pci: rpcit fixes and enhancements

2022-10-28 Thread Matthew Rosato
The following series fixes an issue with guest RPCIT processing discovered during development of [1] as well as proposes a few additional optimizations to the current RPCIT codepath. [1] https://lore.kernel.org/linux-s390/20221019144435.369902-1-schne...@linux.ibm.com/ Matthew Rosato (3

[PATCH 2/3] s390x/pci: coalesce unmap operations

2022-10-28 Thread Matthew Rosato
Currently, each unmapped page is handled as an individual iommu region notification. Attempt to group contiguous unmap operations into fewer notifications to reduce overhead. Signed-off-by: Matthew Rosato --- hw/s390x/s390-pci-inst.c | 51 1 file

[PATCH 1/3] s390x/pci: RPCIT second pass when mappings exhausted

2022-10-28 Thread Matthew Rosato
) Reported-by: Niklas Schnelle Signed-off-by: Matthew Rosato --- hw/s390x/s390-pci-inst.c | 29 ++--- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/hw/s390x/s390-pci-inst.c b/hw/s390x/s390-pci-inst.c index 20a9bcc7af..7cc4bcf850 100644 --- a/hw/s390x/s390-

[PATCH 3/3] s390x/pci: shrink DMA aperture to be bound by vfio DMA limit

2022-10-28 Thread Matthew Rosato
and host limit far less likely and more indicitive of an error. Signed-off-by: Matthew Rosato --- hw/s390x/s390-pci-vfio.c| 11 +++ include/hw/s390x/s390-pci-bus.h | 1 + 2 files changed, 12 insertions(+) diff --git a/hw/s390x/s390-pci-vfio.c b/hw/s390x/s390-pci-vfio.c index 2aefa508a0

Re: [PATCH] hw/s390x/s390-pci-inst.c: Use device_cold_reset() to reset PCI devices

2022-10-13 Thread Matthew Rosato
Maydell > --- > NB: tested only with 'make check' and 'make check-avocado', which > probably don't exercise this codepath. > I exercised the codepath by triggering the associated clp using both virtio and vfio pci devices on s390x; looks good to me. Reviewed-by: Matthew Rosato

[PATCH v8 5/8] s390x/pci: enable adapter event notification for interpreted devices

2022-09-02 Thread Matthew Rosato
Use the associated kvm ioctl operation to enable adapter event notification and forwarding for devices when requested. This feature will be set up with or without firmware assist based upon the 'forwarding_assist' setting. Signed-off-by: Matthew Rosato --- hw/s390x/s390-pci-bus.c | 20

[PATCH v8 4/8] s390x/pci: don't fence interpreted devices without MSI-X

2022-09-02 Thread Matthew Rosato
-by: Matthew Rosato --- hw/s390x/s390-pci-bus.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c index 156051e6e9..816d17af99 100644 --- a/hw/s390x/s390-pci-bus.c +++ b/hw/s390x/s390-pci-bus.c @@ -881,6 +881,10 @@ static int

[PATCH v8 8/8] s390x/s390-virtio-ccw: add zpcii-disable machine property

2022-09-02 Thread Matthew Rosato
The zpcii-disable machine property can be used to force-disable the use of zPCI interpretation facilities for a VM. By default, this setting will be off for machine 7.2 and newer. Signed-off-by: Matthew Rosato --- hw/s390x/s390-pci-kvm.c| 4 +++- hw/s390x/s390-virtio-ccw.c

[PATCH v8 1/8] linux-headers: update to 6.0-rc3

2022-09-02 Thread Matthew Rosato
Signed-off-by: Matthew Rosato --- include/standard-headers/asm-x86/bootparam.h | 7 +- include/standard-headers/drm/drm_fourcc.h | 73 +++- include/standard-headers/linux/ethtool.h | 29 +-- include/standard-headers/linux/input.h| 12 +- include/standard-headers/linux

[PATCH v8 7/8] s390x/pci: reflect proper maxstbl for groups of interpreted devices

2022-09-02 Thread Matthew Rosato
Signed-off-by: Matthew Rosato --- hw/s390x/s390-pci-vfio.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/s390x/s390-pci-vfio.c b/hw/s390x/s390-pci-vfio.c index 985980f021..212dd053f7 100644 --- a/hw/s390x/s390-pci-vfio.c +++ b/hw/s390x/s390-pci-vfio.c @@ -213,7 +213,11

[PATCH v8 6/8] s390x/pci: let intercept devices have separate PCI groups

2022-09-02 Thread Matthew Rosato
PCI groups from hostdevs that are marked as simulated, let's just assign them to the default group to avoid conflicts between host simulated groups and our own simulated groups. Reviewed-by: Pierre Morel Signed-off-by: Matthew Rosato --- hw/s390x/s390-pci-bus.c | 19 ++-- hw

[PATCH v8 0/8] s390x/pci: zPCI interpretation support

2022-09-02 Thread Matthew Rosato
.0-rc3 [1] https://lore.kernel.org/kvm/20220606203325.110625-1-mjros...@linux.ibm.com/ Matthew Rosato (8): linux-headers: update to 6.0-rc3 s390x/pci: add routine to get host function handle from CLP info s390x/pci: enable for load/store intepretation s390x/pci: don't

[PATCH v8 2/8] s390x/pci: add routine to get host function handle from CLP info

2022-09-02 Thread Matthew Rosato
In order to interface with the underlying host zPCI device, we need to know it's function handle. Add a routine to grab this from the vfio CLP capabilities chain. Reviewed-by: Pierre Morel Signed-off-by: Matthew Rosato --- hw/s390x/s390-pci-vfio.c | 83

[PATCH v8 3/8] s390x/pci: enable for load/store intepretation

2022-09-02 Thread Matthew Rosato
model available. Signed-off-by: Matthew Rosato --- hw/s390x/meson.build| 1 + hw/s390x/s390-pci-bus.c | 66 - hw/s390x/s390-pci-inst.c| 16 hw/s390x/s390-pci-kvm.c | 22 +++ include/hw/s390x/s390-pci-bus.h | 1

Re: [PATCH v7 8/8] s390x/s390-virtio-ccw: add zpcii-disable machine property

2022-06-23 Thread Matthew Rosato
On 6/23/22 9:50 AM, Pierre Morel wrote: On 6/22/22 17:20, Matthew Rosato wrote: On 6/22/22 4:50 AM, Pierre Morel wrote: On 6/6/22 22:36, Matthew Rosato wrote: The zpcii-disable machine property can be used to force-disable the use of zPCI interpretation facilities for a VM.  By default

Re: [PATCH v7 8/8] s390x/s390-virtio-ccw: add zpcii-disable machine property

2022-06-22 Thread Matthew Rosato
On 6/22/22 4:50 AM, Pierre Morel wrote: On 6/6/22 22:36, Matthew Rosato wrote: The zpcii-disable machine property can be used to force-disable the use of zPCI interpretation facilities for a VM.  By default, this setting will be off for machine 7.1 and newer. Signed-off-by: Matthew Rosato

Re: [PATCH v7 3/8] s390x/pci: enable for load/store intepretation

2022-06-22 Thread Matthew Rosato
On 6/22/22 4:35 AM, Pierre Morel wrote: On 6/6/22 22:36, Matthew Rosato wrote: If the ZPCI_OP ioctl reports that is is available and usable, then the underlying KVM host will enable load/store intepretation for any guest device without a SHM bit in the guest function handle.  For a device

[PATCH v7 4/8] s390x/pci: don't fence interpreted devices without MSI-X

2022-06-06 Thread Matthew Rosato
-by: Matthew Rosato --- hw/s390x/s390-pci-bus.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c index 156051e6e9..816d17af99 100644 --- a/hw/s390x/s390-pci-bus.c +++ b/hw/s390x/s390-pci-bus.c @@ -881,6 +881,10 @@ static int

[PATCH v7 8/8] s390x/s390-virtio-ccw: add zpcii-disable machine property

2022-06-06 Thread Matthew Rosato
The zpcii-disable machine property can be used to force-disable the use of zPCI interpretation facilities for a VM. By default, this setting will be off for machine 7.1 and newer. Signed-off-by: Matthew Rosato --- hw/s390x/s390-pci-kvm.c| 4 +++- hw/s390x/s390-virtio-ccw.c

[PATCH v7 7/8] s390x/pci: reflect proper maxstbl for groups of interpreted devices

2022-06-06 Thread Matthew Rosato
Signed-off-by: Matthew Rosato --- hw/s390x/s390-pci-vfio.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/s390x/s390-pci-vfio.c b/hw/s390x/s390-pci-vfio.c index 985980f021..212dd053f7 100644 --- a/hw/s390x/s390-pci-vfio.c +++ b/hw/s390x/s390-pci-vfio.c @@ -213,7 +213,11

[PATCH v7 3/8] s390x/pci: enable for load/store intepretation

2022-06-06 Thread Matthew Rosato
model available. Signed-off-by: Matthew Rosato --- hw/s390x/meson.build| 1 + hw/s390x/s390-pci-bus.c | 66 - hw/s390x/s390-pci-inst.c| 16 hw/s390x/s390-pci-kvm.c | 22 +++ include/hw/s390x/s390-pci-bus.h | 1

[PATCH v7 2/8] s390x/pci: add routine to get host function handle from CLP info

2022-06-06 Thread Matthew Rosato
In order to interface with the underlying host zPCI device, we need to know it's function handle. Add a routine to grab this from the vfio CLP capabilities chain. Reviewed-by: Pierre Morel Signed-off-by: Matthew Rosato --- hw/s390x/s390-pci-vfio.c | 83

[PATCH v7 6/8] s390x/pci: let intercept devices have separate PCI groups

2022-06-06 Thread Matthew Rosato
PCI groups from hostdevs that are marked as simulated, let's just assign them to the default group to avoid conflicts between host simulated groups and our own simulated groups. Reviewed-by: Pierre Morel Signed-off-by: Matthew Rosato --- hw/s390x/s390-pci-bus.c | 19 ++-- hw

[PATCH v7 5/8] s390x/pci: enable adapter event notification for interpreted devices

2022-06-06 Thread Matthew Rosato
Use the associated kvm ioctl operation to enable adapter event notification and forwarding for devices when requested. This feature will be set up with or without firmware assist based upon the 'forwarding_assist' setting. Signed-off-by: Matthew Rosato --- hw/s390x/s390-pci-bus.c | 20

[PATCH v7 1/8] Update linux headers

2022-06-06 Thread Matthew Rosato
This is a placeholder that pulls in 5.19-rc1 + unmerged kernel changes required by this item. A proper header sync can be done once the associated kernel code merges. Signed-off-by: Matthew Rosato --- include/standard-headers/asm-x86/bootparam.h | 1 + include/standard-headers/drm

[PATCH v7 0/8] s390x/pci: zPCI interpretation support

2022-06-06 Thread Matthew Rosato
zPCI interpretation will only be used when the underlying kernel supports it, hardware facilties are available and zpcii-disable=off. Matthew Rosato (8): Update linux headers s390x/pci: add routine to get host function handle from CLP info s390x/pci: enable for load/store intepretation s39

Re: [PATCH v6 2/8] target/s390x: add zpci-interp to cpu models

2022-06-01 Thread Matthew Rosato
On 6/1/22 10:10 AM, David Hildenbrand wrote: On 01.06.22 15:48, Matthew Rosato wrote: On 6/1/22 5:52 AM, David Hildenbrand wrote: On 24.05.22 21:02, Matthew Rosato wrote: The zpci-interp feature is used to specify whether zPCI interpretation is to be used for this guest. We have DEF_FEAT

Re: [PATCH v6 2/8] target/s390x: add zpci-interp to cpu models

2022-06-01 Thread Matthew Rosato
On 6/1/22 5:52 AM, David Hildenbrand wrote: On 24.05.22 21:02, Matthew Rosato wrote: The zpci-interp feature is used to specify whether zPCI interpretation is to be used for this guest. We have DEF_FEAT(SIE_PFMFI, "pfmfi", SCLP_CONF_CHAR_EXT, 9, "SIE: PFMF interpre

[PATCH v6 6/8] s390x/pci: enable adapter event notification for interpreted devices

2022-05-24 Thread Matthew Rosato
Use the associated kvm ioctl operation to enable adapter event notification and forwarding for devices when requested. This feature will be set up with or without firmware assist based upon the 'forwarding_assist' setting. Signed-off-by: Matthew Rosato --- hw/s390x/s390-pci-bus.c | 20

[PATCH v6 7/8] s390x/pci: let intercept devices have separate PCI groups

2022-05-24 Thread Matthew Rosato
PCI groups from hostdevs that are marked as simulated, let's just assign them to the default group to avoid conflicts between host simulated groups and our own simulated groups. Reviewed-by: Pierre Morel Signed-off-by: Matthew Rosato --- hw/s390x/s390-pci-bus.c | 19 ++-- hw

[PATCH v6 5/8] s390x/pci: don't fence interpreted devices without MSI-X

2022-05-24 Thread Matthew Rosato
-by: Matthew Rosato --- hw/s390x/s390-pci-bus.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c index 156051e6e9..816d17af99 100644 --- a/hw/s390x/s390-pci-bus.c +++ b/hw/s390x/s390-pci-bus.c @@ -881,6 +881,10 @@ static int

[PATCH v6 4/8] s390x/pci: enable for load/store intepretation

2022-05-24 Thread Matthew Rosato
to choose the best support model available. Signed-off-by: Matthew Rosato --- hw/s390x/meson.build| 1 + hw/s390x/s390-pci-bus.c | 66 - hw/s390x/s390-pci-inst.c| 16 hw/s390x/s390-pci-kvm.c | 23 include/hw/s390x

[PATCH v6 8/8] s390x/pci: reflect proper maxstbl for groups of interpreted devices

2022-05-24 Thread Matthew Rosato
Signed-off-by: Matthew Rosato --- hw/s390x/s390-pci-vfio.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/s390x/s390-pci-vfio.c b/hw/s390x/s390-pci-vfio.c index 985980f021..212dd053f7 100644 --- a/hw/s390x/s390-pci-vfio.c +++ b/hw/s390x/s390-pci-vfio.c @@ -213,7 +213,11

[PATCH v6 0/8] s390x/pci: zPCI interpretation support

2022-05-24 Thread Matthew Rosato
d host FH is not enabled (Pierre) - bugfix: don't free msix if we never initialized it Matthew Rosato (8): Update linux headers target/s390x: add zpci-interp to cpu models s390x/pci: add routine to get host function handle from CLP info s390x/pci: enable for load/store intepretation

[PATCH v6 3/8] s390x/pci: add routine to get host function handle from CLP info

2022-05-24 Thread Matthew Rosato
In order to interface with the underlying host zPCI device, we need to know it's function handle. Add a routine to grab this from the vfio CLP capabilities chain. Reviewed-by: Pierre Morel Signed-off-by: Matthew Rosato --- hw/s390x/s390-pci-vfio.c | 83

[PATCH v6 2/8] target/s390x: add zpci-interp to cpu models

2022-05-24 Thread Matthew Rosato
The zpci-interp feature is used to specify whether zPCI interpretation is to be used for this guest. Signed-off-by: Matthew Rosato --- hw/s390x/s390-virtio-ccw.c | 1 + target/s390x/cpu_features_def.h.inc | 1 + target/s390x/gen-features.c | 2 ++ target/s390x/kvm/kvm.c

[PATCH v6 1/8] Update linux headers

2022-05-24 Thread Matthew Rosato
This is a placeholder that pulls in unmerged kernel changes required by this item. A proper header sync can be done once the associated kernel code merges. Signed-off-by: Matthew Rosato --- linux-headers/asm-s390/kvm.h| 1 + linux-headers/linux/kvm.h | 32

Re: [PATCH v5 7/9] s390x/pci: enable adapter event notification for interpreted devices

2022-05-04 Thread Matthew Rosato
On 5/3/22 10:53 AM, Pierre Morel wrote: On 5/2/22 21:57, Matthew Rosato wrote: On 5/2/22 7:30 AM, Pierre Morel wrote: On 5/2/22 11:19, Niklas Schnelle wrote: On Mon, 2022-05-02 at 09:48 +0200, Pierre Morel wrote: On 4/22/22 14:10, Matthew Rosato wrote: On 4/22/22 5:39 AM, Pierre Morel

Re: [PATCH v5 7/9] s390x/pci: enable adapter event notification for interpreted devices

2022-05-02 Thread Matthew Rosato
On 5/2/22 7:30 AM, Pierre Morel wrote: On 5/2/22 11:19, Niklas Schnelle wrote: On Mon, 2022-05-02 at 09:48 +0200, Pierre Morel wrote: On 4/22/22 14:10, Matthew Rosato wrote: On 4/22/22 5:39 AM, Pierre Morel wrote: On 4/4/22 20:17, Matthew Rosato wrote: Use the associated kvm ioctl

Re: [PATCH v5 7/9] s390x/pci: enable adapter event notification for interpreted devices

2022-04-22 Thread Matthew Rosato
On 4/22/22 5:39 AM, Pierre Morel wrote: On 4/4/22 20:17, Matthew Rosato wrote: Use the associated kvm ioctl operation to enable adapter event notification and forwarding for devices when requested.  This feature will be set up with or without firmware assist based upon the 'forwarding_assist

Re: [PATCH v5 5/9] s390x/pci: enable for load/store intepretation

2022-04-20 Thread Matthew Rosato
On 4/19/22 3:47 PM, Pierre Morel wrote: On 4/4/22 20:17, Matthew Rosato wrote: If the appropriate CPU facilty is available as well as the necessary ZPCI_OP ioctl, then the underlying KVM host will enable load/store intepretation for any guest device without a SHM bit in the guest function

Re: [PATCH v5 2/9] vfio: tolerate migration protocol v1 uapi renames

2022-04-12 Thread Matthew Rosato
On 4/12/22 11:50 AM, Pierre Morel wrote: On 4/4/22 20:17, Matthew Rosato wrote: The v1 uapi is deprecated and will be replaced by v2 at some point; this patch just tolerates the renaming of uapi fields to reflect v1 / deprecated status. Signed-off-by: Matthew Rosato ---   hw/vfio/common.c

[PATCH v5 8/9] s390x/pci: let intercept devices have separate PCI groups

2022-04-04 Thread Matthew Rosato
PCI groups from hostdevs that are marked as simulated, let's just assign them to the default group to avoid conflicts between host simulated groups and our own simulated groups. Reviewed-by: Pierre Morel Signed-off-by: Matthew Rosato --- hw/s390x/s390-pci-bus.c | 19 ++-- hw

[PATCH v5 7/9] s390x/pci: enable adapter event notification for interpreted devices

2022-04-04 Thread Matthew Rosato
Use the associated kvm ioctl operation to enable adapter event notification and forwarding for devices when requested. This feature will be set up with or without firmware assist based upon the 'forwarding_assist' setting. Signed-off-by: Matthew Rosato --- hw/s390x/s390-pci-bus.c | 20

[PATCH v5 6/9] s390x/pci: don't fence interpreted devices without MSI-X

2022-04-04 Thread Matthew Rosato
-by: Matthew Rosato --- hw/s390x/s390-pci-bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c index 156051e6e9..9c02d31250 100644 --- a/hw/s390x/s390-pci-bus.c +++ b/hw/s390x/s390-pci-bus.c @@ -1093,7 +1093,7 @@ static void

  1   2   3   4   5   6   >