Re: [PATCH 12/12] hw/isa/vt82c686: Implement relocation of SuperI/O functions

2023-12-18 Thread Bernhard Beschow
Am 17. Dezember 2023 15:40:58 UTC schrieb BALATON Zoltan : >On Sun, 17 Dec 2023, Bernhard Beschow wrote: >> The VIA south bridges are able to relocate and enable or disable their >> SuperI/O >> functions. So far this is hardcoded such that all functions are always >> enabled >> and are

Re: [PATCH v2 0/4] scsi: eliminate AioContext lock

2023-12-18 Thread Kevin Wolf
[ Cc: qemu-block ] Am 04.12.2023 um 17:42 hat Stefan Hajnoczi geschrieben: > v2: > - Reschedule BH in new AioContext if change is detected [Kevin] > - Drop stray "remember" in Patch 2's commit description [Eric] > > The SCSI subsystem uses the AioContext lock to protect internal state. This is >

Re: [PATCH v2 10/14] aio: remove aio_context_acquire()/aio_context_release() API

2023-12-18 Thread Kevin Wolf
Am 05.12.2023 um 19:20 hat Stefan Hajnoczi geschrieben: > Delete these functions because nothing calls these functions anymore. > > I introduced these APIs in commit 98563fc3ec44 ("aio: add > aio_context_acquire() and aio_context_release()") in 2014. It's with a > sigh of relief that I delete

Re: [PATCH v2 09/14] aio-wait: draw equivalence between AIO_WAIT_WHILE() and AIO_WAIT_WHILE_UNLOCKED()

2023-12-18 Thread Kevin Wolf
Am 05.12.2023 um 19:20 hat Stefan Hajnoczi geschrieben: > Now that the AioContext lock no longer exists, AIO_WAIT_WHILE() and > AIO_WAIT_WHILE_UNLOCKED() are equivalent. > > A future patch will get rid of AIO_WAIT_WHILE_UNLOCKED(). > > Signed-off-by: Stefan Hajnoczi > Reviewed-by: Eric Blake

Re: [PATCH v2 07/14] block: remove bdrv_co_lock()

2023-12-18 Thread Kevin Wolf
Am 05.12.2023 um 19:20 hat Stefan Hajnoczi geschrieben: > The bdrv_co_lock() and bdrv_co_unlock() functions are already no-ops. > Remove them. > > Signed-off-by: Stefan Hajnoczi Reviewed-by: Kevin Wolf

Re: [PATCH 04/12] hw/block/fdc: Expose internal header

2023-12-18 Thread BALATON Zoltan
On Sun, 17 Dec 2023, Bernhard Beschow wrote: Am 17. Dezember 2023 15:47:33 UTC schrieb BALATON Zoltan : On Sun, 17 Dec 2023, Bernhard Beschow wrote: Exposing the internal header allows for exposing struct FDCtrlISABus which is encuraged by qdev guidelines. Hopefully the guidelines don't

Re: [RFC 0/3] aio-posix: call ->poll_end() when removing AioHandler

2023-12-18 Thread Fiona Ebner
Am 14.12.23 um 20:53 schrieb Stefan Hajnoczi: > > I will still try the other approach that Hanna and Paolo have suggested. > It seems more palatable. I will send a v2. > FYI, what I already tried downstream (for VirtIO SCSI): > diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c > index

Re: [PATCH v6 2/4] qcow2: add configurations for zoned format extension

2023-12-18 Thread Markus Armbruster
Sam Li writes: > Markus Armbruster 于2023年11月30日周四 09:40写道: >> >> Sam Li writes: [...] >> > +## >> > +# @Qcow2ZoneHostManaged: >> > +# >> > +# The host-managed zone model. It only allows sequential writes. >> > +# >> > +# @size: Total number of bytes within zones >> > +# >> > +# @capacity:

Re: [RFC 3/3] aio-posix: call ->poll_end() when removing AioHandler

2023-12-18 Thread Stefan Hajnoczi
On Thu, Dec 14, 2023 at 09:39:02PM +0100, Paolo Bonzini wrote: > Il gio 14 dic 2023, 21:12 Stefan Hajnoczi ha scritto: > > > Since the fd may be bypassed until ->io_poll_end() returns, we must poll > > one last time to check if an event snuck in right at the end without > > making the fd

