qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] c519d9: hw/block/nvme: remove superfluous Nvm


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] c519d9: hw/block/nvme: remove superfluous NvmeCtrl parameter
Date: Tue, 09 Feb 2021 05:30:21 -0800

  Branch: refs/heads/staging
  Home:   https://github.com/qemu/qemu
  Commit: c519d9d55e701acf4d502c4aabad8644b75a0115
      
https://github.com/qemu/qemu/commit/c519d9d55e701acf4d502c4aabad8644b75a0115
  Author: Klaus Jensen <k.jensen@samsung.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

  Changed paths:
    M hw/block/nvme.c

  Log Message:
  -----------
  hw/block/nvme: remove superfluous NvmeCtrl parameter

nvme_check_bounds has no use of the NvmeCtrl parameter; remove it.

Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>


  Commit: 54eea8d947869856133a4eba0c0cb0b17cb9a5cd
      
https://github.com/qemu/qemu/commit/54eea8d947869856133a4eba0c0cb0b17cb9a5cd
  Author: Klaus Jensen <k.jensen@samsung.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

  Changed paths:
    M hw/block/nvme.c

  Log Message:
  -----------
  hw/block/nvme: pull aio error handling

Add a new function, nvme_aio_err, to handle errors resulting from AIOs
and use this from the callbacks.

Signed-off-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: 54064e51d1e2c85e08ab64f05d12957ff65dfcd3
      
https://github.com/qemu/qemu/commit/54064e51d1e2c85e08ab64f05d12957ff65dfcd3
  Author: Klaus Jensen <k.jensen@samsung.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

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

  Log Message:
  -----------
  hw/block/nvme: add dulbe support

Add support for reporting the Deallocated or Unwritten Logical Block
Error (DULBE).

Rely on the block status flags reported by the block layer and consider
any block with the BDRV_BLOCK_ZERO flag to be deallocated.

Multiple factors affect when a Write Zeroes command result in
deallocation of blocks.

  * the underlying file system block size
  * the blockdev format
  * the 'discard' and 'logical_block_size' parameters

     format | discard | wz (512B)  wz (4KiB)  wz (64KiB)
    -----------------------------------------------------
      qcow2    ignore   n          n          y
      qcow2    unmap    n          n          y
      raw      ignore   n          y          y
      raw      unmap    n          y          y

So, this works best with an image in raw format and 4KiB LBAs, since
holes can then be punched on a per-block basis (this assumes a file
system with a 4kb block size, YMMV). A qcow2 image, uses a cluster size
of 64KiB by default and blocks will only be marked deallocated if a full
cluster is zeroed or discarded. However, this *is* consistent with the
spec since Write Zeroes "should" deallocate the block if the Deallocate
attribute is set and "may" deallocate if the Deallocate attribute is not
set. Thus, we always try to deallocate (the BDRV_REQ_MAY_UNMAP flag is
always set).

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


  Commit: 6fd704a59af99056ee6ed1284784b092725a9416
      
https://github.com/qemu/qemu/commit/6fd704a59af99056ee6ed1284784b092725a9416
  Author: Klaus Jensen <k.jensen@samsung.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

  Changed paths:
    M include/block/nvme.h

  Log Message:
  -----------
  nvme: add namespace I/O optimization fields to shared header

This adds the NPWG, NPWA, NPDG, NPDA and NOWS family of fields to the
shared nvme.h header for use by later patches.

Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Fam Zheng <fam@euphon.net>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>


  Commit: 2605257a26b873eb8a0917391063df9c7ed7a976
      
https://github.com/qemu/qemu/commit/2605257a26b873eb8a0917391063df9c7ed7a976
  Author: Klaus Jensen <k.jensen@samsung.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

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

  Log Message:
  -----------
  hw/block/nvme: add the dataset management command

Add support for the Dataset Management command and the Deallocate
attribute. Deallocation results in discards being sent to the underlying
block device. Whether of not the blocks are actually deallocated is
affected by the same factors as Write Zeroes (see previous commit).

     format | discard | dsm (512B)  dsm (4KiB)  dsm (64KiB)
    --------------------------------------------------------
      qcow2    ignore   n           n           n
      qcow2    unmap    n           n           y
      raw      ignore   n           n           n
      raw      unmap    n           y           y

Again, a raw format and 4KiB LBAs are preferable.

In order to set the Namespace Preferred Deallocate Granularity and
Alignment fields (NPDG and NPDA), choose a sane minimum discard
granularity of 4KiB. If we are using a passthru device supporting
discard at a 512B granularity, user should set the discard_granularity
property explicitly. NPDG and NPDA will also account for the
cluster_size of the block driver if required (i.e. for QCOW2).

See NVM Express 1.3d, Section 6.7 ("Dataset Management command").

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


  Commit: 0a384f923f519b4229c07816900e87f4a28d3abb
      
https://github.com/qemu/qemu/commit/0a384f923f519b4229c07816900e87f4a28d3abb
  Author: Gollu Appalanaidu <anaidu.gollu@samsung.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

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

  Log Message:
  -----------
  hw/block/nvme: add compare command

Add the Compare command.

This implementation uses a bounce buffer to read in the data from
storage and then compare with the host supplied buffer.

Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
[k.jensen: rebased]
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>


  Commit: e1f81c1478398713f14c1b6ba011d4bb841dea27
      
