[PATCH v4 0/4] Drop deprecated floppy config & bogus -drive if=T

2021-03-10 Thread Markus Armbruster
v4: * PATCH 3: Move a declaration into a loop [Richard] * PATCH 4: Drop a superfluous call to drive_check_orphaned() [Daniel], fix comments [John] v3: * PATCH 1: New [Daniel] v2: * Rebased, straightforward conflict with commit f5d33dd51f "hw/block/fdc: Remove the check_media_rate property"

[PATCH v4 2/4] fdc: Drop deprecated floppy configuration

2021-03-10 Thread Markus Armbruster
Drop the crap deprecated in commit 4a27a638e7 "fdc: Deprecate configuring floppies with -global isa-fdc" (v5.1.0). Signed-off-by: Markus Armbruster Reviewed-by: Daniel P. Berrangé --- docs/system/deprecated.rst | 49 --- docs/system/removed-features.rst | 49 +++ hw/block/fdc.c

[PATCH v4 1/4] docs/system/deprecated: Fix note on fdc drive properties

2021-03-10 Thread Markus Armbruster
Commit 4a27a638e7 "fdc: Deprecate configuring floppies with -global isa-fdc" actually deprecated any use of floppy controller driver properties, not just with -global. Correct the deprecation note accordingly. Fixes: 4a27a638e718b445648de6b27c709353551d9b44 Signed-off-by: Markus Armbruster

[PATCH v4 4/4] blockdev: Drop deprecated bogus -drive interface type

2021-03-10 Thread Markus Armbruster
Drop the crap deprecated in commit a1b40bda08 "blockdev: Deprecate -drive with bogus interface type" (v5.1.0). drive_check_orphaned() no longer depends on qemu_create_cli_devices(). Call it right after board initialization for clarity. Signed-off-by: Markus Armbruster ---

[PATCH v4 3/4] fdc: Inline fdctrl_connect_drives() into fdctrl_realize_common()

2021-03-10 Thread Markus Armbruster
The previous commit rendered the name fdctrl_connect_drives() somewhat misleading. Get rid of it by inlining the (now pretty simple) function into its only caller. Signed-off-by: Markus Armbruster Reviewed-by: Daniel P. Berrangé --- hw/block/fdc.c | 23 --- 1 file changed,

Re: [PATCH v3 00/30] qapi/qom: QAPIfy --object and object-add

2021-03-10 Thread Peter Krempa
On Wed, Mar 10, 2021 at 18:30:44 +0100, Kevin Wolf wrote: > Am 10.03.2021 um 15:31 hat Paolo Bonzini geschrieben: > > On 10/03/21 15:22, Peter Krempa wrote: [...] > The keyval parser would create a list if multiple values are given for > the same key. Some care needs to be taken to avoid mixing

[PATCH 3/3] hw/block/nvme: add administrative controller type

2021-03-10 Thread Klaus Jensen
From: Padmakar Kalghatgi Add the 'administrative' nvme device parameter. This causes the controller to behave as an Administrative Controller. See NVM Express v1.4b, Section 7.1.2 ("Administrative Controller"). Signed-off-by: Padmakar Kalghatgi Signed-off-by: Gollu Appalanaidu Signed-off-by:

[PATCH 2/3] hw/block/nvme: add oacs device parameter

2021-03-10 Thread Klaus Jensen
From: Gollu Appalanaidu Add the 'oacs' nvme device parameter to allow optional features to be enabled/disabled explicitly. Since most of these are optional commands, make the CSE log pages dynamic to account for the value of OACS once the optional commands supported added to device.

[PATCH 1/3] hw/block/nvme: add oncs device parameter

2021-03-10 Thread Klaus Jensen
From: Gollu Appalanaidu Add the 'oncs' nvme device parameter to allow optional features to be enabled/disabled explicitly. Since most of these are optional commands, make the CSE log pages dynamic to account for the value of ONCS. Signed-off-by: Gollu Appalanaidu Signed-off-by: Klaus Jensen

[PATCH 0/3] hw/block/nvme: add administrative controller support

2021-03-10 Thread Klaus Jensen
From: Klaus Jensen This series allows the controller to behave as an Administrative Controller. This is useful when emulating a subsystem. Since some commands are prohibited for an Administrative Controller, this series includes patches that make the CSE log page dynamic and allows supported

Re: [PATCH v3 4/4] blockdev: Drop deprecated bogus -drive interface type

2021-03-10 Thread Markus Armbruster
John Snow writes: > On 3/9/21 11:12 AM, Markus Armbruster wrote: >> Drop the crap deprecated in commit a1b40bda08 "blockdev: Deprecate >> -drive with bogus interface type" (v5.1.0). >> >> Signed-off-by: Markus Armbruster >> --- >> docs/system/deprecated.rst | 7 -- >>

Re: [PATCH v3 4/4] blockdev: Drop deprecated bogus -drive interface type

2021-03-10 Thread John Snow
On 3/9/21 11:12 AM, Markus Armbruster wrote: Drop the crap deprecated in commit a1b40bda08 "blockdev: Deprecate -drive with bogus interface type" (v5.1.0). Signed-off-by: Markus Armbruster --- docs/system/deprecated.rst | 7 -- docs/system/removed-features.rst | 7 ++

Re: [PATCH v2 12/12] hw/block/pflash_cfi: Replace DPRINTF with trace events