Re: [RFC 0/3] aio-posix: call ->poll_end() when removing AioHandler

2023-12-18 Thread Stefan Hajnoczi
On Mon, Dec 18, 2023 at 01:41:38PM +0100, Fiona Ebner wrote: > Am 14.12.23 um 20:53 schrieb Stefan Hajnoczi: > > > > I will still try the other approach that Hanna and Paolo have suggested. > > It seems more palatable. I will send a v2. > > > > FYI, what I already tried downstream (for VirtIO

Re: [PATCH v2 08/14] scsi: remove AioContext locking

2023-12-18 Thread Kevin Wolf
Am 05.12.2023 um 19:20 hat Stefan Hajnoczi geschrieben: > The AioContext lock no longer has any effect. Remove it. > > Signed-off-by: Stefan Hajnoczi > Reviewed-by: Eric Blake Reviewed-by: Kevin Wolf

Re: [PATCH v2 02/14] scsi: assert that callbacks run in the correct AioContext

2023-12-18 Thread Kevin Wolf
Am 05.12.2023 um 19:19 hat Stefan Hajnoczi geschrieben: > Since the removal of AioContext locking, the correctness of the code > relies on running requests from a single AioContext at any given time. > > Add assertions that verify that callbacks are invoked in the correct > AioContext. > >

Re: [RFC 0/3] aio-posix: call ->poll_end() when removing AioHandler

2023-12-18 Thread Paolo Bonzini
On Mon, Dec 18, 2023 at 1:41 PM Fiona Ebner wrote: > I think it's because of nested drains, because when additionally > checking that the drain count is zero and only executing the loop then, > that issue doesn't seem to manifest But isn't virtio_scsi_drained_end only run if bus->drain_count ==

[PATCH v2 09/12] hw/char/serial-isa: Implement relocation and toggling for TYPE_ISA_SERIAL

2023-12-18 Thread Bernhard Beschow
Implement isa_serial_set_{enabled,iobase} in order to implement relocation and toggling of SuperI/O functions in the VIA south bridges without breaking encapsulation. Signed-off-by: Bernhard Beschow --- include/hw/char/serial.h | 2 ++ hw/char/serial-isa.c | 14 ++ 2 files

Re: [PATCH v2 02/12] hw/block/fdc-sysbus: Free struct FDCtrl from MemoryRegion

2023-12-18 Thread BALATON Zoltan
On Mon, 18 Dec 2023, Bernhard Beschow wrote: FDCtrl::iomem isn't used inside FDCtrl context but only inside FDCtrlSysBus context, so more it there. Same comments as for patch 1 otherwise Reviewed-by: BALATON Zoltan Signed-off-by: Bernhard Beschow --- hw/block/fdc-internal.h | 2 --

Re: [PATCH v2 01/12] hw/block/fdc-isa: Free struct FDCtrl from PortioList

2023-12-18 Thread BALATON Zoltan
On Mon, 18 Dec 2023, Bernhard Beschow wrote: FDCtrl::portio_list isn't used inside FDCtrl context but only inside FDCtrlISABus context, so more it there. "more" -> "move", you have the same typo in several other commit messages. Not sure I like the C++ism FDCtrl::portio_list and would write

Re: [PATCH v2 04/12] hw/char/parallel: Free struct ParallelState from PortioList

2023-12-18 Thread BALATON Zoltan
On Mon, 18 Dec 2023, Bernhard Beschow wrote: ParallelState::portio_list isn't used inside ParallelState context but only inside ISAParallelState context, so more it there. Same comments as for patch 1 otherwise Reviewed-by: BALATON Zoltan Signed-off-by: Bernhard Beschow ---

Re: [PATCH v2 08/12] hw/block/fdc-isa: Implement relocation and toggling for TYPE_ISA_FDC

2023-12-18 Thread BALATON Zoltan
On Mon, 18 Dec 2023, Bernhard Beschow wrote: Implement isa_fdc_set_{enabled,iobase} in order to implement relocation and toggling of SuperI/O functions in the VIA south bridges without breaking encapsulation. You may want to revise these commit messages. What toggling means is only defined in

Re: [PATCH v2 03/12] hw/char/serial: Free struct SerialState from MemoryRegion

2023-12-18 Thread BALATON Zoltan
On Mon, 18 Dec 2023, Bernhard Beschow wrote: SerialState::io isn't used within TYPE_SERIAL directly. Push it to its users to make them the owner of the MemoryRegion. I'm not sure this patch is needed. The users already own the SerialState so can use its memory region so they don't need their

Re: [PATCH v2 12/12] hw/isa/vt82c686: Implement relocation and toggling of SuperI/O functions

2023-12-18 Thread BALATON Zoltan
On Mon, 18 Dec 2023, Bernhard Beschow wrote: The VIA south bridges are able to relocate and toggle (enable or disable) their SuperI/O functions. So far this is hardcoded such that all functions are always enabled and are located at fixed addresses. Some PC BIOSes seem to probe for I/O occupancy

Re: [PATCH 04/12] hw/block/fdc: Expose internal header

2023-12-18 Thread BALATON Zoltan
On Mon, 18 Dec 2023, Bernhard Beschow wrote: Am 18. Dezember 2023 10:54:56 UTC schrieb BALATON Zoltan : On Sun, 17 Dec 2023, Bernhard Beschow wrote: Am 17. Dezember 2023 15:47:33 UTC schrieb BALATON Zoltan : On Sun, 17 Dec 2023, Bernhard Beschow wrote: Exposing the internal header allows for

Re: [PATCH v2 06/12] exec/ioport: Add portio_list_set_address()

2023-12-18 Thread BALATON Zoltan
On Mon, 18 Dec 2023, Bernhard Beschow wrote: Some SuperI/O devices such as the VIA south bridges or the PC87312 controller are able to relocate their SuperI/O functions. Add a convenience function for implementing this in the VIA south bridges. This convenience function relies on previous

Re: [PATCH v2 11/12] hw/ppc/pegasos2: Let pegasos2 machine configure SuperI/O functions

2023-12-18 Thread BALATON Zoltan
On Mon, 18 Dec 2023, Bernhard Beschow wrote: This is a preparation for implementing relocation and toggling of SuperI/O functions in the VT8231 device model. Upon reset, all SuperI/O functions will be deactivated, so in case if no -bios is given, let the machine configure those functions the

Re: [PATCH 04/12] hw/block/fdc: Expose internal header

2023-12-18 Thread Bernhard Beschow
Am 18. Dezember 2023 10:54:56 UTC schrieb BALATON Zoltan : >On Sun, 17 Dec 2023, Bernhard Beschow wrote: >> Am 17. Dezember 2023 15:47:33 UTC schrieb BALATON Zoltan >> : >>> On Sun, 17 Dec 2023, Bernhard Beschow wrote: Exposing the internal header allows for exposing struct FDCtrlISABus

[PATCH v2 04/12] hw/char/parallel: Free struct ParallelState from PortioList

2023-12-18 Thread Bernhard Beschow
ParallelState::portio_list isn't used inside ParallelState context but only inside ISAParallelState context, so more it there. Signed-off-by: Bernhard Beschow --- include/hw/char/parallel-isa.h | 2 ++ include/hw/char/parallel.h | 2 -- hw/char/parallel.c | 2 +- 3 files

[PATCH v2 06/12] exec/ioport: Add portio_list_set_address()

2023-12-18 Thread Bernhard Beschow
Some SuperI/O devices such as the VIA south bridges or the PC87312 controller are able to relocate their SuperI/O functions. Add a convenience function for implementing this in the VIA south bridges. This convenience function relies on previous simplifications in exec/ioport which avoids some

[PATCH v2 07/12] exec/ioport: Add portio_list_set_enabled()

2023-12-18 Thread Bernhard Beschow
Some SuperI/O devices such as the VIA south bridges or the PC87312 controller allow to enable or disable their SuperI/O functions. Add a convenience function for implementing this in the VIA south bridges. The naming of the functions is inspired by its memory_region_set_enabled() pendant.

[PATCH v2 05/12] exec/ioport: Resolve redundant .base attribute in struct MemoryRegionPortio

2023-12-18 Thread Bernhard Beschow
portio_list_add_1() creates a MemoryRegionPortioList instance which holds a MemoryRegion `mr` and an array of MemoryRegionPortio elements named `ports`. Each element in the array gets assigned the same value for its .base attribute. The same value also ends up as the .addr attribute of `mr` due to

[PATCH v2 12/12] hw/isa/vt82c686: Implement relocation and toggling of SuperI/O functions

2023-12-18 Thread Bernhard Beschow
The VIA south bridges are able to relocate and toggle (enable or disable) their SuperI/O functions. So far this is hardcoded such that all functions are always enabled and are located at fixed addresses. Some PC BIOSes seem to probe for I/O occupancy before activating such a function and issue an

[PATCH v2 10/12] hw/char/parallel-isa: Implement relocation and toggling for TYPE_ISA_PARALLEL

2023-12-18 Thread Bernhard Beschow
Implement isa_parallel_set_{enabled,iobase} in order to implement relocation and toggling of SuperI/O functions in the VIA south bridges without breaking encapsulation. Signed-off-by: Bernhard Beschow --- include/hw/char/parallel-isa.h | 3 +++ hw/char/parallel-isa.c | 14

[PATCH v2 00/12] hw/isa/vt82c686: Implement relocation and toggling of SuperI/O functions

2023-12-18 Thread Bernhard Beschow
This series implements relocation of the SuperI/O functions of the VIA south bridges which resolves some FIXME's. It is part of my via-apollo-pro-133t branch [1] which is an extension of bringing the VIA south bridges to the PC machine [2]. This branch is able to run some real-world X86 BIOSes in

[PATCH v2 03/12] hw/char/serial: Free struct SerialState from MemoryRegion

2023-12-18 Thread Bernhard Beschow
SerialState::io isn't used within TYPE_SERIAL directly. Push it to its users to make them the owner of the MemoryRegion. Signed-off-by: Bernhard Beschow --- include/hw/char/serial.h | 2 +- hw/char/serial-isa.c | 7 +-- hw/char/serial-pci-multi.c | 7 --- hw/char/serial-pci.c

[PATCH v2 02/12] hw/block/fdc-sysbus: Free struct FDCtrl from MemoryRegion

2023-12-18 Thread Bernhard Beschow
FDCtrl::iomem isn't used inside FDCtrl context but only inside FDCtrlSysBus context, so more it there. Signed-off-by: Bernhard Beschow --- hw/block/fdc-internal.h | 2 -- hw/block/fdc-sysbus.c | 6 -- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/block/fdc-internal.h

[PATCH v2 08/12] hw/block/fdc-isa: Implement relocation and toggling for TYPE_ISA_FDC

2023-12-18 Thread Bernhard Beschow
Implement isa_fdc_set_{enabled,iobase} in order to implement relocation and toggling of SuperI/O functions in the VIA south bridges without breaking encapsulation. Signed-off-by: Bernhard Beschow --- include/hw/block/fdc.h | 3 +++ hw/block/fdc-isa.c | 14 ++ 2 files changed,

[PATCH v2 11/12] hw/ppc/pegasos2: Let pegasos2 machine configure SuperI/O functions

2023-12-18 Thread Bernhard Beschow
This is a preparation for implementing relocation and toggling of SuperI/O functions in the VT8231 device model. Upon reset, all SuperI/O functions will be deactivated, so in case if no -bios is given, let the machine configure those functions the same way pegasos2.rom would do. For now the

[PATCH v2 01/12] hw/block/fdc-isa: Free struct FDCtrl from PortioList

2023-12-18 Thread Bernhard Beschow
FDCtrl::portio_list isn't used inside FDCtrl context but only inside FDCtrlISABus context, so more it there. Signed-off-by: Bernhard Beschow --- hw/block/fdc-internal.h | 2 -- hw/block/fdc-isa.c | 4 +++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git

Re: [PATCH v2 1/2] qdev: add IOThreadVirtQueueMappingList property type

2023-12-18 Thread Markus Armbruster
Stefan Hajnoczi writes: > On Mon, Dec 11, 2023 at 04:32:06PM +0100, Markus Armbruster wrote: >> Kevin Wolf writes: >> >> > Am 18.09.2023 um 18:16 hat Stefan Hajnoczi geschrieben: >> >> virtio-blk and virtio-scsi devices will need a way to specify the >> >> mapping between IOThreads and