qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] f42be4: hw/nvme: fix style


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] f42be4: hw/nvme: fix style
Date: Wed, 30 Jun 2021 13:15:05 -0700

  Branch: refs/heads/staging
  Home:   https://github.com/qemu/qemu
  Commit: f42be416cd0d50bcb2987031fbab09ee257a5058
      
https://github.com/qemu/qemu/commit/f42be416cd0d50bcb2987031fbab09ee257a5058
  Author: Gollu Appalanaidu <anaidu.gollu@samsung.com>
  Date:   2021-06-29 (Tue, 29 Jun 2021)

  Changed paths:
    M hw/nvme/ctrl.c

  Log Message:
  -----------
  hw/nvme: fix style

Identify command related functions style fix.

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: 18de1526baa606789fbe11f17087543ab20a9c49
      
https://github.com/qemu/qemu/commit/18de1526baa606789fbe11f17087543ab20a9c49
  Author: Gollu Appalanaidu <anaidu.gollu@samsung.com>
  Date:   2021-06-29 (Tue, 29 Jun 2021)

  Changed paths:
    M hw/nvme/ns.c
    M include/block/nvme.h

  Log Message:
  -----------
  hw/nvme: add identify namespace flbas/mc enums

Add enums for the Identify Namespace FLBAS and MC fields.

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
[k.jensen: squashed separate flbas/mc commits into one]
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: 421a30927140945c6aa957c2c0e7ad695984483d
      
https://github.com/qemu/qemu/commit/421a30927140945c6aa957c2c0e7ad695984483d
  Author: Gollu Appalanaidu <anaidu.gollu@samsung.com>
  Date:   2021-06-29 (Tue, 29 Jun 2021)

  Changed paths:
    M hw/nvme/ns.c

  Log Message:
  -----------
  hw/nvme: fix lbaf formats initialization

Currently LBAF formats are being intialized based on metadata
size if and only if nvme-ns "ms" parameter is non-zero value.
Since FormatNVM command being supported device parameter "ms"
may not be the criteria to initialize the supported LBAFs.

And make LBAF array as read-only.

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: cccc2651f4222e587582867e966b054dd4b51a0e
      
https://github.com/qemu/qemu/commit/cccc2651f4222e587582867e966b054dd4b51a0e
  Author: Niklas Cassel <niklas.cassel@wdc.com>
  Date:   2021-06-29 (Tue, 29 Jun 2021)

  Changed paths:
    M hw/nvme/ctrl.c
    M hw/nvme/nvme.h

  Log Message:
  -----------
  hw/nvme: add param to control auto zone transitioning to zone state closed

In the Zoned Namespace Command Set Specification, chapter
2.5.1 Managing resources

"The controller may transition zones in the ZSIO:Implicitly Opened state
to the ZSC:Closed state for resource management purposes."

The word may in this sentence means that automatically transitioning
an implicitly opened zone to closed is completely optional.

Add a new parameter so that the user can control if this automatic
transitioning should be performed or not.

Being able to control this can help with verifying that e.g. a user-space
program behaves properly even without this optional ZNS feature.

The default value is set to true, in order to not change the existing
behavior.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
[k.jensen: moved parameter to controller]
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: 3553c48fcb6c8469d41de6410b01298d5f9d975e
      
https://github.com/qemu/qemu/commit/3553c48fcb6c8469d41de6410b01298d5f9d975e
  Author: Gollu Appalanaidu <anaidu.gollu@samsung.com>
  Date:   2021-06-29 (Tue, 29 Jun 2021)

  Changed paths:
    M hw/nvme/ctrl.c

  Log Message:
  -----------
  hw/nvme: fix csi field for cns 0x00 and 0x11

As per the TP 4056d Namespace types CNS 0x00 and CNS 0x11
CSI field shouldn't use but it is being used for these two
Identify command CNS values, fix that.

Remove 'nvme_csi_has_nvm_support()' helper as suggested by
Klaus we can safely assume NVM command set support for all
namespaces.

Suggested-by: Klaus Jensen <k.jensen@samsung.com>
Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: 6870cfb8140d8cf545a464b1e21521fdbeeb3417
      
