diff options
author | Padmakar Kalghatgi | 2020-12-18 00:32:16 +0100 |
---|---|---|
committer | Klaus Jensen | 2021-02-08 21:15:54 +0100 |
commit | f4319477b4fd692b568c22ed97dde7f542a48ac9 (patch) | |
tree | 446704014d45409e65ca22d2a287f5ac398fc308 /hw/block/nvme.h | |
parent | hw/block/nvme: add PMR RDS/WDS support (diff) | |
download | qemu-f4319477b4fd692b568c22ed97dde7f542a48ac9.tar.gz qemu-f4319477b4fd692b568c22ed97dde7f542a48ac9.tar.xz qemu-f4319477b4fd692b568c22ed97dde7f542a48ac9.zip |
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>
Diffstat (limited to 'hw/block/nvme.h')
-rw-r--r-- | hw/block/nvme.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/hw/block/nvme.h b/hw/block/nvme.h index b7702e937e..dee6092bd4 100644 --- a/hw/block/nvme.h +++ b/hw/block/nvme.h @@ -20,6 +20,7 @@ typedef struct NvmeParams { uint8_t mdts; bool use_intel_id; uint32_t zasl_bs; + bool legacy_cmb; } NvmeParams; typedef struct NvmeAsyncEvent { @@ -127,7 +128,6 @@ typedef struct NvmeCtrl { PCIDevice parent_obj; MemoryRegion bar0; MemoryRegion iomem; - MemoryRegion ctrl_mem; NvmeBar bar; NvmeParams params; NvmeBus bus; @@ -143,7 +143,6 @@ typedef struct NvmeCtrl { uint32_t num_namespaces; uint32_t max_q_ents; uint8_t outstanding_aers; - uint8_t *cmbuf; uint32_t irq_status; uint64_t host_timestamp; /* Timestamp sent by the host */ uint64_t timestamp_set_qemu_clock_ms; /* QEMU clock time */ @@ -152,6 +151,13 @@ typedef struct NvmeCtrl { uint8_t smart_critical_warning; struct { + MemoryRegion mem; + uint8_t *buf; + bool cmse; + hwaddr cba; + } cmb; + + struct { HostMemoryBackend *dev; bool cmse; hwaddr cba; |