Re: [PATCH] trace/simple: Fix hang when using simpletrace with fork()

2025-02-27 Thread Eric Blake
On Wed, Feb 26, 2025 at 09:50:15AM +0100, Thomas Huth wrote: > When compiling QEMU with --enable-trace-backends=simple , the > iotest 233 is currently hanging. This happens because qemu-nbd > calls trace_init_backends() first - which causes simpletrace to > install its writer thread and the atexit(

Re: Problem with iotest 233

2025-02-27 Thread Eric Blake
On Wed, Feb 26, 2025 at 09:55:18AM +0100, Thomas Huth wrote: > > > Though, that does not look like the thread from the simpletrace, but > > > the the QEMU RCU thread instead ... so no clue where that writer > > > thread might have gone... > > > > OK, I think I now understood the problem: qemu-nbd

Re: [PATCH] iotests: Stop NBD server in test 162 before starting the next one

2025-02-27 Thread Eric Blake
On Tue, Feb 25, 2025 at 08:06:50AM +0100, Thomas Huth wrote: > Test 162 recently started failing for me for no obvious reasons (I > did not spot any suspicious commits in this area), but looking in > the 162.out.bad log file, there was a suspicious message at the end: > > qemu-nbd: Cannot lock pi

[PATCH] nbd: Defer trace init until after daemonization

2025-02-27 Thread Eric Blake
At least the simple trace backend works by spawning a helper thread, and setting up an atexit() handler that coordinates completion with the helper thread. But since atexit registrations survive fork() but helper threads do not, this means that qemu-nbd configured to use the simple trace will dead

[PULL 07/10] hw/nvme: rework csi handling

2025-02-27 Thread Klaus Jensen
From: Klaus Jensen The controller incorrectly allows a zoned namespace to be attached even if CS.CSS is configured to only support the NVM command set for I/O queues. Rework handling of namespace command sets in general by attaching supported namespaces when the controller is started instead of,

[PULL 08/10] hw/nvme: only set command abort requested when cancelled due to Abort

2025-02-27 Thread Klaus Jensen
From: Klaus Jensen The Command Abort Requested status code should only be set if the command was explicitly cancelled due to an Abort command. Or, in the case the cancel was due to Submission Queue deletion, set the status code to Command Aborted due to SQ Deletion. Reviewed-by: Jesper Wendel De

[PULL 09/10] hw/nvme: set error status code explicitly for misc commands

2025-02-27 Thread Klaus Jensen
From: Klaus Jensen The nvme_aio_err() does not handle Verify, Compare, Copy and other misc commands and defaults to setting the error status code to Internal Device Error. For some of these commands, we know better, so set it explicitly. For the commands using the nvme_misc_cb() callback (Copy,

[PULL 02/10] hw/nvme: always initialize a subsystem

2025-02-27 Thread Klaus Jensen
From: Klaus Jensen If no nvme-subsys is explicitly configured, instantiate one. Reviewed-by: Jesper Wendel Devantier Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 36 +++- hw/nvme/ns.c | 64 +- 2 files changed, 42 in

[PULL 01/10] hw/nvme: Add OCP SMART / Health Information Extended Log Page

2025-02-27 Thread Klaus Jensen
From: Stephen Bates The Open Compute Project [1] includes a Datacenter NVMe SSD Specification [2]. The most recent version of this specification (as of November 2024) is 2.6.1. This specification layers on top of the NVM Express specifications [3] to provide additional functionality. A key part o

[PULL 06/10] hw/nvme: be compliant wrt. dsm processing limits

2025-02-27 Thread Klaus Jensen
From: Klaus Jensen The specification states that, > The controller shall set all three processing limit fields (i.e., the > DMRL, DMRSL and DMSL fields) to non-zero values or shall clear all > three processing limit fields to 0h. So, set the DMRL and DMSL fields in addition to DMRSL. Reviewed-

[PULL 10/10] hw/nvme: remove nvme_aio_err()

2025-02-27 Thread Klaus Jensen
From: Klaus Jensen nvme_rw_complete_cb() is the only remaining user of nvme_aio_err(), so open code the status code setting instead. Reviewed-by: Jesper Wendel Devantier Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 60 +++--- 1 file changed, 23

[PULL 04/10] hw/nvme: add knob for doorbell buffer config support

2025-02-27 Thread Klaus Jensen
From: Klaus Jensen Add a 'dbcs' knob to allow Doorbell Buffer Config command to be disabled. Reviewed-by: Jesper Wendel Devantier Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 11 --- hw/nvme/nvme.h | 1 + include/block/nvme.h | 2 +- 3 files changed, 10 insertions(+)

[PULL 03/10] hw/nvme: make oacs dynamic

2025-02-27 Thread Klaus Jensen
From: Klaus Jensen Virtualization Management needs sriov-related parameters. Only report support for the command when that conditions are true. Reviewed-by: Jesper Wendel Devantier Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 25 ++--- hw/nvme/nvme.h | 4 +

[PULL 05/10] nvme: fix iocs status code values

2025-02-27 Thread Klaus Jensen
From: Klaus Jensen The status codes related to I/O Command Sets are in the wrong group. Reviewed-by: Jesper Wendel Devantier Signed-off-by: Klaus Jensen --- hw/nvme/ctrl.c | 4 ++-- include/block/nvme.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/nvme/ctr