Re: [PATCH v2 22/43] hw/isa/piix3: Rename piix3_reset() for sharing with PIIX4

2022-10-23 Thread Philippe Mathieu-Daudé
On 22/10/22 17:04, Bernhard Beschow wrote: Signed-off-by: Bernhard Beschow --- hw/isa/piix3.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Philippe Mathieu-Daudé

[PATCH v2 22/43] hw/isa/piix3: Rename piix3_reset() for sharing with PIIX4

2022-10-23 Thread Bernhard Beschow
Signed-off-by: Bernhard Beschow --- hw/isa/piix3.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/isa/piix3.c b/hw/isa/piix3.c index 8dbf22eaab..5214a75891 100644 --- a/hw/isa/piix3.c +++ b/hw/isa/piix3.c @@ -156,7 +156,7 @@ static void

[PATCH v2 39/43] hw/isa/piix: Rename functions to be shared for interrupt triggering

2022-10-23 Thread Bernhard Beschow
PIIX4 will get the same optimizations which are already implemented for PIIX3. Signed-off-by: Bernhard Beschow --- hw/isa/piix.c | 56 +-- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/hw/isa/piix.c b/hw/isa/piix.c index

Re: [PATCH v2 24/43] hw/isa/piix3: Rename typedef PIIX3State to PIIXState

2022-10-23 Thread Philippe Mathieu-Daudé
On 22/10/22 17:04, Bernhard Beschow wrote: This commit marks the finalization of the PIIX3 preparations to be merged with PIIX4. In particular, PIIXState is prepared to be reused in piix4.c. Signed-off-by: Bernhard Beschow --- hw/isa/piix3.c| 58

[PATCH v2 19/43] hw/isa/piix3: Allow board to provide PCI interrupt routes

2022-10-23 Thread Bernhard Beschow
PIIX3 initializes the PIRQx route control registers to the default values as described in the 82371AB PCI-TO-ISA/IDE XCELERATOR (PIIX4) April 1997 manual. PIIX4, however, initializes the routes according to the Malta™ User’s Manual, ch 6.6, which are IRQs 10 and 11. In order to allow the reset

Re: [PATCH v2 18/43] hw/isa/piix3: Remove unused include

2022-10-23 Thread Philippe Mathieu-Daudé
On 22/10/22 17:04, Bernhard Beschow wrote: Ammends commit 988fb613215993dd0ce642b89ca8182c479d39dd. Signed-off-by: Bernhard Beschow --- hw/isa/piix3.c | 1 - 1 file changed, 1 deletion(-) Reviewed-by: Philippe Mathieu-Daudé

[PATCH v2 34/43] hw/isa/piix4: Rename reset control operations to match PIIX3

2022-10-23 Thread Bernhard Beschow
Both implementations are the same and will be shared upon merging. Signed-off-by: Bernhard Beschow --- hw/isa/piix4.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index a7d52c5294..2f5b6fc934 100644 --- a/hw/isa/piix4.c +++

[PATCH v2 08/43] hw/ide/piix: Introduce TYPE_ macros for PIIX IDE controllers

2022-10-23 Thread Bernhard Beschow
Suggested-by: Mark Cave-Ayland Signed-off-by: Bernhard Beschow --- hw/i386/pc_piix.c | 3 ++- hw/ide/piix.c | 5 +++-- hw/isa/piix4.c| 3 ++- include/hw/ide/piix.h | 7 +++ 4 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 include/hw/ide/piix.h diff

Re: [RFC v3 2/2] virtio-blk: add zoned storage emulation for zoned devices

2022-10-23 Thread Sam Li
Dmitry Fomichev 于2022年10月23日周日 10:08写道: > > On Tue, 2022-10-18 at 16:56 +0800, Sam Li wrote: > > Dmitry Fomichev 于2022年10月17日周一 09:01写道: > > > > > > On Sun, 2022-10-16 at 23:05 +0800, Sam Li wrote: > > > > This patch extends virtio-blk emulation to handle zoned device commands > > > > by calling

