Re: [PATCH v2 06.5/18] hw/ide/piix: Allow using PIIX3-IDE as standalone PCI function

2023-02-27 Thread Philippe Mathieu-Daudé
On 20/2/23 10:52, Philippe Mathieu-Daudé wrote: On 20/2/23 10:10, Gerd Hoffmann wrote: On Mon, Feb 20, 2023 at 09:00:44AM +0100, Philippe Mathieu-Daudé wrote: In order to allow Frankenstein uses such plugging a PIIX3 IDE function on a ICH9 chipset (which already exposes AHCI ports...) as:    $

[PATCH 2/3] block: make BlockBackend->disable_request_queuing atomic

2023-02-27 Thread Stefan Hajnoczi
This field is accessed by multiple threads without a lock. Use explicit qatomic_read()/qatomic_set() calls. There is no need for acquire/release because blk_set_disable_request_queuing() doesn't provide any guarantees (it helps that it's used at BlockBackend creation time and not when there is I/O

[PATCH 3/3] block: protect BlockBackend->queued_requests with a lock

2023-02-27 Thread Stefan Hajnoczi
The CoQueue API offers thread-safety via the lock argument that qemu_co_queue_wait() and qemu_co_enter_next() take. BlockBackend currently does not make use of the lock argument. This means that multiple threads submitting I/O requests can corrupt the CoQueue's QSIMPLEQ. Add a QemuMutex and pass i

[PATCH 0/3] block: protect BlockBackend->queued_requests with a lock

2023-02-27 Thread Stefan Hajnoczi
QEMU block layer multi-queue support involves running I/O requests from multiple threads. Shared state must be protected somehow to avoid thread-safety issues. The BlockBackend->queued_requests CoQueue is accessed without a lock and will likely be corrupted when multiple threads queue requests at

[PATCH 1/3] block: make BlockBackend->quiesce_counter atomic

2023-02-27 Thread Stefan Hajnoczi
The main loop thread increments/decrements BlockBackend->quiesce_counter when drained sections begin/end. The counter is read in the I/O code path. Therefore this field is used to communicate between threads without a lock. Use qatomic_set()/qatomic_read() to make it clear that this field is acces

Re: [PATCH v15 3/8] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls

2023-02-27 Thread Stefan Hajnoczi
On Mon, Feb 27, 2023 at 07:20:14PM +0100, Kevin Wolf wrote: > Am 29.01.2023 um 11:28 hat Sam Li geschrieben: > > Add zoned device option to host_device BlockDriver. It will be presented > > only > > for zoned host block devices. By adding zone management operations to the > > host_block_device Blo

Re: [PATCH v15 3/8] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls

2023-02-27 Thread Kevin Wolf
Am 29.01.2023 um 11:28 hat Sam Li geschrieben: > Add zoned device option to host_device BlockDriver. It will be presented only > for zoned host block devices. By adding zone management operations to the > host_block_device BlockDriver, users can use the new block layer APIs > including Report Zone

Re: [PATCH v2 17/24] hw/ide: Declare ide_get_[geometry/bios_chs_trans] in 'hw/ide/internal.h'

2023-02-27 Thread Philippe Mathieu-Daudé
On 27/2/23 12:17, Alex Bennée wrote: Philippe Mathieu-Daudé writes: ide_get_geometry() and ide_get_bios_chs_trans() are only used by the TYPE_PC_MACHINE. "hw/ide.h" is a mixed bag of lost IDE declarations. In order to remove this (almost) pointless header soon, move these declarations to "hw/

Re: [PULL 00/29] Block layer patches

2023-02-27 Thread Peter Maydell
On Mon, 27 Feb 2023 at 09:12, Thomas Huth wrote: > Peter, in case you also have a github account, could you maybe enable the > Cirrus-CI for your gitlab repo like it is explained here: > > .gitlab-ci.d/cirrus/README.rst Sorry, no. The Cirrus-CI signup wants more permissions on my github account

Re: [PATCH 1/7] configure: expose the direct container command

2023-02-27 Thread Daniel P . Berrangé
On Fri, Feb 24, 2023 at 06:08:51PM +, Alex Bennée wrote: > In the process of migrating away from using docker.py to build our > containers we need to expose the command to the build environment. The > script is still a useful way to probe which command works though. > > Signed-off-by: Alex Ben

Re: [PATCH v2 17/24] hw/ide: Declare ide_get_[geometry/bios_chs_trans] in 'hw/ide/internal.h'

2023-02-27 Thread Alex Bennée
Philippe Mathieu-Daudé writes: > ide_get_geometry() and ide_get_bios_chs_trans() are only > used by the TYPE_PC_MACHINE. > "hw/ide.h" is a mixed bag of lost IDE declarations. In order > to remove this (almost) pointless header soon, move these > declarations to "hw/ide/internal.h". > > Signed-o

