Re: [External] [PATCH v13 3/8] QIOChannelSocket: Implement io_writev zero copy flag & io_flush for CONFIG_LINUX

2022-06-07 Thread Leonardo Bras Soares Passos
Hello 徐闯, Thanks for reviewing! On Wed, Jun 1, 2022 at 6:37 AM 徐闯 wrote: [...] > Hi, Leonardo. I'm also paying attention to the application of > MSG_ZEROCOPY in live migration recently. I noticed that you defined a > member `zero_copy_queued` in the struct QIOChannelSocket, but I can't > find

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

2022-06-07 Thread Niklas Cassel via
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 can be used to emulate a namespace that never

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

2022-06-07 Thread Niklas Cassel via
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, the controller will become ready when CSTS.RDY gets

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

2022-06-07 Thread Niklas Cassel via
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 compliance with NVMe 2.0 such that a follow up patch can set the CRMS.CRWMS bit. This is needed since CC.CRIME is only writable when both

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

2022-06-07 Thread Niklas Cassel via
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 patch. Signed-off-by: Niklas Cassel ---

[PATCH 0/4] hw/nvme: add support for TP4084

2022-06-07 Thread Niklas Cassel via
Hello there, considering that Linux v5.19-rc1 is out which includes support for NVMe TP4084: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/nvme/host/core.c?id=354201c53e61e493017b15327294b0c8ab522d69 I thought that it might be nice to have QEMU support for the

Re: [PATCH v5 14/45] block/snapshot: drop indirection around bdrv_snapshot_fallback_ptr

2022-06-07 Thread Hanna Reitz
On 30.03.22 23:28, Vladimir Sementsov-Ogievskiy wrote: Now the indirection is not actually used, we can safely reduce it to simple pointer. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/snapshot.c | 39 +-- 1 file changed, 17 insertions(+), 22

Re: [PATCH v5 13/45] block: Manipulate bs->file / bs->backing pointers in .attach/.detach

2022-06-07 Thread Hanna Reitz
On 30.03.22 23:28, Vladimir Sementsov-Ogievskiy wrote: bs->file and bs->backing are a kind of duplication of part of bs->children. But very useful diplication, so let's not drop them at all:) We should manage bs->file and bs->backing in same place, where we manage bs->children, to keep them in

Re: [PATCH v6 02/18] job.h: categorize fields in struct Job

2022-06-07 Thread Paolo Bonzini
On 6/7/22 15:20, Emanuele Giuseppe Esposito wrote: Am 03/06/2022 um 18:00 schrieb Kevin Wolf: Am 14.03.2022 um 14:36 hat Emanuele Giuseppe Esposito geschrieben: Categorize the fields in struct Job to understand which ones need to be protected by the job mutex and which don't. Signed-off-by:

Re: [PATCH v5 09/45] Revert "block: Let replace_child_noperm free children"

2022-06-07 Thread Vladimir Sementsov-Ogievskiy
On 6/7/22 17:03, Hanna Reitz wrote: On 30.03.22 23:28, Vladimir Sementsov-Ogievskiy wrote: We are going to reimplement this behavior (clear bs->file / bs->backing pointers automatically when child->bs is cleared) in a nicer way. This reverts commit b0a9f6fed3d80de610dcd04a7e66f9f30a04174f.

Re: [PATCH v5 09/45] Revert "block: Let replace_child_noperm free children"

2022-06-07 Thread Hanna Reitz
On 30.03.22 23:28, Vladimir Sementsov-Ogievskiy wrote: We are going to reimplement this behavior (clear bs->file / bs->backing pointers automatically when child->bs is cleared) in a nicer way. This reverts commit b0a9f6fed3d80de610dcd04a7e66f9f30a04174f. This doesn’t really explain why it’s

Re: [PATCH v5 08/45] block/snapshot: stress that we fallback to primary child