Re: [PATCH v3 2/2] error handling: Use RETRY_ON_EINTR() macro where applicable

2022-10-23 Thread Nikita Ivanov
Hi! Thanks for clarification! Corrected it in v4. On Wed, Oct 19, 2022 at 6:24 PM Christian Schoenebeck < qemu_...@crudebyte.com> wrote: > On Tuesday, October 18, 2022 10:43:41 AM CEST Nikita Ivanov wrote: > > There is a defined RETRY_ON_EINTR() macro in qemu/osdep.h > > which handles the same

[PATCH v2 02/43] hw/i386/pc_piix: Allow for setting properties before realizing PIIX3 south bridge

2022-10-23 Thread Bernhard Beschow
The next patches will need to take advantage of it. Signed-off-by: Bernhard Beschow Reviewed-by: Peter Maydell --- hw/i386/pc_piix.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 7a55b9ca8e..5caef9bfc9 100644 ---

Re: [PATCH v12 6/7] qemu-iotests: test new zone operations

2022-10-23 Thread Dmitry Fomichev
On Tue, 2022-10-18 at 16:41 +0800, Sam Li wrote: > Dmitry Fomichev 于2022年10月17日周一 08:57写道: > > > > On Sun, 2022-10-16 at 22:51 +0800, Sam Li wrote: > > > We have added new block layer APIs of zoned block devices. > > > Test it with: > > > Create a null_blk device, run each zone operation on it

[PATCH v2 37/43] hw/isa/piix: Harmonize names of reset control memory regions

2022-10-23 Thread Bernhard Beschow
There is no need for having different names here. Having the same name further allows code to be shared between PIIX3 and PIIX4. Signed-off-by: Bernhard Beschow --- hw/isa/piix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/isa/piix.c b/hw/isa/piix.c index

[PATCH v2 23/43] hw/isa/piix3: Prefix pci_slot_get_pirq() with "piix3_"

2022-10-23 Thread Bernhard Beschow
The additional prefix aligns the function name with both other piix3-internal functions as well as QEMU conventions. Furthermore, it will help to distinguish the function from its PIIX4 counterpart once merged. Signed-off-by: Bernhard Beschow --- hw/isa/piix3.c | 4 ++-- 1 file changed, 2

[PATCH v2 20/43] hw/isa/piix3: Resolve redundant PIIX_NUM_PIC_IRQS

2022-10-23 Thread Bernhard Beschow
PIIX_NUM_PIC_IRQS is assumed to be the same as ISA_NUM_IRQS, otherwise inconsistencies can occur. Signed-off-by: Bernhard Beschow --- hw/isa/piix3.c| 8 include/hw/southbridge/piix.h | 5 ++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git

[PATCH v2 17/43] hw/isa/piix3: Wire up ACPI interrupt internally

2022-10-23 Thread Bernhard Beschow
Now that PIIX3 has the PIC integrated, the ACPI controller can be wired up internally. Signed-off-by: Bernhard Beschow --- hw/i386/pc_piix.c | 1 - hw/isa/piix3.c| 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index

[PATCH v2 05/43] hw/isa/piix3: Modernize reset handling

2022-10-23 Thread Bernhard Beschow
Rather than registering the reset handler via a function which appends the handler to a global list, prefer to implement it as a virtual method - PIIX4 does the same already. Note that this means that piix3_reset can now also be called writing to the relevant configuration space register on a PCI

[PATCH v2 43/43] hw/i386/acpi-build: Resolve PIIX ISA bridge rather than ACPI controller

2022-10-23 Thread Bernhard Beschow
Resolving the PIIX ISA bridge rather than the PIIX ACPI controller mirrors the ICH9 code one line below. Signed-off-by: Bernhard Beschow --- hw/i386/acpi-build.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index

[PATCH v2 29/43] hw/isa/piix4: Make PIIX4's ACPI and USB functions optional

