Re: [PATCH 2/2] vfio/helpers: Align mmaps

2024-10-23 Thread Alex Williamson
On Wed, 23 Oct 2024 14:44:19 +0200 Cédric Le Goater wrote: > On 10/22/24 22:08, Alex Williamson wrote: > > Thanks to work by Peter Xu, support is introduced in Linux v6.12 to > > allow pfnmap insertions at PMD and PUD levels of the page table. This > > means that provid

[PATCH 1/2] vfio/helpers: Refactor vfio_region_mmap() error handling

2024-10-22 Thread Alex Williamson
Move error handling code to the end of the function so that it can more easily be shared by new mmap failure conditions. No functional change intended. Signed-off-by: Alex Williamson --- hw/vfio/helpers.c | 34 +- 1 file changed, 17 insertions(+), 17 deletions

[PATCH 2/2] vfio/helpers: Align mmaps

2024-10-22 Thread Alex Williamson
pping level sizes, therefore this takes the simple approach to align the mapping to the power-of-two size of the region, up to 1GiB, which is currently the maximum alignment we care about. Cc: Peter Xu Signed-off-by: Alex Williamson --- hw/vfio/helpers.c | 32 ++-- 1

[PATCH 0/2] vfio: Align mmaps

2024-10-22 Thread Alex Williamson
value for mmap, please share. Thanks, Alex Alex Williamson (2): vfio/helpers: Refactor vfio_region_mmap() error handling vfio/helpers: Align mmaps hw/vfio/helpers.c | 66 +-- 1 file changed, 47 insertions(+), 19 deletions(-) -- 2.46.2

Re: [RFC 1/1] vfio: support CXL device in VFIO stub

2024-10-11 Thread Alex Williamson
On Sat, 21 Sep 2024 00:14:40 -0700 Zhi Wang wrote: > To support CXL device passthrough, vfio-cxl-core is introduced. This > is the QEMU part. > > Get the CXL caps from the vfio-cxl-core. Trap and emulate the HDM > decoder registers. Map the HDM decdoers when the guest commits a HDM > decoder. I

Re: [PATCH v3 0/7] vfio/igd: add passthrough support for IGDs of gen 11 and later

2024-08-29 Thread Alex Williamson
gt; hw/vfio/igd.c| 185 +-- > hw/vfio/pci-quirks.c | 1 + > hw/vfio/pci.h | 1 + > 3 files changed, 161 insertions(+), 26 deletions(-) > LGTM, for series Reviewed-by: Alex Williamson

Re: [PATCH 4/7] vfio/igd: add new bar0 quirk to emulate BDSM mirror

2024-08-26 Thread Alex Williamson
On Thu, 22 Aug 2024 13:08:29 +0200 Corvin Köhne wrote: > The BDSM register is mirrored into MMIO space at least for gen 11 and > later devices. Unfortunately, the Windows driver reads the register > value from MMIO space instead of PCI config space for those devices [1]. > Therefore, we either h

Re: [PATCH RFC/RFT] vfio/pci-quirks: Quirk for ath wireless

2024-08-15 Thread Alex Williamson
On Tue, 13 Aug 2024 20:37:24 -0300 Jason Gunthorpe wrote: > On Tue, Aug 13, 2024 at 03:03:20PM -0600, Alex Williamson wrote: > > > How does the guest know to write a remappable vector format? How does > > the guest know the host interrupt architecture? For example why wo

Re: [PATCH RFC/RFT] vfio/pci-quirks: Quirk for ath wireless

2024-08-13 Thread Alex Williamson
On Tue, 13 Aug 2024 13:43:41 -0300 Jason Gunthorpe wrote: > On Mon, Aug 12, 2024 at 11:00:40AM -0600, Alex Williamson wrote: > > These devices have an embedded interrupt controller which is programmed > > with guest physical MSI address/data, which doesn't work. We need

Re: [PATCH V2 01/11] machine: alloc-anon option

2024-08-13 Thread Alex Williamson
On Tue, 13 Aug 2024 11:35:15 -0400 Peter Xu wrote: > On Mon, Aug 12, 2024 at 02:37:59PM -0400, Steven Sistare wrote: > > On 8/8/2024 2:32 PM, Steven Sistare wrote: > > > On 7/29/2024 8:29 AM, Igor Mammedov wrote: > > > > On Sat, 20 Jul 2024 16:28:25 -0400 > > > > Steven Sistare wrote: > > >

Re: [RFC V1 02/12] iommufd: no DMA to BARs

2024-08-12 Thread Alex Williamson
On Sat, 20 Jul 2024 12:15:27 -0700 Steve Sistare wrote: > Do not map VFIO PCI BARs for DMA. This stops a raft of warnings of the > following form at QEMU start time when using -object iommufd: > > qemu-kvm: warning: IOMMU_IOAS_MAP failed: Bad address, PCI BAR? > qemu-kvm: vfio_container_dma_map

[PATCH RFC/RFT] vfio/pci-quirks: Quirk for ath wireless

2024-08-12 Thread Alex Williamson
uires interrupt remapping support in the host. NB. The #define for the new vfio feature is temporary for RFC/RFT, a formal proposal will include a proper linux-headers update. Link: https://bugzilla.kernel.org/show_bug.cgi?id=216055 Signed-off-by: Alex Williamson --- hw/vfio/pci-quirks.c

Re: [PATCH V1 4/8] vfio-pci: cpr part 1 (fd and dma)

2024-07-10 Thread Alex Williamson
On Tue, 9 Jul 2024 13:58:53 -0700 Steve Sistare wrote: > Enable vfio-pci devices to be saved and restored across a cpr-exec of qemu. > > At vfio creation time, save the value of vfio container, group, and device > descriptors in CPR state. > > In the container pre_save handler, suspend the use

