summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorXiao Guangrong <guangrong.xiao@linux.intel.com>2016-06-07 20:22:05 +0800
committerMichael S. Tsirkin <mst@redhat.com>2016-06-24 05:13:57 +0300
commitd15fc53f8d564ba977f64df96b0114b58f36d154 (patch)
tree2f3b8f823d22aa4460e738fcb7314309c7d1c1bf /hw
parent189f4d56356f0301c9e61c7d35ec8c03c69e7133 (diff)
downloadqemu-d15fc53f8d564ba977f64df96b0114b58f36d154.zip
nvdimm acpi: check revision
Currently only revision 1 is supported Signed-off-by: Xiao Guangrong <guangrong.xiao@linux.intel.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/acpi/nvdimm.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/hw/acpi/nvdimm.c b/hw/acpi/nvdimm.c
index 07c95c1f1f..8b89285587 100644
--- a/hw/acpi/nvdimm.c
+++ b/hw/acpi/nvdimm.c
@@ -485,6 +485,13 @@ nvdimm_dsm_write(void *opaque, hwaddr addr, uint64_t val, unsigned size)
nvdimm_debug("Revision %#x Handler %#x Function %#x.\n", in->revision,
in->handle, in->function);
+ if (in->revision != 0x1 /* Currently we only support DSM Spec Rev1. */) {
+ nvdimm_debug("Revision %#x is not supported, expect %#x.\n",
+ in->revision, 0x1);
+ nvdimm_dsm_no_payload(1 /* Not Supported */, dsm_mem_addr);
+ goto exit;
+ }
+
/* Handle 0 is reserved for NVDIMM Root Device. */
if (!in->handle) {
nvdimm_dsm_root(in, dsm_mem_addr);