https://github.com/qemu/qemu/commit/6870cfb8140d8cf545a464b1e21521fdbeeb3417
  Author: Heinrich Schuchardt <xypron.glpk@gmx.de>
  Date:   2021-06-29 (Tue, 29 Jun 2021)

  Changed paths:
    M docs/system/nvme.rst
    M hw/nvme/ctrl.c
    M hw/nvme/ns.c
    M hw/nvme/nvme.h

  Log Message:
  -----------
  hw/nvme: namespace parameter for EUI-64

The EUI-64 field is the only identifier for NVMe namespaces in UEFI device
paths. Add a new namespace property "eui64", that provides the user the
option to specify the EUI-64.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Acked-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: 3276dde4f262588f3645f2adbc84d07cb6981d3e
      
https://github.com/qemu/qemu/commit/3276dde4f262588f3645f2adbc84d07cb6981d3e
  Author: Heinrich Schuchardt <xypron.glpk@gmx.de>
  Date:   2021-06-29 (Tue, 29 Jun 2021)

  Changed paths:
    M docs/system/nvme.rst
    M hw/core/machine.c
    M hw/nvme/ns.c
    M hw/nvme/nvme.h

  Log Message:
  -----------
  hw/nvme: default for namespace EUI-64

On machines with version > 6.0 replace a missing EUI-64 by a generated
value.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: 38f4ac65ac88ebf4f1869c1361f40b1817b4a39c
      
https://github.com/qemu/qemu/commit/38f4ac65ac88ebf4f1869c1361f40b1817b4a39c
  Author: Klaus Jensen <k.jensen@samsung.com>
  Date:   2021-06-29 (Tue, 29 Jun 2021)

  Changed paths:
    M hw/nvme/ctrl.c
    M hw/nvme/nvme.h
    M hw/nvme/trace-events

  Log Message:
  -----------
  hw/nvme: reimplement flush to allow cancellation

Prior to this patch, a broadcast flush would result in submitting
multiple "fire and forget" aios (no reference saved to the aiocbs
returned from the blk_aio_flush calls).

Fix this by issuing the flushes one after another.

Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>


  Commit: ff0ac2c8b89dfcfbb4186d8ae5469d4e80a10da9
      
https://github.com/qemu/qemu/commit/ff0ac2c8b89dfcfbb4186d8ae5469d4e80a10da9
  Author: Klaus Jensen <k.jensen@samsung.com>
  Date:   2021-06-29 (Tue, 29 Jun 2021)

  Changed paths:
    M hw/nvme/ctrl.c

  Log Message:
  -----------
  hw/nvme: add nvme_block_status_all helper

Pull the gist of nvme_check_dulbe() into a helper function. This is in
preparation for dsm refactoring.

Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>


  Commit: d7d1474fd85d6c3fce46fa2edd051a6ff3f17cd1
      
https://github.com/qemu/qemu/commit/d7d1474fd85d6c3fce46fa2edd051a6ff3f17cd1
  Author: Klaus Jensen <k.jensen@samsung.com>
  Date:   2021-06-29 (Tue, 29 Jun 2021)

  Changed paths:
    M hw/nvme/ctrl.c
    M hw/nvme/trace-events

  Log Message:
  -----------
  hw/nvme: reimplement dsm to allow cancellation

Prior to this patch, a loop was used to issue multiple "fire and forget"
aios for each range in the command. Without a reference to the aiocb
returned from the blk_aio_pdiscard calls, the aios cannot be canceled.

Fix this by processing the ranges one after another.

As a bonus, this fixes how metadata is cleared (i.e. we only zero it out
if the data was succesfully discarded).

Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>


  Commit: 0ca5c3ccac72ce58a11f97b74f304934df72e90a
      
https://github.com/qemu/qemu/commit/0ca5c3ccac72ce58a11f97b74f304934df72e90a
  Author: Klaus Jensen <k.jensen@samsung.com>
  Date:   2021-06-29 (Tue, 29 Jun 2021)

  Changed paths:
    M hw/nvme/ctrl.c
    M hw/nvme/dif.c
    M hw/nvme/nvme.h

  Log Message:
  -----------
  hw/nvme: save reftag when generating pi