https://github.com/qemu/qemu/commit/e1f81c1478398713f14c1b6ba011d4bb841dea27
  Author: Klaus Jensen <k.jensen@samsung.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

  Changed paths:
    M hw/block/nvme.c

  Log Message:
  -----------
  hw/block/nvme: fix bad clearing of CAP

Commit 37712e00b1f0 ("hw/block/nvme: factor out pmr setup") changed the
control flow such that the CAP register is erronously cleared after
nvme_init_pmr() has configured it. Since the entire NvmeCtrl structure
is zero-filled initially, there is no need for the explicit clearing, so
just remove it.

Fixes: 37712e00b1f0 ("hw/block/nvme: factor out pmr setup")
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>


  Commit: ba69f224817437b5280f4c8ef511d09f17ab1305
      
https://github.com/qemu/qemu/commit/ba69f224817437b5280f4c8ef511d09f17ab1305
  Author: Dmitry Fomichev <dmitry.fomichev@wdc.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

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

  Log Message:
  -----------
  hw/block/nvme: Process controller reset and shutdown differently

Controller reset ans subsystem shutdown are handled very much the same
in the current code, but some of the steps should be different in these
two cases.

Introduce two new functions, nvme_reset_ctrl() and nvme_shutdown_ctrl(),
to separate some portions of the code from nvme_clear_ctrl(). The steps
that are made different between reset and shutdown are that BAR.CC is not
reset to zero upon the shutdown and namespace data is flushed to
backing storage as a part of shutdown handling, but not upon reset.

Suggested-by: Klaus Jensen <k.jensen@samsung.com>
Signed-off-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: b52f26cd1f743a63682d33a7e3d427b9610e9545
      
https://github.com/qemu/qemu/commit/b52f26cd1f743a63682d33a7e3d427b9610e9545
  Author: Dmitry Fomichev <dmitry.fomichev@wdc.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

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

  Log Message:
  -----------
  hw/block/nvme: Generate namespace UUIDs

In NVMe 1.4, a namespace must report an ID descriptor of UUID type
if it doesn't support EUI64 or NGUID. Add a new namespace property,
"uuid", that provides the user the option to either specify the UUID
explicitly or have a UUID generated automatically every time a
namespace is initialized.

Suggested-by: Klaus Jensen <k.jensen@samsung.com>
Signed-off-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Niklas Cassel <Niklas.Cassel@wdc.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: 13a7b6539df527e89ec59ca6b90f9e73d208a81a
      
https://github.com/qemu/qemu/commit/13a7b6539df527e89ec59ca6b90f9e73d208a81a
  Author: Dmitry Fomichev <dmitry.fomichev@wdc.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

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

  Log Message:
  -----------
  hw/block/nvme: Separate read and write handlers

The majority of code in nvme_rw() is becoming read- or write-specific.
Move these parts to two separate handlers, nvme_read() and nvme_write()
to make the code more readable and to remove multiple is_write checks
that has been present in the i/o path.

This is a refactoring patch, no change in functionality.

Signed-off-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Reviewed-by: Niklas Cassel <Niklas.Cassel@wdc.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: 3ec1d547a5b70482aac3a446c848f1a9eed165e6
      
https://github.com/qemu/qemu/commit/3ec1d547a5b70482aac3a446c848f1a9eed165e6
  Author: Dmitry Fomichev <dmitry.fomichev@wdc.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

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

  Log Message:
  -----------
  hw/block/nvme: Combine nvme_write_zeroes() and nvme_write()

Move write processing to nvme_do_write() that now handles both WRITE
and WRITE ZEROES. Both nvme_write() and nvme_write_zeroes() become
inline helper functions.

Signed-off-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Reviewed-by: Niklas Cassel <Niklas.Cassel@wdc.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: 62e8faa468109ae66b55a038cbd268ad6e40472b
      
https://github.com/qemu/qemu/commit/62e8faa468109ae66b55a038cbd268ad6e40472b
  Author: Dmitry Fomichev <dmitry.fomichev@wdc.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

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

  Log Message:
  -----------
  hw/block/nvme: Add Commands Supported and Effects log

This log page becomes necessary to implement to allow checking for
Zone Append command support in Zoned Namespace Command Set.

This commit adds the code to report this log page for NVM Command
Set only. The parts that are specific to zoned operation will be
added later in the series.

All incoming admin and i/o commands are now only processed if their
corresponding support bits are set in this log. This provides an
easy way to control what commands to support and what not to
depending on set CC.CSS.

Signed-off-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Reviewed-by: Niklas Cassel <Niklas.Cassel@wdc.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: 141354d55ba92768ea8fad54d441d3ba90d2b59e
      
https://github.com/qemu/qemu/commit/141354d55ba92768ea8fad54d441d3ba90d2b59e
  Author: Niklas Cassel <niklas.cassel@wdc.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

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

  Log Message:
  -----------
  hw/block/nvme: Add support for Namespace Types

Define the structures and constants required to implement
Namespace Types support.

Namespace Types introduce a new command set, "I/O Command Sets",
that allows the host to retrieve the command sets associated with
a namespace. Introduce support for the command set and enable
detection for the NVM Command Set.

The new workflows for identify commands rely heavily on zero-filled
identify structs. E.g., certain CNS commands are defined to return
a zero-filled identify struct when an inactive namespace NSID
is supplied.