2021-03-10 Thread Bin Meng
On Thu, Mar 11, 2021 at 1:43 AM Philippe Mathieu-Daudé wrote: > > From: David Edmondson > > Rather than having a device specific debug implementation in > pflash_cfi01.c and pflash_cfi02.c, use the standard tracing facility. > > Signed-off-by: David Edmondson > Reviewed-by: Philippe

Re: [PATCH v2 11/12] hw/block/pflash_cfi01: Correct the type of PFlashCFI01.ro

2021-03-10 Thread Bin Meng
On Thu, Mar 11, 2021 at 1:28 AM Philippe Mathieu-Daudé wrote: > > From: David Edmondson > > PFlashCFI01.ro is a bool, declare it as such. > > Signed-off-by: David Edmondson > Reviewed-by: Philippe Mathieu-Daudé > Message-Id: <20210216142721.1985543-3-david.edmond...@oracle.com> >

Re: [PATCH v2 07/12] hw/block/pflash_cfi02: Factor out pflash_reset_state_machine()

2021-03-10 Thread Bin Meng
On Thu, Mar 11, 2021 at 1:36 AM Philippe Mathieu-Daudé wrote: > > There is multiple places resetting the internal state machine. > Factor the code out in a new pflash_reset_state_machine() method. > > Signed-off-by: Philippe Mathieu-Daudé > --- > hw/block/pflash_cfi02.c | 20

Re: [PATCH v2 08/12] hw/block/pflash_cfi02: Add DeviceReset method

2021-03-10 Thread Bin Meng
On Thu, Mar 11, 2021 at 1:22 AM Philippe Mathieu-Daudé wrote: > > Signed-off-by: Philippe Mathieu-Daudé > --- > hw/block/pflash_cfi02.c | 8 > 1 file changed, 8 insertions(+) > Reviewed-by: Bin Meng

Re: [PATCH v2 10/12] hw/block/pflash_cfi01: Extract pflash_mode_read_array()

2021-03-10 Thread Bin Meng
On Thu, Mar 11, 2021 at 1:37 AM Philippe Mathieu-Daudé wrote: > > The same pattern is used when setting the flash in READ_ARRAY mode: > - Set the state machine command to READ_ARRAY > - Reset the write_cycle counter > - Reset the memory region in ROMD > > Refactor the current code by extracting

Re: [PATCH 0/4] vhost-user-blk-test: add vhost-user-blk server tests

2021-03-10 Thread Kevin Wolf
Am 09.03.2021 um 10:41 hat Stefan Hajnoczi geschrieben: > These patches were dropped from Kevin's last block pull request due to a > GitLab > CI failure. The old CentOS 7 and opensuse Leap build images lack > memfd_create(2) (introduced in Linux around 2014). The vhost-user-blk server > had a

Re: [PATCH v3 00/30] qapi/qom: QAPIfy --object and object-add

2021-03-10 Thread Kevin Wolf
Am 10.03.2021 um 15:31 hat Paolo Bonzini geschrieben: > On 10/03/21 15:22, Peter Krempa wrote: > > I've stumbled upon a regression with this patchset applied: > > > > error: internal error: process exited while connecting to monitor: > > qemu-system-x86_64: -object > >

Re: [PATCH] block: Introduce zero-co:// and zero-aio://

2021-03-10 Thread Kevin Wolf
Am 10.03.2021 um 15:17 hat f...@euphon.net geschrieben: > From: Fam Zheng > > null-co:// has a read-zeroes=off default, when used to in security > analysis, this can cause false positives because the driver doesn't > write to the read buffer. > > null-co:// has the highest possible performance

Re: [PATCH v2 08/12] hw/block/pflash_cfi02: Add DeviceReset method

2021-03-10 Thread David Edmondson
On Wednesday, 2021-03-10 at 18:05:24 +01, Philippe Mathieu-Daudé wrote: > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: David Edmondson > --- > hw/block/pflash_cfi02.c | 8 > 1 file changed, 8 insertions(+) > > diff --git a/hw/block/pflash_cfi02.c b/hw/block/pflash_cfi02.c >

Re: [PATCH v2 07/12] hw/block/pflash_cfi02: Factor out pflash_reset_state_machine()

2021-03-10 Thread David Edmondson
On Wednesday, 2021-03-10 at 18:05:23 +01, Philippe Mathieu-Daudé wrote: > There is multiple places resetting the internal state machine. > Factor the code out in a new pflash_reset_state_machine() method. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: David Edmondson > --- >

[PATCH v2 11/12] hw/block/pflash_cfi01: Correct the type of PFlashCFI01.ro

2021-03-10 Thread Philippe Mathieu-Daudé
From: David Edmondson PFlashCFI01.ro is a bool, declare it as such. Signed-off-by: David Edmondson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20210216142721.1985543-3-david.edmond...@oracle.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/block/pflash_cfi01.c | 4 ++-- 1 file

[PATCH v2 10/12] hw/block/pflash_cfi01: Extract pflash_mode_read_array()

2021-03-10 Thread Philippe Mathieu-Daudé
The same pattern is used when setting the flash in READ_ARRAY mode: - Set the state machine command to READ_ARRAY - Reset the write_cycle counter - Reset the memory region in ROMD Refactor the current code by extracting this pattern. It is used three times: - On a read access (on invalid

[PATCH v2 09/12] hw/block/pflash_cfi01: Clarify trace events

2021-03-10 Thread Philippe Mathieu-Daudé
Use the 'mode_read_array' event when we set the device in such mode, and use the 'reset' event in DeviceReset handler. Reviewed-by: Bin Meng Reviewed-by: David Edmondson Signed-off-by: Philippe Mathieu-Daudé --- hw/block/pflash_cfi01.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)