Prepare nvme_dif_pract_generate_dif() and nvme_dif_check() to be
callable in smaller increments by making the reftag a pointer parameter
updated by the function.

Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>


  Commit: 189a8bf7f64aff9c2e26a6e6f2adc654eb9bbe81
      
https://github.com/qemu/qemu/commit/189a8bf7f64aff9c2e26a6e6f2adc654eb9bbe81
  Author: Klaus Jensen <k.jensen@samsung.com>
  Date:   2021-06-29 (Tue, 29 Jun 2021)

  Changed paths:
    M hw/nvme/ctrl.c

  Log Message:
  -----------
  hw/nvme: remove assert from nvme_get_zone_by_slba

Make nvme_get_zone_by_slba() return NULL if the slba is out of range.
This allows the function to be used without guarding the call with a
call to nvme_check_bounds(), in preparation for the next patch.

Add asserts after calling nvme_get_zone_by_slba() instead.

Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>


  Commit: 2a132309e45dfce6dcae901388c05c3cc3cb8d73
      
https://github.com/qemu/qemu/commit/2a132309e45dfce6dcae901388c05c3cc3cb8d73
  Author: Klaus Jensen <k.jensen@samsung.com>
  Date:   2021-06-29 (Tue, 29 Jun 2021)

  Changed paths:
    M hw/nvme/ctrl.c
    M hw/nvme/dif.c
    M hw/nvme/nvme.h
    M include/block/nvme.h

  Log Message:
  -----------
  hw/nvme: use prinfo directly in nvme_check_prinfo and nvme_dif_check

The nvme_check_prinfo() and nvme_dif_check() functions operate on the
16 bit "control" member of the NvmeCmd. These functions do not otherwise
operate on an NvmeCmd or an NvmeRequest, so change them to expect the
actual 4 bit PRINFO field and add constants that work on this field as
well.

Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>


  Commit: f1c97407c5728e284b4e2b331e08c0d88ba568da
      
https://github.com/qemu/qemu/commit/f1c97407c5728e284b4e2b331e08c0d88ba568da
  Author: Klaus Jensen <k.jensen@samsung.com>
  Date:   2021-06-29 (Tue, 29 Jun 2021)

  Changed paths:
    M hw/nvme/ctrl.c
    M hw/nvme/trace-events

  Log Message:
  -----------
  hw/nvme: add dw0/1 to the req completion trace event

Some commands report additional useful information in dw0 and dw1 of the
completion queue entry.

Add them to the trace.

Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>


  Commit: 796d20681d9bef4f863565f1a2f2dbe28e2322c7
      
https://github.com/qemu/qemu/commit/796d20681d9bef4f863565f1a2f2dbe28e2322c7
  Author: Klaus Jensen <k.jensen@samsung.com>
  Date:   2021-06-29 (Tue, 29 Jun 2021)

  Changed paths:
    M hw/nvme/ctrl.c
    M hw/nvme/trace-events

  Log Message:
  -----------
  hw/nvme: reimplement the copy command to allow aio cancellation

Before this patch the code would issue several aios simultaneously
without saving a reference to the aiocb. Without the aiocb reference the
individual copies cannot be canceled.

Fix this by issuing copies of the ranges one after another.

Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>


  Commit: 63d96e4ffd71a4ac2769448a567d46ed71e5bdd6
      
https://github.com/qemu/qemu/commit/63d96e4ffd71a4ac2769448a567d46ed71e5bdd6
  Author: Klaus Jensen <k.jensen@samsung.com>
  Date:   2021-06-29 (Tue, 29 Jun 2021)

  Changed paths:
    M hw/nvme/ctrl.c
    M hw/nvme/trace-events

  Log Message:
  -----------
  hw/nvme: reimplement zone reset to allow cancellation

Prior to this patch, the aios associated with zone reset are submitted
anonymously (no reference saved to the aiocb from the blk_aio call).

Fix this by resetting the zones one after another, saving a reference to
the aiocb for each reset.

Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>


  Commit: 3bcf26d3d6192e350b165c681aff13f6697f30fb
      
https://github.com/qemu/qemu/commit/3bcf26d3d6192e350b165c681aff13f6697f30fb
  Author: Klaus Jensen <k.jensen@samsung.com>
  Date:   2021-06-29 (Tue, 29 Jun 2021)

  Changed paths:
    M hw/nvme/ctrl.c
    M hw/nvme/trace-events

  Log Message:
  -----------
  hw/nvme: reimplement format nvm to allow cancellation

Prior to this patch, the aios associated with broadcast format are
submitted anonymously (no aiocb reference saved from the blk_aio call).

Fix this by formatting the namespaces one after another, saving a
reference to the aiocb for each.

Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>


  Commit: e76fb260ca8fc2420a4ce792324af0544628b331
      
https://github.com/qemu/qemu/commit/e76fb260ca8fc2420a4ce792324af0544628b331
  Author: Klaus Jensen <k.jensen@samsung.com>
  Date:   2021-06-29 (Tue, 29 Jun 2021)

  Changed paths:
    M hw/nvme/ctrl.c

  Log Message:
  -----------
  Partially revert "hw/block/nvme: drain namespaces on sq deletion"

This partially reverts commit 98f84f5a4eca5c03e32fff20f246d9b4b96d6422.

Since all "multi aio" commands are now reimplemented to properly track
the nested aiocbs, we can revert the "hack" that was introduced to make
sure all requests we're properly drained upon sq deletion.

The revert is partial since we keep the assert that no outstanding
requests remain on the submission queue after the explicit cancellation.

Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>


  Commit: 5f4eb94dbb2251b290a1e8b89dc7732865e8a43b
      
https://github.com/qemu/qemu/commit/5f4eb94dbb2251b290a1e8b89dc7732865e8a43b
  Author: Gollu Appalanaidu <anaidu.gollu@samsung.com>
  Date:   2021-06-29 (Tue, 29 Jun 2021)

  Changed paths:
    M hw/nvme/ctrl.c
    M hw/nvme/trace-events
    M include/block/nvme.h

  Log Message:
  -----------
  hw/nvme: fix endianess conversion and add controller list

Add the controller identifiers list CNS 0x13, available list of ctrls
in NVM Subsystem that may or may not be attached to namespaces.

In Identify Ctrl List of the CNS 0x12 and 0x13 no endian conversion
for the nsid field.

These two CNS values shows affect when there exists a Subsystem.
Added condition if there is no Subsystem return invalid field in
command.

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: eeef43290d1598363f886acb4c78652073271011
      
https://github.com/qemu/qemu/commit/eeef43290d1598363f886acb4c78652073271011
  Author: Gollu Appalanaidu <anaidu.gollu@samsung.com>
  Date:   2021-06-29 (Tue, 29 Jun 2021)

  Changed paths:
    M hw/nvme/ctrl.c

  Log Message:
  -----------
  hw/nvme: documentation fix

In the documentation of the '-detached' param "be" and "not" has been
used side by side, fix that.

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: 2b02aabc9d02f9e95946cf639f546bb61f1721b7
      
https://github.com/qemu/qemu/commit/2b02aabc9d02f9e95946cf639f546bb61f1721b7
  Author: Klaus Jensen <k.jensen@samsung.com>
  Date:   2021-06-29 (Tue, 29 Jun 2021)

  Changed paths:
    M hw/nvme/ctrl.c

  Log Message:
  -----------
  hw/nvme: fix missing check for PMR capability

Qiang Liu reported that an access on an unknown address is triggered in
memory_region_set_enabled because a check on CAP.PMRS is missing for the
PMRCTL register write when no PMR is configured.

Cc: qemu-stable@nongnu.org
Fixes: 75c3c9de961d ("hw/block/nvme: disable PMR at boot up")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/362
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>


  Commit: 83d7ed5c570d4c1d5163951b3057cac2ae7da4ff
      
https://github.com/qemu/qemu/commit/83d7ed5c570d4c1d5163951b3057cac2ae7da4ff
  Author: Klaus Jensen <k.jensen@samsung.com>
  Date:   2021-06-29 (Tue, 29 Jun 2021)

  Changed paths:
    M hw/nvme/ctrl.c
    M hw/nvme/nvme.h

  Log Message:
  -----------
  hw/nvme: fix pin-based interrupt behavior (again)

Jakub noticed[1] that, when using pin-based interrupts, the device will
unconditionally deasssert when any CQEs are acknowledged. However, the
pin should not be deasserted if other completion queues still holds
unacknowledged CQEs.

