Re: [PATCH v4 5/5] qapi: More complex uses of QAPI_LIST_APPEND

2021-01-27 Thread Markus Armbruster
Eric Blake writes: > On 1/26/21 3:31 AM, Markus Armbruster wrote: >> Eric Blake writes: >> >>> These cases require a bit more thought to review; in each case, the >>> code was appending to a list, but not with a FOOList **tail variable. >>> >>> Signed-off-by: Eric Blake >>> Reviewed-by: Vladim

Re: [PATCH 2/3] hw/sd: sd: Move the sd_block_{read, write} and macros ahead

2021-01-27 Thread Cédric Le Goater
Hello Bin, On 1/28/21 7:43 AM, Bin Meng wrote: > From: Bin Meng > > These APIs and macros may be referenced by functions that are > currently before them. Move them ahead a little bit. We could also change fprintf() by qemu_log_mask() Thanks, C. > Signed-off-by: Bin Meng > --- > > hw/s

[PATCH 2/3] hw/sd: sd: Move the sd_block_{read, write} and macros ahead

2021-01-27 Thread Bin Meng
From: Bin Meng These APIs and macros may be referenced by functions that are currently before them. Move them ahead a little bit. Signed-off-by: Bin Meng --- hw/sd/sd.c | 42 +- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/hw/sd/sd.c

[PATCH 3/3] hw/sd: sd: Actually perform the erase operation

2021-01-27 Thread Bin Meng
From: Bin Meng At present the sd_erase() does not erase the requested range of card data to 0xFFs. Let's make the erase operation actually happen. Signed-off-by: Bin Meng --- hw/sd/sd.c | 9 + 1 file changed, 9 insertions(+) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 1886d4b30b..8c3

[PATCH v4 8/9] hw/sd: ssi-sd: Fix STOP_TRANSMISSION (CMD12) response

2021-01-27 Thread Bin Meng
From: Bin Meng CMD12's response type is R1b, which is basically a R1 plus optional addition of the busy signal token that can be any number of bytes. A zero value indicates card is busy and a non-zero value indicates the card is ready for the next command. Current implementation sends the busy s

[PATCH 0/3] hw/sd: sd: erase operation fixes

2021-01-27 Thread Bin Meng
From: Bin Meng This includes several fixes related to erase operation of a SD card. Based-on: http://patchwork.ozlabs.org/project/qemu-devel/list/?series=226785 Bin Meng (3): hw/sd: sd: Fix address check in sd_erase() hw/sd: sd: Move the sd_block_{read,write} and macros ahead hw/sd: sd:

[PATCH 1/3] hw/sd: sd: Fix address check in sd_erase()

2021-01-27 Thread Bin Meng
From: Bin Meng For high capacity memory cards, the erase start address and end address are multiplied by 512, but the address check is still based on the original block number in sd->erase_{start, end}. Fixes: 1bd6fd8ed593 ("hw/sd/sdcard: Do not attempt to erase out of range addresses") Signed-

[PATCH v4 9/9] hw/sd: ssi-sd: Handle the rest commands with R1b response type

2021-01-27 Thread Bin Meng
From: Bin Meng Besides CMD12, the following command's reponse type is R1b: - SET_WRITE_PROT (CMD28) - CLR_WRITE_PROT (CMD29) - ERASE (CMD38) Reuse the same s->stopping to indicate a R1b reponse is needed. Signed-off-by: Bin Meng --- Changes in v4: - new patch: handle the rest commands with

[PATCH v4 5/9] hw/sd: ssi-sd: Support single block write

