Re: [RFC v3 1/5] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls.

2022-06-28 Thread Sam Li
Damien Le Moal 于2022年6月29日周三 10:32写道: > > On 6/29/22 10:50, Sam Li wrote: > >>> +rep_size = sizeof(struct blk_zone_report) + nrz * sizeof(struct > >>> blk_zone); > >>> +g_autofree struct blk_zone_report *rep = g_new(struct > >>> blk_zone_report, nrz); > >> > >>

Re: [RFC v3 1/5] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls.

2022-06-28 Thread Damien Le Moal
On 6/29/22 10:50, Sam Li wrote: >>> +rep_size = sizeof(struct blk_zone_report) + nrz * sizeof(struct >>> blk_zone); >>> +g_autofree struct blk_zone_report *rep = g_new(struct >>> blk_zone_report, nrz); >> >> g_new() looks incorrect. There should be 1 struct

Re: [RFC v3 1/5] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls.

2022-06-28 Thread Sam Li
Damien Le Moal 于2022年6月29日周三 09:43写道: > > On 6/28/22 19:23, Sam Li wrote: > > Damien Le Moal 于2022年6月28日周二 17:05写道: > >> > >> On 6/28/22 17:05, Sam Li wrote: > >>> Stefan Hajnoczi 于2022年6月28日周二 14:52写道: > > On Mon, Jun 27, 2022 at 08:19:13AM +0800, Sam Li wrote: > > diff --git

Re: [RFC v3 1/5] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls.

2022-06-28 Thread Damien Le Moal
On 6/28/22 19:23, Sam Li wrote: > Damien Le Moal 于2022年6月28日周二 17:05写道: >> >> On 6/28/22 17:05, Sam Li wrote: >>> Stefan Hajnoczi 于2022年6月28日周二 14:52写道: On Mon, Jun 27, 2022 at 08:19:13AM +0800, Sam Li wrote: > diff --git a/block/block-backend.c b/block/block-backend.c > index

Re: [PATCH v7 10/18] jobs: rename static functions called with job_mutex held

2022-06-28 Thread Vladimir Sementsov-Ogievskiy
On 6/28/22 20:28, Emanuele Giuseppe Esposito wrote: Am 28/06/2022 um 17:26 schrieb Vladimir Sementsov-Ogievskiy: On 6/28/22 18:22, Vladimir Sementsov-Ogievskiy wrote: On 6/28/22 16:04, Emanuele Giuseppe Esposito wrote: Ok so far I did the following: - duplicated each public function as

Re: [PATCH v7 10/18] jobs: rename static functions called with job_mutex held

2022-06-28 Thread Emanuele Giuseppe Esposito
Am 28/06/2022 um 17:26 schrieb Vladimir Sementsov-Ogievskiy: > On 6/28/22 18:22, Vladimir Sementsov-Ogievskiy wrote: >> On 6/28/22 16:04, Emanuele Giuseppe Esposito wrote: > Ok so far I did the following: > > - duplicated each public function as static {function}_locked() They

Re: [PATCH v4] hw: m25p80: add WP# pin and SRWD bit for write protection

2022-06-28 Thread Francisco Iglesias
On [2022 Jun 28] Tue 17:52:50, Cédric Le Goater wrote: > Alistair, Francisco, > > On 6/22/22 11:45, Francisco Iglesias wrote: > > On [2022 Jun 21] Tue 13:24:27, Iris Chen wrote: > > > From: Iris Chen > > > > > > Signed-off-by: Iris Chen > > > > Reviewed-by: Francisco Iglesias > > I am

Re: [PATCH v4] hw: m25p80: add WP# pin and SRWD bit for write protection

2022-06-28 Thread Cédric Le Goater
Alistair, Francisco, On 6/22/22 11:45, Francisco Iglesias wrote: On [2022 Jun 21] Tue 13:24:27, Iris Chen wrote: From: Iris Chen Signed-off-by: Iris Chen Reviewed-by: Francisco Iglesias I am planning to include this patch in the next aspeed PR if that's OK with you. Thanks, C.

Re: [PATCH v7 10/18] jobs: rename static functions called with job_mutex held

