[PATCH 2/3] hw/nvme: Support SR-IOV VFs more than 127

2024-02-14 Thread Minwoo Im
From: Minwoo Im The number of virtual functions(VFs) supported in SR-IOV is 64k as per spec. To test a large number of MSI-X vectors mapping to CPU matrix in the QEMU system, we need much more than 127 VFs. This patch made support for 256 VFs per a physical function(PF). Signed-off-by: Minwoo

[PATCH 3/3] hw/nvme: Expand VI/VQ resource to uint32

2024-02-14 Thread Minwoo Im
From: Minwoo Im VI and VQ resources cover queue resources in each VFs in SR-IOV. Current maximum I/O queue pair size is 0x, we can expand them to cover the full number of I/O queue pairs. This patch also fixed Identify Secondary Controller List overflow due to expand of number of secondary c

[PATCH 0/3] hw/nvme: FDP and SR-IOV enhancements

2024-02-14 Thread Minwoo Im
Hello, This patchset includes patches for adding Identify data for the recently added Endurance Group (endgrpid=1) used in FDP, and patches for increasing the maximum number of SR-IOV VF Resources to support more resources to enable testing as recent SSDs. Thanks, Minwoo Im (3): hw/nvme: add I

[PATCH 1/3] hw/nvme: add Identify Endurance Group List

2024-02-14 Thread Minwoo Im
From: Minwoo Im Commit 73064edfb864 ("hw/nvme: flexible data placement emulation") intorudced NVMe FDP feature to nvme-subsys and nvme-ctrl with a single endurance group #1 supported. This means that controller should return proper identify data to host with Identify Endurance Group List (CNS 19

Re: [PATCH v4 9/9] hw/nvme: Refer to dev->exp.sriov_pf.num_vfs

2024-02-14 Thread Akihiko Odaki
On 2024/02/15 1:34, Michael S. Tsirkin wrote: On Thu, Feb 15, 2024 at 01:07:29AM +0900, Akihiko Odaki wrote: On 2024/02/15 0:46, Michael S. Tsirkin wrote: On Wed, Feb 14, 2024 at 11:09:50PM +0900, Akihiko Odaki wrote: On 2024/02/14 16:07, Michael S. Tsirkin wrote: On Wed, Feb 14, 2024 at 02:1

Re: [PATCH v4 9/9] hw/nvme: Refer to dev->exp.sriov_pf.num_vfs

2024-02-14 Thread Michael S. Tsirkin
On Thu, Feb 15, 2024 at 01:07:29AM +0900, Akihiko Odaki wrote: > On 2024/02/15 0:46, Michael S. Tsirkin wrote: > > On Wed, Feb 14, 2024 at 11:09:50PM +0900, Akihiko Odaki wrote: > > > On 2024/02/14 16:07, Michael S. Tsirkin wrote: > > > > On Wed, Feb 14, 2024 at 02:13:47PM +0900, Akihiko Odaki wrot

Re: [PATCH v4 5/9] pcie_sriov: Validate NumVFs

2024-02-14 Thread Akihiko Odaki
On 2024/02/15 0:54, Michael S. Tsirkin wrote: On Wed, Feb 14, 2024 at 11:49:52PM +0900, Akihiko Odaki wrote: On 2024/02/14 15:52, Michael S. Tsirkin wrote: On Wed, Feb 14, 2024 at 02:13:43PM +0900, Akihiko Odaki wrote: The guest may write NumVFs greater than TotalVFs and that can lead to buffe

Re: [PATCH v4 8/9] pcie_sriov: Do not reset NumVFs after unregistering VFs

2024-02-14 Thread Akihiko Odaki
On 2024/02/15 0:51, Michael S. Tsirkin wrote: On Wed, Feb 14, 2024 at 11:32:11PM +0900, Akihiko Odaki wrote: On 2024/02/14 15:53, Michael S. Tsirkin wrote: On Wed, Feb 14, 2024 at 02:13:46PM +0900, Akihiko Odaki wrote: I couldn't find such a behavior specified. Is it fixing a bug or just rem

Re: [PATCH v4 9/9] hw/nvme: Refer to dev->exp.sriov_pf.num_vfs

2024-02-14 Thread Akihiko Odaki
On 2024/02/15 0:46, Michael S. Tsirkin wrote: On Wed, Feb 14, 2024 at 11:09:50PM +0900, Akihiko Odaki wrote: On 2024/02/14 16:07, Michael S. Tsirkin wrote: On Wed, Feb 14, 2024 at 02:13:47PM +0900, Akihiko Odaki wrote: NumVFs may not equal to the current effective number of VFs because VF Enab

Re: [PATCH v4 5/9] pcie_sriov: Validate NumVFs

2024-02-14 Thread Michael S. Tsirkin
On Wed, Feb 14, 2024 at 06:53:43PM +0300, Michael Tokarev wrote: > Nope, I don't remember how to request a CVE ;) https://www.qemu.org/contribute/security-process/

Re: [PATCH v4 5/9] pcie_sriov: Validate NumVFs

2024-02-14 Thread Michael S. Tsirkin
On Wed, Feb 14, 2024 at 11:49:52PM +0900, Akihiko Odaki wrote: > On 2024/02/14 15:52, Michael S. Tsirkin wrote: > > On Wed, Feb 14, 2024 at 02:13:43PM +0900, Akihiko Odaki wrote: > > > The guest may write NumVFs greater than TotalVFs and that can lead > > > to buffer overflow in VF implementations.

Re: [PATCH v4 5/9] pcie_sriov: Validate NumVFs

