Re: [PATCH 08/12] block/nvme: nvme_process_completion() fix bound for cid

2023-09-25 Thread Michael Tokarev
25.09.2023 22:40, Vladimir Sementsov-Ogievskiy wrote: NVMeQueuePair::reqs as length NVME_NUM_REQS, which less than NVME_QUEUE_SIZE by 1. +if (cid == 0 || cid > NVME_NUM_REQS) { +warn_report("NVMe: Unexpected CID in completion queue: %" PRIu32 +",

Re: [PATCH 1/1] hw/ide/core: terminate in-flight DMA on IDE bus reset

2023-09-25 Thread John Snow
Niklas, I'm sorry to lean on you here a little bit - You've been working on the SATA side of this a bit more often, can you let me know if you think this patch is safe? I'm not immediately sure what the impact of applying it is, but I have some questions about it: (1) When does ide_dma_cb get

[PATCH 08/12] block/nvme: nvme_process_completion() fix bound for cid

2023-09-25 Thread Vladimir Sementsov-Ogievskiy
NVMeQueuePair::reqs as length NVME_NUM_REQS, which less than NVME_QUEUE_SIZE by 1. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/nvme.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/block/nvme.c b/block/nvme.c index b6e95f0b7e..7f11ce1d46 100644 ---

[PATCH v7 03/12] nbd/server: Prepare to send extended header replies

2023-09-25 Thread Eric Blake
Although extended mode is not yet enabled, once we do turn it on, we need to reply with extended headers to all messages. Update the low level entry points necessary so that all other callers automatically get the right header based on the current mode. Signed-off-by: Eric Blake Reviewed-by:

[PATCH v7 04/12] nbd/server: Support 64-bit block status

2023-09-25 Thread Eric Blake
The NBD spec states that if the client negotiates extended headers, the server must avoid NBD_REPLY_TYPE_BLOCK_STATUS and instead use NBD_REPLY_TYPE_BLOCK_STATUS_EXT which supports 64-bit lengths, even if the reply does not need more than 32 bits. As of this patch, client->mode is still never

[PATCH v7 02/12] nbd/server: Prepare to receive extended header requests

2023-09-25 Thread Eric Blake
Although extended mode is not yet enabled, once we do turn it on, we need to accept extended requests for all messages. Previous patches have already taken care of supporting 64-bit lengths, now we just need to read it off the wire. Note that this implementation will block indefinitely on a

[PATCH v7 11/12] nbd/server: Prepare for per-request filtering of BLOCK_STATUS

2023-09-25 Thread Eric Blake
The next commit will add support for the optional extension NBD_CMD_FLAG_PAYLOAD during NBD_CMD_BLOCK_STATUS, where the client can request that the server only return a subset of negotiated contexts, rather than all contexts. To make that task easier, this patch populates the list of contexts to

[PATCH v7 12/12] nbd/server: Add FLAG_PAYLOAD support to CMD_BLOCK_STATUS

2023-09-25 Thread Eric Blake
Allow a client to request a subset of negotiated meta contexts. For example, a client may ask to use a single connection to learn about both block status and dirty bitmaps, but where the dirty bitmap queries only need to be performed on a subset of the disk; forcing the server to compute that

[PATCH v7 09/12] nbd/client: Request extended headers during negotiation

2023-09-25 Thread Eric Blake
All the pieces are in place for a client to finally request extended headers. Note that we must not request extended headers when qemu-nbd is used to connect to the kernel module (as nbd.ko does not expect them, but expects us to do the negotiation in userspace before handing the socket over to

[PATCH v7 08/12] nbd/client: Accept 64-bit block status chunks

2023-09-25 Thread Eric Blake
Once extended mode is enabled, we need to accept 64-bit status replies (even for replies that don't exceed a 32-bit length). It is easier to normalize narrow replies into wide format so that the rest of our code only has to handle one width. Although a server is non-compliant if it sends a

[PATCH v7 10/12] nbd/server: Refactor list of negotiated meta contexts

2023-09-25 Thread Eric Blake
Peform several minor refactorings of how the list of negotiated meta contexts is managed, to make upcoming patches easier: Promote the internal type NBDExportMetaContexts to the public opaque type NBDMetaContexts, and mark exp const. Use a shorter member name in NBDClient. Hoist calls to

[PATCH v7 05/12] nbd/server: Enable initial support for extended headers

2023-09-25 Thread Eric Blake
Time to start supporting clients that request extended headers. Now we can finally reach the code added across several previous patches. Even though the NBD spec has been altered to allow us to accept NBD_CMD_READ larger than the max payload size (provided our response is a hole or broken up

[PATCH v7 06/12] nbd/client: Plumb errp through nbd_receive_replies

2023-09-25 Thread Eric Blake
Instead of ignoring the low-level error just to refabricate our own message to pass to the caller, we can just plumb the caller's errp down to the low level. Signed-off-by: Eric Blake --- v5: set errp on more failure cases [Vladimir], typo fix v4: new patch [Vladimir] --- block/nbd.c | 18

[PATCH v7 07/12] nbd/client: Initial support for extended headers

2023-09-25 Thread Eric Blake
Update the client code to be able to send an extended request, and parse an extended header from the server. Note that since we reject any structured reply with a too-large payload, we can always normalize a valid header back into the compact form, so that the caller need not deal with two

[PATCH v7 00/12] NBD 64-bit extensions for qemu

2023-09-25 Thread Eric Blake
v6 was here: https://lists.gnu.org/archive/html/qemu-devel/2023-08/msg05231.html Since then: - patches v6 1-5 included in pull request - patch v6 6 logic improved, now v7 patch 1 - rebased to master Still needing review: - patch 1,6,7,11,12 Eric Blake (12): nbd/server: Support a request

[PATCH v7 01/12] nbd/server: Support a request payload

2023-09-25 Thread Eric Blake
Upcoming additions to support NBD 64-bit effect lengths allow for the possibility to distinguish between payload length (capped at 32M) and effect length (64 bits, although we generally assume 63 bits because of off_t limitations). Without that extension, only the NBD_CMD_WRITE request has a

Re: [PATCH v6 05/17] nbd/server: Refactor handling of command sanity checks

2023-09-25 Thread Eric Blake
On Mon, Sep 04, 2023 at 07:53:10PM +0300, Vladimir Sementsov-Ogievskiy wrote: > On 29.08.23 20:58, Eric Blake wrote: > > Upcoming additions to support NBD 64-bit effect lengths will add a new > > command flag NBD_CMD_FLAG_PAYLOAD_LEN that needs to be considered in > > our sanity checks of the

[PULL 1/7] iotests: use TEST_IMG_FILE instead of TEST_IMG in _require_large_file

2023-09-25 Thread Eric Blake
From: "Denis V. Lunev" We need to check that we are able to create large enough file which is used as an export base rather than connection URL. Unfortunately, there are cases when the TEST_IMG_FILE is not defined. We should fallback to TEST_IMG in that case. This problem has been detected when

[PULL 2/7] iotests: improve 'not run' message for nbd-multiconn test

2023-09-25 Thread Eric Blake
From: "Denis V. Lunev" The test actually requires Python bindings to libnbd rather than libnbd itself. Clarify that inside the message. Signed-off-by: Denis V. Lunev CC: Kevin Wolf CC: Hanna Reitz CC: Eric Blake CC: Vladimir Sementsov-Ogievskiy Message-ID:

[PULL 4/7] nbd/client: Pass mode through to nbd_send_request

2023-09-25 Thread Eric Blake
Once the 64-bit headers extension is enabled, the data layout we send over the wire for a client request depends on the mode negotiated with the server. Rather than adding a parameter to nbd_send_request, we can add a member to struct NBDRequest, since it already does not reflect on-wire format.

[PULL 3/7] nbd: Replace bool structured_reply with mode enum

2023-09-25 Thread Eric Blake
The upcoming patches for 64-bit extensions requires various points in the protocol to make decisions based on what was negotiated. While we could easily add a 'bool extended_headers' alongside the existing 'bool structured_reply', this does not scale well if more modes are added in the future.

[PULL 5/7] nbd: Add types for extended headers

2023-09-25 Thread Eric Blake
Add the constants and structs necessary for later patches to start implementing the NBD_OPT_EXTENDED_HEADERS extension in both the client and server, matching recent upstream nbd.git (through commit e6f3b94a934). This patch does not change any existing behavior, but merely sets the stage for

[PULL 6/7] nbd: Prepare for 64-bit request effect lengths

2023-09-25 Thread Eric Blake
Widen the length field of NBDRequest to 64-bits, although we can assert that all current uses are still under 32 bits: either because of NBD_MAX_BUFFER_SIZE which is even smaller (and where size_t can still be appropriate, even on 32-bit platforms), or because nothing ever puts us into

[PULL 7/7] nbd/server: Refactor handling of command sanity checks

2023-09-25 Thread Eric Blake
Upcoming additions to support NBD 64-bit effect lengths will add a new command flag NBD_CMD_FLAG_PAYLOAD_LEN that needs to be considered in our sanity checks of the client's messages (that is, more than just CMD_WRITE have the potential to carry a client payload when extended headers are in

Re: [PATCH v2] hw/sd/sdhci: Block Size Register bits [14:12] is lost

2023-09-25 Thread Philippe Mathieu-Daudé
On 22/9/23 04:03, Lu Gao wrote: Block Size Register bits [14:12] is SDMA Buffer Boundary, it is missed in register write, but it is needed in SDMA transfer. e.g. it will be used in sdhci_sdma_transfer_multi_blocks to calculate boundary_ variables. Missing this field will cause wrong operation

Re: [PATCH v3 0/2] qemu-img: map: implement support for compressed clusters

2023-09-25 Thread Andrey Drobyshev
On 9/22/23 17:28, Eric Blake wrote: > On Fri, Sep 22, 2023 at 12:10:45PM +0200, Kevin Wolf wrote: >>> >>> In the patches applied to master something went wrong and my email isn't >>> displayed correctly: >>> commit 2848289168fbbd9a6855c84ec8fde8929a2b042b Author: Andrey Drobyshev via

Re: [PATCH 2/3] backends: Initial support for SPDM socket support

2023-09-25 Thread Jonathan Cameron via
On Thu, 21 Sep 2023 16:28:00 +1000 Alistair Francis wrote: > On Mon, Sep 18, 2023 at 8:28 PM Jonathan Cameron > wrote: > > > > On Mon, 18 Sep 2023 13:16:01 +1000 > > Alistair Francis wrote: > > > > > On Sat, Sep 16, 2023 at 1:19 AM Jonathan Cameron > > > wrote: > > > > > > > > On Fri, 15

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

2023-09-25 Thread Sam Li
Markus Armbruster 于2023年9月25日周一 21:05写道: > > Sam Li writes: > > > To configure the zoned format feature on the qcow2 driver, it > > requires settings as: the device size, zone model, zone size, > > zone capacity, number of conventional zones, limits on zone > > resources (max append sectors, max

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

2023-09-25 Thread Markus Armbruster
Sam Li writes: > To configure the zoned format feature on the qcow2 driver, it > requires settings as: the device size, zone model, zone size, > zone capacity, number of conventional zones, limits on zone > resources (max append sectors, max open zones, and max_active_zones). > > To create a

Re: [PATCH] qemu-nbd: changes towards enabling -Wshadow=local

2023-09-25 Thread Daniel P . Berrangé
On Fri, Sep 22, 2023 at 03:50:20PM -0500, Eric Blake wrote: > Address all compiler complaints from -Wshadow in qemu-nbd. Several > instances of 'int ret' became shadows when commit 4fbec260 added 'ret' > at a higher scope in main. More interesting was the 'void *ret' > capturing the result of a

[PATCH] hw/nvme: Clean up local variable shadowing in nvme_ns_init()

2023-09-25 Thread Klaus Jensen
NvmeLBAF *lbaf = _ns->lbaf[i]; --- base-commit: b55e4b9c0525560577384adfc6d30eb0daa8d7be change-id: 20230925-fix-local-shadowing-9606793e8ae9 Best regards, -- Klaus Jensen