Re: About VFIO Device Pass-through on Qemu.

2024-07-05 Thread Alex Williamson
On Fri, 5 Jul 2024 17:08:49 +0800 (CST) tugouxp <13824125...@163.com> wrote: > Hi folks: > > > I have a questions about device vfio pass-through usage snarios, > PCI device pass-throug for example. did the GPA that host physical > memory mapped to Guest vcpu through MMU must be identical wi

Re: [PATCH v10 11/12] hw/pci: Convert rom_bar into OnOffAuto

2024-07-03 Thread Alex Williamson
On Wed, 3 Jul 2024 13:00:21 +0200 (CEST) BALATON Zoltan wrote: > On Wed, 3 Jul 2024, Michael S. Tsirkin wrote: > > On Wed, Jul 03, 2024 at 04:15:23AM +0200, BALATON Zoltan wrote: > >> On Tue, 2 Jul 2024, Michael S. Tsirkin wrote: > >>> On Thu, Jun 27, 2024 at 03:08:00PM +0900, Akihiko Odaki w

Re: [PATCH 02/12] hw/vfio/pci: Replace sprintf() by g_strdup_printf()

2024-04-12 Thread Alex Williamson
On Wed, 10 Apr 2024 18:06:03 +0200 Philippe Mathieu-Daudé wrote: > sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, > resulting in painful developper experience. Use g_strdup_printf() > instead. Isn't this code only compiled for Linux hosts? Maybe still a valid change, but the r

Re: [PATCH v3] vfio/pci: migration: Skip config space check for Vendor Specific Information in VSC during restore/load

2024-03-27 Thread Alex Williamson
On Wed, 27 Mar 2024 16:11:37 -0400 "Michael S. Tsirkin" wrote: > On Wed, Mar 27, 2024 at 11:39:15AM -0600, Alex Williamson wrote: > > On Fri, 22 Mar 2024 12:12:10 +0530 > > Vinayak Kale wrote: > > > > > In case of migration, during restore operation

Re: [PATCH v3] vfio/pci: migration: Skip config space check for Vendor Specific Information in VSC during restore/load

2024-03-27 Thread Alex Williamson
or Specific Info in VSC, check > is > still enforced for 3 byte VSC header. > - Updated commit description with live migration failure scenario. > v1->v2: > - Limited scope of change to vfio-pci devices instead of all pci devices. > > hw/vfio/pci.c | 24 +

Re: [PATCH v2] vfio/pci: migration: Skip config space check for vendor specific capability during restore/load

2024-03-18 Thread Alex Williamson
On Fri, 15 Mar 2024 23:22:22 +0530 Vinayak Kale wrote: > On 11/03/24 8:32 pm, Alex Williamson wrote: > > External email: Use caution opening links or attachments > > > > > > On Mon, 11 Mar 2024 17:45:19 +0530 > > Vinayak Kale wrote: > > > >>

Re: [PATCH v2] vfio/pci: migration: Skip config space check for vendor specific capability during restore/load

2024-03-11 Thread Alex Williamson
On Mon, 11 Mar 2024 17:45:19 +0530 Vinayak Kale wrote: > In case of migration, during restore operation, qemu checks config space of > the > pci device with the config space in the migration stream captured during save > operation. In case of config space data mismatch, restore operation is fail

Re: [PATCH 0/2] Revert "hw/i386/pc: Confine system flash handling to pc_sysfw"

2024-03-09 Thread Alex Williamson
386/pc_sysfw.c | 17 + > 4 files changed, 17 insertions(+), 4 deletions(-) > Please apply this, the original commits break my existing VMs. Tested-by: Alex Williamson

Re: [PATCH] pci: Add option to disable device level INTx masking

2024-03-08 Thread Alex Williamson
On Fri, 8 Mar 2024 14:37:06 -0500 "Michael S. Tsirkin" wrote: > On Fri, Mar 08, 2024 at 10:24:14AM -0700, Alex Williamson wrote: > > On Fri, 8 Mar 2024 11:57:38 -0500 > > "Michael S. Tsirkin" wrote: > > > > > On Thu, Mar 07, 2024 at 11:46:42

Re: [PATCH] pci: Add option to disable device level INTx masking

2024-03-08 Thread Alex Williamson
On Fri, 8 Mar 2024 11:57:38 -0500 "Michael S. Tsirkin" wrote: > On Thu, Mar 07, 2024 at 11:46:42AM -0700, Alex Williamson wrote: > > The PCI 2.3 spec added definitions of the INTx disable and status bits, > > in the command and status registers respectively. The

[PATCH] pci: Add option to disable device level INTx masking

2024-03-07 Thread Alex Williamson
). Add an experimental option to the base set of properties for PCI devices which allows the DisINTx bit to be excluded from wmask, making it read-only to the guest for testing purposes related to INTx masking. Signed-off-by: Alex Williamson --- hw/pci/pci.c | 14 ++ include

Re: [PATCH v7 2/2] hw/acpi: Implement the SRAT GI affinity structure

2024-03-05 Thread Alex Williamson
On Tue, 5 Mar 2024 05:59:46 + Ankit Agrawal wrote: > > One thing I forgot. > > > > Please add a test.  tests/qtest/bios-tables-test.c > > + relevant table dumps. > > Here I need to add a test that creates a vfio-pci device and numa > nodes and link using the acpi-generic-initiator object.

Re: Why does the vmovdqu works for passthrough device but crashes for emulated device with "illegal operand" error (in x86_64 QEMU, -accel = kvm) ?

2024-03-04 Thread Alex Williamson
On Sun, 3 Mar 2024 22:20:33 + Xu Liu wrote: > Hello, > > Recently I am running my programs in QEMU (x86_64) with “-accel=kvm”. > The QEMU version is 6.0.0. > > I run my programs in two ways: > > 1. I pass through my device through vfio-pci to QEMU, this way > works well. > > 2. I wr

