Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F149390107
D32767.1789991182.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D32767.1789991182.diff
View Options
diff --git a/usr.sbin/bhyve/pci_nvme.c b/usr.sbin/bhyve/pci_nvme.c
--- a/usr.sbin/bhyve/pci_nvme.c
+++ b/usr.sbin/bhyve/pci_nvme.c
@@ -119,6 +119,18 @@
/* Reported temperature in Kelvin (i.e. room temperature) */
#define NVME_TEMPERATURE 296
+#define NVME_FEAT_SET_SV_SHIFT (31)
+#define NVME_FEAT_SET_SV_MASK (0x1)
+#define NVME_FEAT_SET_FID_SHIFT (0)
+#define NVME_FEAT_SET_FID_MASK (0xFF)
+
+#define NVME_FEAT_SET_SV(x) \
+ (((x) >> NVME_FEAT_SET_SV_SHIFT) & \
+ NVME_FEAT_SET_SV_MASK)
+#define NVME_FEAT_SET_FID(x) \
+ (((x) >> NVME_FEAT_SET_FID_SHIFT) & \
+ NVME_FEAT_SET_FID_MASK)
+
/* helpers */
/* Convert a zero-based value into a one-based value */
@@ -1845,7 +1857,8 @@
{
struct nvme_feature_obj *feat;
uint32_t nsid = command->nsid;
- uint8_t fid = command->cdw10 & 0xFF;
+ uint8_t fid = NVME_FEAT_SET_FID(command->cdw10);
+ bool sv = NVME_FEAT_SET_SV(command->cdw10);
DPRINTF("%s: Feature ID 0x%x (%s)", __func__, fid, nvme_fid_to_name(fid));
@@ -1854,6 +1867,12 @@
pci_nvme_status_genc(&compl->status, NVME_SC_INVALID_FIELD);
return (1);
}
+ if (sv) {
+ DPRINTF("%s feature is not saveable 0x%x", __func__, fid);
+ pci_nvme_status_tc(&compl->status, NVME_SCT_COMMAND_SPECIFIC,
+ NVME_SC_FEATURE_NOT_SAVEABLE);
+ return (1);
+ }
feat = &sc->feat[fid];
if (feat->namespace_specific && (nsid == NVME_GLOBAL_NAMESPACE_TAG)) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Sep 21, 11:46 AM (3 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29840115
Default Alt Text
D32767.1789991182.diff (1 KB)
Attached To
Mode
D32767: bhyve: abort and return FEATURE_NOT_SAVEABLE while set feature with a save flag for NVMe controller.
Attached
Detach File
Event Timeline
Log In to Comment