Add a helper function in order to avoid code duplication when
reporting zero-filled identify structures.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Signed-off-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: 922e6f4ebd09c69c354b7b008552f0002521f5c8
      
https://github.com/qemu/qemu/commit/922e6f4ebd09c69c354b7b008552f0002521f5c8
  Author: Niklas Cassel <niklas.cassel@wdc.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

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

  Log Message:
  -----------
  hw/block/nvme: Support allocated CNS command variants

Many CNS commands have "allocated" command variants. These include
a namespace as long as it is allocated, that is a namespace is
included regardless if it is active (attached) or not.

While these commands are optional (they are mandatory for controllers
supporting the namespace attachment command), our QEMU implementation
is more complete by actually providing support for these CNS values.

However, since our QEMU model currently does not support the namespace
attachment command, these new allocated CNS commands will return the
same result as the active CNS command variants.

The reason for not hooking up this command completely is because the
NVMe specification requires the namespace management command to be
supported if the namespace attachment command is supported.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Signed-off-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: e9ba46eeafd7062724d21b92750c7919951e16a8
      
https://github.com/qemu/qemu/commit/e9ba46eeafd7062724d21b92750c7919951e16a8
  Author: Dmitry Fomichev <dmitry.fomichev@wdc.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

  Changed paths:
    M include/block/nvme.h

  Log Message:
  -----------
  nvme: Make ZNS-related definitions

Define values and structures that are needed to support Zoned
Namespace Command Set (NVMe TP 4053).

Signed-off-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: a479335bfaf3aa286924c14fbd75307456ebe1fa
      
https://github.com/qemu/qemu/commit/a479335bfaf3aa286924c14fbd75307456ebe1fa
  Author: Dmitry Fomichev <dmitry.fomichev@wdc.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

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

  Log Message:
  -----------
  hw/block/nvme: Support Zoned Namespace Command Set

The emulation code has been changed to advertise NVM Command Set when
"zoned" device property is not set (default) and Zoned Namespace
Command Set otherwise.

Define values and structures that are needed to support Zoned
Namespace Command Set (NVMe TP 4053) in PCI NVMe controller emulator.
Define trace events where needed in newly introduced code.

In order to improve scalability, all open, closed and full zones
are organized in separate linked lists. Consequently, almost all
zone operations don't require scanning of the entire zone array
(which potentially can be quite large) - it is only necessary to
enumerate one or more zone lists.

Handlers for three new NVMe commands introduced in Zoned Namespace
Command Set specification are added, namely for Zone Management
Receive, Zone Management Send and Zone Append.

Device initialization code has been extended to create a proper
configuration for zoned operation using device properties.

Read/Write command handler is modified to only allow writes at the
write pointer if the namespace is zoned. For Zone Append command,
writes implicitly happen at the write pointer and the starting write
pointer value is returned as the result of the command. Write Zeroes
handler is modified to add zoned checks that are identical to those
done as a part of Write flow.

Subsequent commits in this series add ZDE support and checks for
active and open zone limits.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Signed-off-by: Hans Holmberg <hans.holmberg@wdc.com>
Signed-off-by: Ajay Joshi <ajay.joshi@wdc.com>
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Matias Bjorling <matias.bjorling@wdc.com>
Signed-off-by: Aravind Ramesh <aravind.ramesh@wdc.com>
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: Adam Manzanares <adam.manzanares@wdc.com>
Signed-off-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Reviewed-by: Niklas Cassel <Niklas.Cassel@wdc.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: 8d18ddcd229753933a20a20dc54e52379ce43d27
      
https://github.com/qemu/qemu/commit/8d18ddcd229753933a20a20dc54e52379ce43d27
  Author: Dmitry Fomichev <dmitry.fomichev@wdc.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

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

  Log Message:
  -----------
  hw/block/nvme: Introduce max active and open zone limits

Add two module properties, "zoned.max_active" and "zoned.max_open"
to control the maximum number of zones that can be active or open.
Once these variables are set to non-default values, these limits are
checked during I/O and Too Many Active or Too Many Open command status
is returned if they are exceeded.

Signed-off-by: Hans Holmberg <hans.holmberg@wdc.com>
Signed-off-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Reviewed-by: Niklas Cassel <Niklas.Cassel@wdc.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: 1a9290ade33a8993ec0ceca8da36e504ec356ed0
      
https://github.com/qemu/qemu/commit/1a9290ade33a8993ec0ceca8da36e504ec356ed0
  Author: Dmitry Fomichev <dmitry.fomichev@wdc.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

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

  Log Message:
  -----------
  hw/block/nvme: Support Zone Descriptor Extensions

Zone Descriptor Extension is a label that can be assigned to a zone.
It can be set to an Empty zone and it stays assigned until the zone
is reset.

This commit adds a new optional module property,
"zoned.descr_ext_size". Its value must be a multiple of 64 bytes.
If this value is non-zero, it becomes possible to assign extensions
of that size to any Empty zones. The default value for this property
is 0, therefore setting extensions is disabled by default.

Signed-off-by: Hans Holmberg <hans.holmberg@wdc.com>
Signed-off-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Reviewed-by: Niklas Cassel <Niklas.Cassel@wdc.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: 00dd640dff7d8a294be8ab6afcff2355c1d664a7
      
https://github.com/qemu/qemu/commit/00dd640dff7d8a294be8ab6afcff2355c1d664a7
  Author: Dmitry Fomichev <dmitry.fomichev@wdc.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

  Changed paths:
    M hw/block/nvme.c

  Log Message:
  -----------
  hw/block/nvme: Document zoned parameters in usage text

Added brief descriptions of the new device properties that are
now available to users to configure features of Zoned Namespace
Command Set in the emulator.

This patch is for documentation only, no functionality change.

Signed-off-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Reviewed-by: Niklas Cassel <Niklas.Cassel@wdc.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: 55886345d01d72a03cbfaf1c4d89f967174dedd9
      
https://github.com/qemu/qemu/commit/55886345d01d72a03cbfaf1c4d89f967174dedd9
  Author: Klaus Jensen <k.jensen@samsung.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

  Changed paths:
    M hw/block/nvme.c

  Log Message:
  -----------
  hw/block/nvme: fix for non-msix machines

Commit 1c0c2163aa08 ("hw/block/nvme: verify msix_init_exclusive_bar()
return value") had the unintended effect of breaking support on
several platforms not supporting MSI-X.

Still check for errors, but only report that MSI-X is unsupported
instead of bailing out.

Fixes: 1c0c2163aa08 ("hw/block/nvme: verify msix_init_exclusive_bar() return 
value")
Fixes: fbf2e5375e33 ("hw/block/nvme: Verify msix_vector_use() returned value")
Reported-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: 1b5804a80d8bd6ecb8910e864afb89049279df17
      
https://github.com/qemu/qemu/commit/1b5804a80d8bd6ecb8910e864afb89049279df17
  Author: Klaus Jensen <k.jensen@samsung.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

  Changed paths:
    M hw/block/nvme-ns.c

  Log Message:
  -----------
  hw/block/nvme: conditionally enable DULBE for zoned namespaces

The device uses the BDRV_BLOCK_ZERO flag to determine the "deallocated"
status of logical blocks. Since the zoned namespaces command set
specification defines that logical blocks SHALL be marked as deallocated
when the zone is in the Empty or Offline states, DULBE can only be
supported if the zone size is a multiple of the calculated deallocation
granularity (reported in NPDG) which depends on the underlying block
device cluster size (if applicable) or the configured
discard_granularity.

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


  Commit: 165f134f3d8f62cb74ab2f53e3b72158be0cfb31
      
https://github.com/qemu/qemu/commit/165f134f3d8f62cb74ab2f53e3b72158be0cfb31
  Author: Klaus Jensen <k.jensen@samsung.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

  Changed paths:
    M hw/block/nvme.c

  Log Message:
  -----------
  hw/block/nvme: fix shutdown/reset logic

A shutdown is only about flushing stuff. It is the host that should
delete any queues, so do not perform a reset here.

Also, on shutdown, make sure that the PMR is flushed if in use.

Fixes: 368f4e752cf9 ("hw/block/nvme: Process controller reset and shutdown 
differently")
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Tested-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Reviewed-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>


  Commit: 57206696058e3a8b1ee6ec8a129722baa6e7ec9f
      
https://github.com/qemu/qemu/commit/57206696058e3a8b1ee6ec8a129722baa6e7ec9f
  Author: Klaus Jensen <k.jensen@samsung.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

  Changed paths:
    M hw/block/nvme.c

  Log Message:
  -----------
  hw/block/nvme: merge implicitly/explicitly opened processing masks

Implicitly and explicitly opended zones are always bulk processed
together, so merge the two processing masks.

Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Tested-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Reviewed-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>


  Commit: b05fde2881118e7e6e66b352e3a7ea1b8f52e1ad
      
https://github.com/qemu/qemu/commit/b05fde2881118e7e6e66b352e3a7ea1b8f52e1ad
  Author: Klaus Jensen <k.jensen@samsung.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

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

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

Align with existing style and use a typedef for header-file enums.

Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Tested-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Reviewed-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>


  Commit: 5f5dc4c6a9426d6a1fe69ea1b539721f5eab7176
      
https://github.com/qemu/qemu/commit/5f5dc4c6a9426d6a1fe69ea1b539721f5eab7176
  Author: Klaus Jensen <k.jensen@samsung.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

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

  Log Message:
  -----------
  hw/block/nvme: zero out zones on reset

The zoned command set specification states that "All logical blocks in a
zone *shall* be marked as deallocated when [the zone is reset]". Since
the device guarantees 0x00 to be read from deallocated blocks we have to
issue a pwrite_zeroes since we cannot be sure that a discard will do
anything. But typically, this will be achieved with an efficient
unmap/discard operation.

Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Tested-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Reviewed-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>


  Commit: cd42771a334434c5ca8a4a48a62e48570dbe8d9e
      
https://github.com/qemu/qemu/commit/cd42771a334434c5ca8a4a48a62e48570dbe8d9e
  Author: Klaus Jensen <k.jensen@samsung.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

  Changed paths:
    M hw/block/nvme.h

  Log Message:
  -----------
  hw/block/nvme: add missing string representations for commands

Add missing string representations for a couple of new commands.

Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Tested-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Reviewed-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>


  Commit: 521ea778b264116310182db9c4d329c5aa867c59
      
https://github.com/qemu/qemu/commit/521ea778b264116310182db9c4d329c5aa867c59
  Author: Klaus Jensen <k.jensen@samsung.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

  Changed paths:
    M hw/block/nvme.c

  Log Message:
  -----------
  hw/block/nvme: remove unnecessary check for append

nvme_io_cmd already checks if the namespace supports the Zone Append
command, so the removed check is dead code.

Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
Tested-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Reviewed-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>


  Commit: add961300c8e29167465fe8206539c4e6bffde28
      
https://github.com/qemu/qemu/commit/add961300c8e29167465fe8206539c4e6bffde28
  Author: Dmitry Fomichev <dmitry.fomichev@wdc.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

  Changed paths:
    M hw/block/nvme.c

  Log Message:
  -----------
  hw/block/nvme: Correct error status for unaligned ZA

TP 4053 says (in section 2.3.1.1) -
... if a Zone Append command specifies a ZSLBA that is not the lowest
logical block address in that zone, then the controller shall abort
that command with a status code of Invalid Field In Command.

In the code, Zone Invalid Write is returned instead, fix this.

Signed-off-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: 1490be5a8a278c17bceffa0be1dbd21dcb2f9bee
      
https://github.com/qemu/qemu/commit/1490be5a8a278c17bceffa0be1dbd21dcb2f9bee
  Author: Minwoo Im <minwoo.im.dev@gmail.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

  Changed paths:
    M hw/block/nvme-ns.c

  Log Message:
  -----------
  hw/block/nvme: remove unused argument in nvme_ns_init_zoned

nvme_ns_init_zoned() has no use for given NvmeCtrl object.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: aa5e55e3b07ede87a8fd7aa3e67583dfc464dd52
      
https://github.com/qemu/qemu/commit/aa5e55e3b07ede87a8fd7aa3e67583dfc464dd52
  Author: Minwoo Im <minwoo.im.dev@gmail.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

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

  Log Message:
  -----------
  hw/block/nvme: open code for volatile write cache

Volatile Write Cache(VWC) feature is set in nvme_ns_setup() in the
initial time.  This feature is related to block device backed,  but this
feature is controlled in controller level via Set/Get Features command.

This patch removed dependency between nvme and nvme-ns to manage the VWC
flag value.  Also, it open coded the Get Features for VWC to check all
namespaces attached to the controller, and if false detected, return
directly false.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
[k.jensen: report write cache preset if present on ANY namespace]
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: 337ccd7650cfab379bfba9eed54ad790e88ec62e
      
https://github.com/qemu/qemu/commit/337ccd7650cfab379bfba9eed54ad790e88ec62e
  Author: Minwoo Im <minwoo.im.dev@gmail.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

  Changed paths:
    M hw/block/nvme-ns.c

  Log Message:
  -----------
  hw/block/nvme: remove unused argument in nvme_ns_init_blk

Removed no longer used aregument NvmeCtrl object in nvme_ns_init_blk().

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: 15d024d4aa9b73ff05604f6f6d998788d3ea26e2
      
https://github.com/qemu/qemu/commit/15d024d4aa9b73ff05604f6f6d998788d3ea26e2
  Author: Minwoo Im <minwoo.im.dev@gmail.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

  Changed paths:
    M hw/block/nvme-ns.c

  Log Message:
  -----------
  hw/block/nvme: split setup and register for namespace

In NVMe, namespace is being attached to process I/O.  We register NVMe
namespace to a controller via nvme_register_namespace() during
nvme_ns_setup().  This is main reason of receiving NvmeCtrl object
instance to this function to map the namespace to a controller.

To make namespace instance more independent, it should be split into two
parts: setup and register.  This patch split them into two differnt
parts, and finally nvme_ns_setup() does not have nothing to do with
NvmeCtrl instance at all.

This patch is a former patch to introduce NVMe subsystem scheme to the
existing design especially for multi-path.  In that case, it should be
split into two to make namespace independent from a controller.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: 24ec776a5ac70954e95a33249d8fe3378c01f3a0
      
https://github.com/qemu/qemu/commit/24ec776a5ac70954e95a33249d8fe3378c01f3a0
  Author: Minwoo Im <minwoo.im.dev@gmail.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

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

  Log Message:
  -----------
  hw/block/nvme: remove unused argument in nvme_ns_setup

nvme_ns_setup() finally does not have nothing to do with NvmeCtrl
instance.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: 635b23ad43e37910eb7607cfee6887e89ae9e69a
      
https://github.com/qemu/qemu/commit/635b23ad43e37910eb7607cfee6887e89ae9e69a
  Author: Klaus Jensen <k.jensen@samsung.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

  Changed paths:
    M hw/block/nvme.c

  Log Message:
  -----------
  hw/block/nvme: fix zone write finalize

The zone write pointer is unconditionally advanced, even for write
faults. Make sure that the zone is always transitioned to Full if the
write pointer reaches zone capacity.

Cc: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: c6d1b5c13bf937d3314f4bad596ced52f32106c5
      
https://github.com/qemu/qemu/commit/c6d1b5c13bf937d3314f4bad596ced52f32106c5
  Author: zhenwei pi <pizhenwei@bytedance.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

  Changed paths:
    M include/block/nvme.h

  Log Message:
  -----------
  nvme: introduce bit 5 for critical warning

According to NVM Express v1.4, Section 5.14.1.2 ("SMART / Health
Information"), introduce bit 5 for "Persistent Memory Region has become
read-only or unreliable".

Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
[k.jensen: minor brush ups in commit message]
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: 4714791b66ae39bea6b6e3c3e84aaed8dcb005c7
      
https://github.com/qemu/qemu/commit/4714791b66ae39bea6b6e3c3e84aaed8dcb005c7
  Author: zhenwei pi <pizhenwei@bytedance.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

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

  Log Message:
  -----------
  hw/block/nvme: add smart_critical_warning property

There is a very low probability that hitting physical NVMe disk
hardware critical warning case, it's hard to write & test a monitor
agent service.

For debugging purposes, add a new 'smart_critical_warning' property
to emulate this situation.

The orignal version of this change is implemented by adding a fixed
property which could be initialized by QEMU command line. Suggested
by Philippe & Klaus, rework like current version.

Test with this patch:
1, change smart_critical_warning property for a running VM:
 #virsh qemu-monitor-command nvme-upstream '{ "execute": "qom-set",
  "arguments": { "path": "/machine/peripheral-anon/device[0]",
  "property": "smart_critical_warning", "value":16 } }'
2, run smartctl in guest
 #smartctl -H -l error /dev/nvme0n1

  === START OF SMART DATA SECTION ===
  SMART overall-health self-assessment test result: FAILED!
  - volatile memory backup device has failed

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: c62720f137dffcefa7f03ac1a51b4aadba2a38be
      
https://github.com/qemu/qemu/commit/c62720f137dffcefa7f03ac1a51b4aadba2a38be
  Author: zhenwei pi <pizhenwei@bytedance.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

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

  Log Message:
  -----------
  hw/block/nvme: trigger async event during injecting smart warning

During smart critical warning injection by setting property from QMP
command, also try to trigger asynchronous event.

Suggested by Keith, if a event has already been raised, there is no
need to enqueue the duplicate event any more.

Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
[k.jensen: fix typo in commit message]
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: ffacaf090893c5d6a5a6ea51b93087411af859c4
      
https://github.com/qemu/qemu/commit/ffacaf090893c5d6a5a6ea51b93087411af859c4
  Author: Klaus Jensen <k.jensen@samsung.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

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

  Log Message:
  -----------
  hw/block/nvme: add size to mmio read/write trace events

Add the size of the mmio read/write to the trace event.

Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: 0d3d5da2ccc8823c7c904b790b8d0fdf569790f0
      
https://github.com/qemu/qemu/commit/0d3d5da2ccc8823c7c904b790b8d0fdf569790f0
  Author: Klaus Jensen <k.jensen@samsung.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

  Changed paths:
    M hw/block/nvme.c

  Log Message:
  -----------
  hw/block/nvme: fix 64 bit register hi/lo split writes

64 bit registers like ASQ and ACQ should be writable by both a hi/lo 32
bit write combination as well as a plain 64 bit write. The spec does not
define ordering on the hi/lo split, but the code currently assumes that
the low order bits are written first. Additionally, the code does not
consider that another address might already have been written into the
register, causing the OR'ing to result in a bad address.

Fix this by explicitly overwriting only the low or high order bits for
32 bit writes.

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


  Commit: c7050631297f07917c23c7f4cdec8a6cca0eed12
      
https://github.com/qemu/qemu/commit/c7050631297f07917c23c7f4cdec8a6cca0eed12
  Author: Andrzej Jakowski <andrzej.jakowski@linux.intel.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

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

  Log Message:
  -----------
  hw/block/nvme: indicate CMB support through controller capabilities register

This patch sets CMBS bit in controller capabilities register when user
configures NVMe driver with CMB support, so capabilites are correctly
reported to guest OS.

Signed-off-by: Andrzej Jakowski <andrzej.jakowski@linux.intel.com>
Reviewed-by: Maxim Levitsky <mlevitsky@gmail.com>
Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: 1901b4967c3fdd47e59d9023aea2285d94f3998a
      
https://github.com/qemu/qemu/commit/1901b4967c3fdd47e59d9023aea2285d94f3998a
  Author: Klaus Jensen <k.jensen@samsung.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

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

  Log Message:
  -----------
  hw/block/nvme: move msix table and pba to BAR 0

In the interest of supporting both CMB and PMR to be enabled on the same
device, move the MSI-X table and pending bit array out of BAR 4 and into
BAR 0.

This is a simplified version of the patch contributed by Andrzej
Jakowski (see [1]). Leaving the CMB at offset 0 removes the need for
changes to CMB address mapping code.

  [1]: 
https://lore.kernel.org/qemu-devel/20200729220107.37758-3-andrzej.jakowski@linux.intel.com/

Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>
Tested-by: Minwoo Im <minwoo.im.dev@gmail.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: 709cc8fc68f7456f4db604db7c24c8a96eebb652
      
https://github.com/qemu/qemu/commit/709cc8fc68f7456f4db604db7c24c8a96eebb652
  Author: Klaus Jensen <k.jensen@samsung.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

  Changed paths:
    M hw/block/nvme.c

  Log Message:
  -----------
  hw/block/nvme: allow cmb and pmr to coexist

With BAR 4 now free to use, allow PMR and CMB to be enabled
simultaneously.

Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: 8e9e8b48216b134bb9165c1f023a60a4ec480b42
      
https://github.com/qemu/qemu/commit/8e9e8b48216b134bb9165c1f023a60a4ec480b42
  Author: Klaus Jensen <k.jensen@samsung.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

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

  Log Message:
  -----------
  hw/block/nvme: rename PMR/CMB shift/mask fields

Use the correct field names.

Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: b78b9bb0ee1f07b27b649065158dcac571986f30
      
https://github.com/qemu/qemu/commit/b78b9bb0ee1f07b27b649065158dcac571986f30
  Author: Klaus Jensen <k.jensen@samsung.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

  Changed paths:
    M hw/block/nvme.c

  Log Message:
  -----------
  hw/block/nvme: remove redundant zeroing of PMR registers

The controller registers are initially zero. Remove the redundant
zeroing.

Reviewed-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: 75c3c9de961db9a76842452c973aea921eb4fa1f
      
https://github.com/qemu/qemu/commit/75c3c9de961db9a76842452c973aea921eb4fa1f
  Author: Klaus Jensen <k.jensen@samsung.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

  Changed paths:
    M hw/block/nvme.c

  Log Message:
  -----------
  hw/block/nvme: disable PMR at boot up

The PMR should not be enabled at boot up. Disable the PMR MemoryRegion
initially and implement MMIO for PMRCTL, allowing the host to enable the
PMR explicitly.

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


  Commit: 7ec9f2eef979e51891d99667e01d6c0e789a52b2
      
https://github.com/qemu/qemu/commit/7ec9f2eef979e51891d99667e01d6c0e789a52b2
  Author: Naveen Nagar <naveen.n1@samsung.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

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

  Log Message:
  -----------
  hw/block/nvme: add PMR RDS/WDS support

Add support for the PMRMSCL and PMRMSCU MMIO registers. This allows
adding RDS/WDS support for PMR as well.

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


  Commit: f4319477b4fd692b568c22ed97dde7f542a48ac9
      
https://github.com/qemu/qemu/commit/f4319477b4fd692b568c22ed97dde7f542a48ac9
  Author: Padmakar Kalghatgi <p.kalghatgi@samsung.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

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

  Log Message:
  -----------
  hw/block/nvme: move cmb logic to v1.4

Implement v1.4 logic for configuring the Controller Memory Buffer. By
default, the v1.4 scheme will be used (CMB must be explicitly enabled by
the host), so drivers that only support v1.3 will not be able to use the
CMB anymore.

To retain the v1.3 behavior, set the boolean 'legacy-cmb' nvme device
parameter.

Reviewed-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>
Signed-off-by: Padmakar Kalghatgi <p.kalghatgi@samsung.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: c2a3640de8e97bc0398976a7fc0fe9f6a088e777
      
https://github.com/qemu/qemu/commit/c2a3640de8e97bc0398976a7fc0fe9f6a088e777
  Author: Klaus Jensen <k.jensen@samsung.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

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

  Log Message:
  -----------
  hw/block/nvme: bump to v1.4

With the new CMB logic in place, bump the implemented specification
version to v1.4 by default.

This requires adding the setting the CNTRLTYPE field and modifying the
VWC field since 0x00 is no longer a valid value for bits 2:1.

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


  Commit: 38001f73403808dde35c523695ee895587bcc6ba
      
https://github.com/qemu/qemu/commit/38001f73403808dde35c523695ee895587bcc6ba
  Author: Klaus Jensen <k.jensen@samsung.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

  Changed paths:
    M hw/block/nvme.c

  Log Message:
  -----------
  hw/block/nvme: lift cmb restrictions

The controller now implements v1.4 and we can lift the restrictions on
CMB Data Pointer and Command Independent Locations Support (CDPCILS) and
CMB Data Pointer Mixed Locations Support (CDPMLS) since the device
really does not care about mixed host/cmb pointers in those cases.

Reviewed-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: 044f1876b0b00a970e65b99d9be21925cdd7dc6b
      
https://github.com/qemu/qemu/commit/044f1876b0b00a970e65b99d9be21925cdd7dc6b
  Author: Minwoo Im <minwoo.im.dev@gmail.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

  Changed paths:
    M hw/block/nvme-ns.c

  Log Message:
  -----------
  hw/block/nvme: error if drive less than a zone size

If a user assigns a backing device with less capacity than the size of a
single zone, the namespace capacity will be reported as zero and the
kernel will silently fail to allocate the namespace.

This patch errors out in case that the backing device cannot accomodate
at least a single zone.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
[k.jensen: small fixup in the error and commit message]
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: 56990c777a635ded6e2f191c470ca6410cf5c11a
      
https://github.com/qemu/qemu/commit/56990c777a635ded6e2f191c470ca6410cf5c11a
  Author: Gollu Appalanaidu <anaidu.gollu@samsung.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

  Changed paths:
    M hw/block/nvme.c

  Log Message:
  -----------
  hw/block/nvme: fix set feature for error recovery

Only enable DULBE if the namespace supports it.

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


  Commit: 0065f42ef1206527188a44e9c456c9b6d10de5ec
      
https://github.com/qemu/qemu/commit/0065f42ef1206527188a44e9c456c9b6d10de5ec
  Author: Gollu Appalanaidu <anaidu.gollu@samsung.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

  Changed paths:
    M hw/block/nvme.c

  Log Message:
  -----------
  hw/block/nvme: fix set feature save field check

Currently, no features are saveable, so the current check is not wrong,
but add a check against the feature capabilities to make sure this will
not regress if saveable features are added later.

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


  Commit: 74eb89219e6683d62e0a547281bd890f9db0916a
      
https://github.com/qemu/qemu/commit/74eb89219e6683d62e0a547281bd890f9db0916a
  Author: Gollu Appalanaidu <anaidu.gollu@samsung.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

  Changed paths:
    M hw/block/nvme.c

  Log Message:
  -----------
  hw/block/nvme: align with existing style

Change status checks to align with the existing style and remove the
explicit check against NVME_SUCCESS.

Cc: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Signed-off-by: Gollu Appalanaidu <anaidu.gollu@samsung.com>
Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: 74cbbf3031e92c44bb138f16d3f0dc46ca2bc84c
      
https://github.com/qemu/qemu/commit/74cbbf3031e92c44bb138f16d3f0dc46ca2bc84c
  Author: Minwoo Im <minwoo.im.dev@gmail.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

  Changed paths:
    M hw/block/nvme.c

  Log Message:
  -----------
  hw/block/nvme: fix wrong parameter name 'cross_read'

The actual parameter name is 'cross_read' rather than 'cross_zone_read'.

Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: a679dc3efd580de67f30dcb8cb1a52a4bb559899
      
https://github.com/qemu/qemu/commit/a679dc3efd580de67f30dcb8cb1a52a4bb559899
  Author: Klaus Jensen <k.jensen@samsung.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

  Changed paths:
    M hw/block/nvme.c

  Log Message:
  -----------
  hw/block/nvme: fix zone boundary check for append

When a zone append is processed the controller checks that validity of
the write before assigning the LBA to the append command. This causes
the boundary check to be wrong.

Fix this by checking the write *after* assigning the LBA. Remove the
append special case from the nvme_check_zone_write and open code it in
nvme_do_write, assigning the slba when basic sanity checks have been
performed. Then check the validity of the resulting write like any other
write command.

In the process, also fix a missing endianness conversion for the zone
append ALBA.

Reported-by: Niklas Cassel <Niklas.Cassel@wdc.com>
Cc: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Tested-by: Niklas Cassel <niklas.cassel@wdc.com>
Tested-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Reviewed-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: 3e22762edc74be3e1ecafc361351a9640d114978
      
https://github.com/qemu/qemu/commit/3e22762edc74be3e1ecafc361351a9640d114978
  Author: Klaus Jensen <k.jensen@samsung.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

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

  Log Message:
  -----------
  hw/block/nvme: refactor the logic for zone write checks

Refactor the zone write check logic such that the most "meaningful"
error is returned first. That is, first, if the zone is not writable,
return an appropriate status code for that. Then, make sure we are
actually writing at the write pointer and finally check that we do not
cross the zone write boundary. This aligns with the "priority" of status
codes for zone read checks.

Also add a couple of additional descriptive trace events and remove an
always true assert.

Cc: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Tested-by: Niklas Cassel <niklas.cassel@wdc.com>
Tested-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Reviewed-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>


  Commit: 1214d55d1c41fbab3a9973a05085b8760647e411
      
https://github.com/qemu/qemu/commit/1214d55d1c41fbab3a9973a05085b8760647e411
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2021-02-09 (Tue, 09 Feb 2021)

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

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

Emulated NVMe device updates

  * deallocate or unwritten logical block error feature (me)
  * dataset management command (me)
  * compare command (Gollu Appalanaidu)
  * namespace types (Niklas Cassel)
  * zoned namespaces (Dmitry Fomichev)
  * smart critical warning toggle (Zhenwei Pi)
  * allow cmb and pmr to coexist (me)
  * pmr rds/wds support (Naveen Nagar)
  * cmb v1.4 logic (Padmakar Kalghatgi)

And a lot of smaller fixes from Gollu Appalanaidu and Minwoo Im.

# gpg: Signature made Tue 09 Feb 2021 07:25:18 GMT
# 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: (56 commits)
  hw/block/nvme: refactor the logic for zone write checks
  hw/block/nvme: fix zone boundary check for append
  hw/block/nvme: fix wrong parameter name 'cross_read'
  hw/block/nvme: align with existing style
  hw/block/nvme: fix set feature save field check
  hw/block/nvme: fix set feature for error recovery
  hw/block/nvme: error if drive less than a zone size
  hw/block/nvme: lift cmb restrictions
  hw/block/nvme: bump to v1.4
  hw/block/nvme: move cmb logic to v1.4
  hw/block/nvme: add PMR RDS/WDS support
  hw/block/nvme: disable PMR at boot up
  hw/block/nvme: remove redundant zeroing of PMR registers
  hw/block/nvme: rename PMR/CMB shift/mask fields
  hw/block/nvme: allow cmb and pmr to coexist
  hw/block/nvme: move msix table and pba to BAR 0
  hw/block/nvme: indicate CMB support through controller capabilities register
  hw/block/nvme: fix 64 bit register hi/lo split writes
  hw/block/nvme: add size to mmio read/write trace events
  hw/block/nvme: trigger async event during injecting smart warning
  ...

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


Compare: https://github.com/qemu/qemu/compare/41d306ec7d98...1214d55d1c41



reply via email to

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