]> git.ipfire.org Git - thirdparty/qemu.git/commit
hw/block/nvme: zero out zones on reset
authorKlaus Jensen <k.jensen@samsung.com>
Wed, 9 Dec 2020 22:43:15 +0000 (23:43 +0100)
committerKlaus Jensen <k.jensen@samsung.com>
Mon, 8 Feb 2021 20:15:53 +0000 (21:15 +0100)
commit5f5dc4c6a9426d6a1fe69ea1b539721f5eab7176
tree407e512fbbe8525770121fa42c9e3d4e155e8a7e
parentb05fde2881118e7e6e66b352e3a7ea1b8f52e1ad
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>
hw/block/nvme.c
hw/block/trace-events