Re: [PATCH v7 1/2] qom: new object to associate device to numa node

2024-03-01 Thread Alex Williamson
On Fri, 1 Mar 2024 08:33:42 + Ankit Agrawal wrote: > >> As for your suggestion of using acpi-dev as the arg to take both > >> pci-dev and acpi-dev.. Would that mean sending a pure pci device > >> (not the corner case you mentioned) through the acpi-dev argument > >> as well? Not sure if that

Re: [q&a] Status of IOMMU virtualization for nested virtualization (userspace PCI drivers in VMs)

2024-02-28 Thread Alex Williamson
On Wed, 28 Feb 2024 10:29:32 -0800 Peter Delevoryas wrote: > Hey guys, > > I’m having a little trouble reading between the lines on various > docs, mailing list threads, KVM presentations, github forks, etc, so > I figured I’d just ask: > > What is the status of IOMMU virtualization, like in th

Re: [PATCH] hw/pci: migration: Skip config space check for vendor specific capability during restore/load

2024-02-01 Thread Alex Williamson
On Thu, 1 Feb 2024 13:10:48 -0500 "Michael S. Tsirkin" wrote: > On Thu, Feb 01, 2024 at 11:08:58PM +0530, Vinayak Kale wrote: > > > > On 31/01/24 11:08 pm, Alex Williamson wrote: > > > > > > On Wed, 31 Jan 2024 15:22:59 +0530 > > > Vinaya

Re: [PATCH] hw/pci: migration: Skip config space check for vendor specific capability during restore/load

2024-01-31 Thread Alex Williamson
On Wed, 31 Jan 2024 15:22:59 +0530 Vinayak Kale wrote: > On 31/01/24 12:28 am, Alex Williamson wrote: > > > > On Tue, 30 Jan 2024 23:32:26 +0530 > > Vinayak Kale wrote: > > > >> Missed adding Michael, Marcel, Alex and Avihai earlier, apologies. > >

Re: [PATCH] hw/pci: migration: Skip config space check for vendor specific capability during restore/load

2024-01-30 Thread Alex Williamson
On Tue, 30 Jan 2024 23:32:26 +0530 Vinayak Kale wrote: > Missed adding Michael, Marcel, Alex and Avihai earlier, apologies. > > Regards, > Vinayak > > On 30/01/24 3:26 pm, Vinayak Kale wrote: > > In case of migration, during restore operation, qemu checks the config > > space of the pci device

Re: [PATCH v2] target/i386/host-cpu: Use iommu phys_bits with VFIO assigned devices on Intel h/w

2024-01-25 Thread Alex Williamson
t; > phys_bits value as shown in this patch. > > > > Previous attempt at solving this issue in OVMF: > > https://edk2.groups.io/g/devel/topic/102359124 > > > > Cc: Gerd Hoffmann > > Cc: Philippe Mathieu-Daudé > > Cc: Alex Williamson > >

Re: [PATCH] vfio/pci: Clear MSI-X IRQ index always

2024-01-25 Thread Alex Williamson
NTX-0: VFIO_DEVICE_SET_IRQS failure: Invalid argument > > To avoid that, unconditionaly clear the IRQ index when MSI-X is > disabled. > > Buglink: https://issues.redhat.com/browse/RHEL-21293 > Fixes: 5ebffa4e87e7 ("vfio/pci: use an invalid fd to enable MSI-X") > Cc: J

Re: [PATCH 1/3] virtio-iommu: Add an option to define the input range width

2024-01-24 Thread Alex Williamson
On Wed, 24 Jan 2024 14:57:41 +0100 Eric Auger wrote: > Hi Alex, > > On 1/24/24 14:37, Alex Williamson wrote: > > On Wed, 24 Jan 2024 14:14:19 +0100 > > Eric Auger wrote: > > > >> Hi Alex, > >> > >> On 1/24/24 00:51, Alex Williamson wrote:

Re: [PATCH 1/3] virtio-iommu: Add an option to define the input range width

2024-01-24 Thread Alex Williamson
On Wed, 24 Jan 2024 14:14:19 +0100 Eric Auger wrote: > Hi Alex, > > On 1/24/24 00:51, Alex Williamson wrote: > > On Tue, 23 Jan 2024 19:15:55 +0100 > > Eric Auger wrote: > > > >> aw-bits is a new option that allows to set the bit width of > >> the

Re: [PATCH 1/3] virtio-iommu: Add an option to define the input range width

2024-01-23 Thread Alex Williamson
On Tue, 23 Jan 2024 19:15:55 +0100 Eric Auger wrote: > aw-bits is a new option that allows to set the bit width of > the input address range. This value will be used as a default for > the device config input_range.end. By default it is set to 64 bits > which is the current value. > > Signed-off

Re: [PATCH V2 00/11] allow cpr-reboot for vfio

2024-01-12 Thread Alex Williamson
On Fri, 12 Jan 2024 07:04:59 -0800 Steve Sistare wrote: > Allow cpr-reboot for vfio if the guest is in the suspended runstate. The > guest drivers' suspend methods flush outstanding requests and re-initialize > the devices, and thus there is no device state to save and restore. The > user is re

Re: [PATCH v6 1/2] qom: new object to associate device to numa node

2024-01-04 Thread Alex Williamson
On Thu, 4 Jan 2024 16:40:39 + Ankit Agrawal wrote: > Had a discussion with RH folks, summary follows: > > 1. To align with the current spec description pointed by Jonathan, we first do > a separate object instance per GI node as suggested by Jonathan. i.e. > a acpi-generic-initiato

Re: [PATCH v6 1/2] qom: new object to associate device to numa node