2022-06-28 Thread Vladimir Sementsov-Ogievskiy
On 6/28/22 18:22, Vladimir Sementsov-Ogievskiy wrote: On 6/28/22 16:04, Emanuele Giuseppe Esposito wrote: Ok so far I did the following: - duplicated each public function as static {function}_locked() They shouldn't be duplicates: function without _locked suffix should take the mutex. By

Re: [PATCH v7 10/18] jobs: rename static functions called with job_mutex held

2022-06-28 Thread Vladimir Sementsov-Ogievskiy
On 6/28/22 16:04, Emanuele Giuseppe Esposito wrote: Ok so far I did the following: - duplicated each public function as static {function}_locked() They shouldn't be duplicates: function without _locked suffix should take the mutex. By "duplicate" I mean same function name, with just _locked

Re: [PATCH v7 01/18] job.c: make job_mutex and job_lock/unlock() public

2022-06-28 Thread Vladimir Sementsov-Ogievskiy
On 6/28/22 16:08, Emanuele Giuseppe Esposito wrote: Am 24/06/2022 um 20:22 schrieb Vladimir Sementsov-Ogievskiy: I've already acked this (honestly, because Stefan do), but still, want to clarify: On 6/16/22 16:18, Emanuele Giuseppe Esposito wrote: job mutex will be used to protect the job

Re: [PATCH v7 01/18] job.c: make job_mutex and job_lock/unlock() public

2022-06-28 Thread Emanuele Giuseppe Esposito
Am 24/06/2022 um 20:22 schrieb Vladimir Sementsov-Ogievskiy: > I've already acked this (honestly, because Stefan do), but still, want > to clarify: > > On 6/16/22 16:18, Emanuele Giuseppe Esposito wrote: >> job mutex will be used to protect the job struct elements and list, >> replacing

Re: [PATCH v7 10/18] jobs: rename static functions called with job_mutex held

2022-06-28 Thread Emanuele Giuseppe Esposito
Am 28/06/2022 um 12:47 schrieb Vladimir Sementsov-Ogievskiy: > On 6/28/22 10:40, Emanuele Giuseppe Esposito wrote: >> >> >> Am 22/06/2022 um 20:38 schrieb Vladimir Sementsov-Ogievskiy: >>> On 6/22/22 17:26, Emanuele Giuseppe Esposito wrote: Am 21/06/2022 um 19:26 schrieb Vladimir

Re: [PATCH] hw/nvme: force nvme-ns param 'shared' to false if no nvme-subsys node

2022-06-28 Thread Niklas Cassel
On Tue, Jun 28, 2022 at 02:22:09PM +0200, Niklas Cassel via wrote: Hello Peter, It seems that mailman configuration on qemu-devel is rewriting the "From:" field to "From: Niklas Cassel via " If found this old thread about the same issue:

Re: [PATCH] hw/nvme: fix example serial in documentation

2022-06-28 Thread Klaus Jensen
On Jun 28 13:26, Daniel P. Berrangé wrote: > On Mon, Jun 27, 2022 at 02:39:57PM +0200, Niklas Cassel via wrote: > > The serial prop on the controller is actually describing the nvme > > subsystem serial, which has to be identical for all controllers within > > the same nvme subsystem. > > Given

Re: [PATCH] hw/nvme: fix example serial in documentation

2022-06-28 Thread Daniel P . Berrangé
On Mon, Jun 27, 2022 at 02:39:57PM +0200, Niklas Cassel via wrote: > The serial prop on the controller is actually describing the nvme > subsystem serial, which has to be identical for all controllers within > the same nvme subsystem. Given this description... > > -device

[PATCH] hw/nvme: force nvme-ns param 'shared' to false if no nvme-subsys node

2022-06-28 Thread Niklas Cassel via
Since commit 916b0f0b5264 ("hw/nvme: change nvme-ns 'shared' default") the default value of nvme-ns param 'shared' is set to true, regardless if there is a nvme-subsys node or not. On a system without a nvme-subsys node, a namespace will never be able to be attached to more than one controller,

Re: [PATCH v7 10/18] jobs: rename static functions called with job_mutex held