2022-10-23 Thread Bernhard Beschow
This aligns PIIX4 with PIIX3. Signed-off-by: Bernhard Beschow --- hw/isa/piix4.c | 44 hw/mips/malta.c | 6 -- 2 files changed, 36 insertions(+), 14 deletions(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index a7389ff193..fc698c23be 100644

[PATCH v2 15/43] hw/isa/piix3: Create ISA PIC in host device

2022-10-23 Thread Bernhard Beschow
Use the newly introduced i8259 proxy "isa-pic" which allows for wiring up devices in the southbridge where the virtualization technology used (KVM, TCG, Xen) is not yet known. Signed-off-by: Bernhard Beschow --- hw/i386/pc_piix.c | 15 +-- hw/isa/Kconfig|

[PATCH v2 00/43] Consolidate PIIX south bridges

2022-10-23 Thread Bernhard Beschow
This series consolidates the implementations of the PIIX3 and PIIX4 south bridges and is an extended version of [1]. The motivation is to share as much code as possible and to bring both device models to feature parity such that perhaps PIIX4 can become a drop-in-replacement for PIIX3 in the pc

[PATCH v2 31/43] hw/isa/piix4: Remove unused code

2022-10-23 Thread Bernhard Beschow
The Malta board, which is the only user of PIIX4, doesn't connect to the exported interrupt lines. Signed-off-by: Bernhard Beschow --- hw/isa/piix4.c | 8 1 file changed, 8 deletions(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index 57b0b98bef..d65f486008 100644 ---

[PATCH v2 28/43] hw/isa/piix4: Move pci_ide_create_devs() call to board code

2022-10-23 Thread Bernhard Beschow
For the VIA south bridges there was a comment to have the call in board code. Move it there for PIIX4 as well for consistency. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé --- hw/isa/piix4.c | 1 - hw/mips/malta.c | 10 ++ 2 files changed, 6 insertions(+), 5

[PATCH v2 11/43] hw/i386/pc: No need for rtc_state to be an out-parameter

2022-10-23 Thread Bernhard Beschow
Now that the RTC is created as part of the southbridges it doesn't need to be an out-parameter any longer. Signed-off-by: Bernhard Beschow Reviewed-by: Peter Maydell --- hw/i386/pc.c | 12 ++-- hw/i386/pc_piix.c| 2 +- hw/i386/pc_q35.c | 2 +- include/hw/i386/pc.h |

[PATCH v2 42/43] hw/isa/piix: Drop the "3" from the PIIX base class

2022-10-23 Thread Bernhard Beschow
Now that the base class is used for both PIIX3 and PIIX4, the "3" became misleading. Signed-off-by: Bernhard Beschow --- hw/i386/acpi-build.c | 2 +- hw/isa/piix.c | 8 include/hw/southbridge/piix.h | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-)

[PATCH v2 16/43] hw/isa/piix3: Create IDE controller in host device

2022-10-23 Thread Bernhard Beschow
Now that PIIX3 contains the new isa-pic, it is possible to instantiate PIIX3 IDE in the PIIX3 southbridge. PIIX3 IDE wires up its interrupts to the ISA bus in its realize method which requires the interrupt controller to provide fully populated qemu_irqs. This is the case for isa-pic even though

[PATCH v2 26/43] meson: Fix dependencies of piix4 southbridge

2022-10-23 Thread Bernhard Beschow
Signed-off-by: Bernhard Beschow --- configs/devices/mips-softmmu/common.mak | 1 - hw/isa/Kconfig | 6 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/configs/devices/mips-softmmu/common.mak b/configs/devices/mips-softmmu/common.mak index

Re: [PATCH v4 0/7] ppc/e500: Add support for two types of flash, cleanup

2022-10-23 Thread Bernhard Beschow
Am 18. Oktober 2022 21:01:39 UTC schrieb Bernhard Beschow : >Cover letter: > >~ > > > >This series adds support for -pflash and direct SD card access to the > >PPC e500 boards. The idea is to increase compatibility with "real" firmware > >images where only the bare minimum of drivers

