Skip to contentSkip to conversation

nvme: support NVME_VOLATILE_WRITE_CACHE feature

PATCH Applied Christoph Hellwig 3 participants 3 messages Apr 30, 2015 – May 7, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nvme: support NVME_VOLATILE_WRITE_CACHE feature

The SCSI emulation in the Linux NVMe driver really wants to know if a device has a volatile write cache. Given that qemu has moved away from a model where we report the backing store WCE bit to one where the WCE bit is supposed to be part of the migratable guest-visible state we always return 1 here.

hw/block/nvme.c +3 -0
index 1e07166..50d76f1 100644
@@ -479,6 +479,9 @@ static uint16_t nvme_get_feature(NvmeCtrl *n, NvmeCmd *cmd, NvmeRequest *req)
         req->cqe.result =
             cpu_to_le32((n->num_queues - 1) | ((n->num_queues - 1) << 16));
         break;
+    case NVME_VOLATILE_WRITE_CACHE:
+        req->cqe.result = cpu_to_le32(1);
+        break;
     default:
         return NVME_INVALID_FIELD | NVME_DNR;
     }
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Christoph Hellwig

The SCSI emulation in the Linux NVMe driver really wants to know if a device has a volatile write cache. Given that qemu has moved away from a model where we report the backing store WCE bit to one where the WCE bit is supposed to be part of the migratable guest-visible state we always return 1 here.

Thanks, this fix was long overdue and already incorporated in my tree. I really need to get my act together for a legit pull request with all the other 1.0, 1.1 and 1.2 features.

Quoted 17 lines
hw/block/nvme.c +3 -0
index 1e07166..50d76f1 100644
@@ -479,6 +479,9 @@ static uint16_t nvme_get_feature(NvmeCtrl *n, NvmeCmd *cmd, NvmeRequest *req)
        req->cqe.result =
            cpu_to_le32((n->num_queues - 1) | ((n->num_queues - 1) << 16));
        break;
+    case NVME_VOLATILE_WRITE_CACHE:
+        req->cqe.result = cpu_to_le32(1);
+        break;
    default:
        return NVME_INVALID_FIELD | NVME_DNR;
    }
Applied
#2 lore raw

[ Cc: qemu-block ]

Am 30.04.2015 um 16:03 hat Keith Busch geschrieben:

Quoted 7 lines · Christoph Hellwig
Quoted 5 lines

The SCSI emulation in the Linux NVMe driver really wants to know if a device has a volatile write cache. Given that qemu has moved away from a model where we report the backing store WCE bit to one where the WCE bit is supposed to be part of the migratable guest-visible state we always return 1 here.

Quoted 5 lines

Thanks, this fix was long overdue and already incorporated in my tree. I really need to get my act together for a legit pull request with all the other 1.0, 1.1 and 1.2 features.

Thanks, applied to the block branch.

Kevin