2022-06-28 Thread Vladimir Sementsov-Ogievskiy
On 6/28/22 10:40, Emanuele Giuseppe Esposito wrote: Am 22/06/2022 um 20:38 schrieb Vladimir Sementsov-Ogievskiy: On 6/22/22 17:26, Emanuele Giuseppe Esposito wrote: Am 21/06/2022 um 19:26 schrieb Vladimir Sementsov-Ogievskiy: On 6/16/22 16:18, Emanuele Giuseppe Esposito wrote: With

Re: [RFC v3 2/5] qemu-io: add zoned block device operations.

2022-06-28 Thread Sam Li
Damien Le Moal 于2022年6月28日周二 17:11写道: > > On 6/28/22 16:56, Stefan Hajnoczi wrote: > > On Mon, Jun 27, 2022 at 08:19:14AM +0800, Sam Li wrote: > >> diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c > >> index 2f0d8ac25a..3f2592b9f5 100644 > >> --- a/qemu-io-cmds.c > >> +++ b/qemu-io-cmds.c > >> @@

Re: [RFC v3 1/5] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls.

2022-06-28 Thread Sam Li
Damien Le Moal 于2022年6月28日周二 17:05写道: > > On 6/28/22 17:05, Sam Li wrote: > > Stefan Hajnoczi 于2022年6月28日周二 14:52写道: > >> > >> On Mon, Jun 27, 2022 at 08:19:13AM +0800, Sam Li wrote: > >>> diff --git a/block/block-backend.c b/block/block-backend.c > >>> index e0e1aff4b1..786f964d02 100644 > >>>

Re: [PATCH 4/4] hw/ide/piix: Ignore writes of hardwired PCI command register bits

2022-06-28 Thread Laurent Vivier
CC: John Snow (supporter:IDE) qemu-block@nongnu.org (open list:IDE) Le 28/05/2022 à 23:02, Lev Kujawski a écrit : One method to enable PCI bus mastering for IDE controllers, often used by x86 firmware, is to write 0x7 to the PCI command register. Neither the PIIX3 specification nor actual

Re: [PATCH 2/4] hw/ide/core: Clear LBA and drive bits for EXECUTE DEVICE DIAGNOSTIC

2022-06-28 Thread Laurent Vivier
CC: John Snow (supporter:IDE) qemu-block@nongnu.org (open list:IDE) Le 28/05/2022 à 23:02, Lev Kujawski a écrit : Prior to this patch, cmd_exec_dev_diagnostic relied upon ide_set_signature to clear the device register. While the preservation of the drive bit by ide_set_signature is necessary

Re: [PATCH 3/4] piix_ide_reset: Use pci_set_* functions instead of direct access

2022-06-28 Thread Laurent Vivier
CC: John Snow (supporter:IDE) qemu-block@nongnu.org (open list:IDE) Le 28/05/2022 à 23:02, Lev Kujawski a écrit : Eliminates the remaining TODOs in hw/ide/piix.c by: - Using pci_set_{size} functions to write the PIIX PCI configuration space instead of manipulating it directly as an array;

Re: [RFC v3 2/5] qemu-io: add zoned block device operations.

