[PATCH 0/3] hw/block/nvme: cmb enhancements and bump to v1.4

Klaus Jensen posted 3 patches 3 years, 4 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20201218092308.894367-1-its@irrelevant.dk
Maintainers: Keith Busch <kbusch@kernel.org>, Fam Zheng <fam@euphon.net>, Max Reitz <mreitz@redhat.com>, Klaus Jensen <its@irrelevant.dk>, Stefan Hajnoczi <stefanha@redhat.com>, Kevin Wolf <kwolf@redhat.com>
hw/block/nvme.h      |   1 +
include/block/nvme.h | 106 +++++++++++++++++++++++++++++++++----
hw/block/nvme.c      | 121 ++++++++++++++++++++++++++-----------------
3 files changed, 170 insertions(+), 58 deletions(-)
[PATCH 0/3] hw/block/nvme: cmb enhancements and bump to v1.4
Posted by Klaus Jensen 3 years, 4 months ago
From: Klaus Jensen <k.jensen@samsung.com>

This adds CMB logic from v1.4. To my knowledge, this is the last piece
missing for v1.4 compliance, so bump the controller spec version. Please
retort if I am jumping the gun.

Since the slow-moving (sorry, super poor attempt of humor) Linux kernel
nvme driver does not support v1.4 CMB, this series adds a 'x-legacy-cmb'
nvme device parameter that reverts the CMB configuration behavior to
v1.3, thus allowing the kernel to continue using the CMB for submission
queues.

The question here is if we should rather skip that parameter, only
support v1.4 behavior and point the finger at the kernel nvme gang. I'm
leaning towards this.

Keith, what is your opinion on this?

Klaus Jensen (2):
  hw/block/nvme: bump to v1.4
  hw/block/nvme: lift cmb restrictions

Padmakar Kalghatgi (1):
  hw/block/nvme: cmb enhancements

 hw/block/nvme.h      |   1 +
 include/block/nvme.h | 106 +++++++++++++++++++++++++++++++++----
 hw/block/nvme.c      | 121 ++++++++++++++++++++++++++-----------------
 3 files changed, 170 insertions(+), 58 deletions(-)

-- 
2.29.2


Re: [PATCH 0/3] hw/block/nvme: cmb enhancements and bump to v1.4
Posted by Keith Busch 3 years, 4 months ago
On Fri, Dec 18, 2020 at 10:23:04AM +0100, Klaus Jensen wrote:
> From: Klaus Jensen <k.jensen@samsung.com>
> 
> This adds CMB logic from v1.4. To my knowledge, this is the last piece
> missing for v1.4 compliance, so bump the controller spec version. Please
> retort if I am jumping the gun.
> 
> Since the slow-moving (sorry, super poor attempt of humor) Linux kernel
> nvme driver does not support v1.4 CMB, this series adds a 'x-legacy-cmb'
> nvme device parameter that reverts the CMB configuration behavior to
> v1.3, thus allowing the kernel to continue using the CMB for submission
> queues.
> 
> The question here is if we should rather skip that parameter, only
> support v1.4 behavior and point the finger at the kernel nvme gang. I'm
> leaning towards this.
> 
> Keith, what is your opinion on this?

The driver may know if it's running in a VM, but it doesn't necessarily
know if its device is a passthrough vs. emulated. In the passthrough
case, we can't use the CMB at all for <= 1.3 versions since the GPA vs
HPA are not being considered. IMO, the kernel driver does need to be
updated to suppress CMB usage for pre-1.4, and it should also add the
CMBMSC capabilities for 1.4+.

Going forward with the qemu controller, I would remove legacy support
for CMB entirely since every host should be able to interop with it
without CMB support.