2024-01-04 Thread Alex Williamson
On Thu, 4 Jan 2024 03:36:06 + Ankit Agrawal wrote: > Thanks Jonathan for the review. > > > As per reply to the cover letter I definitely want to see SRAT table dumps > > in here though so we can easily see what this is actually building. > > Ack. > > > I worry that some OS might make the

Re: [PATCH v4 1/2] qom: new object to associate device to numa node

2023-11-27 Thread Alex Williamson
On Sun, 19 Nov 2023 18:31:10 +0530 wrote: > From: Ankit Agrawal > > NVIDIA GPU's support MIG (Mult-Instance GPUs) feature [1], which allows > partitioning of the GPU device resources (including device memory) into > several (upto 8) isolated instances. Each of the partitioned memory needs > a d

Re: [PATCH v4 2/2] hw/acpi: Implement the SRAT GI affinity structure

2023-11-27 Thread Alex Williamson
On Sun, 19 Nov 2023 18:31:11 +0530 wrote: > From: Ankit Agrawal > > ACPI spec provides a scheme to associate "Generic Initiators" [1] > (e.g. heterogeneous processors and accelerators, GPUs, and I/O devices with > integrated compute or DMA engines GPUs) with Proximity Domains. This is > achieve

Re: [PATCH v3 2/2] hw/acpi: Implement the SRAT GI affinity structure

2023-11-07 Thread Alex Williamson
On Wed, 8 Nov 2023 00:30:39 +0530 wrote: > From: Ankit Agrawal > > ACPI spec provides a scheme to associate "Generic Initiators" [1] > (e.g. heterogeneous processors and accelerators, GPUs, and I/O devices with > integrated compute or DMA engines GPUs) with Proximity Domains. This is > achieved

Re: [PATCH] vfio/pci: Check return value of vfio_set_irq_signaling()

2023-10-26 Thread Alex Williamson
On Thu, 26 Oct 2023 09:10:43 +0200 Cédric Le Goater wrote: > and drop warning when ENOTTY is returned. Only useful for the mdev-mtty > driver today, which has partial support for INTx: the AUTOMASK > behavior is not implemented. FWIW, I prefer not to carry a sentence through from subject to comm

Re: [PATCH 2/2] vfio/pci: Fix buffer overrun when writing the VF token

2023-10-25 Thread Alex Williamson
1522913 > Fixes: 2dca1b37a760 ("vfio/pci: add support for VF token") > Cc: Alex Williamson > Signed-off-by: Cédric Le Goater > --- > hw/vfio/pci.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c &g

Re: [PATCH v3 13/13] vfio: Remove 64-bit IOVA address space assumption

2023-10-18 Thread Alex Williamson
On Wed, 11 Oct 2023 19:52:29 +0200 Eric Auger wrote: > Now we retrieve the usable IOVA ranges from the host, > we now the physical IOMMU aperture and we can remove s/now/use/? > the assumption of 64b IOVA space when calling > vfio_host_win_add(). > > This works fine in general but in case of a

Re: [PATCH v3 03/13] vfio: Collect container iova range info

2023-10-18 Thread Alex Williamson
re. We can just test iova_ranges != NULL for calling set_iova_ranges. In patch 13 we can again test against NULL, which I think also negates the need to assert nr_iovas since the NULL test automatically catches the zero case. Otherwise Reviewed-by: Alex Williamson > } VFIOContainer; >

Re: [PATCH v2 3/3] qom: Link multiple numa nodes to device using a new object

2023-10-17 Thread Alex Williamson
On Tue, 17 Oct 2023 12:28:30 -0300 Jason Gunthorpe wrote: > On Tue, Oct 17, 2023 at 09:21:16AM -0600, Alex Williamson wrote: > > > Do we therefore need some programatic means for the kernel driver to > > expose the node configuration to userspace? What interfaces would >

Re: [PATCH v2 3/3] qom: Link multiple numa nodes to device using a new object

2023-10-17 Thread Alex Williamson
On Tue, 17 Oct 2023 14:00:54 + Ankit Agrawal wrote: > >> -device > >>vfio-pci-nohotplug,host=0009:01:00.0,bus=pcie.0,addr=04.0,rombar=0,id=dev0 \ > >> -object > >>nvidia-acpi-generic-initiator,id=gi0,device=dev0,numa-node-start=2,numa-node-count=8 > >> > > > > Why didn't w

Re: [PATCH v2 1/3] qom: new object to associate device to numa node

2023-10-11 Thread Alex Williamson
On Sun, 8 Oct 2023 01:47:38 +0530 wrote: > From: Ankit Agrawal > > The CPU cache coherent device memory can be added as NUMA nodes > distinct from the system memory nodes. These nodes are associated > with the device and Qemu needs a way to maintain this link. > > Introduce a new acpi-generic-

Re: [PATCH v2 3/3] qom: Link multiple numa nodes to device using a new object

2023-10-11 Thread Alex Williamson
On Sun, 8 Oct 2023 01:47:40 +0530 wrote: > From: Ankit Agrawal > > NVIDIA GPU's support MIG (Mult-Instance GPUs) feature [1], which allows > partitioning of the GPU device resources (including device memory) into > several (upto 8) isolated instances. Each of the partitioned memory needs > a de

Re: [PATCH v2 2/3] hw/acpi: Implement the SRAT GI affinity structure

2023-10-11 Thread Alex Williamson
On Sun, 8 Oct 2023 01:47:39 +0530 wrote: > From: Ankit Agrawal > > ACPI spec provides a scheme to associate "Generic Initiators" [1] > (e.g. heterogeneous processors and accelerators, GPUs, and I/O devices with > integrated compute or DMA engines GPUs) with Proximity Domains. This is > achieved

Re: [PATCH v2 3/3] qom: Link multiple numa nodes to device using a new object