[PATCH v2 07/43] hw/isa/piix4: Rename wrongly named method

2022-10-23 Thread Bernhard Beschow
This method post-loads the southbridge, not the IDE device. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé --- hw/isa/piix4.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index 15f344dbb7..c88d3bf3bf 100644 ---

[PATCH v2 06/43] hw/isa/piix3: Prefer pci_address_space() over get_system_memory()

2022-10-23 Thread Bernhard Beschow
get_system_memory() accesses global state while pci_address_space() uses whatever has been passed to the device instance, so avoid the global. Moreover, PIIX4 uses pci_address_space() here as well. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé --- hw/isa/piix3.c | 2 +- 1

[PATCH v2 10/43] hw/i386/pc: Create RTC controllers in south bridges

2022-10-23 Thread Bernhard Beschow
Just like in the real hardware (and in PIIX4), create the RTC controllers in the south bridges. Signed-off-by: Bernhard Beschow --- hw/i386/pc.c | 12 +++- hw/i386/pc_piix.c | 8 hw/i386/pc_q35.c | 1 + hw/isa/Kconfig|

[PATCH v2 01/43] hw/i386/pc: Create DMA controllers in south bridges

2022-10-23 Thread Bernhard Beschow
Just like in the real hardware (and in PIIX4), create the DMA controllers in the south bridges. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé --- hw/i386/pc.c | 3 --- hw/i386/pc_piix.c | 2 ++ hw/isa/Kconfig| 2 ++ hw/isa/lpc_ich9.c | 3 +++ hw/isa/piix3.c|

[PATCH v2 14/43] hw/intc/i8259: Introduce i8259 proxy "isa-pic"

2022-10-23 Thread Bernhard Beschow
Having an i8259 proxy allows for ISA PICs to be created and wired up in southbridges. This is especially interesting for PIIX3 for two reasons: First, the southbridge doesn't need to care about the virtualization technology used (KVM, TCG, Xen) due to in-IRQs (where devices get attached) and

[PATCH v2 09/43] hw/usb/hcd-uhci: Introduce TYPE_ defines for device models

2022-10-23 Thread Bernhard Beschow
Suggested-by: Mark Cave-Ayland Signed-off-by: Bernhard Beschow --- hw/i386/pc_piix.c | 3 ++- hw/i386/pc_q35.c | 13 +++-- hw/isa/piix4.c| 2 +- hw/usb/hcd-uhci.c | 16 hw/usb/hcd-uhci.h | 9 + 5 files changed, 27 insertions(+), 16 deletions(-) diff

[PATCH v2 25/43] hw/mips/malta: Reuse dev variable

2022-10-23 Thread Bernhard Beschow
While at it, move the assignments closer to where they are used. Signed-off-by: Bernhard Beschow --- hw/mips/malta.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/mips/malta.c b/hw/mips/malta.c index 0e932988e0..0ec2ac2eaf 100644 --- a/hw/mips/malta.c +++

[PATCH v2 36/43] hw/isa/piix3: Merge hw/isa/piix4.c

2022-10-23 Thread Bernhard Beschow
Now that the PIIX3 and PIIX4 device models are sufficiently consolidated Signed-off-by: Bernhard Beschow --- MAINTAINERS | 6 +- configs/devices/mips-softmmu/common.mak | 2 +- hw/i386/Kconfig | 2 +- hw/isa/Kconfig

[PATCH v2 27/43] hw/isa/piix4: Add missing initialization

2022-10-23 Thread Bernhard Beschow
PIIX3 clears its reset control register, so do the same in PIIX4. Signed-off-by: Bernhard Beschow --- hw/isa/piix4.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index 83b50c3a9b..4b8dece257 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -140,6

[PATCH v2 40/43] hw/isa/piix: Consolidate IRQ triggering

2022-10-23 Thread Bernhard Beschow
Speeds up PIIX4 which resolves an old TODO. Signed-off-by: Bernhard Beschow --- hw/isa/piix.c | 26 +++--- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/hw/isa/piix.c b/hw/isa/piix.c index 446105a7a1..4ced9995f9 100644 --- a/hw/isa/piix.c +++ b/hw/isa/piix.c