2022-06-28 Thread Damien Le Moal
On 6/28/22 16:56, Stefan Hajnoczi wrote: > On Mon, Jun 27, 2022 at 08:19:14AM +0800, Sam Li wrote: >> diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c >> index 2f0d8ac25a..3f2592b9f5 100644 >> --- a/qemu-io-cmds.c >> +++ b/qemu-io-cmds.c >> @@ -1706,6 +1706,122 @@ static const cmdinfo_t flush_cmd = {

Re: [PATCH 1/2] Trivial: 3 char repeat typos

2022-06-28 Thread Laurent Vivier
Le 14/06/2022 à 12:40, Dr. David Alan Gilbert (git) a écrit : From: "Dr. David Alan Gilbert" Inspired by Julia Lawall's fixing of Linux kernel comments, I looked at qemu, although I did it manually. Signed-off-by: Dr. David Alan Gilbert --- hw/intc/openpic.c| 2 +-

Re: [RFC v3 2/5] qemu-io: add zoned block device operations.

2022-06-28 Thread Sam Li
Stefan Hajnoczi 于2022年6月28日周二 16:20写道: > > On Mon, Jun 27, 2022 at 08:19:14AM +0800, Sam Li wrote: > > diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c > > index 2f0d8ac25a..3f2592b9f5 100644 > > --- a/qemu-io-cmds.c > > +++ b/qemu-io-cmds.c > > @@ -1706,6 +1706,122 @@ static const cmdinfo_t

Re: [RFC v3 5/5] qemu-iotests: add zone operation tests.

2022-06-28 Thread Sam Li
Stefan Hajnoczi 于2022年6月28日周二 16:20写道: > > On Mon, Jun 27, 2022 at 08:19:17AM +0800, Sam Li wrote: > > diff --git a/tests/qemu-iotests/tests/zoned.sh > > b/tests/qemu-iotests/tests/zoned.sh > > new file mode 100755 > > index 00..262c0b5427 > > --- /dev/null > > +++

Re: [PATCH 2/2] trivial typos: namesapce

2022-06-28 Thread Laurent Vivier
Le 14/06/2022 à 12:40, Dr. David Alan Gilbert (git) a écrit : From: "Dr. David Alan Gilbert" 'namespace' is misspelled in a bunch of places. Signed-off-by: Dr. David Alan Gilbert --- hw/9pfs/9p-xattr-user.c | 8 hw/acpi/nvdimm.c| 2 +- hw/nvme/ctrl.c | 2 +- 3

Re: [RFC v3 3/5] file-posix: introduce get_sysfs_long_val for zoned device information.

2022-06-28 Thread Sam Li
Stefan Hajnoczi 于2022年6月28日周二 16:20写道: > > On Mon, Jun 27, 2022 at 08:19:15AM +0800, Sam Li wrote: > > Use sysfs attribute files to get the zoned device information in case > > that ioctl() commands of zone management interface won't work. It can > > return long type of value like chunk_sectors,

Re: [RFC v3 1/5] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls.

2022-06-28 Thread Damien Le Moal
On 6/28/22 17:05, Sam Li wrote: > Stefan Hajnoczi 于2022年6月28日周二 14:52写道: >> >> On Mon, Jun 27, 2022 at 08:19:13AM +0800, Sam Li wrote: >>> diff --git a/block/block-backend.c b/block/block-backend.c >>> index e0e1aff4b1..786f964d02 100644 >>> --- a/block/block-backend.c >>> +++

Re: [RFC v3 1/5] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls.

2022-06-28 Thread Stefan Hajnoczi
On Mon, Jun 27, 2022 at 08:19:13AM +0800, Sam Li wrote: > diff --git a/block/block-backend.c b/block/block-backend.c > index e0e1aff4b1..786f964d02 100644 > --- a/block/block-backend.c > +++ b/block/block-backend.c > @@ -1810,6 +1810,62 @@ int blk_flush(BlockBackend *blk) > return ret; > } >

Re: [RFC v3 3/5] file-posix: introduce get_sysfs_long_val for zoned device information.

2022-06-28 Thread Stefan Hajnoczi
On Mon, Jun 27, 2022 at 08:19:15AM +0800, Sam Li wrote: > Use sysfs attribute files to get the zoned device information in case > that ioctl() commands of zone management interface won't work. It can > return long type of value like chunk_sectors, zoned_append_max_bytes, > max_open_zones,

Re: [RFC v3 5/5] qemu-iotests: add zone operation tests.

2022-06-28 Thread Stefan Hajnoczi
On Mon, Jun 27, 2022 at 08:19:17AM +0800, Sam Li wrote: > diff --git a/tests/qemu-iotests/tests/zoned.sh > b/tests/qemu-iotests/tests/zoned.sh > new file mode 100755 > index 00..262c0b5427 > --- /dev/null > +++ b/tests/qemu-iotests/tests/zoned.sh > @@ -0,0 +1,49 @@ > +#!/usr/bin/env bash

Re: [PATCH v2 3/4] hw/nvme: add support for ratified TP4084

2022-06-28 Thread Klaus Jensen
On Jun 27 13:47, Niklas Cassel wrote: > TP4084 adds a new mode, CC.CRIME, that can be used to mark a namespace > as ready independently from the controller. > > When CC.CRIME is 0 (default), things behave as before, all namespaces > are ready when CSTS.RDY gets set to 1. > > When CC.CRIME is 1,

Re: [RFC v3 2/5] qemu-io: add zoned block device operations.