2023-10-09 Thread Alex Williamson
On Mon, 9 Oct 2023 13:30:48 +0100 Jonathan Cameron wrote: > On Sun, 8 Oct 2023 01:47:40 +0530 > wrote: > > > From: Ankit Agrawal > > > > NVIDIA GPU's support MIG (Mult-Instance GPUs) feature [1], which allows > > partitioning of the GPU device resources (including device memory) into > > seve

Re: [PATCH v2 4/5] ramfb: make migration conditional

2023-10-02 Thread Alex Williamson
On Mon, 2 Oct 2023 21:41:55 +0200 Laszlo Ersek wrote: > On 10/2/23 21:26, Alex Williamson wrote: > > On Mon, 2 Oct 2023 20:24:11 +0200 > > Laszlo Ersek wrote: > > > >> On 10/2/23 16:41, Alex Williamson wrote: > >>> On Mon, 2 Oct 2023 15

Re: [PATCH v2 4/5] ramfb: make migration conditional

2023-10-02 Thread Alex Williamson
On Mon, 2 Oct 2023 20:24:11 +0200 Laszlo Ersek wrote: > On 10/2/23 16:41, Alex Williamson wrote: > > On Mon, 2 Oct 2023 15:38:10 +0200 > > Cédric Le Goater wrote: > > > >> On 10/2/23 13:11, marcandre.lur...@redhat.com wrote: > >>> From: Marc-And

Re: [PATCH v2 4/5] ramfb: make migration conditional

2023-10-02 Thread Alex Williamson
On Mon, 2 Oct 2023 15:38:10 +0200 Cédric Le Goater wrote: > On 10/2/23 13:11, marcandre.lur...@redhat.com wrote: > > From: Marc-André Lureau > > > > RAMFB migration was unsupported until now, let's make it conditional. > > The following patch will prevent machines <= 8.1 to migrate it. > > > >

Re: [PATCH v1 0/4] vfio: report NUMA nodes for device memory

2023-09-27 Thread Alex Williamson
On Wed, 27 Sep 2023 15:03:09 + Vikram Sethi wrote: > > From: Alex Williamson > > Sent: Wednesday, September 27, 2023 9:25 AM > > To: Jason Gunthorpe > > Cc: Jonathan Cameron ; Ankit Agrawal > > ; David Hildenbrand ; Cédric Le > > Goater ; shan

Re: [PATCH v1 0/4] vfio: report NUMA nodes for device memory

2023-09-27 Thread Alex Williamson
On Wed, 27 Sep 2023 10:53:36 -0300 Jason Gunthorpe wrote: > On Wed, Sep 27, 2023 at 12:33:18PM +0100, Jonathan Cameron wrote: > > > CXL accelerators / GPUs etc are a different question but who has one > > of those anyway? :) > > That's exactly what I mean when I say CXL will need it too. I ke

Re: [PATCH v1 0/4] vfio: report NUMA nodes for device memory

2023-09-26 Thread Alex Williamson
On Tue, 26 Sep 2023 18:54:53 +0200 David Hildenbrand wrote: > On 26.09.23 16:52, Ankit Agrawal wrote: > > Good idea.  Fundamentally the device should not be creating NUMA > > nodes, the VM should be configured with NUMA nodes and the device > > memory associated with those nodes. >

Re: [PATCH v2 0/4] Support dynamic MSI-X allocation

2023-09-22 Thread Alex Williamson
X in interrupt restoring on dynamic allocation > > hw/vfio/pci.c| 121 +-- > hw/vfio/pci.h| 1 + > hw/vfio/trace-events | 2 +- > 3 files changed, 96 insertions(+), 28 deletions(-) > Some minor comments on 2/ but otherwise: Reviewed-by: Alex Williamson

Re: [PATCH v2 2/4] vfio/pci: enable vector on dynamic MSI-X allocation

2023-09-22 Thread Alex Williamson
On Mon, 18 Sep 2023 05:45:05 -0400 Jing Liu wrote: > The vector_use callback is used to enable vector that is unmasked in > guest. The kernel used to only support static MSI-X allocation. When > allocating a new interrupt using "static MSI-X allocation" kernels, > QEMU first disables all previous

Re: [PATCH v1 07/22] vfio/common: Refactor vfio_viommu_preset() to be group agnostic

2023-09-20 Thread Alex Williamson
On Wed, 30 Aug 2023 18:37:39 +0800 Zhenzhong Duan wrote: > So that it doesn't need to be moved into container.c as done > in following patch. > > Signed-off-by: Zhenzhong Duan > --- > hw/vfio/common.c | 17 - > 1 file changed, 16 insertions(+), 1 deletion(-) > > diff --git a/h

Re: [PATCH v1 06/22] vfio/common: Add a vfio device iterator

2023-09-20 Thread Alex Williamson
On Wed, 30 Aug 2023 18:37:38 +0800 Zhenzhong Duan wrote: > With a vfio device iterator added, we can make some migration and reset > related functions group agnostic. > E.x: > vfio_mig_active > vfio_migratable_device_num > vfio_devices_all_dirty_tracking > vfio_devices_all_device_dirty_tracking >

Re: [PATCH v1 05/22] vfio/common: Extract out vfio_kvm_device_[add/del]_fd

2023-09-20 Thread Alex Williamson
On Wed, 30 Aug 2023 18:37:37 +0800 Zhenzhong Duan wrote: > ...which will be used by both legacy and iommufd backend. +1 to Eric's comments regarding complete sentences in the commit log and suggested description. > > Signed-off-by: Yi Liu > Signed-off-by: Zhenzhong Duan > --- > hw/vfio/comm

Re: [PATCH v1 15/22] Add iommufd configure option