[PATCH v2 06/12] hw/block/pflash_cfi02: Rename register_memory(true) as mode_read_array

2021-03-10 Thread Philippe Mathieu-Daudé
The same pattern is used when setting the flash in READ_ARRAY mode: - Set the state machine command to READ_ARRAY - Reset the write_cycle counter - Reset the memory region in ROMD Refactor the current code by extracting this pattern. It is used three times: - When the timer expires and not in

Re: [PATCH v2 05/12] hw/block/pflash_cfi02: Open-code pflash_register_memory(rom=false)

2021-03-10 Thread David Edmondson
On Wednesday, 2021-03-10 at 18:05:21 +01, Philippe Mathieu-Daudé wrote: > There is only one call to pflash_register_memory() with > rom_mode == false. As we want to modify pflash_register_memory() > in the next patch, open-code this trivial function in place for > the 'rom_mode == false' case. >

Re: [PATCH v2 04/12] hw/block/pflash_cfi02: Set rom_mode to true in pflash_setup_mappings()

2021-03-10 Thread David Edmondson
On Wednesday, 2021-03-10 at 18:05:20 +01, Philippe Mathieu-Daudé wrote: > There is only one call to pflash_setup_mappings(). Convert 'rom_mode' > to boolean and set it to true directly within pflash_setup_mappings(). > > Reviewed-by: Bin Meng > Signed-off-by: Philippe Mathieu-Daudé

[PATCH v2 07/12] hw/block/pflash_cfi02: Factor out pflash_reset_state_machine()

2021-03-10 Thread Philippe Mathieu-Daudé
There is multiple places resetting the internal state machine. Factor the code out in a new pflash_reset_state_machine() method. Signed-off-by: Philippe Mathieu-Daudé --- hw/block/pflash_cfi02.c | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git

[PATCH v2 02/12] hw/block/pflash_cfi01: Extract pflash_cfi01_fill_cfi_table()

2021-03-10 Thread Philippe Mathieu-Daudé
Fill the CFI table in out of DeviceRealize() in a new function: pflash_cfi01_fill_cfi_table(). Reviewed-by: Bin Meng Reviewed-by: David Edmondson Signed-off-by: Philippe Mathieu-Daudé --- hw/block/pflash_cfi01.c | 140 +--- 1 file changed, 73 insertions(+),

[PATCH v2 05/12] hw/block/pflash_cfi02: Open-code pflash_register_memory(rom=false)

2021-03-10 Thread Philippe Mathieu-Daudé
There is only one call to pflash_register_memory() with rom_mode == false. As we want to modify pflash_register_memory() in the next patch, open-code this trivial function in place for the 'rom_mode == false' case. Reviewed-by: Bin Meng Signed-off-by: Philippe Mathieu-Daudé ---

[PATCH v2 12/12] hw/block/pflash_cfi: Replace DPRINTF with trace events

