mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
hw/block/nvme: add support for the get log page command
Add support for the Get Log Page command and basic implementations of the mandatory Error Information, SMART / Health Information and Firmware Slot Information log pages. In violation of the specification, the SMART / Health Information log page does not persist information over the lifetime of the controller because the device has no place to store such persistent state. Note that the LPA field in the Identify Controller data structure intentionally has bit 0 cleared because there is no namespace specific information in the SMART / Health information log page. Required for compliance with NVMe revision 1.3d. See NVM Express 1.3d, Section 5.14 ("Get Log Page command"). Signed-off-by: Klaus Jensen <klaus.jensen@cnexlabs.com> Signed-off-by: Klaus Jensen <k.jensen@samsung.com> Acked-by: Keith Busch <kbusch@kernel.org> Reviewed-by: Dmitry Fomichev <dmitry.fomichev@wdc.com> Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com> Message-Id: <20200706061303.246057-8-its@irrelevant.dk>
This commit is contained in:
parent
42a42e4610
commit
94a7897c41
4 changed files with 149 additions and 2 deletions
|
@ -707,7 +707,7 @@ typedef struct QEMU_PACKED NvmeErrorLog {
|
|||
|
||||
typedef struct QEMU_PACKED NvmeSmartLog {
|
||||
uint8_t critical_warning;
|
||||
uint8_t temperature[2];
|
||||
uint16_t temperature;
|
||||
uint8_t available_spare;
|
||||
uint8_t available_spare_threshold;
|
||||
uint8_t percentage_used;
|
||||
|
@ -847,6 +847,10 @@ enum NvmeIdCtrlFrmw {
|
|||
NVME_FRMW_SLOT1_RO = 1 << 0,
|
||||
};
|
||||
|
||||
enum NvmeIdCtrlLpa {
|
||||
NVME_LPA_EXTENDED = 1 << 2,
|
||||
};
|
||||
|
||||
#define NVME_CTRL_SQES_MIN(sqes) ((sqes) & 0xf)
|
||||
#define NVME_CTRL_SQES_MAX(sqes) (((sqes) >> 4) & 0xf)
|
||||
#define NVME_CTRL_CQES_MIN(cqes) ((cqes) & 0xf)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue