From: Haozhong Zhang <haozhong.zhang@intel.com>
To: qemu-devel@nongnu.org, xen-devel@lists.xensource.com
Cc: Haozhong Zhang <haozhong.zhang@intel.com>,
	Igor Mammedov <imammedo@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Xiao Guangrong <guangrong.xiao@linux.intel.com>
Subject: [RFC QEMU PATCH 1/8] nvdimm: do not initialize label_data if label_size is zero
Date: Mon, 10 Oct 2016 08:34:16 +0800	[thread overview]
Message-ID: <20161010003423.4333-2-haozhong.zhang@intel.com> (raw)
In-Reply-To: <20161010003423.4333-1-haozhong.zhang@intel.com>
When memory-backend-xen is used, the label_data pointer can not be got
via memory_region_get_ram_ptr(). We will use other functions to get
label_data once we introduce NVDIMM label support to Xen.
Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
---
Cc: Xiao Guangrong <guangrong.xiao@linux.intel.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
---
 hw/mem/nvdimm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c
index 7895805..d25993b 100644
--- a/hw/mem/nvdimm.c
+++ b/hw/mem/nvdimm.c
@@ -87,7 +87,9 @@ static void nvdimm_realize(PCDIMMDevice *dimm, Error **errp)
     align = memory_region_get_alignment(mr);
 
     pmem_size = size - nvdimm->label_size;
-    nvdimm->label_data = memory_region_get_ram_ptr(mr) + pmem_size;
+    if (nvdimm->label_size) {
+        nvdimm->label_data = memory_region_get_ram_ptr(mr) + pmem_size;
+    }
     pmem_size = QEMU_ALIGN_DOWN(pmem_size, align);
 
     if (size <= nvdimm->label_size || !pmem_size) {
-- 
2.10.1
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply	other threads:[~2016-10-10  0:34 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-10  0:34 [RFC QEMU PATCH 0/8] Implement vNVDIMM for Xen HVM guest Haozhong Zhang
2016-10-10  0:34 ` Haozhong Zhang [this message]
2017-02-15 22:18   ` [RFC QEMU PATCH 1/8] nvdimm: do not initialize label_data if label_size is zero Konrad Rzeszutek Wilk
2016-10-10  0:34 ` [RFC QEMU PATCH 2/8] xen-hvm: add a function to copy ACPI to guest Haozhong Zhang
2016-10-10  0:34 ` [RFC QEMU PATCH 3/8] nvdimm acpi: do not use fw_cfg on Xen Haozhong Zhang
2016-10-10  0:34 ` [RFC QEMU PATCH 4/8] nvdimm acpi: build and copy NFIT to guest " Haozhong Zhang
2016-10-10  0:34 ` [RFC QEMU PATCH 5/8] nvdimm acpi: build and copy NVDIMM namespace devices " Haozhong Zhang
2016-10-10  0:34 ` [RFC QEMU PATCH 6/8] hostmem: add a host memory backend for Xen Haozhong Zhang
2016-10-10  0:34 ` [RFC QEMU PATCH 7/8] xen-hvm: create hotplug memory region for HVM guest Haozhong Zhang
2016-10-10  0:34 ` [RFC QEMU PATCH 8/8] qmp: add a qmp command 'query-nvdimms' to get plugged NVDIMM devices Haozhong Zhang
2016-10-10 19:16   ` Eric Blake
2016-10-11  6:31     ` Haozhong Zhang
2016-10-11  8:22       ` Markus Armbruster
2016-10-11 10:12         ` Haozhong Zhang
2016-10-11 14:45         ` Eric Blake
2016-10-10 16:52 ` [RFC QEMU PATCH 0/8] Implement vNVDIMM for Xen HVM guest no-reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox
  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):
  git send-email \
    --in-reply-to=20161010003423.4333-2-haozhong.zhang@intel.com \
    --to=haozhong.zhang@intel.com \
    --cc=guangrong.xiao@linux.intel.com \
    --cc=imammedo@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY
  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
  Be sure your reply has a Subject: header at the top and a blank line
  before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).