qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Jinhao Fan <fanjinhao21s@ict.ac.cn>
Cc: qemu-devel@nongnu.org, its@irrelevant.dk, kbusch@kernel.org
Subject: Re: [PATCH v3 1/2] hw/nvme: Implement shadow doorbell buffer support
Date: Wed, 7 Dec 2022 09:49:18 -0800	[thread overview]
Message-ID: <20221207174918.GA1151796@roeck-us.net> (raw)
In-Reply-To: <20220616123408.3306055-2-fanjinhao21s@ict.ac.cn>

Hi,

On Thu, Jun 16, 2022 at 08:34:07PM +0800, Jinhao Fan wrote:
> Implement Doorbel Buffer Config command (Section 5.7 in NVMe Spec 1.3)
> and Shadow Doorbel buffer & EventIdx buffer handling logic (Section 7.13
> in NVMe Spec 1.3). For queues created before the Doorbell Buffer Config
> command, the nvme_dbbuf_config function tries to associate each existing
> SQ and CQ with its Shadow Doorbel buffer and EventIdx buffer address.
> Queues created after the Doorbell Buffer Config command will have the
> doorbell buffers associated with them when they are initialized.
> 
> In nvme_process_sq and nvme_post_cqe, proactively check for Shadow
> Doorbell buffer changes instead of wait for doorbell register changes.
> This reduces the number of MMIOs.
> 
> In nvme_process_db(), update the shadow doorbell buffer value with
> the doorbell register value if it is the admin queue. This is a hack
> since hosts like Linux NVMe driver and SPDK do not use shadow
> doorbell buffer for the admin queue. Copying the doorbell register
> value to the shadow doorbell buffer allows us to support these hosts
> as well as spec-compliant hosts that use shadow doorbell buffer for
> the admin queue.
> 
> Signed-off-by: Jinhao Fan <fanjinhao21s@ict.ac.cn>

I noticed that I can no longer boot Linux kernels from nvme on riscv64
systems. The problem is seen with qemu v7.1 and qemu v7.2-rc4.
The log shows:

[   35.904128] nvme nvme0: I/O 642 (I/O Cmd) QID 1 timeout, aborting
[   35.905000] EXT4-fs (nvme0n1): mounting ext2 file system using the ext4 subsystem
[   66.623863] nvme nvme0: I/O 643 (I/O Cmd) QID 1 timeout, aborting
[   97.343989] nvme nvme0: Abort status: 0x0
[   97.344355] nvme nvme0: Abort status: 0x0
[   97.344647] nvme nvme0: I/O 7 QID 0 timeout, reset controller
[   97.350568] nvme nvme0: I/O 644 (I/O Cmd) QID 1 timeout, aborting

This is with the mainline Linux kernel (v6.1-rc8).

Bisect points to this patch. Reverting this patch and a number of associated
patches (to fix conflicts) fixes the problem.

06143d8771 Revert "hw/nvme: Implement shadow doorbell buffer support"
acb4443e3a Revert "hw/nvme: Use ioeventfd to handle doorbell updates"
d5fd309feb Revert "hw/nvme: do not enable ioeventfd by default"
1ca1e6c47c Revert "hw/nvme: unregister the event notifier handler on the main loop"
2d26abd51e Revert "hw/nvme: skip queue processing if notifier is cleared"
99d411b5a5 Revert "hw/nvme: reenable cqe batching"
2293d3ca6c Revert "hw/nvme: Add trace events for shadow doorbell buffer"

Qemu command line:

qemu-system-riscv64 -M virt -m 512M \
     -kernel arch/riscv/boot/Image -snapshot \
     -device nvme,serial=foo,drive=d0 \
     -drive file=rootfs.ext2,if=none,format=raw,id=d0 \
     -bios default \
     -append "root=/dev/nvme0n1 console=ttyS0,115200 earlycon=uart8250,mmio,0x10000000,115200" \
     -nographic -monitor none

Guenter


  parent reply	other threads:[~2022-12-07 17:49 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-16 12:34 [PATCH v3 0/2] hw/nvme: Add shadow doorbell buffer support Jinhao Fan
2022-06-16 12:34 ` [PATCH v3 1/2] hw/nvme: Implement " Jinhao Fan
2022-06-27 19:17   ` Keith Busch
2022-06-27 19:33     ` Klaus Jensen
2022-06-28  0:29       ` Jinhao Fan
2022-12-07 17:49   ` Guenter Roeck [this message]
2022-12-08  7:16     ` Klaus Jensen
2022-12-08  8:08       ` Klaus Jensen
2022-12-08 18:47         ` Guenter Roeck
2022-12-08 20:13           ` Guenter Roeck
2022-12-08 20:28             ` Keith Busch
2022-12-08 21:16               ` Guenter Roeck
2022-12-08 20:39             ` Guenter Roeck
2022-12-09 11:00               ` Guenter Roeck
2022-12-12  9:58               ` Klaus Jensen
2022-12-12 13:39                 ` Guenter Roeck
2022-12-12 13:45                   ` Klaus Jensen
2022-12-12 14:27                     ` Guenter Roeck
2022-12-12 15:18                       ` Klaus Jensen
2022-06-16 12:34 ` [PATCH v3 2/2] hw/nvme: Add trace events for shadow doorbell buffer Jinhao Fan
2022-06-17 11:54 ` [PATCH v3 0/2] hw/nvme: Add shadow doorbell buffer support Klaus Jensen
2022-06-17 12:47   ` Jinhao Fan
2022-06-17 12:56     ` Klaus Jensen
2022-06-17 13:02       ` Jinhao Fan
2022-06-17 20:35 ` Keith Busch
2022-06-27  6:00 ` Klaus Jensen

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=20221207174918.GA1151796@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=fanjinhao21s@ict.ac.cn \
    --cc=its@irrelevant.dk \
    --cc=kbusch@kernel.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).