2023-09-20 Thread Alex Williamson
On Wed, 20 Sep 2023 15:12:59 -0300 Jason Gunthorpe wrote: > On Wed, Sep 20, 2023 at 12:01:42PM -0600, Alex Williamson wrote: > > On Wed, 20 Sep 2023 03:42:20 + > > "Duan, Zhenzhong" wrote: > > > > > >-Original Message- > >

Re: [PATCH v2 12/12] vfio: Remove 64-bit IOVA address space assumption

2023-09-20 Thread Alex Williamson
On Wed, 13 Sep 2023 10:01:47 +0200 Eric Auger wrote: > Now we retrieve the usable IOVA ranges from the host, > we now the physical IOMMU aperture and we can remove > the assumption of 64b IOVA space when calling > vfio_host_win_add(). > > This works fine in general but in case of an IOMMU memory

Re: [PATCH v1 15/22] Add iommufd configure option

2023-09-20 Thread Alex Williamson
On Wed, 20 Sep 2023 14:49:19 -0300 Jason Gunthorpe wrote: > On Wed, Sep 20, 2023 at 07:37:53PM +0200, Eric Auger wrote: > > > >> qemu will typically not be able to > > >> self-open /dev/iommufd as it is root-only. > > > > > > I don't understand, we open multiple fds to KVM devices. This is the

Re: [PATCH v1 15/22] Add iommufd configure option

2023-09-20 Thread Alex Williamson
On Wed, 20 Sep 2023 03:42:20 + "Duan, Zhenzhong" wrote: > >-Original Message- > >From: Cédric Le Goater > >Sent: Wednesday, September 20, 2023 1:08 AM > >Subject: Re: [PATCH v1 15/22] Add iommufd configure option > > > >On 8/30/23 12:37, Zhenzhong Duan wrote: > >> This adds "--enab

Re: [PATCH v2 12/12] vfio: Remove 64-bit IOVA address space assumption

2023-09-19 Thread Alex Williamson
On Wed, 13 Sep 2023 10:01:47 +0200 Eric Auger wrote: > Now we retrieve the usable IOVA ranges from the host, > we now the physical IOMMU aperture and we can remove > the assumption of 64b IOVA space when calling > vfio_host_win_add(). > > This works fine in general but in case of an IOMMU memory

Re: [PATCH v2 06/12] range: Introduce range_inverse_array()

2023-09-19 Thread Alex Williamson
On Wed, 13 Sep 2023 10:01:41 +0200 Eric Auger wrote: > This helper reverses an array of regions, turning original > regions into holes and original holes into actual regions, > covering the whole UINT64_MAX span. > > Signed-off-by: Eric Auger > > --- > > v1 -> v2: > - Move range_inverse_array

Re: [PATCH v2 03/12] vfio: Collect container iova range info

2023-09-19 Thread Alex Williamson
On Wed, 13 Sep 2023 10:01:38 +0200 Eric Auger wrote: > Collect iova range information if VFIO_IOMMU_TYPE1_INFO_CAP_IOVA_RANGE > capability is supported. > > This allows to propagate the information though the IOMMU MR > set_iova_ranges() callback so that virtual IOMMUs > get aware of those apert

Re: [PATCH] spapr: Remove support for NVIDIA V100 GPU with NVLink2

2023-09-15 Thread Alex Williamson
io_pci_nvlink2") > > This was 2.5 years ago. Do the same in QEMU with a revert of commit > ec132efaa81f ("spapr: Support NVIDIA V100 GPU with NVLink2"). Some > adjustements are required on the NUMA part. > > Cc: Alexey Kardashevskiy > Signed-off-by: Céd

Re: [PATCH v1 0/4] vfio: report NUMA nodes for device memory

2023-09-15 Thread Alex Williamson
On Fri, 15 Sep 2023 16:19:29 +0200 Cédric Le Goater wrote: > Hello Ankit, > > On 9/15/23 04:45, ank...@nvidia.com wrote: > > From: Ankit Agrawal > > > > For devices which allow CPU to cache coherently access their memory, > > it is sensible to expose such memory as NUMA nodes separate from > >

Re: [PATCH for-8.1] vfio/display: Fix missing update to set backing fields

2023-09-13 Thread Alex Williamson
ay. Thanks, Alex On Tue, 5 Sep 2023 09:09:07 -0600 Alex Williamson wrote: > On Mon, 4 Sep 2023 21:00:53 +0400 > Marc-André Lureau wrote: > > > Hi > > > > On Mon, Sep 4, 2023 at 6:11 PM Alex Williamson > > wrote: > > > > > > On

Re: Usage of vfio-pci without KVM.

2023-09-12 Thread Alex Williamson
> On Tue, Sep 12, 2023 at 3:58 PM Alex Williamson > wrote: > > > > On Tue, 12 Sep 2023 14:47:41 +0200 > > Philippe Mathieu-Daudé wrote: > > > > > Cc'ing VFIO maintainers. > > > > > > On 12/9/23 14:39, Shlomo Pongratz wrote: > &

Re: Usage of vfio-pci without KVM.

2023-09-12 Thread Alex Williamson
On Tue, 12 Sep 2023 14:47:41 +0200 Philippe Mathieu-Daudé wrote: > Cc'ing VFIO maintainers. > > On 12/9/23 14:39, Shlomo Pongratz wrote: > > Hi, > > I'm running qemu-system-aarch64 (QEMU emulator version 7.0.93) on > > Ubuntu 20.04.4 LTS i with Intel's i7. > > I'm trying to pass a Samsung NVME d

Re: [PATCH v1] vfio/common: Separate vfio-pci ranges

2023-09-11 Thread Alex Williamson
On Mon, 11 Sep 2023 11:12:55 +0100 Joao Martins wrote: > On 11/09/2023 10:48, Duan, Zhenzhong wrote: > >> -Original Message- > >> From: Joao Martins > >> Sent: Monday, September 11, 2023 5:07 PM > >> Subject: Re: [PATCH v1] vfio/common: Separate vfio-pci ranges > >> > >> On 11/09/2023 09

