On 2024/02/14 16:54, Michael S. Tsirkin wrote:
On Wed, Feb 14, 2024 at 02:13:45PM +0900, Akihiko Odaki wrote:
Release VFs failed to realize just as we do in unregister_vfs().
Fixes: 7c0fa8dff811 ("pcie: Add support for Single Root I/O Virtualization
(SR/IOV)")
Signed-off-by: Akihiko Odaki
I
On Wed, Feb 14, 2024 at 02:13:45PM +0900, Akihiko Odaki wrote:
> Release VFs failed to realize just as we do in unregister_vfs().
>
> Fixes: 7c0fa8dff811 ("pcie: Add support for Single Root I/O Virtualization
> (SR/IOV)")
> Signed-off-by: Akihiko Odaki
Is this fixing an old bug or a bug introdu
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 realization errors at PF
> realization time.
>
> Si
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 ("hw/nvme: Add support for the Virtualiza
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?
> Signed-off-by: Akihiko Odaki
> ---
> hw/pci/pcie_sriov.c | 1 -
> 1 file changed, 1 deletion(-)
>
>
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
> (SR/IOV)")
> Signed-off-by: Akihiko Odak
On Wed, Feb 14, 2024 at 02:13:40PM +0900, Akihiko Odaki wrote:
> vfio determines if rombar is explicitly enabled by inspecting QDict.
> Inspecting QDict is not nice because QDict is untyped and depends on the
> details on the external interface. Add an infrastructure to determine if
> rombar is exp
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
(SR/IOV)")
Signed-off-by: Akihiko Odaki
---
hw/pci/pcie_sriov.c | 3 +++
1 file changed, 3 insertions(+)
diff
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 ("hw/nvme: Add support for the Virtualization Management
command")
Signed-off-by: Akihiko Odaki
---
hw/nvme/ctr
Release VFs failed to realize just as we do in unregister_vfs().
Fixes: 7c0fa8dff811 ("pcie: Add support for Single Root I/O Virtualization
(SR/IOV)")
Signed-off-by: Akihiko Odaki
---
hw/pci/pcie_sriov.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/hw/pci/pcie_sriov.c b/hw/pci/pcie_sri
vfio determines if rombar is explicitly enabled by inspecting QDict.
Inspecting QDict is not nice because QDict is untyped and depends on the
details on the external interface. Add an infrastructure to determine if
rombar is explicitly enabled to hw/pci.
Signed-off-by: Akihiko Odaki
---
include/
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 realization errors at PF
realization time.
Signed-off-by: Akihiko Odaki
---
docs/pcie_sriov.txt | 8 ++--
in
I couldn't find such a behavior specified.
Signed-off-by: Akihiko Odaki
---
hw/pci/pcie_sriov.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/hw/pci/pcie_sriov.c b/hw/pci/pcie_sriov.c
index 9d668b8d6c17..410bc090fc58 100644
--- a/hw/pci/pcie_sriov.c
+++ b/hw/pci/pcie_sriov.c
@@ -209,7 +209,
Use pci_rom_bar_explicitly_enabled() to determine if rombar is explicitly
enabled.
Signed-off-by: Akihiko Odaki
---
hw/vfio/pci.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index 4fa387f0430d..647f15b2a060 100644
--- a/hw/vfio/pci.c
+++ b/
Currently there is no way to distinguish the case that rombar is
explicitly specified as 1 and the case that rombar is not specified.
Set rombar -1 by default to distinguish these cases just as it is done
for addr and romsize. It was confirmed that changing the default value
to -1 will not change
It is no longer used.
Signed-off-by: Akihiko Odaki
Reviewed-by: Philippe Mathieu-Daudé
---
include/hw/qdev-core.h | 4
hw/core/qdev.c | 1 -
system/qdev-monitor.c | 12 +++-
3 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/include/hw/qdev-core.h b/include/
I submitted a RFC series[1] to add support for SR-IOV emulation to
virtio-net-pci. During the development of the series, I fixed some
trivial bugs and made improvements that I think are independently
useful. This series extracts those fixes and improvements from the RFC
series. Below is an explanat
On Sat, 3 Feb 2024 at 06:30, Michael Tokarev wrote:
>
> 03.02.2024 12:01, Michael Tokarev wrote:
> ...
> > This change broke something in 7.2. I'm still debugging it, will
> > come with a follow-up once some more details are found, I'll also
> > check current master with and without this commit.
>
On 13/02/2024 13:03, Philippe Mathieu-Daudé wrote:
Inline cpu_create() in order to call
qdev_init_gpio_in_named_with_opaque()
before the CPU is realized.
Note that with the previous new patch included in the series,
qdev_init_gpio_in_named_with_opaque() should be replaced by
qdev_init_gpio_i
On 13/02/2024 13:03, Philippe Mathieu-Daudé wrote:
By passing a DeviceState context to a QDev IRQ handler,
we can simplify and use qdev_init_gpio_in_named() instead
of qdev_init_gpio_in_named_with_opaque().
Suggested-by: Mark Cave-Ayland
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sparc/le
On Tue, 13 Feb 2024, Philippe Mathieu-Daudé wrote:
We should not wire IRQs on unrealized device.
Signed-off-by: Philippe Mathieu-Daudé
Reviewed-by: Mark Cave-Ayland
Reviewed-by: BALATON Zoltan
---
hw/misc/macio/macio.c | 9 ++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --
On Tue, 13 Feb 2024, Philippe Mathieu-Daudé wrote:
We should not wire IRQs on unrealized device.
Signed-off-by: Philippe Mathieu-Daudé
Reviewed-by: BALATON Zoltan
---
hw/i386/pc_q35.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35
On 2/12/24 22:11, Philippe Mathieu-Daudé wrote:
Introduce the 'ich9' variable and inline ahci_get_num_ports().
Signed-off-by: Philippe Mathieu-Daudé
---
include/hw/ide/ahci.h | 1 -
hw/i386/pc_q35.c | 6 --
hw/ide/ahci.c | 8
hw/mips/boston.c | 6 --
4 f
On 2/12/24 22:11, Philippe Mathieu-Daudé wrote:
QDev API provides the DEVICE() macro to access the
'qdev' parent field of the PCIDevice structure.
Signed-off-by: Philippe Mathieu-Daudé
---
hw/i386/pc_q35.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Richard Hender
On 2024-02-13 08:12, Philippe Mathieu-Daudé wrote:
Keep "hw/ide/ahci.h" AHCI-generic.
Signed-off-by: Philippe Mathieu-Daudé
---
include/hw/arm/allwinner-a10.h | 2 +-
include/hw/arm/allwinner-r40.h | 2 +-
include/hw/arm/xlnx-zynqmp.h | 2 +-
include/hw/ide/ahci-sysbus.h | 35 ++
On 2024/02/13 19:59, Michael S. Tsirkin wrote:
On Mon, Feb 12, 2024 at 07:20:33PM +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
On 2024/02/13 17:51, Minwoo Im wrote:
-Original Message-
From: qemu-block-bounces+minwoo.im.dev=gmail@nongnu.org On Behalf Of Akihiko Odaki
Sent: Monday, February 12, 2024 7:21 PM
To: Philippe Mathieu-Daudé ; Michael S. Tsirkin
; Marcel Apfelbaum ; Alex
Williamson ; Cédric Le Goater
On 2/13/24 14:03, Philippe Mathieu-Daudé wrote:
Inline cpu_create() in order to call
qdev_init_gpio_in_named_with_opaque()
before the CPU is realized.
Signed-off-by: Philippe Mathieu-Daudé
Reviewed-by: Peter Maydell
Reviewed-by: Mark Cave-Ayland
---
hw/sparc64/sparc64.c | 4 +++-
1 file
On 2/13/24 14:03, Philippe Mathieu-Daudé wrote:
We should not wire IRQs on unrealized device.
Signed-off-by: Philippe Mathieu-Daudé > ---
hw/i386/pc_q35.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 7ca3f465e0..b7c69d
We should not wire IRQs on unrealized device.
Signed-off-by: Philippe Mathieu-Daudé
Reviewed-by: Mark Cave-Ayland
---
hw/misc/macio/macio.c | 9 ++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c
index c9f22f8515..3f449f91c0 100
Inline cpu_create() in order to call
qdev_init_gpio_in_named_with_opaque()
before the CPU is realized.
Signed-off-by: Philippe Mathieu-Daudé
Reviewed-by: Peter Maydell
Reviewed-by: Mark Cave-Ayland
---
hw/sparc64/sparc64.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/
By passing a DeviceState context to a QDev IRQ handler,
we can simplify and use qdev_init_gpio_in_named() instead
of qdev_init_gpio_in_named_with_opaque().
Suggested-by: Mark Cave-Ayland
Signed-off-by: Philippe Mathieu-Daudé
---
hw/sparc/leon3.c | 10 --
1 file changed, 4 insertions(+),
Inline cpu_create() in order to call
qdev_init_gpio_in_named_with_opaque()
before the CPU is realized.
Signed-off-by: Philippe Mathieu-Daudé
Reviewed-by: Peter Maydell
Reviewed-by: Mark Cave-Ayland
---
hw/sparc/leon3.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/hw
We should not wire IRQs on unrealized device.
Signed-off-by: Philippe Mathieu-Daudé
Reviewed-by: Peter Maydell
Reviewed-by: Mark Cave-Ayland
---
hw/ppc/prep.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c
index 1a6cd05c61..4eb5477069 100644
-
We should not wire IRQs on unrealized device.
Signed-off-by: Philippe Mathieu-Daudé
Reviewed-by: Peter Maydell
Reviewed-by: Mark Cave-Ayland
---
hw/sparc/sun4m.c | 7 +--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c
index e782c8ec7a..d52
We should not wire IRQs on unrealized device.
Signed-off-by: Philippe Mathieu-Daudé
Reviewed-by: Peter Maydell
Reviewed-by: Mark Cave-Ayland
---
hw/sparc/leon3.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c
index 2dfb742566..0df5fc
We should not wire IRQs on unrealized device.
Signed-off-by: Philippe Mathieu-Daudé
Reviewed-by: Peter Maydell
Reviewed-by: Yoshinori Sato
---
hw/sh4/r2d.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/sh4/r2d.c b/hw/sh4/r2d.c
index e9f316a6ce..c73e8f49b8 100644
--- a/
We should not wire IRQs on unrealized device.
Signed-off-by: Philippe Mathieu-Daudé
---
hw/i386/pc_q35.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 7ca3f465e0..b7c69d55d6 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
Instead of filling an array of all the possible IRQs, only call
qdev_get_gpio_in() when an IRQ is used. Remove the array from
RX62NState. Doing so we avoid calling qdev_get_gpio_in() on an
unrealized device.
Signed-off-by: Philippe Mathieu-Daudé
Reviewed-by: Peter Maydell
Reviewed-by: Yoshinori
"qemu/units.h" is not used in the "hw/rx/rx62n.h"
header, include it in the source where it is.
Signed-off-by: Philippe Mathieu-Daudé
Reviewed-by: Peter Maydell
Reviewed-by: Yoshinori Sato
---
include/hw/rx/rx62n.h | 1 -
hw/rx/rx-gdbsim.c | 1 +
hw/rx/rx62n.c | 1 +
3 files change
QEMU coding style recommend using structure typedefs:
https://www.qemu.org/docs/master/devel/style.html#typedefs
Signed-off-by: Philippe Mathieu-Daudé
Reviewed-by: Peter Maydell
---
hw/ide/ich.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/ide/ich.c b/hw/ide/ich.
Missing review: 4, 12
Since v1:
- Addressed Zoltan review comments
- Addressed Mark suggestion
- Added R-b tags
Hi,
This series ensure following is called *before* a
device is realized:
- qbus_new()
- sysbus_init_mmio()
- qdev_init_gpio_in_named_with_opaque()
and these are called *after* it is:
On 9/2/24 23:01, Mark Cave-Ayland wrote:
On 09/02/2024 11:34, Peter Maydell wrote:
On Thu, 8 Feb 2024 at 18:14, Philippe Mathieu-Daudé
wrote:
Inline cpu_create() in order to call
qdev_init_gpio_in_named_with_opaque()
before the CPU is realized.
Signed-off-by: Philippe Mathieu-Daudé
---
h
On 2024/02/13 17:51, Minwoo Im wrote:
-Original Message-
From: qemu-block-bounces+minwoo.im.dev=gmail@nongnu.org On Behalf Of Akihiko Odaki
Sent: Monday, February 12, 2024 7:21 PM
To: Philippe Mathieu-Daudé ; Michael S. Tsirkin
; Marcel Apfelbaum ; Alex
Williamson ; Cédric Le Goater
On 2024/02/13 20:01, Michael S. Tsirkin wrote:
On Mon, Feb 12, 2024 at 07:20:34PM +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
On 2024/02/13 19:52, Michael S. Tsirkin wrote:
On Mon, Feb 12, 2024 at 07:20:30PM +0900, Akihiko Odaki wrote:
vfio determines if rombar is explicitly enabled by inspecting QDict.
Inspecting QDict is not nice because QDict is untyped and depends on the
details on the external interface. Add an in
On Tue, Feb 13, 2024 at 09:11:51AM +0100, Philippe Mathieu-Daudé wrote:
> - Split 'ahci.h' as sysbus / pci
> - Inline ahci_get_num_ports()
> - Directly use AHCIState::ports instead of SysbusAHCIState::num_ports
PC part:
Reviewed-by: Michael S. Tsirkin
feel free to merge with rest of patches.
On Mon, Feb 12, 2024 at 07:20:34PM +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 realization errors at PF
> realization time.
>
> Si
On Mon, Feb 12, 2024 at 07:20:33PM +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
> (SR/IOV)")
> Signed-off-by: Akihiko Odak
On Mon, Feb 12, 2024 at 07:20:30PM +0900, Akihiko Odaki wrote:
> vfio determines if rombar is explicitly enabled by inspecting QDict.
> Inspecting QDict is not nice because QDict is untyped and depends on the
> details on the external interface. Add an infrastructure to determine if
> rombar is exp
> -Original Message-
> From: qemu-block-bounces+minwoo.im.dev=gmail@nongnu.org bounces+minwoo.im.dev=gmail@nongnu.org> On Behalf Of Akihiko Odaki
> Sent: Monday, February 12, 2024 7:21 PM
> To: Philippe Mathieu-Daudé ; Michael S. Tsirkin
> ; Marcel Apfelbaum ; Alex
> Williamson ; C
Introduce the 'ich9' variable and inline ahci_get_num_ports().
Signed-off-by: Philippe Mathieu-Daudé
---
include/hw/ide/ahci.h | 1 -
hw/i386/pc_q35.c | 6 --
hw/ide/ahci.c | 8
hw/mips/boston.c | 6 --
4 files changed, 8 insertions(+), 13 deletions(-)
diff --
Since ahci_ide_create_devs() is not PCI specific, pass
it an AHCIState argument instead of PCIDevice.
Signed-off-by: Philippe Mathieu-Daudé
---
include/hw/ide/ahci.h | 2 +-
hw/i386/pc_q35.c | 2 +-
hw/ide/ahci.c | 5 +
hw/mips/boston.c | 2 +-
4 files changed, 4 insertions
QDev API provides the DEVICE() macro to access the
'qdev' parent field of the PCIDevice structure.
Signed-off-by: Philippe Mathieu-Daudé
---
hw/i386/pc_q35.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 7ca3f465e0..33a4413708 1
Explicitly set AHCIState::ports before calling ahci_realize().
Signed-off-by: Philippe Mathieu-Daudé
---
hw/ide/ahci_internal.h | 2 +-
hw/ide/ahci.c | 9 +
hw/ide/ich.c | 3 ++-
3 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/hw/ide/ahci_internal.h b/hw
No need to duplicate AHCIState::ports, directly access it.
Signed-off-by: Philippe Mathieu-Daudé
---
include/hw/ide/ahci.h | 1 -
hw/ide/ahci.c | 3 +--
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/include/hw/ide/ahci.h b/include/hw/ide/ahci.h
index 604d3a0994..c0b10c2bb
AHCIState::ports should be unsigned. Besides, we never
check it for negative value. It is unlikely it was ever
used with more than INT32_MAX ports, so it is safe to
convert it to unsigned.
Signed-off-by: Philippe Mathieu-Daudé
---
include/hw/ide/ahci.h | 2 +-
hw/ide/ahci.c | 4 ++--
2 f
We want to access AHCIPCIState::ahci field. In order to keep
the code simple (avoiding &ahci->ahci), rename the current
'ahci' variable as 'pdev'
Signed-off-by: Philippe Mathieu-Daudé
---
hw/i386/pc_q35.c | 15 ---
hw/mips/boston.c | 10 +-
2 files changed, 13 insertions(+),
Keep "hw/ide/ahci.h" AHCI-generic.
Signed-off-by: Philippe Mathieu-Daudé
---
include/hw/arm/allwinner-a10.h | 2 +-
include/hw/arm/allwinner-r40.h | 2 +-
include/hw/arm/xlnx-zynqmp.h | 2 +-
include/hw/ide/ahci-sysbus.h | 35 ++
include/hw/ide/ahci.h
- Split 'ahci.h' as sysbus / pci
- Inline ahci_get_num_ports()
- Directly use AHCIState::ports instead of SysbusAHCIState::num_ports
Philippe Mathieu-Daudé (9):
hw/i386/q35: Use DEVICE() cast macro with PCIDevice object
hw/ide/ahci: Expose AHCIPCIState structure
hw/ide/ahci: Rename AHCI PCI
In order to be able to QOM-embed a structure, we need
its full definition. Move it from "ahci_internal.h"
to the new "hw/ide/ahci-pci.h" header.
Signed-off-by: Philippe Mathieu-Daudé
---
hw/ide/ahci_internal.h| 8
include/hw/ide/ahci-pci.h | 22 ++
include/hw/id
61 matches
Mail list logo