2022-06-07 Thread Hanna Reitz
On 30.03.22 23:28, Vladimir Sementsov-Ogievskiy wrote: Actually what we chose is a primary child. Let's stress it in the code. We are going to drop indirect pointer logic here in future. Actually this commit simplifies the future work: we drop use of indirection in the assertion now.

Re: [PATCH v6 15/18] job: detect change of aiocontext within job coroutine

2022-06-07 Thread Emanuele Giuseppe Esposito
Am 03/06/2022 um 18:59 schrieb Kevin Wolf: > Am 14.03.2022 um 14:37 hat Emanuele Giuseppe Esposito geschrieben: >> From: Paolo Bonzini >> >> We want to make sure access of job->aio_context is always done >> under either BQL or job_mutex. The problem is that using >>

Re: [PATCH v6 06/18] jobs: protect jobs with job_lock/unlock

2022-06-07 Thread Emanuele Giuseppe Esposito
Am 03/06/2022 um 18:40 schrieb Kevin Wolf: > Am 14.03.2022 um 14:36 hat Emanuele Giuseppe Esposito geschrieben: >> Introduce the job locking mechanism through the whole job API, >> following the comments in job.h and requirements of job-monitor >> (like the functions in job-qmp.c, assume lock

Re: [PATCH v6 05/18] job.h: add _locked duplicates for job API functions called with and without job_mutex

2022-06-07 Thread Emanuele Giuseppe Esposito
Am 03/06/2022 um 18:17 schrieb Kevin Wolf: > Am 14.03.2022 um 14:36 hat Emanuele Giuseppe Esposito geschrieben: >> In preparation to the job_lock/unlock usage, create _locked >> duplicates of some functions, since they will be sometimes called with >> job_mutex held (mostly within job.c), >>

Re: [PATCH v6 02/18] job.h: categorize fields in struct Job

2022-06-07 Thread Emanuele Giuseppe Esposito
Am 03/06/2022 um 18:00 schrieb Kevin Wolf: > Am 14.03.2022 um 14:36 hat Emanuele Giuseppe Esposito geschrieben: >> Categorize the fields in struct Job to understand which ones >> need to be protected by the job mutex and which don't. >> >> Signed-off-by: Emanuele Giuseppe Esposito > > I

Re: [PATCH v2] hw/nvme: allow to pass a memory backend object for the CMB

2022-06-07 Thread Wertenbroek Rick
Hi, So it seems the patch is messed up, I forked QEMU applied the patch to the current master. Here it is : https://gitlab.com/rwe-reds/qemu/-/tree/master I rebuilt QEMU to check that everything builds and runs. Sorry for the inconvenience, I don’t know why the patch gets corrupted… Best

Re: [PATCH v3] hw/nvme: clean up CC register write logic

2022-06-07 Thread Lukasz Maniak
On Tue, Jun 07, 2022 at 01:23:20PM +0200, Klaus Jensen wrote: > From: Klaus Jensen > > The SRIOV series exposed an issued with how CC register writes are > handled and how CSTS is set in response to that. Specifically, after > applying the SRIOV series, the controller could end up in a state

[PATCH v3] hw/nvme: clean up CC register write logic

2022-06-07 Thread Klaus Jensen
From: Klaus Jensen The SRIOV series exposed an issued with how CC register writes are handled and how CSTS is set in response to that. Specifically, after applying the SRIOV series, the controller could end up in a state with CC.EN set to '1' but with CSTS.RDY cleared to '0', causing drivers to

Re: [PATCH v5 06/45] test-bdrv-graph-mod: fix filters to be filters

2022-06-07 Thread Hanna Reitz
On 30.03.22 23:28, Vladimir Sementsov-Ogievskiy wrote: bdrv_pass_through is used as filter, even all node variables has corresponding names. We want to append it, so it should be backing-child-based filter like mirror_top. So, in test_update_perm_tree, first child should be DATA, as we don't

Re: [PATCH v5 07/45] block: document connection between child roles and bs->backing/bs->file

2022-06-07 Thread Hanna Reitz
On 30.03.22 23:28, Vladimir Sementsov-Ogievskiy wrote: Make the informal rules formal. In further commit we'll add corresponding assertions. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/block-common.h | 42 1 file changed, 42

Re: [PATCH v2] hw/nvme: allow to pass a memory backend object for the CMB

2022-06-07 Thread Wertenbroek Rick
Hello, Sorry about that, I had the same issue with the patch for some reason, I think it is the git send email that messed up the patch (couldn’t directly send via smtp so I created a draft via IMAP before sending). Anyway, below is the patch, it was created on the master branch (commit

Re: [PATCH v5 05/45] tests-bdrv-drain: bdrv_replace_test driver: declare supports_backing

2022-06-07 Thread Hanna Reitz
On 30.03.22 23:28, Vladimir Sementsov-Ogievskiy wrote: We do add COW child to the node. In future we are going to forbid adding COW child to the node that doesn't support backing. So, fix it here now. Don't worry about setting bs->backing itself: it further commit we'll s/it/in/ update the

Re: [PATCH v2] hw/nvme: clean up CC register write logic

2022-06-07 Thread Klaus Jensen
On Jun 7 13:06, Łukasz Gieryk wrote: > On Fri, Jun 03, 2022 at 10:24:51PM +0200, Klaus Jensen wrote: > > On Jun 1 15:28, Lukasz Maniak wrote: > > > On Wed, May 25, 2022 at 09:35:24AM +0200, Klaus Jensen wrote: > > > > > > > > +stl_le_p(>bar.intms, 0); > > > > +

Re: [PATCH v5 04/45] test-bdrv-graph-mod: update test_parallel_perm_update test case

2022-06-07 Thread Hanna Reitz
On 30.03.22 23:28, Vladimir Sementsov-Ogievskiy wrote: test_parallel_perm_update() does two things that we are going to restrict in the near future: 1. It updates bs->file field by hand. bs->file will be managed automatically by generic code (together with bs->children list). Let's

Re: [PATCH v2] hw/nvme: clean up CC register write logic

2022-06-07 Thread Łukasz Gieryk
On Fri, Jun 03, 2022 at 10:24:51PM +0200, Klaus Jensen wrote: > On Jun 1 15:28, Lukasz Maniak wrote: > > On Wed, May 25, 2022 at 09:35:24AM +0200, Klaus Jensen wrote: > > > > > > +stl_le_p(>bar.intms, 0); > > > +stl_le_p(>bar.intmc, 0); > > > +stl_le_p(>bar.cc, 0); > > >

Re: [PATCH v5 03/45] block/blklogwrites: don't care to remove bs->file child on failure

2022-06-07 Thread Hanna Reitz
On 30.03.22 23:28, Vladimir Sementsov-Ogievskiy wrote: We don't need to remove bs->file, generic layer takes care of it. No other driver cares to remove bs->file on failure by hand. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/blklogwrites.c | 4 1 file changed, 4 deletions(-)

Re: [PATCH v5 02/45] block: introduce bdrv_open_file_child() helper

2022-06-07 Thread Hanna Reitz
On 30.03.22 23:28, Vladimir Sementsov-Ogievskiy wrote: Almost all drivers call bdrv_open_child() similarly. Let's create a helper for this. The only not updated driver that call bdrv_open_child() to set bs->file is raw-format, as it sometimes want to have filtered child but don't set

Re: [PATCH v5 01/45] block: BlockDriver: add .filtered_child_is_backing field

2022-06-07 Thread Hanna Reitz
On 30.03.22 23:28, Vladimir Sementsov-Ogievskiy wrote: Unfortunately not all filters use .file child as filtered child. Two exclusions are mirror_top and commit_top. Happily they both are private filters. Bad thing is that this inconsistency is observable through qmp commands query-block /