Re: [PATCH v1 21/22] vfio/pci: Allow the selection of a given iommu backend

2023-09-06 Thread Alex Williamson
On Wed, 6 Sep 2023 15:10:39 -0300 Jason Gunthorpe wrote: > On Wed, Aug 30, 2023 at 06:37:53PM +0800, Zhenzhong Duan wrote: > > Note the /dev/iommu device may have been pre-opened by a > > management tool such as libvirt. This mode is no more considered > > for the legacy backend. So let's remove

Re: [PATCH 00/13] VIRTIO-IOMMU/VFIO: Don't assume 64b IOVA space

2023-09-05 Thread Alex Williamson
On Mon, 4 Sep 2023 10:03:43 +0200 Eric Auger wrote: > On x86, when assigning VFIO-PCI devices protected with virtio-iommu > we encounter the case where the guest tries to map IOVAs beyond 48b > whereas the physical VTD IOMMU only supports 48b. This ends up with > VFIO_MAP_DMA failures at qemu le

Re: [PATCH for-8.1] vfio/display: Fix missing update to set backing fields

2023-09-05 Thread Alex Williamson
On Mon, 4 Sep 2023 21:00:53 +0400 Marc-André Lureau wrote: > Hi > > On Mon, Sep 4, 2023 at 6:11 PM Alex Williamson > wrote: > > > > On Mon, 4 Sep 2023 15:06:21 +0400 > > Marc-André Lureau wrote: > > > > > Hi > > > > >

Re: [PATCH for-8.1] vfio/display: Fix missing update to set backing fields

2023-09-04 Thread Alex Williamson
with normal width/height. > > > > On 8/16/2023 3:31 PM, Philippe Mathieu-Daudé wrote: > > > On 16/8/23 23:55, Alex Williamson wrote: > > >> The below referenced commit renames scanout_width/height to > > >> backing_width/height, but also promotes these

Re: [8.1 regression] Re: [PULL 05/19] virtio-gpu-udmabuf: correct naming of QemuDmaBuf size properties

2023-08-21 Thread Alex Williamson
On Mon, 21 Aug 2023 14:20:38 +0400 Marc-André Lureau wrote: > Hi Alex > > On Thu, Aug 17, 2023 at 1:25 AM Alex Williamson > wrote: > > > > On Wed, 16 Aug 2023 15:08:10 -0600 > > Alex Williamson wrote: > > > > diff --git a/ui/egl-helpers.c b

[PATCH for-8.1] vfio/display: Fix missing update to set backing fields

2023-08-16 Thread Alex Williamson
screen when transitioning from ramfb to dmabuf display when using Intel vGPU with these features. Link: https://lists.gnu.org/archive/html/qemu-devel/2023-08/msg02726.html Fixes: 9ac06df8b684 ("virtio-gpu-udmabuf: correct naming of QemuDmaBuf size properties") Signed-off-by: Alex Williamson

Re: [8.1 regression] Re: [PULL 05/19] virtio-gpu-udmabuf: correct naming of QemuDmaBuf size properties

2023-08-16 Thread Alex Williamson
On Wed, 16 Aug 2023 15:08:10 -0600 Alex Williamson wrote: > > diff --git a/ui/egl-helpers.c b/ui/egl-helpers.c > > index 8f9fbf583e..3d19dbe382 100644 > > --- a/ui/egl-helpers.c > > +++ b/ui/egl-helpers.c > > @@ -314,9 +314,9 @@ void egl_dmabuf_imp

[8.1 regression] Re: [PULL 05/19] virtio-gpu-udmabuf: correct naming of QemuDmaBuf size properties

2023-08-16 Thread Alex Williamson
This commit introduces a regression when using GVT-g with the display and ramfb options. At the point where it appears the guest is switching from ramfb to the vGPU display, the display goes black and QEMU reports: qemu: eglCreateImageKHR failed This message occurs repeatedly. VM command line:

Re: [PATCH] vfio/pci: hide ROM BAR on SFC9220 10/40G Ethernet Controller PF

2023-08-09 Thread Alex Williamson
On Wed, 9 Aug 2023 14:07:07 +0200 Laszlo Ersek wrote: > On 8/8/23 17:40, Alex Williamson wrote: > > On Tue, 8 Aug 2023 16:59:16 +0200 > > Laszlo Ersek wrote: > > > >> The Solarflare Communications SFC9220 NIC's physical function (PF) appears >

Re: [PATCH] vfio/pci: hide ROM BAR on SFC9220 10/40G Ethernet Controller PF