2021-03-10 Thread Philippe Mathieu-Daudé
From: David Edmondson Rather than having a device specific debug implementation in pflash_cfi01.c and pflash_cfi02.c, use the standard tracing facility. Signed-off-by: David Edmondson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20210216142721.1985543-2-david.edmond...@oracle.com> [PMD:

[PATCH v2 08/12] hw/block/pflash_cfi02: Add DeviceReset method

2021-03-10 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- hw/block/pflash_cfi02.c | 8 1 file changed, 8 insertions(+) diff --git a/hw/block/pflash_cfi02.c b/hw/block/pflash_cfi02.c index aea47a99c61..c40febd2a41 100644 --- a/hw/block/pflash_cfi02.c +++ b/hw/block/pflash_cfi02.c @@ -942,6 +942,13 @@

[PATCH v2 04/12] hw/block/pflash_cfi02: Set rom_mode to true in pflash_setup_mappings()

2021-03-10 Thread Philippe Mathieu-Daudé
There is only one call to pflash_setup_mappings(). Convert 'rom_mode' to boolean and set it to true directly within pflash_setup_mappings(). Reviewed-by: Bin Meng Signed-off-by: Philippe Mathieu-Daudé --- v2: Convert to bool in pflash_register_memory (David) --- hw/block/pflash_cfi02.c | 6

[PATCH v2 03/12] hw/block/pflash_cfi02: Extract pflash_cfi02_fill_cfi_table()

2021-03-10 Thread Philippe Mathieu-Daudé
Fill the CFI table in out of DeviceRealize() in a new function: pflash_cfi02_fill_cfi_table(). Reviewed-by: Bin Meng Reviewed-by: David Edmondson Signed-off-by: Philippe Mathieu-Daudé --- hw/block/pflash_cfi02.c | 193 +--- 1 file changed, 99 insertions(+),

[PATCH v2 01/12] hw/block/pflash_cfi: Fix code style for checkpatch.pl

2021-03-10 Thread Philippe Mathieu-Daudé
We are going to move this code, fix its style first. Reviewed-by: Bin Meng Reviewed-by: David Edmondson Signed-off-by: Philippe Mathieu-Daudé --- hw/block/pflash_cfi01.c | 36 hw/block/pflash_cfi02.c | 9 ++--- 2 files changed, 30 insertions(+), 15

[PATCH v2 00/12] hw/block/pflash: Refactors around setting the device in read-array mode

2021-03-10 Thread Philippe Mathieu-Daudé
I remembered this almost 2 years old series while reviewing David Edmondson's patches... (which are included at the end). Basically we move things around to make the code easier to maintain. Since v1: - Addressed David/Bin comments - Added R-b Missing review: patches 7 & 8 Regards, Phil.

Re: [PATCH 7/9] hw/block/pflash_cfi02: Factor out DeviceReset method

2021-03-10 Thread Philippe Mathieu-Daudé
On 3/10/21 9:48 AM, Bin Meng wrote: > On Wed, Mar 10, 2021 at 7:55 AM Philippe Mathieu-Daudé > wrote: >> >> There is multiple places doing a device reset. Factor that >> out in a common method which matches the DeviceReset prototype, >> so we can also remove the reset code from the

Re: [PATCH 4/9] hw/block/pflash_cfi02: Set rom_mode to true in pflash_setup_mappings()

2021-03-10 Thread Philippe Mathieu-Daudé
On 3/10/21 11:58 AM, David Edmondson wrote: > On Wednesday, 2021-03-10 at 00:50:23 +01, Philippe Mathieu-Daudé wrote: > >> There is only one call to pflash_setup_mappings(). Convert 'rom_mode' >> to boolean and set it to true directly within pflash_setup_mappings(). >> >> Signed-off-by: Philippe

Re: [PATCH] coroutine: add libucontext as external library

2021-03-10 Thread Joelle van Dyne
Good point, I only ran the PC BIOS but it did time out of 56 tests. -j On Wed, Mar 10, 2021 at 1:30 AM Daniel P. Berrangé wrote: > > On Tue, Mar 09, 2021 at 01:21:29PM -0800, Joelle van Dyne wrote: > > On Tue, Mar 9, 2021 at 10:24 AM Joelle van Dyne wrote: > > > > > > On Tue, Mar 9, 2021 at

Re: [PATCH] block: Introduce zero-co:// and zero-aio://

2021-03-10 Thread Fam Zheng
On Wed, 10 Mar 2021 at 15:02, Max Reitz wrote: > On 10.03.21 15:17, f...@euphon.net wrote: > > From: Fam Zheng > > > > null-co:// has a read-zeroes=off default, when used to in security > > analysis, this can cause false positives because the driver doesn't > > write to the read buffer. > > > >

Re: [PATCH 6/9] hw/block/pflash_cfi02: Rename register_memory(true) as mode_read_array

2021-03-10 Thread Philippe Mathieu-Daudé
On 3/10/21 5:31 PM, Philippe Mathieu-Daudé wrote: > On 3/10/21 11:59 AM, David Edmondson wrote: >> On Wednesday, 2021-03-10 at 00:50:25 +01, Philippe Mathieu-Daudé wrote: >> >>> The same pattern is used when setting the flash in READ_ARRAY mode: >>> - Set the state machine command to READ_ARRAY

Re: [PATCH v2 00/12] block/export: vhost-user-blk server tests and input validation

2021-03-10 Thread Kevin Wolf
Am 10.03.2021 um 16:51 hat Peter Maydell geschrieben: > On Fri, 19 Feb 2021 at 22:38, Peter Maydell wrote: > > > > On Mon, 15 Feb 2021 at 10:41, Kevin Wolf wrote: > > > > > > Am 07.12.2020 um 18:20 hat Stefan Hajnoczi geschrieben: > > > > v2: > > > > * Add abrt handler that terminates

Re: [PATCH 6/9] hw/block/pflash_cfi02: Rename register_memory(true) as mode_read_array

2021-03-10 Thread Philippe Mathieu-Daudé
On 3/10/21 11:59 AM, David Edmondson wrote: > On Wednesday, 2021-03-10 at 00:50:25 +01, Philippe Mathieu-Daudé wrote: > >> The same pattern is used when setting the flash in READ_ARRAY mode: >> - Set the state machine command to READ_ARRAY >> - Reset the write_cycle counter >> - Reset the memory

Re: [PATCH 4/4] iotests/108: Test new refcount rebuild algorithm

2021-03-10 Thread Eric Blake
On 3/10/21 9:59 AM, Max Reitz wrote: > One clear problem with how qcow2's refcount structure rebuild algorithm > used to be before "qcow2: Improve refcount structure rebuilding" was > that it is prone to failure for qcow2 images on block devices: There is > generally unused space after the actual

[PATCH 2/4] iotests/common.qemu: Add _cleanup_single_qemu

2021-03-10 Thread Max Reitz
_cleanup_qemu cleans up all qemu instances, which sometimes is not very useful. Pull out _cleanup_single_qemu, which does the same only for a single instance. Signed-off-by: Max Reitz --- tests/qemu-iotests/common.qemu | 55 +- 1 file changed, 34 insertions(+),

[PATCH 4/4] iotests/108: Test new refcount rebuild algorithm

2021-03-10 Thread Max Reitz
One clear problem with how qcow2's refcount structure rebuild algorithm used to be before "qcow2: Improve refcount structure rebuilding" was that it is prone to failure for qcow2 images on block devices: There is generally unused space after the actual image, and if that exceeds what one refblock

[PATCH 3/4] iotests/common.qemu: Allow using the QSD

2021-03-10 Thread Max Reitz
For block things, we often do not need to run all of qemu, so allow using the qemu-storage-daemon instead. Signed-off-by: Max Reitz --- tests/qemu-iotests/common.qemu | 53 +++--- 1 file changed, 43 insertions(+), 10 deletions(-) diff --git

[PATCH 1/4] qcow2: Improve refcount structure rebuilding

2021-03-10 Thread Max Reitz
When rebuilding the refcount structures (when qemu-img check -r found errors with refcount = 0, but reference count > 0), the new refcount table defaults to being put at the image file end[1]. There is no good reason for that except that it means we will not have to rewrite any refblocks we

[PATCH 0/4] qcow2: Improve refcount structure rebuilding

2021-03-10 Thread Max Reitz
Hi, When the qcow2 refcount structure is broken to a point where we cannot rely on any information from it (because it shows clusters as free that are in use), “qemu-img check -r all” completely rewrites it. The new reftable is preferably written into the area covered by the last refblock for

Re: [PATCH v2 00/12] block/export: vhost-user-blk server tests and input validation

2021-03-10 Thread Peter Maydell
On Fri, 19 Feb 2021 at 22:38, Peter Maydell wrote: > > On Mon, 15 Feb 2021 at 10:41, Kevin Wolf wrote: > > > > Am 07.12.2020 um 18:20 hat Stefan Hajnoczi geschrieben: > > > v2: > > > * Add abrt handler that terminates qemu-storage-daemon to > > >vhost-user-blk-test. No more orphaned

[PATCH v3 2/2] block: Add backend_defaults property

2021-03-10 Thread Akihiko Odaki
backend_defaults property allow users to control if default block properties should be decided with backend information. If it is off, any backend information will be discarded, which is suitable if you plan to perform live migration to a different disk backend. If it is on, a block device may

[PATCH v3 1/2] block/file-posix: Optimize for macOS

2021-03-10 Thread Akihiko Odaki
This commit introduces "punch hole" operation and optimizes transfer block size for macOS. This commit introduces two additional members, discard_granularity and opt_io to BlockSizes type in include/block/block.h. Also, the members of the type are now optional. Set -1 to discard_granularity and 0

Re: [PATCH] block: Introduce zero-co:// and zero-aio://

2021-03-10 Thread Max Reitz
On 10.03.21 15:17, f...@euphon.net wrote: From: Fam Zheng null-co:// has a read-zeroes=off default, when used to in security analysis, this can cause false positives because the driver doesn't write to the read buffer. null-co:// has the highest possible performance as a block driver, so

Re: [PATCH] block: Introduce zero-co:// and zero-aio://

2021-03-10 Thread Fam Zheng
On Wed, 10 Mar 2021 at 14:51, Philippe Mathieu-Daudé wrote: > On 3/10/21 3:28 PM, Fam Zheng wrote: > > On Wed, 10 Mar 2021 at 14:24, Philippe Mathieu-Daudé > > wrote: > > > > On 3/10/21 3:17 PM, f...@euphon.net wrote: > > > From: Fam

Re: [PATCH] block: Introduce zero-co:// and zero-aio://

2021-03-10 Thread Fam Zheng
On Wed, 10 Mar 2021 at 14:41, Vladimir Sementsov-Ogievskiy < vsement...@virtuozzo.com> wrote: > 10.03.2021 17:17, f...@euphon.net wrote: > > From: Fam Zheng > > > > null-co:// has a read-zeroes=off default, when used to in security > > analysis, this can cause false positives because the driver

Re: [PATCH] block: Introduce zero-co:// and zero-aio://

2021-03-10 Thread Philippe Mathieu-Daudé
On 3/10/21 3:28 PM, Fam Zheng wrote: > On Wed, 10 Mar 2021 at 14:24, Philippe Mathieu-Daudé > wrote: > > On 3/10/21 3:17 PM, f...@euphon.net wrote: > > From: Fam Zheng mailto:famzh...@amazon.com>> > > > > null-co:// has a

Re: [PATCH v3 00/30] qapi/qom: QAPIfy --object and object-add

2021-03-10 Thread Peter Krempa
On Wed, Mar 10, 2021 at 15:31:57 +0100, Paolo Bonzini wrote: > On 10/03/21 15:22, Peter Krempa wrote: > > I've stumbled upon a regression with this patchset applied: > > > > error: internal error: process exited while connecting to monitor: > > qemu-system-x86_64: -object > >

Re: [PATCH] block: Introduce zero-co:// and zero-aio://

2021-03-10 Thread Vladimir Sementsov-Ogievskiy
10.03.2021 17:17, f...@euphon.net wrote: From: Fam Zheng null-co:// has a read-zeroes=off default, when used to in security analysis, this can cause false positives because the driver doesn't write to the read buffer. null-co:// has the highest possible performance as a block driver, so let's

Re: [PATCH v3 00/30] qapi/qom: QAPIfy --object and object-add

2021-03-10 Thread Paolo Bonzini
On 10/03/21 15:22, Peter Krempa wrote: I've stumbled upon a regression with this patchset applied: error: internal error: process exited while connecting to monitor: qemu-system-x86_64: -object memory-backend-ram,id=pc.ram,size=1048576000,host-nodes=0,policy=bind: Invalid parameter type for

Re: [PATCH] block: Introduce zero-co:// and zero-aio://

2021-03-10 Thread Fam Zheng
On Wed, 10 Mar 2021 at 14:24, Philippe Mathieu-Daudé wrote: > On 3/10/21 3:17 PM, f...@euphon.net wrote: > > From: Fam Zheng > > > > null-co:// has a read-zeroes=off default, when used to in security > > analysis, this can cause false positives because the driver doesn't > > write to the read

Re: [PATCH 0/3] block: Introduce the 'zeroes-co' driver to help security reports

2021-03-10 Thread Fam Zheng
On Wed, 10 Mar 2021 at 12:38, Philippe Mathieu-Daudé wrote: > On 3/10/21 1:32 PM, Fam Zheng wrote: > > On Wed, 10 Mar 2021 at 11:44, Philippe Mathieu-Daudé > > wrote: > > > > Hi, > > > > This is an alternative approach to changing null-co driver > > default

Re: [PATCH v3 00/30] qapi/qom: QAPIfy --object and object-add

2021-03-10 Thread Peter Krempa
On Mon, Mar 08, 2021 at 17:54:10 +0100, Kevin Wolf wrote: > This series adds a QAPI type for the properties of all user creatable > QOM types and finally makes the --object command line option (in all > binaries) and the object-add monitor commands (in QMP and HMP) use the > new ObjectOptions

Re: [PATCH] block: Introduce zero-co:// and zero-aio://

2021-03-10 Thread Philippe Mathieu-Daudé
On 3/10/21 3:17 PM, f...@euphon.net wrote: > From: Fam Zheng > > null-co:// has a read-zeroes=off default, when used to in security > analysis, this can cause false positives because the driver doesn't > write to the read buffer. > > null-co:// has the highest possible performance as a block

[PATCH] block: Introduce zero-co:// and zero-aio://

2021-03-10 Thread fam
From: Fam Zheng null-co:// has a read-zeroes=off default, when used to in security analysis, this can cause false positives because the driver doesn't write to the read buffer. null-co:// has the highest possible performance as a block driver, so let's keep it that way. This patch introduces

Re: [PATCH 00/10] target: Provide target-specific Kconfig

2021-03-10 Thread Claudio Fontana
Hi all, where are we with this series? I am trying to figure out how to apply the whole thing, in order to build only compatible ARM boards and devices for KVM-only builds. Ie, I would like to combine this with: "arm cleanup experiment for kvm-only build"

Re: [PATCH 0/3] block: Introduce the 'zeroes-co' driver to help security reports

2021-03-10 Thread Fam Zheng
On Wed, 10 Mar 2021 at 11:44, Philippe Mathieu-Daudé wrote: > Hi, > > This is an alternative approach to changing null-co driver > default 'read-zeroes' option to true: > https://www.mail-archive.com/qemu-block@nongnu.org/msg80873.html > > Instead we introduce yet another block driver with an

Re: [PATCH 3/3] docs/secure-coding-practices: Describe null-co/zeroes-co block drivers

2021-03-10 Thread Vladimir Sementsov-Ogievskiy
10.03.2021 14:43, Philippe Mathieu-Daudé wrote: Document that security reports must not use the 'null-co' block driver, as it leaves memory uninitialized on purposed (this is a performance feature). Reports must be send using the 'zeroes-co' driver. Signed-off-by: Philippe Mathieu-Daudé ---

Re: [PATCH 0/3] block: Introduce the 'zeroes-co' driver to help security reports

2021-03-10 Thread Philippe Mathieu-Daudé
On 3/10/21 1:32 PM, Fam Zheng wrote: > On Wed, 10 Mar 2021 at 11:44, Philippe Mathieu-Daudé > wrote: > > Hi, > > This is an alternative approach to changing null-co driver > default 'read-zeroes' option to true: >

Re: [PATCH 0/3] block: Introduce the 'zeroes-co' driver to help security reports

2021-03-10 Thread Philippe Mathieu-Daudé
On 3/10/21 12:55 PM, Daniel P. Berrangé wrote: > On Wed, Mar 10, 2021 at 12:43:11PM +0100, Philippe Mathieu-Daudé wrote: >> Hi, >> >> This is an alternative approach to changing null-co driver >> default 'read-zeroes' option to true: >>

Re: [PATCH 0/3] block: Introduce the 'zeroes-co' driver to help security reports

2021-03-10 Thread Daniel P . Berrangé
On Wed, Mar 10, 2021 at 12:43:11PM +0100, Philippe Mathieu-Daudé wrote: > Hi, > > This is an alternative approach to changing null-co driver > default 'read-zeroes' option to true: > https://www.mail-archive.com/qemu-block@nongnu.org/msg80873.html > > Instead we introduce yet another block

Re: [PATCH v2 15/36] block: use topological sort for permission update

2021-03-10 Thread Kevin Wolf
Am 10.03.2021 um 12:08 hat Vladimir Sementsov-Ogievskiy geschrieben: > 03.02.2021 21:38, Kevin Wolf wrote: > > Am 28.01.2021 um 19:04 hat Vladimir Sementsov-Ogievskiy geschrieben: > > > 28.01.2021 20:13, Kevin Wolf wrote: > > > > Am 28.01.2021 um 10:34 hat Vladimir Sementsov-Ogievskiy geschrieben:

Re: [PATCH 0/2] block/curl: Disconnect sockets from CURLState

2021-03-10 Thread Kevin Wolf
Am 09.03.2021 um 14:05 hat Max Reitz geschrieben: > Hi, > > There’s been a bug report concerning our curl driver on Launchpad: > https://bugs.launchpad.net/qemu/+bug/1916501 > > When downloading an image from a certain URL, it crashes. >

[PATCH 3/3] docs/secure-coding-practices: Describe null-co/zeroes-co block drivers

2021-03-10 Thread Philippe Mathieu-Daudé
Document that security reports must not use the 'null-co' block driver, as it leaves memory uninitialized on purposed (this is a performance feature). Reports must be send using the 'zeroes-co' driver. Signed-off-by: Philippe Mathieu-Daudé --- docs/devel/secure-coding-practices.rst | 7 +++

[RFC PATCH 2/3] tests/test-blockjob: Use zeroes-co instead of null-co, read-zeroes=on

2021-03-10 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- RFC because I won't convert the rest of the tests until the previous patch is reviewed. --- tests/test-blockjob.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/test-blockjob.c b/tests/test-blockjob.c index

[PATCH 1/3] block: Introduce the 'zeroes-co' driver

2021-03-10 Thread Philippe Mathieu-Daudé
The 'zeroes-co' block driver is almost a copy of the 'null-co' block driver designed for performance testing, but targets security needs, by always zero-initializing read accesses. Write accesses are discarded. Suggested-by: Fam Zheng Signed-off-by: Philippe Mathieu-Daudé --- block/zeroes.c

[PATCH 0/3] block: Introduce the 'zeroes-co' driver to help security reports

2021-03-10 Thread Philippe Mathieu-Daudé
Hi, This is an alternative approach to changing null-co driver default 'read-zeroes' option to true: https://www.mail-archive.com/qemu-block@nongnu.org/msg80873.html Instead we introduce yet another block driver with an explicit name: 'zeroes-co'. We then clarify in secure-coding-practices.rst

Re: [PATCH v2] block/file-posix: Optimize for macOS

2021-03-10 Thread Stefan Hajnoczi
On Tue, Mar 09, 2021 at 12:37:35AM +0900, Akihiko Odaki wrote: > 2021年3月9日(火) 0:17 Stefan Hajnoczi : > > > > The live migration compatibility issue is still present. Migrating to > > another host might not work if the block limits are different. > > > > Here is an idea for solving it: > > > >

Re: [PATCH v2 15/36] block: use topological sort for permission update

2021-03-10 Thread Vladimir Sementsov-Ogievskiy
03.02.2021 21:38, Kevin Wolf wrote: Am 28.01.2021 um 19:04 hat Vladimir Sementsov-Ogievskiy geschrieben: 28.01.2021 20:13, Kevin Wolf wrote: Am 28.01.2021 um 10:34 hat Vladimir Sementsov-Ogievskiy geschrieben: 27.01.2021 21:38, Kevin Wolf wrote: Am 27.11.2020 um 15:45 hat Vladimir

Re: [PATCH 9/9] hw/block/pflash_cfi01: Extract pflash_mode_read_array()

2021-03-10 Thread David Edmondson
On Wednesday, 2021-03-10 at 00:50:28 +01, Philippe Mathieu-Daudé wrote: > The same pattern is used when setting the flash in READ_ARRAY mode: > - Set the state machine command to READ_ARRAY > - Reset the write_cycle counter > - Reset the memory region in ROMD > > Refactor the current code by

Re: [PULL v2 00/30] Block layer patches

2021-03-10 Thread Peter Maydell
On Mon, 8 Mar 2021 at 17:02, Kevin Wolf wrote: > > The following changes since commit 138d2931979cb7ee4a54a434a54088231f6980ff: > > Merge remote-tracking branch > 'remotes/pmaydell/tags/pull-target-arm-20210308' into staging (2021-03-08 > 11:57:36 +) > > are available in the Git

Re: [PATCH 8/9] hw/block/pflash_cfi01: Clarify trace events

2021-03-10 Thread David Edmondson
On Wednesday, 2021-03-10 at 00:50:27 +01, Philippe Mathieu-Daudé wrote: > Use the 'mode_read_array' event when we set the device in such > mode, and use the 'reset' event in DeviceReset handler. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: David Edmondson > --- >

Re: [PATCH 7/9] hw/block/pflash_cfi02: Factor out DeviceReset method

2021-03-10 Thread David Edmondson
On Wednesday, 2021-03-10 at 00:50:26 +01, Philippe Mathieu-Daudé wrote: > There is multiple places doing a device reset. Factor that > out in a common method which matches the DeviceReset prototype, > so we can also remove the reset code from the DeviceRealize() > handler. Explicit the device is

Re: [PATCH 6/9] hw/block/pflash_cfi02: Rename register_memory(true) as mode_read_array

2021-03-10 Thread David Edmondson
On Wednesday, 2021-03-10 at 00:50:25 +01, Philippe Mathieu-Daudé wrote: > The same pattern is used when setting the flash in READ_ARRAY mode: > - Set the state machine command to READ_ARRAY > - Reset the write_cycle counter > - Reset the memory region in ROMD > > Refactor the current code by

Re: [PATCH 4/9] hw/block/pflash_cfi02: Set rom_mode to true in pflash_setup_mappings()

2021-03-10 Thread David Edmondson
On Wednesday, 2021-03-10 at 00:50:23 +01, Philippe Mathieu-Daudé wrote: > There is only one call to pflash_setup_mappings(). Convert 'rom_mode' > to boolean and set it to true directly within pflash_setup_mappings(). > > Signed-off-by: Philippe Mathieu-Daudé > --- > hw/block/pflash_cfi02.c | 4

Re: [PATCH 3/9] hw/block/pflash_cfi02: Extract pflash_cfi02_fill_cfi_table()

2021-03-10 Thread David Edmondson
On Wednesday, 2021-03-10 at 00:50:22 +01, Philippe Mathieu-Daudé wrote: > Fill the CFI table in out of DeviceRealize() in a new function: > pflash_cfi02_fill_cfi_table(). > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: David Edmondson > --- > hw/block/pflash_cfi02.c | 193

Re: [PATCH] stream: Don't crash when node permission is denied

2021-03-10 Thread Alberto Garcia
On Tue 09 Mar 2021 06:34:51 PM CET, Kevin Wolf wrote: > The image streaming block job restricts shared permissions of the nodes > it accesses. This can obviously fail when other users already got these > permissions. _abort is therefore wrong and can crash. Handle these > errors gracefully and

[PATCH v5 13/13] hw/block/nvme: add support for the format nvm command

2021-03-10 Thread Klaus Jensen
From: Minwoo Im Format NVM admin command can make a namespace or namespaces to be with different LBA size and metadata size with protection information types. This patch introduces Format NVM command with LBA format, Metadata, and Protection Information for the device. The secure erase

[PATCH v5 09/13] hw/block/nvme: parameterize nvme_ns_nlbas

2021-03-10 Thread Klaus Jensen
From: Klaus Jensen Provide a more flexible nlbas helper. Signed-off-by: Klaus Jensen --- hw/block/nvme-ns.h | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/hw/block/nvme-ns.h b/hw/block/nvme-ns.h index 07e16880801d..34f9474a1cd1 100644 ---

[PATCH v5 08/13] hw/block/nvme: pull lba format initialization

2021-03-10 Thread Klaus Jensen
From: Klaus Jensen Pull lba format initialization code into separate function in preparation for Format NVM support. Signed-off-by: Klaus Jensen --- hw/block/nvme-ns.c | 74 +- 1 file changed, 41 insertions(+), 33 deletions(-) diff --git

[PATCH v5 06/13] hw/block/nvme: support multiple lba formats

2021-03-10 Thread Klaus Jensen
From: Minwoo Im This patch introduces multiple LBA formats supported with the typical logical block sizes of 512 bytes and 4096 bytes as well as metadata sizes of 0, 8, 16 and 64 bytes. The format will be chosed based on the lbads and ms parameters of the nvme-ns device. Signed-off-by: Minwoo

[PATCH v5 03/13] hw/block/nvme: end-to-end data protection

2021-03-10 Thread Klaus Jensen
From: Klaus Jensen Add support for namespaces formatted with protection information. The type of end-to-end data protection (i.e. Type 1, Type 2 or Type 3) is selected with the `pi` nvme-ns device parameter. If the number of metadata bytes is larger than 8, the `pil` nvme-ns device parameter may

[PATCH v5 12/13] hw/block/nvme: split zone check/set geometry

2021-03-10 Thread Klaus Jensen
From: Klaus Jensen In preparation for Format NVM support, split zone geometry check from the zone geometry set function. Signed-off-by: Klaus Jensen --- hw/block/nvme-ns.c | 76 -- 1 file changed, 47 insertions(+), 29 deletions(-) diff --git

[PATCH v5 07/13] hw/block/nvme: prefer runtime helpers instead of device parameters

2021-03-10 Thread Klaus Jensen
From: Klaus Jensen In preparation for Format NVM support, use runtime helpers instead of the constant device parameters when getting lba size information etc. Signed-off-by: Klaus Jensen --- hw/block/nvme-ns.h | 2 +- hw/block/nvme-ns.c | 6 +++--- 2 files changed, 4 insertions(+), 4

[PATCH v5 10/13] hw/block/nvme: remove invalid zone resource checks

2021-03-10 Thread Klaus Jensen
From: Klaus Jensen It is not an error to report more active/open zones supported than the number of zones in the namespace. Signed-off-by: Klaus Jensen --- hw/block/nvme-ns.c | 13 - 1 file changed, 13 deletions(-) diff --git a/hw/block/nvme-ns.c b/hw/block/nvme-ns.c index

[PATCH v5 11/13] hw/block/nvme: move zoned constraints checks

2021-03-10 Thread Klaus Jensen
From: Klaus Jensen Validation of the max_active and max_open zoned parameters are independent of any other state, so move them to the early nvme_ns_check_constraints parameter checks. Signed-off-by: Klaus Jensen --- hw/block/nvme-ns.c | 52 +- 1

[PATCH v5 01/13] hw/block/nvme: fix zone management receive reporting too many zones

2021-03-10 Thread Klaus Jensen
From: Klaus Jensen nvme_zone_mgmt_recv uses nvme_ns_nlbas() to get the number of LBAs in the namespace and then calculates the number of zones to report by incrementing slba with ZSZE until exceeding the number of LBAs as returned by nvme_ns_nlbas(). This is bad because the namespace might be

[PATCH v5 05/13] hw/block/nvme: add non-mdts command size limit for verify

2021-03-10 Thread Klaus Jensen
From: Klaus Jensen Verify is not subject to MDTS, so a single Verify command may result in excessive amounts of allocated memory. Impose a limit on the data size by adding support for TP 4040 ("Non-MDTS Command Size Limits"). Signed-off-by: Klaus Jensen Reviewed-by: Keith Busch ---

[PATCH v5 02/13] hw/block/nvme: add metadata support

2021-03-10 Thread Klaus Jensen
From: Klaus Jensen Add support for metadata in the form of extended logical blocks as well as a separate buffer of data. The new `ms` nvme-ns device parameter specifies the size of metadata per logical block in bytes. The `mset` nvme-ns device parameter controls whether metadata is transfered as

[PATCH v5 04/13] hw/block/nvme: add verify command

2021-03-10 Thread Klaus Jensen
From: Gollu Appalanaidu See NVM Express 1.4, section 6.14 ("Verify Command"). Signed-off-by: Gollu Appalanaidu [k.jensen: rebased, refactored for e2e] Signed-off-by: Klaus Jensen Reviewed-by: Keith Busch --- hw/block/nvme-dif.h | 2 + hw/block/nvme.h | 1 + include/block/nvme.h

  1   2   >