Re: [PATCH 2/7] tests/dockerfiles: unify debian-toolchain references

2023-02-27 Thread Daniel P . Berrangé
On Fri, Feb 24, 2023 at 06:08:52PM +, Alex Bennée wrote: > We use the debian release number elsewhere so fix it for consistency > along with the broken comment. > > Signed-off-by: Alex Bennée > --- > tests/docker/dockerfiles/debian-toolchain.docker | 4 ++-- > 1 file changed, 2 insertions(+)

Re: [PATCH v2 07/24] hw/ide/atapi: Restrict 'scsi/constants.h' inclusion

2023-02-27 Thread Alex Bennée
Philippe Mathieu-Daudé writes: > Only atapi.c requires the SCSI constants. No need to include > it in all files including "hw/ide/internal.h". > > Signed-off-by: Philippe Mathieu-Daudé > Message-Id: <20230215112712.23110-7-phi...@linaro.org> > Reviewed-by: Richard Henderson Reviewed-by: Alex

Re: [PATCH v2 08/24] hw/ide: Remove unused 'qapi/qapi-types-run-state.h'

2023-02-27 Thread Alex Bennée
Philippe Mathieu-Daudé writes: > Missed in commit d7458e7754 ("hw/ide/internal: Remove unused > DMARestartFunc typedef") which removed the single use of RunState. > > Signed-off-by: Philippe Mathieu-Daudé > Message-Id: <20230215112712.23110-8-phi...@linaro.org> > Reviewed-by: Richard Henderson

Re: [PATCH v2 09/24] hw/ide: Include 'exec/ioport.h' instead of 'hw/isa/isa.h'

2023-02-27 Thread Alex Bennée
Philippe Mathieu-Daudé writes: > The IDEBus structure has PortioList fields, so we need its > declarations from "exec/ioport.h". "hw/isa/isa.h" is not required. > > Signed-off-by: Philippe Mathieu-Daudé > Message-Id: <20230215112712.23110-9-phi...@linaro.org> > Reviewed-by: Richard Henderson

Re: [PATCH v2 02/24] hw/ide/mmio: Use CamelCase for MMIO_IDE state name

2023-02-27 Thread Alex Bennée
Philippe Mathieu-Daudé writes: > Following docs/devel/style.rst guidelines, rename MMIOIDEState > as MmioIdeState. > > Having the structure name and its typedef named equally, > we can manually convert from the old DECLARE_INSTANCE_CHECKER() > macro to the more recent OBJECT_DECLARE_SIMPLE_TYPE

[PATCH 0/2] block/fuse: Let PUNCH_HOLE write zeroes

2023-02-27 Thread Hanna Czenczek
Hi, https://gitlab.com/qemu-project/qemu/-/issues/1507 reports a bug in FUSE exports: fallocate(PUNCH_HOLE) is implemented with blk_pdiscard(), but its man page documents that a successful call will result in the data being read as zero. blk_pdiscard() does not guarantee this, so we must use blk_

[PATCH 2/2] iotests/308: Add test for 'write -zu'

2023-02-27 Thread Hanna Czenczek
Try writing zeroes to a FUSE export while allowing the area to be unmapped; block/file-posix.c generally implements writing zeroes with BDRV_REQ_MAY_UNMAP ('write -zu') by calling fallocate(PUNCH_HOLE). This used to lead to a blk_pdiscard() in the FUSE export, which may or may not lead to the area

[PATCH 1/2] block/fuse: Let PUNCH_HOLE write zeroes

2023-02-27 Thread Hanna Czenczek
fallocate(2) says about PUNCH_HOLE: "After a successful call, subsequent reads from this range will return zeros." As it is, PUNCH_HOLE is implemented as a call to blk_pdiscard(), which does not guarantee this. We must call blk_pwrite_zeroes() instead. The difference to ZERO_RANGE is that we pas

Re: [PATCH v2 00/10] Resolve isabus global

2023-02-27 Thread Bernhard Beschow
Am 26. Februar 2023 20:38:24 UTC schrieb Bernhard Beschow : > > >Am 24. Februar 2023 16:22:48 UTC schrieb "Michael S. Tsirkin" >: >>On Thu, Jan 26, 2023 at 10:17:30PM +0100, Bernhard Beschow wrote: >>> This series resolves the global "isabus" variable and is basically a v2 of >>> [1]. >>> Note

Re: [PULL 00/29] Block layer patches

2023-02-27 Thread Thomas Huth
On 24/02/2023 22.35, Philippe Mathieu-Daudé wrote: Hi, On 24/2/23 19:50, Peter Maydell wrote: On Thu, 23 Feb 2023 at 18:51, Kevin Wolf wrote: The following changes since commit 79b677d658d3d35e1e776826ac4abb28cdce69b8:    Merge tag 'net-pull-request' of https://github.com/jasowang/qemu into