* Re: Usage of vfio-pci without KVM.
[not found] <CAHzK-V2a-tW8BQBJNurf0QogTNYH3_oEg7HAfi-dSU_3D626Tw@mail.gmail.com>
@ 2023-09-12 12:47 ` Philippe Mathieu-Daudé
2023-09-12 12:57 ` Alex Williamson
0 siblings, 1 reply; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-09-12 12:47 UTC (permalink / raw)
To: Shlomo Pongratz, Cédric Le Goater, Alex Williamson
Cc: qemu-discuss, QEMU Developers
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 device using vfio-pci. I detached
> the device from the nvme driver and attached it to the vfio-pci.
> Using lspci I can see "Kernel driver in use: vfio-pci"
> In QEMU script I've written "-device vfio-pci,host=0000:03:00.0" where
> 0000:03:00.0 is the device PCI address.
> I get the error
> qemu-system-aarch64: -device vfio-pci,host=0000:03:00.0: VFIO_MAP_DMA
> failed: Invalid argument
> qemu-system-aarch64: -device vfio-pci,host=0000:03:00.0: vfio
> 0000:03:00.0: failed to setup container for group 15: memory listener
> initialization failed: Region mach-virt.ram:
> vfio_dma_map(0x55855c75bf00, 0x40000000, 0x100000000, 0x7f5197e00000)
> = -22 (Invalid argument
>
> My question is vfio-pci is supported with cross architecture?
>
> Thank you.
>
> S.P.
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Usage of vfio-pci without KVM.
2023-09-12 12:47 ` Usage of vfio-pci without KVM Philippe Mathieu-Daudé
@ 2023-09-12 12:57 ` Alex Williamson
2023-09-12 13:22 ` Shlomo Pongratz
0 siblings, 1 reply; 5+ messages in thread
From: Alex Williamson @ 2023-09-12 12:57 UTC (permalink / raw)
To: Philippe Mathieu-Daudé
Cc: Shlomo Pongratz, Cédric Le Goater, qemu-discuss,
QEMU Developers, Eric Auger
On Tue, 12 Sep 2023 14:47:41 +0200
Philippe Mathieu-Daudé <philmd@linaro.org> 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 device using vfio-pci. I detached
> > the device from the nvme driver and attached it to the vfio-pci.
> > Using lspci I can see "Kernel driver in use: vfio-pci"
> > In QEMU script I've written "-device vfio-pci,host=0000:03:00.0" where
> > 0000:03:00.0 is the device PCI address.
> > I get the error
> > qemu-system-aarch64: -device vfio-pci,host=0000:03:00.0: VFIO_MAP_DMA
> > failed: Invalid argument
> > qemu-system-aarch64: -device vfio-pci,host=0000:03:00.0: vfio
> > 0000:03:00.0: failed to setup container for group 15: memory listener
> > initialization failed: Region mach-virt.ram:
> > vfio_dma_map(0x55855c75bf00, 0x40000000, 0x100000000, 0x7f5197e00000)
> > = -22 (Invalid argument
> >
> > My question is vfio-pci is supported with cross architecture?
It does, but reserved address ranges need to be honored. x86 has a
reserved range at 0xfee00000 for MSI mapping, so the VM address space
needs to be such that it avoids trying to place mappings there. Thanks,
Alex
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Usage of vfio-pci without KVM.
2023-09-12 12:57 ` Alex Williamson
@ 2023-09-12 13:22 ` Shlomo Pongratz
2023-09-12 13:56 ` Alex Williamson
2023-09-15 12:01 ` Cédric Le Goater
0 siblings, 2 replies; 5+ messages in thread
From: Shlomo Pongratz @ 2023-09-12 13:22 UTC (permalink / raw)
To: Alex Williamson
Cc: Philippe Mathieu-Daudé, Cédric Le Goater, qemu-discuss,
QEMU Developers, Eric Auger
Hi,
What can I as a user do to honor this requirement.
Are you suggesting that I should patch the QEMU code as it is not
supported out of the box?
Thank you.
S.P.
On Tue, Sep 12, 2023 at 3:58 PM Alex Williamson
<alex.williamson@redhat.com> wrote:
>
> On Tue, 12 Sep 2023 14:47:41 +0200
> Philippe Mathieu-Daudé <philmd@linaro.org> 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 device using vfio-pci. I detached
> > > the device from the nvme driver and attached it to the vfio-pci.
> > > Using lspci I can see "Kernel driver in use: vfio-pci"
> > > In QEMU script I've written "-device vfio-pci,host=0000:03:00.0" where
> > > 0000:03:00.0 is the device PCI address.
> > > I get the error
> > > qemu-system-aarch64: -device vfio-pci,host=0000:03:00.0: VFIO_MAP_DMA
> > > failed: Invalid argument
> > > qemu-system-aarch64: -device vfio-pci,host=0000:03:00.0: vfio
> > > 0000:03:00.0: failed to setup container for group 15: memory listener
> > > initialization failed: Region mach-virt.ram:
> > > vfio_dma_map(0x55855c75bf00, 0x40000000, 0x100000000, 0x7f5197e00000)
> > > = -22 (Invalid argument
> > >
> > > My question is vfio-pci is supported with cross architecture?
>
> It does, but reserved address ranges need to be honored. x86 has a
> reserved range at 0xfee00000 for MSI mapping, so the VM address space
> needs to be such that it avoids trying to place mappings there. Thanks,
>
> Alex
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Usage of vfio-pci without KVM.
2023-09-12 13:22 ` Shlomo Pongratz
@ 2023-09-12 13:56 ` Alex Williamson
2023-09-15 12:01 ` Cédric Le Goater
1 sibling, 0 replies; 5+ messages in thread
From: Alex Williamson @ 2023-09-12 13:56 UTC (permalink / raw)
To: Shlomo Pongratz
Cc: Philippe Mathieu-Daudé, Cédric Le Goater, qemu-discuss,
QEMU Developers, Eric Auger
On Tue, 12 Sep 2023 16:22:27 +0300
Shlomo Pongratz <shlomopongratz@gmail.com> wrote:
> Hi,
> What can I as a user do to honor this requirement.
> Are you suggesting that I should patch the QEMU code as it is not
> supported out of the box?
You can reduce the VM memory, for example the mapping is starting at
1GB so using 2GB for the VM memory size would avoid the issue.
Understood that this isn't a very practical solution, but neither is
the original problem of needing to assign a high performance I/O device
to an emulated VM. Support for such configurations is not a high
priority. Thanks,
Alex
> On Tue, Sep 12, 2023 at 3:58 PM Alex Williamson
> <alex.williamson@redhat.com> wrote:
> >
> > On Tue, 12 Sep 2023 14:47:41 +0200
> > Philippe Mathieu-Daudé <philmd@linaro.org> 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 device using vfio-pci. I detached
> > > > the device from the nvme driver and attached it to the vfio-pci.
> > > > Using lspci I can see "Kernel driver in use: vfio-pci"
> > > > In QEMU script I've written "-device vfio-pci,host=0000:03:00.0" where
> > > > 0000:03:00.0 is the device PCI address.
> > > > I get the error
> > > > qemu-system-aarch64: -device vfio-pci,host=0000:03:00.0: VFIO_MAP_DMA
> > > > failed: Invalid argument
> > > > qemu-system-aarch64: -device vfio-pci,host=0000:03:00.0: vfio
> > > > 0000:03:00.0: failed to setup container for group 15: memory listener
> > > > initialization failed: Region mach-virt.ram:
> > > > vfio_dma_map(0x55855c75bf00, 0x40000000, 0x100000000, 0x7f5197e00000)
> > > > = -22 (Invalid argument
> > > >
> > > > My question is vfio-pci is supported with cross architecture?
> >
> > It does, but reserved address ranges need to be honored. x86 has a
> > reserved range at 0xfee00000 for MSI mapping, so the VM address space
> > needs to be such that it avoids trying to place mappings there. Thanks,
> >
> > Alex
> >
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Usage of vfio-pci without KVM.
2023-09-12 13:22 ` Shlomo Pongratz
2023-09-12 13:56 ` Alex Williamson
@ 2023-09-15 12:01 ` Cédric Le Goater
1 sibling, 0 replies; 5+ messages in thread
From: Cédric Le Goater @ 2023-09-15 12:01 UTC (permalink / raw)
To: Shlomo Pongratz, Alex Williamson
Cc: Philippe Mathieu-Daudé, qemu-discuss, QEMU Developers,
Eric Auger
On 9/12/23 15:22, Shlomo Pongratz wrote:
> Hi,
> What can I as a user do to honor this requirement.
> Are you suggesting that I should patch the QEMU code as it is not
> supported out of the box?
You could try to upgrade your test environment to use upstream edk2
and QEMU first and change your PCI topology. It does work on my setup,
RHEL9 x86_64 host, RHEL9 aarch64 guest with a NVMe passthrough, under
libvirt.
$ lspci -tv
-[0000:00]-+-00.0 Red Hat, Inc. QEMU PCIe Host bridge
+-01.0-[01]----00.0 Red Hat, Inc. Virtio 1.0 network device
+-01.1-[02]----00.0 Red Hat, Inc. QEMU XHCI Host Controller
+-01.2-[03]----00.0 Red Hat, Inc. Virtio 1.0 console
+-01.3-[04]----00.0 Red Hat, Inc. Virtio 1.0 block device
+-01.4-[05]----00.0 Red Hat, Inc. Virtio 1.0 memory balloon
+-01.5-[06]----00.0 Red Hat, Inc. Virtio 1.0 RNG
+-01.6-[07]--
+-01.7-[08]--
+-02.0-[09]----00.0 Micron/Crucial Technology P5 Plus NVMe PCIe SSD
+-02.1-[0a]--
+-02.2-[0b]--
+-02.3-[0c]--
+-02.4-[0d]--
\-02.5-[0e]--
Thanks
C.
>
> Thank you.
>
> S.P.
>
> On Tue, Sep 12, 2023 at 3:58 PM Alex Williamson
> <alex.williamson@redhat.com> wrote:
>>
>> On Tue, 12 Sep 2023 14:47:41 +0200
>> Philippe Mathieu-Daudé <philmd@linaro.org> 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 device using vfio-pci. I detached
>>>> the device from the nvme driver and attached it to the vfio-pci.
>>>> Using lspci I can see "Kernel driver in use: vfio-pci"
>>>> In QEMU script I've written "-device vfio-pci,host=0000:03:00.0" where
>>>> 0000:03:00.0 is the device PCI address.
>>>> I get the error
>>>> qemu-system-aarch64: -device vfio-pci,host=0000:03:00.0: VFIO_MAP_DMA
>>>> failed: Invalid argument
>>>> qemu-system-aarch64: -device vfio-pci,host=0000:03:00.0: vfio
>>>> 0000:03:00.0: failed to setup container for group 15: memory listener
>>>> initialization failed: Region mach-virt.ram:
>>>> vfio_dma_map(0x55855c75bf00, 0x40000000, 0x100000000, 0x7f5197e00000)
>>>> = -22 (Invalid argument
>>>>
>>>> My question is vfio-pci is supported with cross architecture?
>>
>> It does, but reserved address ranges need to be honored. x86 has a
>> reserved range at 0xfee00000 for MSI mapping, so the VM address space
>> needs to be such that it avoids trying to place mappings there. Thanks,
>>
>> Alex
>>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-09-15 12:02 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CAHzK-V2a-tW8BQBJNurf0QogTNYH3_oEg7HAfi-dSU_3D626Tw@mail.gmail.com>
2023-09-12 12:47 ` Usage of vfio-pci without KVM Philippe Mathieu-Daudé
2023-09-12 12:57 ` Alex Williamson
2023-09-12 13:22 ` Shlomo Pongratz
2023-09-12 13:56 ` Alex Williamson
2023-09-15 12:01 ` Cédric Le Goater
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 NNTP newsgroup(s).