[PATCH v2 30/43] hw/isa/piix4: Allow board to provide PCI interrupt routes

2022-10-23 Thread Bernhard Beschow
PIIX3 initializes the PIRQx route control registers to the default values as described in the 82371AB PCI-TO-ISA/IDE XCELERATOR (PIIX4) April 1997 manual. PIIX4, however, initializes the routes according to the Malta™ User’s Manual, ch 6.6, which are IRQs 10 and 11. In order to allow the reset

[PATCH v2 41/43] hw/isa/piix: Share PIIX3 base class with PIIX4

2022-10-23 Thread Bernhard Beschow
Having a common base class allows for substituting PIIX3 with PIIX4 and vice versa. Moreover, it makes PIIX4 implement the acpi-dev-aml-interface. Signed-off-by: Bernhard Beschow --- hw/isa/piix.c | 53 +++ 1 file changed, 24 insertions(+), 29

[PATCH v2 24/43] hw/isa/piix3: Rename typedef PIIX3State to PIIXState

2022-10-23 Thread Bernhard Beschow
This commit marks the finalization of the PIIX3 preparations to be merged with PIIX4. In particular, PIIXState is prepared to be reused in piix4.c. Signed-off-by: Bernhard Beschow --- hw/isa/piix3.c| 58 +-- include/hw/southbridge/piix.h | 4 +--

[PATCH v2 13/43] hw/isa/piix3: Create power management controller in host device

2022-10-23 Thread Bernhard Beschow
The power management controller is an integral part of PIIX3 (function 3). So create it as part of the south bridge. Note that the ACPI function is optional in QEMU. This is why it gets object_initialize_child()'ed in realize rather than in instance_init. Signed-off-by: Bernhard Beschow ---

[PATCH v2 21/43] hw/isa/piix3: Rename pci_piix3_props for sharing with PIIX4

2022-10-23 Thread Bernhard Beschow
Signed-off-by: Bernhard Beschow --- hw/isa/piix3.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/isa/piix3.c b/hw/isa/piix3.c index 9de7287589..8dbf22eaab 100644 --- a/hw/isa/piix3.c +++ b/hw/isa/piix3.c @@ -381,7 +381,7 @@ static void pci_piix3_init(Object *obj)

[PATCH v2 32/43] hw/isa/piix4: Use ISA PIC device

2022-10-23 Thread Bernhard Beschow
Aligns the code with PIIX3 such that PIIXState can be used in PIIX4, too. Signed-off-by: Bernhard Beschow --- hw/isa/piix4.c | 28 ++-- hw/mips/malta.c | 11 +-- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c

[PATCH v2 18/43] hw/isa/piix3: Remove unused include

2022-10-23 Thread Bernhard Beschow
Ammends commit 988fb613215993dd0ce642b89ca8182c479d39dd. Signed-off-by: Bernhard Beschow --- hw/isa/piix3.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/isa/piix3.c b/hw/isa/piix3.c index 59599558a1..aa32f43e4a 100644 --- a/hw/isa/piix3.c +++ b/hw/isa/piix3.c @@ -32,7 +32,6 @@

[PATCH v2 12/43] hw/isa/piix3: Create USB controller in host device

2022-10-23 Thread Bernhard Beschow
The USB controller is an integral part of PIIX3 (function 2). So create it as part of the south bridge. Note that the USB function is optional in QEMU. This is why it gets object_initialize_child()'ed in realize rather than in instance_init. Signed-off-by: Bernhard Beschow ---

[PATCH v2 03/43] hw/isa/piix3: Remove extra ';' outside of functions

2022-10-23 Thread Bernhard Beschow
Fixes the "extra-semi" clang-tidy check. Signed-off-by: Bernhard Beschow Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé --- hw/isa/piix3.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/isa/piix3.c b/hw/isa/piix3.c index 44a9998752..04895ce2e5