hw/block/nvme: validate command set selected

Fail to start the controller if the user requests a command set that the
controller does not support.

Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
This commit is contained in:
Keith Busch 2020-09-30 10:54:05 -07:00 committed by Klaus Jensen
parent 2fbbecc5cd
commit 492f9a8d79
3 changed files with 10 additions and 1 deletions

View file

@ -82,6 +82,10 @@ enum NvmeCapMask {
#define NVME_CAP_SET_PMRS(cap, val) (cap |= (uint64_t)(val & CAP_PMR_MASK)\
<< CAP_PMR_SHIFT)
enum NvmeCapCss {
NVME_CAP_CSS_NVM = 1 << 0,
};
enum NvmeCcShift {
CC_EN_SHIFT = 0,
CC_CSS_SHIFT = 4,