2021-01-27 Thread Bin Meng
From: Bin Meng Add 2 more states for the block write operation. The SPI host needs to send a data start token to start the transfer, and the data block written to the card will be acknowledged by a data response token. Signed-off-by: Bin Meng Acked-by: Alistair Francis [PMD: Change VMState ver

[PATCH v4 7/9] hw/sd: ssi-sd: Fix SEND_IF_COND (CMD8) response

2021-01-27 Thread Bin Meng
From: Bin Meng The SEND_IF_COND command (CMD8) response is of format R7, but current code returns R1 for CMD8. Fix it. Fixes: 775616c3ae8c ("Partial SD card SPI mode support") Signed-off-by: Bin Meng Reviewed-by: Philippe Mathieu-Daudé --- When testing with VxWorks driver, this additional iss

[PATCH v4 6/9] hw/sd: ssi-sd: Support multiple block write

2021-01-27 Thread Bin Meng
From: Bin Meng For a multiple block write operation, each block begins with a multi write start token. Unlike the SD mode that the multiple block write ends when receiving a STOP_TRAN command (CMD12), a special stop tran token is used to signal the card. Emulating this by manually sending a CMD1

[PATCH v4 3/9] hw/sd: sd: Allow single/multiple block write for SPI mode

2021-01-27 Thread Bin Meng
From: Bin Meng At present the single/multiple block write in SPI mode is blocked by sd_normal_command(). Remove the limitation. Signed-off-by: Bin Meng Acked-by: Alistair Francis Tested-by: Philippe Mathieu-Daudé --- (no changes since v1) hw/sd/sd.c | 3 --- 1 file changed, 3 deletions(-)

[PATCH v4 4/9] hw/sd: Introduce receive_ready() callback

2021-01-27 Thread Bin Meng
From: Bin Meng At present there is a data_ready() callback for the SD data read path. Let's add a receive_ready() for the SD data write path. Signed-off-by: Bin Meng Reviewed-by: Philippe Mathieu-Daudé Acked-by: Alistair Francis Tested-by: Philippe Mathieu-Daudé --- (no changes since v1)

[PATCH v4 2/9] hw/sd: sd: Remove duplicated codes in single/multiple block read/write

2021-01-27 Thread Bin Meng
From: Bin Meng The single block read (CMD17) codes are the same as the multiple block read (CMD18). Merge them into one. The same applies to single block write (CMD24) and multiple block write (CMD25). Signed-off-by: Bin Meng Acked-by: Alistair Francis Tested-by: Philippe Mathieu-Daudé --- (

[PATCH v4 1/9] hw/sd: ssi-sd: Support multiple block read

2021-01-27 Thread Bin Meng
From: Bin Meng In the case of a multiple block read operation every transferred block has its suffix of CRC16. Update the state machine logic to handle multiple block read. Signed-off-by: Bin Meng Acked-by: Alistair Francis [PMD: Change VMState version id 5 -> 6] Signed-off-by: Philippe Mathie

[PATCH v4 0/9] hw/sd: Support block read/write in SPI mode

2021-01-27 Thread Bin Meng
From: Bin Meng This includes the previously v3 series [1], and one single patch [2]. Compared to v3, this fixed the following issue in patch [v3,6/6]: - Keep the card state to SSI_SD_CMD instead of SSI_SD_RESPONSE after receiving the STOP_TRAN token per the spec All software tested so far (U-

Re: [PATCH 0/2] hw/block/nvme: zoned fixes

2021-01-27 Thread Klaus Jensen
On Jan 19 14:54, Klaus Jensen wrote: > From: Klaus Jensen > > Patch [1/2] fixes the zone append bug reported by Niklas. [2/2] > refactors the zone write check function to return status codes in a > different order if there are multiple zone write violations that apply. > > Klaus Jensen (2): >

[PATCH v4] blockjob: Fix crash with IOthread when block commit after snapshot

2021-01-27 Thread 08005325
From: Michael Qiu v4: rebase to latest code v3: reformat the commit log, remove duplicate content v2: modify the coredump backtrace within commit log with the newest qemu with master branch Currently, if guest has workloads, IO thread will acquire aio_context lock before do io_submit, it l

RE: [PATCH 0/2] hw/block/nvme: zoned fixes

2021-01-27 Thread Dmitry Fomichev
> -Original Message- > From: Keith Busch > Sent: Wednesday, January 27, 2021 12:42 PM > To: Klaus Jensen > Cc: qemu-de...@nongnu.org; Kevin Wolf ; Max Reitz > ; qemu-block@nongnu.org; Dmitry Fomichev > ; Klaus Jensen > Subject: Re: [PATCH 0/2] hw/block/nvme: zoned fixes > > On Tue, Jan

Re: [PATCH 2/2] block/nvme: Trace NVMe spec version supported by the controller

2021-01-27 Thread Klaus Jensen
On Jan 27 22:21, Philippe Mathieu-Daudé wrote: > NVMe controllers implement different versions of the spec, > and different features of it. It is useful to gather this > information when debugging. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Klaus Jensen > --- > block/nvme.c

Re: [PATCH 1/2] block/nvme: Properly display doorbell stride length in trace event

2021-01-27 Thread Klaus Jensen
On Jan 27 22:21, Philippe Mathieu-Daudé wrote: > Commit 15b2260bef3 ("block/nvme: Trace controller capabilities") > misunderstood the doorbell stride value from the datasheet, use > the correct one. The 'doorbell_scale' variable used few lines > later is correct. > > Signed-off-by: Philippe Mathie

[PATCH 0/2] block/nvme: Minor tracing improvements

2021-01-27 Thread Philippe Mathieu-Daudé
Fix an incorrect trace event (sometimes it is better to have no information rather than having incorrect info...) and add another event to display the spec implemented by the controller. Philippe Mathieu-Daudé (2): block/nvme: Properly display doorbell stride length in trace event block/nvme:

[PATCH 2/2] block/nvme: Trace NVMe spec version supported by the controller

2021-01-27 Thread Philippe Mathieu-Daudé
NVMe controllers implement different versions of the spec, and different features of it. It is useful to gather this information when debugging. Signed-off-by: Philippe Mathieu-Daudé --- block/nvme.c | 6 ++ block/trace-events | 1 + 2 files changed, 7 insertions(+) diff --git a/block

[PATCH 1/2] block/nvme: Properly display doorbell stride length in trace event

2021-01-27 Thread Philippe Mathieu-Daudé
Commit 15b2260bef3 ("block/nvme: Trace controller capabilities") misunderstood the doorbell stride value from the datasheet, use the correct one. The 'doorbell_scale' variable used few lines later is correct. Signed-off-by: Philippe Mathieu-Daudé --- block/nvme.c | 2 +- 1 file changed, 1 insert

[PULL 7/8] iotests: rewrite check into python

2021-01-27 Thread Kevin Wolf
From: Vladimir Sementsov-Ogievskiy Just use classes introduced in previous three commits. Behavior difference is described in these three commits. Drop group file, as it becomes unused. Drop common.env: now check is in python, and for tests we use same python interpreter that runs the check its

[PULL 6/8] iotests: add testrunner.py

2021-01-27 Thread Kevin Wolf
From: Vladimir Sementsov-Ogievskiy Add TestRunner class, which will run tests in a new python iotests running framework. There are some differences with current ./check behavior, most significant are: - Consider all tests self-executable, just run them, don't run python by hand. - Elapsed time

[PULL 8/8] iotests: rename and move 169 and 199 tests

2021-01-27 Thread Kevin Wolf
From: Vladimir Sementsov-Ogievskiy Rename bitmaps migration tests and move them to tests subdirectory to demonstrate new human-friendly test naming. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id: <20210125185056.129513-7-vsement...@virtuozzo.com> Signed-off-by: Kevin Wolf --- tests/q

[PULL 5/8] iotests: add testenv.py

2021-01-27 Thread Kevin Wolf
From: Vladimir Sementsov-Ogievskiy Add TestEnv class, which will handle test environment in a new python iotests running framework. Don't add compat=1.1 for qcow2 IMGOPTS, as v3 is default anyway. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id: <20210125185056.129513-4-vsement...@virtu

[PULL 3/8] iotests: 146: drop extra whitespaces from .out file

2021-01-27 Thread Kevin Wolf
From: Vladimir Sementsov-Ogievskiy check script will be stricter soon about whitespaces, so fix 146.out now. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id: <20210125185056.129513-2-vsement...@virtuozzo.com> Reviewed-by: Eric Blake Signed-off-by: Kevin Wolf --- tests/qemu-iotests/146

[PULL 2/8] virtio-scsi-test: Test writing to scsi-cd device

2021-01-27 Thread Kevin Wolf
This tests that trying to write to a (read-only) scsi-cd device backed by a read-write image file doesn't crash and results in the correct error. This is a regression test for https://bugs.launchpad.net/bugs/1906693. Signed-off-by: Kevin Wolf Message-Id: <20210118123448.307825-3-kw...@redhat.com

[PULL 4/8] iotests: add findtests.py

2021-01-27 Thread Kevin Wolf
From: Vladimir Sementsov-Ogievskiy Add python script with new logic of searching for tests: Current ./check behavior: - tests are named [0-9][0-9][0-9] - tests must be registered in group file (even if test doesn't belong to any group, like 142) Behavior of findtests.py: - group file is d

[PULL 1/8] block: Separate blk_is_writable() and blk_supports_write_perm()

2021-01-27 Thread Kevin Wolf
Currently, blk_is_read_only() tells whether a given BlockBackend can only be used in read-only mode because its root node is read-only. Some callers actually try to answer a slightly different question: Is the BlockBackend configured to be writable, by taking write permissions on the root node? Th

[PULL 0/8] Block layer patches

2021-01-27 Thread Kevin Wolf
The following changes since commit bf159f0bdc7b8e7aa8342dedb3829ca744c1b612: Merge remote-tracking branch 'remotes/edgar/tags/edgar/xilinx-next-2021-01-27.for-upstream' into staging (2021-01-27 17:40:25 +) are available in the Git repository at: git://repo.or.cz/qemu/kevin.git tags/for

Re: [PATCH v2 8/9] tests/docker: Add dockerfile for Alpine Linux

2021-01-27 Thread John Snow
On 1/27/21 4:58 AM, Daniel P. Berrangé wrote: On Tue, Jan 26, 2021 at 04:38:57PM -0500, John Snow wrote: On 1/19/21 8:41 AM, Thomas Huth wrote: On 18/01/2021 11.33, Daniel P. Berrangé wrote: On Mon, Jan 18, 2021 at 02:38:07PM +0800, Jiaxun Yang wrote: Alpine Linux[1] is a security-oriented, l

Re: [PATCH v5 02/10] iotests/297: Rewrite in Python and extend reach

2021-01-27 Thread John Snow
On 1/27/21 5:42 AM, Max Reitz wrote: Sounds reasonable to me (can’t find pylint-3 on Arch, for example).  As a follow-up, that is, because I’m afraid I’ve already put this series in a pull request... Max Ah, yeah. I checked master but didn't hunt through the maintainer branches. It's not

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

2021-01-27 Thread Kevin Wolf
Am 27.11.2020 um 15:45 hat Vladimir Sementsov-Ogievskiy geschrieben: > Rewrite bdrv_check_perm(), bdrv_abort_perm_update() and bdrv_set_perm() > to update nodes in topological sort order instead of simple DFS. With > topologically sorted nodes, we update a node only when all its parents > already u

Re: [PATCH v9 1/6] iotests: 146: drop extra whitespaces from .out file

2021-01-27 Thread Eric Blake
On 1/25/21 12:50 PM, Vladimir Sementsov-Ogievskiy wrote: > check script will be stricter soon about whitespaces, so fix 146.out > now. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > tests/qemu-iotests/146.out | 780 ++--- > 1 file changed, 390 insertions(

Re: [PATCH v4 5/5] qapi: More complex uses of QAPI_LIST_APPEND

2021-01-27 Thread Eric Blake
On 1/26/21 3:31 AM, Markus Armbruster wrote: > Eric Blake writes: > >> These cases require a bit more thought to review; in each case, the >> code was appending to a list, but not with a FOOList **tail variable. >> >> Signed-off-by: Eric Blake >> Reviewed-by: Vladimir Sementsov-Ogievskiy >> >>

Re: [PATCH 0/3] Fix zone write validation

2021-01-27 Thread Keith Busch
On Tue, Jan 26, 2021 at 09:40:44AM +0100, Klaus Jensen wrote: > On Jan 26 09:21, Klaus Jensen wrote: > > On Jan 26 14:02, Dmitry Fomichev wrote: > > > These patches solve a few problems that exist in zoned Write > > > ans Zone Append validation code. > > > > > > Dmitry Fomichev (3): > > > hw/blo

Re: [PATCH 0/2] hw/block/nvme: zoned fixes

2021-01-27 Thread Keith Busch
On Tue, Jan 19, 2021 at 02:54:58PM +0100, Klaus Jensen wrote: > From: Klaus Jensen > > Patch [1/2] fixes the zone append bug reported by Niklas. [2/2] > refactors the zone write check function to return status codes in a > different order if there are multiple zone write violations that apply. L

Re: [PULL 00/53] Block patches

2021-01-27 Thread Peter Maydell
On Tue, 26 Jan 2021 at 14:20, Max Reitz wrote: > > The following changes since commit 31ee895047bdcf7387e3570cbd2a473c6f744b08: > > Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into > staging (2021-01-25 15:56:13 +) > > are available in the Git repository at: > >

Re: [PATCH v4 1/7] qapi/block-core: Add retry option for error action

2021-01-27 Thread Eric Blake
On 12/15/20 6:30 AM, Jiahui Cen wrote: > Add a new error action 'retry' to support retry on errors. > > Signed-off-by: Jiahui Cen > Signed-off-by: Ying Fang > --- > blockdev.c | 2 ++ > qapi/block-core.json | 4 ++-- > 2 files changed, 4 insertions(+), 2 deletions(-) > +++ b/qapi/blo

Re: [PATCH v6 01/14] block: return status from bdrv_append and friends

2021-01-27 Thread Alberto Garcia
On Sat 16 Jan 2021 10:51:56 PM CET, Vladimir Sementsov-Ogievskiy wrote: > The recommended use of qemu error api assumes returning status together > with setting errp and avoid void functions with errp parameter. Let's > improve bdrv_append and some friends to reduce error-propagation > overhead in

[PATCH] hw/block/nvme: drain namespaces on sq deletion

2021-01-27 Thread Klaus Jensen
From: Klaus Jensen For most commands, when issuing an AIO, the BlockAIOCB is stored in the NvmeRequest aiocb pointer when the AIO is issued. The purpose of storing this is to allow the AIO to be cancelled when deleting submission queues (it is currently not used for Abort). Since the addition of

Re: [PATCH v5 02/10] iotests/297: Rewrite in Python and extend reach

2021-01-27 Thread Max Reitz
On 26.01.21 22:28, John Snow wrote: On 1/18/21 5:57 AM, Max Reitz wrote: Instead of checking iotests.py only, check all Python files in the qemu-iotests/ directory.  Of course, most of them do not pass, so there is an extensive skip list for now.  (The only files that do pass are 209, 254, 283,

Re: [PATCH v2 8/9] tests/docker: Add dockerfile for Alpine Linux

2021-01-27 Thread Daniel P . Berrangé
On Tue, Jan 26, 2021 at 04:38:57PM -0500, John Snow wrote: > On 1/19/21 8:41 AM, Thomas Huth wrote: > > On 18/01/2021 11.33, Daniel P. Berrangé wrote: > > > On Mon, Jan 18, 2021 at 02:38:07PM +0800, Jiaxun Yang wrote: > > > > Alpine Linux[1] is a security-oriented, lightweight Linux distribution >