The bug is an artifact of commit ca247d35098d ("hw/block/nvme: fix
pin-based interrupt behavior") which fixed one bug but introduced
another. This is the third time someone tries to fix pin-based
interrupts (see commit 5e9aa92eb1a5 ("hw/block: Fix pin-based interrupt
behaviour of NVMe"))...

Third time's the charm, so fix it, again, by keeping track of how many
CQs have unacknowledged CQEs and only deassert when all are cleared.

  [1]: <20210610114624.304681-1-jakub.jermar@kernkonzept.com>

Cc: qemu-stable@nongnu.org
Fixes: ca247d35098d ("hw/block/nvme: fix pin-based interrupt behavior")
Reported-by: Jakub Jermář <jakub.jermar@kernkonzept.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>


  Commit: 176c0a4973d3ca5d46b05d0edb439b154363d29f
      
https://github.com/qemu/qemu/commit/176c0a4973d3ca5d46b05d0edb439b154363d29f
  Author: Keith Busch <kbusch@kernel.org>
  Date:   2021-06-29 (Tue, 29 Jun 2021)

  Changed paths:
    M docs/system/nvme.rst

  Log Message:
  -----------
  hw/nvme: add 'zoned.zasl' to documentation

Signed-off-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: 1ec2cd0ce2ca94292ce237becc2c21b4eb9edca0
      
https://github.com/qemu/qemu/commit/1ec2cd0ce2ca94292ce237becc2c21b4eb9edca0
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2021-06-30 (Wed, 30 Jun 2021)

  Changed paths:
    M docs/system/nvme.rst
    M hw/core/machine.c
    M hw/nvme/ctrl.c
    M hw/nvme/dif.c
    M hw/nvme/ns.c
    M hw/nvme/nvme.h
    M hw/nvme/trace-events
    M include/block/nvme.h

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/nvme/tags/nvme-next-pull-request' into 
staging

hw/nvme patches

* namespace eui64 support (Heinrich)
* aiocb refactoring (Klaus)
* controller parameter for auto zone transitioning (Niklas)
* misc fixes and additions (Gollu, Klaus, Keith)

# gpg: Signature made Tue 29 Jun 2021 19:46:55 BST
# gpg:                using RSA key 522833AA75E2DCE6A24766C04DE1AF316D4F0DE9
# gpg: Good signature from "Klaus Jensen <its@irrelevant.dk>" [unknown]
# gpg:                 aka "Klaus Jensen <k.jensen@samsung.com>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: DDCA 4D9C 9EF9 31CC 3468  4272 63D5 6FC5 E55D A838
#      Subkey fingerprint: 5228 33AA 75E2 DCE6 A247  66C0 4DE1 AF31 6D4F 0DE9

* remotes/nvme/tags/nvme-next-pull-request: (23 commits)
  hw/nvme: add 'zoned.zasl' to documentation
  hw/nvme: fix pin-based interrupt behavior (again)
  hw/nvme: fix missing check for PMR capability
  hw/nvme: documentation fix
  hw/nvme: fix endianess conversion and add controller list
  Partially revert "hw/block/nvme: drain namespaces on sq deletion"
  hw/nvme: reimplement format nvm to allow cancellation
  hw/nvme: reimplement zone reset to allow cancellation
  hw/nvme: reimplement the copy command to allow aio cancellation
  hw/nvme: add dw0/1 to the req completion trace event
  hw/nvme: use prinfo directly in nvme_check_prinfo and nvme_dif_check
  hw/nvme: remove assert from nvme_get_zone_by_slba
  hw/nvme: save reftag when generating pi
  hw/nvme: reimplement dsm to allow cancellation
  hw/nvme: add nvme_block_status_all helper
  hw/nvme: reimplement flush to allow cancellation
  hw/nvme: default for namespace EUI-64
  hw/nvme: namespace parameter for EUI-64
  hw/nvme: fix csi field for cns 0x00 and 0x11
  hw/nvme: add param to control auto zone transitioning to zone state closed
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/d940d468e29b...1ec2cd0ce2ca



reply via email to

[Prev in Thread] Current Thread [Next in Thread]