2022-06-28 Thread Stefan Hajnoczi
On Mon, Jun 27, 2022 at 08:19:14AM +0800, Sam Li wrote: > diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c > index 2f0d8ac25a..3f2592b9f5 100644 > --- a/qemu-io-cmds.c > +++ b/qemu-io-cmds.c > @@ -1706,6 +1706,122 @@ static const cmdinfo_t flush_cmd = { > .oneline= "flush all in-core file

Re: [PATCH v4 6/7] block/copy-before-write: implement cbw-timeout option

2022-06-28 Thread Vladimir Sementsov-Ogievskiy
While debugging my "[PULL 00/10] Block jobs & NBD patches", I found that we have bdrv_dec_in_flight() and bdrv_inc_in_flight(). So, this should be fixed: On 4/7/22 16:27, Vladimir Sementsov-Ogievskiy wrote: In some scenarios, when copy-before-write operations lasts too long time, it's better

Re: [PATCH v7 10/18] jobs: rename static functions called with job_mutex held

2022-06-28 Thread Emanuele Giuseppe Esposito
Am 22/06/2022 um 20:38 schrieb Vladimir Sementsov-Ogievskiy: > On 6/22/22 17:26, Emanuele Giuseppe Esposito wrote: >> >> >> Am 21/06/2022 um 19:26 schrieb Vladimir Sementsov-Ogievskiy: >>> On 6/16/22 16:18, Emanuele Giuseppe Esposito wrote: With the*nop*  job_lock/unlock placed, rename the

Re: [PATCH v4 3/7] iotests: add copy-before-write: on-cbw-error tests

2022-06-28 Thread Vladimir Sementsov-Ogievskiy
I had a long and not fun debugging session through gitlab pipelines with this:) The problem is that pure QEMUMachine doesn't work on arm in gitlab. And we have to specify at least machine. And we don't want qtest, as described in commit message. So, the following fix helps: On 4/7/22 16:27,

Re: [RFC v3 1/5] block: add block layer APIs resembling Linux ZonedBlockDevice ioctls.

2022-06-28 Thread Sam Li
Stefan Hajnoczi 于2022年6月28日周二 14:52写道: > > On Mon, Jun 27, 2022 at 08:19:13AM +0800, Sam Li wrote: > > diff --git a/block/block-backend.c b/block/block-backend.c > > index e0e1aff4b1..786f964d02 100644 > > --- a/block/block-backend.c > > +++ b/block/block-backend.c > > @@ -1810,6 +1810,62 @@ int

Re: [PATCH v2 2/4] hw/nvme: store a pointer to the NvmeSubsystem in the NvmeNamespace

2022-06-28 Thread Klaus Jensen
On Jun 27 13:47, Niklas Cassel wrote: > Each NvmeNamespace can be used by serveral controllers, > but a NvmeNamespace can at most belong to a single NvmeSubsystem. > Store a pointer to the NvmeSubsystem, if the namespace was realized > with a NvmeSubsystem. > > This will be used by a follow up

Re: nvme shared namespaces without subsys

2022-06-28 Thread Klaus Jensen
On Jun 27 18:34, Niklas Cassel wrote: > Hello qemu-nvme maintainers, > > I noticed that since commit > 916b0f0b5264 ("hw/nvme: change nvme-ns 'shared' default") > > The default value of ns param 'shared' is true, regardless > if there is a nvme-subsys node or not. > > It probably doesn't matter

Re: [PATCH v2 1/4] hw/nvme: claim NVMe 2.0 compliance

2022-06-28 Thread Klaus Jensen
On Jun 27 10:59, Christoph Hellwig wrote: > On Mon, Jun 27, 2022 at 01:47:28PM +0200, Niklas Cassel via wrote: > > CRMS.CRWMS bit shall be set to 1 on controllers compliant with versions > > later than NVMe 1.4. > > > > The first version later than NVMe 1.4 is NVMe 2.0 > > > > Let's claim

Re: [PATCH v2 4/4] hw/nvme: add new never_ready parameter to test the DNR bit

2022-06-28 Thread Klaus Jensen
On Jun 27 13:47, Niklas Cassel wrote: > Since we verify that "ready_delay" parameter has to be smaller than CRWMT, > we know that the namespace will always become ready. > Therefore the "Namespace Not Ready" status code will never have the DNR > bit set. > > Add a new parameter "never_ready" that