2024-02-14 Thread Michael Tokarev
14.02.2024 17:54, Akihiko Odaki wrote: On 2024/02/14 17:58, Michael Tokarev wrote: 14.02.2024 08:13, Akihiko Odaki wrote: The guest may write NumVFs greater than TotalVFs and that can lead to buffer overflow in VF implementations. This seems to be stable-worthy (Cc'd), and maybe even CVE-wort

Re: [PATCH v4 8/9] pcie_sriov: Do not reset NumVFs after unregistering VFs

2024-02-14 Thread Michael S. Tsirkin
On Wed, Feb 14, 2024 at 11:32:11PM +0900, Akihiko Odaki wrote: > On 2024/02/14 15:53, Michael S. Tsirkin wrote: > > On Wed, Feb 14, 2024 at 02:13:46PM +0900, Akihiko Odaki wrote: > > > I couldn't find such a behavior specified. > > > > Is it fixing a bug or just removing unnecessary code? > > Is t

Re: [PATCH v4 9/9] hw/nvme: Refer to dev->exp.sriov_pf.num_vfs

2024-02-14 Thread Michael S. Tsirkin
On Wed, Feb 14, 2024 at 11:09:50PM +0900, Akihiko Odaki wrote: > On 2024/02/14 16:07, Michael S. Tsirkin wrote: > > On Wed, Feb 14, 2024 at 02:13:47PM +0900, Akihiko Odaki wrote: > > > NumVFs may not equal to the current effective number of VFs because VF > > > Enable is cleared, NumVFs is set afte

Re: [PATCH v4 5/9] pcie_sriov: Validate NumVFs

2024-02-14 Thread Akihiko Odaki
On 2024/02/14 17:58, Michael Tokarev wrote: 14.02.2024 08:13, Akihiko Odaki wrote: The guest may write NumVFs greater than TotalVFs and that can lead to buffer overflow in VF implementations. This seems to be stable-worthy (Cc'd), and maybe even CVE-worthy? Perhaps so. The scope of the bug i

Re: [PATCH v4 5/9] pcie_sriov: Validate NumVFs

2024-02-14 Thread Akihiko Odaki
On 2024/02/14 15:52, Michael S. Tsirkin wrote: On Wed, Feb 14, 2024 at 02:13:43PM +0900, Akihiko Odaki wrote: The guest may write NumVFs greater than TotalVFs and that can lead to buffer overflow in VF implementations. Fixes: 7c0fa8dff811 ("pcie: Add support for Single Root I/O Virtualization

Re: [PATCH v4 6/9] pcie_sriov: Reuse SR-IOV VF device instances

2024-02-14 Thread Akihiko Odaki
On 2024/02/14 16:54, Michael S. Tsirkin wrote: On Wed, Feb 14, 2024 at 02:13:44PM +0900, Akihiko Odaki wrote: Disable SR-IOV VF devices by reusing code to power down PCI devices instead of removing them when the guest requests to disable VFs. This allows to realize devices and report VF realizat

Re: [PATCH v4 8/9] pcie_sriov: Do not reset NumVFs after unregistering VFs

2024-02-14 Thread Akihiko Odaki
On 2024/02/14 15:53, Michael S. Tsirkin wrote: On Wed, Feb 14, 2024 at 02:13:46PM +0900, Akihiko Odaki wrote: I couldn't find such a behavior specified. Is it fixing a bug or just removing unnecessary code? Is this guest visible at all? My intention is just to remove unnecessary code, but it

Re: [PATCH v4 9/9] hw/nvme: Refer to dev->exp.sriov_pf.num_vfs

2024-02-14 Thread Akihiko Odaki
On 2024/02/14 16:07, Michael S. Tsirkin wrote: On Wed, Feb 14, 2024 at 02:13:47PM +0900, Akihiko Odaki wrote: NumVFs may not equal to the current effective number of VFs because VF Enable is cleared, NumVFs is set after VF Enable is set, or NumVFs is greater than TotalVFs. Fixes: 11871f53ef8e (

[PULL 28/60] hw/block/fdc-isa: Implement relocation and enabling/disabling for TYPE_ISA_FDC

2024-02-14 Thread Michael S. Tsirkin
From: Bernhard Beschow The real SuperI/O chips emulated by QEMU allow for relocating and enabling or disabling their SuperI/O functions via software. So far this is not implemented. Prepare for that by adding isa_fdc_set_{enabled,iobase}. Signed-off-by: Bernhard Beschow Message-Id: <20240114123

[PULL 22/60] hw/block/fdc-isa: Move portio_list from FDCtrl to FDCtrlISABus

2024-02-14 Thread Michael S. Tsirkin
From: Bernhard Beschow FDCtrl::portio_list isn't used inside FDCtrl context but only inside FDCtrlISABus context, so move it there. Signed-off-by: Bernhard Beschow Reviewed-by: BALATON Zoltan Message-Id: <20240114123911.4877-2-shen...@gmail.com> Reviewed-by: Michael S. Tsirkin Signed-off-by:

[PULL 23/60] hw/block/fdc-sysbus: Move iomem from FDCtrl to FDCtrlSysBus

2024-02-14 Thread Michael S. Tsirkin
From: Bernhard Beschow FDCtrl::iomem isn't used inside FDCtrl context but only inside FDCtrlSysBus context, so move it there. Signed-off-by: Bernhard Beschow Reviewed-by: BALATON Zoltan Message-Id: <20240114123911.4877-3-shen...@gmail.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michae

Re: [PATCH v4 5/9] pcie_sriov: Validate NumVFs

2024-02-14 Thread Michael Tokarev
14.02.2024 08:13, Akihiko Odaki wrote: The guest may write NumVFs greater than TotalVFs and that can lead to buffer overflow in VF implementations. This seems to be stable-worthy (Cc'd), and maybe even CVE-worthy? Thanks, /mjt Fixes: 7c0fa8dff811 ("pcie: Add support for Single Root I/O Virt