From: Maxim Levitsky <mlevitsk@redhat.com>
To: Max Reitz <mreitz@redhat.com>, qemu-devel@nongnu.org
Cc: Fam Zheng <fam@euphon.net>, Paolo Bonzini <pbonzini@redhat.com>,
John Snow <jsnow@redhat.com>,
qemu-block@nongnu.org, Kevin Wolf <kwolf@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v3 1/6] block/nvme: don't touch the completion entries
Date: Mon, 08 Jul 2019 15:51:34 +0300 [thread overview]
Message-ID: <7eeafe074290d5374b5ad6c0fc81d1c0dea492e1.camel@redhat.com> (raw)
In-Reply-To: <5d32c846-1ff6-ec99-af20-8e7a794c4fe2@redhat.com>
On Mon, 2019-07-08 at 14:23 +0200, Max Reitz wrote:
> On 07.07.19 10:43, Maxim Levitsky wrote:
> > On Fri, 2019-07-05 at 13:03 +0200, Max Reitz wrote:
> > > On 03.07.19 17:59, Maxim Levitsky wrote:
> > > > Completion entries are meant to be only read by the host and written by the device.
> > > > The driver is supposed to scan the completions from the last point where it left,
> > > > and until it sees a completion with non flipped phase bit.
> > >
> > > (Disclaimer: This is the first time I read the nvme driver, or really
> > > something in the nvme spec.)
> > >
> > > Well, no, completion entries are also meant to be initialized by the
> > > host. To me it looks like this is the place where that happens:
> > > Everything that has been processed by the device is immediately being
> > > re-initialized.
> > >
> > > Maybe we shouldn’t do that here but in nvme_submit_command(). But
> > > currently we don’t, and I don’t see any other place where we currently
> > > initialize the CQ entries.
> >
> > Hi!
> > I couldn't find any place in the spec that says that completion entries should be initialized.
> > It is probably wise to initialize that area to 0 on driver initialization, but nothing beyond that.
>
> Ah, you’re right, I misread. I didn’t pay as much attention to the
> “...prior to setting CC.EN to ‘1’” as I should have. Yep, and that is
> done in nvme_init_queue().
>
> OK, I cease my wrongful protest:
>
> Reviewed-by: Max Reitz <mreitz@redhat.com>
>
> >
Thank you very much!
BTW, the qemu driver does allocate zeroed memory (in nvme_init_queue,
"q->queue = qemu_try_blockalign0(bs, bytes);"
Thus I think this is all that is needed in that regard.
Note that this patch doesn't fix any real bug I know of,
but just makes the thing right in regard to the spec.
Also racing with hardware in theory can have various memory ordering bugs,
although in this case the writes are done in
entries which controller probably won't touch, but still.
TL;DR - no need in code which does nothing and might cause issues.
Do you want me to resend the series or shall I wait till we decide
what to do with the image creation support? I done fixing all the
review comments long ago, just didn't want to resend the series.
Or shall I drop that patch and resend?
From the urgency standpoint the only patch that really should
be merged ASAP is the one that adds support for block sizes,
because without it, the whole thing crashes and burns on 4K
nvme drives.
Best regards,
Maxim Levitsky
next prev parent reply other threads:[~2019-07-08 12:52 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-03 15:59 [Qemu-devel] [PATCH v3 0/6] Few fixes for userspace NVME driver Maxim Levitsky
2019-07-03 15:59 ` [Qemu-devel] [PATCH v3 1/6] block/nvme: don't touch the completion entries Maxim Levitsky
2019-07-05 11:03 ` Max Reitz
2019-07-07 8:43 ` Maxim Levitsky
2019-07-08 12:23 ` Max Reitz
2019-07-08 12:51 ` Maxim Levitsky [this message]
2019-07-08 13:00 ` Max Reitz
2019-07-08 13:06 ` Maxim Levitsky
2019-07-03 15:59 ` [Qemu-devel] [PATCH v3 2/6] block/nvme: fix doorbell stride Maxim Levitsky
2019-07-05 11:09 ` Max Reitz
2019-07-05 11:10 ` Max Reitz
2019-07-07 8:47 ` Maxim Levitsky
2019-07-03 15:59 ` [Qemu-devel] [PATCH v3 3/6] block/nvme: support larger that 512 bytes sector devices Maxim Levitsky
2019-07-05 11:58 ` Max Reitz
2019-07-07 8:51 ` Maxim Levitsky
2019-07-03 15:59 ` [Qemu-devel] [PATCH v3 4/6] block/nvme: add support for image creation Maxim Levitsky
2019-07-05 12:09 ` Max Reitz
2019-07-07 9:03 ` Maxim Levitsky
2019-07-03 15:59 ` [Qemu-devel] [PATCH v3 5/6] block/nvme: add support for write zeros Maxim Levitsky
2019-07-05 13:33 ` Max Reitz
2019-07-07 9:19 ` Maxim Levitsky
2019-07-03 15:59 ` [Qemu-devel] [PATCH v3 6/6] block/nvme: add support for discard Maxim Levitsky
2019-07-03 16:07 ` [Qemu-devel] [PATCH v4] " Maxim Levitsky
2019-07-05 13:50 ` Max Reitz
2019-07-07 9:40 ` Maxim Levitsky
2019-07-03 20:43 ` [Qemu-devel] [PATCH v3 0/6] Few fixes for userspace NVME driver no-reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7eeafe074290d5374b5ad6c0fc81d1c0dea492e1.camel@redhat.com \
--to=mlevitsk@redhat.com \
--cc=fam@euphon.net \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).