2023-08-08 Thread Alex Williamson
during boot on i440fx/SeaBIOS (a relatively frequent scenario). > Users can restore the original behavior via the QEMU cmdline and the > libvirt domain XML. > > (In two years, we've not seen any customer interest in this bug, hence > there's no incentive to investigate (2).

Re: [PATCH RFC v1 1/3] vfio/pci: detect the support of dynamic MSI-X allocation

2023-07-28 Thread Alex Williamson
On Fri, 28 Jul 2023 10:27:17 +0200 Cédric Le Goater wrote: > On 7/28/23 10:09, Liu, Jing2 wrote: > > Hi Alex, > > > > Thanks very much for reviewing the patches. > > > >> On July 28, 2023 1:25 AM, Alex Williamson > >> wrote: > >> > &

Re: [PATCH RFC v1 1/3] vfio/pci: detect the support of dynamic MSI-X allocation

2023-07-27 Thread Alex Williamson
On Thu, 27 Jul 2023 03:24:08 -0400 Jing Liu wrote: > From: Reinette Chatre > > Kernel provides the guidance of dynamic MSI-X allocation support of > passthrough device, by clearing the VFIO_IRQ_INFO_NORESIZE flag to > guide user space. > > Fetch and store the flags from host for later use to d

Re: [PATCH RFC v1 3/3] vfio/pci: dynamic MSI-X allocation in interrupt restoring

2023-07-27 Thread Alex Williamson
On Thu, 27 Jul 2023 03:24:10 -0400 Jing Liu wrote: > During migration restoring, vfio_enable_vectors() is called to restore > enabling MSI-X interrupts for assigned devices. It sets the range from 0 > to nr_vectors to kernel to enable MSI-X and the vectors unmasked in > guest. During the MSI-X en

Re: [PATCH RFC v1 2/3] vfio/pci: enable vector on dynamic MSI-X allocation

2023-07-27 Thread Alex Williamson
On Thu, 27 Jul 2023 03:24:09 -0400 Jing Liu wrote: > The vector_use callback is used to enable vector that is unmasked in > guest. The kernel used to only support static MSI-X allocation. When > allocating a new interrupt using "static MSI-X allocation" kernels, > Qemu first disables all previous

Re: [PATCH] treewide: spelling fixes in comments and some strings

2023-07-14 Thread Alex Williamson
On Fri, 14 Jul 2023 21:50:01 +0300 Michael Tokarev wrote: > 14.07.2023 21:22, Alex Williamson wrote: > > On Fri, 14 Jul 2023 14:38:06 +0300 > > Michael Tokarev wrote: > > > >> diff --git a/hw/ppc/spapr_pci_vfio.c b/hw/ppc/spapr_pci_vfio.c > >> index d

Re: [PATCH] treewide: spelling fixes in comments and some strings

2023-07-14 Thread Alex Williamson
On Fri, 14 Jul 2023 14:38:06 +0300 Michael Tokarev wrote: > diff --git a/hw/ppc/spapr_pci_vfio.c b/hw/ppc/spapr_pci_vfio.c > index d8aeee0b7e..12e7790cf6 100644 > --- a/hw/ppc/spapr_pci_vfio.c > +++ b/hw/ppc/spapr_pci_vfio.c > @@ -39,7 +39,7 @@ static void spapr_phb_vfio_eeh_reenable(SpaprPhbStat

Re: [PATCH v2] vfio: Fix null pointer dereference bug in vfio_bars_finalize()

2023-07-06 Thread Alex Williamson
gion_finalize(&bar->region); > -if (bar->size) { > +if (bar->mr) { > +assert(bar->size); > object_unparent(OBJECT(bar->mr)); > g_free(bar->mr); > +bar->mr = NULL; > } > } > Reviewed-by: Alex Williamson

[PATCH] hw/vfio/pci-quirks: Sanitize capability pointer

2023-06-30 Thread Alex Williamson
for GPUDirect Cliques") Signed-off-by: Alex Williamson --- hw/vfio/pci-quirks.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/hw/vfio/pci-quirks.c b/hw/vfio/pci-quirks.c index 0ed2fcd53152..f4ff83680572 100644 --- a/hw/vfio/pci-quirks.c +++ b/hw/vfio/pci-quirks.c

Re: [PATCH v4 5/5] vfio/migration: Refactor and fix print of "Migration disabled"

2023-06-29 Thread Alex Williamson
On Thu, 29 Jun 2023 16:42:23 +0100 Joao Martins wrote: > On 29/06/2023 16:20, Avihai Horon wrote: > > On 29/06/2023 15:44, Joao Martins wrote: > >> On 29/06/2023 09:40, Zhenzhong Duan wrote: > >>> This patch refactors vfio_migration_realize() and its dependend code > >>> as follows: > >>> > >

Re: [PATCH v2 0/2] vfio/migration: Make VFIO migration non-experimental

2023-06-28 Thread Alex Williamson
igration/savevm.c| 1 + > migration/target.c| 17 ++- > hw/vfio/trace-events | 2 +- > 9 files changed, 97 insertions(+), 37 deletions(-) > Reviewed-by: Alex Williamson

[PATCH] MAINTAINERS: Promote Cédric to VFIO co-maintainer

2023-06-28 Thread Alex Williamson
Cédric has stepped up involvement in vfio, reviewing and managing patches, as well as pull requests. This work deserves gratitude and punishment with a promotion to co-maintainer ;) Signed-off-by: Alex Williamson --- Cédric, I'd also support if you wanted to add a tree entry

Re: [PATCH 3/3] vfio/migration: Make VFIO migration non-experimental

2023-06-27 Thread Alex Williamson
On Tue, 27 Jun 2023 11:00:46 +0300 Avihai Horon wrote: > On 26/06/2023 20:27, Alex Williamson wrote: > > External email: Use caution opening links or attachments > > > > > > On Mon, 26 Jun 2023 17:26:42 +0200 > > Cédric Le Goater wrote: > > &g

Re: [PATCH 3/3] vfio/migration: Make VFIO migration non-experimental

2023-06-26 Thread Alex Williamson
On Mon, 26 Jun 2023 17:26:42 +0200 Cédric Le Goater wrote: > On 6/26/23 15:40, Joao Martins wrote: > > On 26/06/2023 14:20, Cédric Le Goater wrote: > >> Hello Avihai, > >> > >> On 6/26/23 10:23, Avihai Horon wrote: > >>> The major parts of VFIO migration are supported today in QEMU. This > >>

Re: [PATCH v6 0/8] migration: Add switchover ack capability and VFIO precopy support

2023-06-21 Thread Alex Williamson
were given). > * Dropped patch #8 (x-allow-pre-copy property). (Alex) > * Adjusted patch #9 commit message according to drop of patch #8. > * Added R-b to patch #9 and Tested-by tags to the series. I think Cédric is going to handle the pull request for this, so... Acked-by: Alex Williamson

  1   2   3   4   5   6   7   8   9   10   >