hw/nvme: add atomic write support
authorAlan Adamson <alan.adamson@oracle.com>
Thu, 26 Sep 2024 21:24:58 +0000 (14:24 -0700)
committerKlaus Jensen <k.jensen@samsung.com>
Tue, 1 Oct 2024 07:02:05 +0000 (09:02 +0200)
commitebd1568fc73209bbc1339a449f3df0b6c9a12358
tree3ead7c860f7947063b3bb809af94da03f487e93c
parente4bcb5865c46289e9320936e910056dc37e9d678
hw/nvme: add atomic write support

Adds support for the controller atomic parameters: AWUN and AWUPF. Atomic
Compare and Write Unit (ACWU) is not currently supported.

Writes that adhere to the ACWU and AWUPF parameters are guaranteed to be atomic.

New NVMe QEMU Parameters (See NVMe Specification for details):
       atomic.dn (default off) - Set the value of Disable Normal.
       atomic.awun=UINT16 (default: 0)
       atomic.awupf=UINT16 (default: 0)

By default (Disable Normal set to zero), the maximum atomic write size is
set to the AWUN value.  If Disable Normal is set, the maximum atomic write
size is set to AWUPF.

Signed-off-by: Alan Adamson <alan.adamson@oracle.com>
Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
hw/nvme/ctrl.c
hw/nvme/nvme.h