From: Haozhong Zhang <haozhong.zhang@intel.com>
To: qemu-devel@nongnu.org, xen-devel@lists.xen.org
Cc: Haozhong Zhang <haozhong.zhang@intel.com>,
Xiao Guangrong <guangrong.xiao@linux.intel.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Igor Mammedov <imammedo@redhat.com>,
Konrad Rzeszutek Wilk <konrad@darnok.org>,
Dan Williams <dan.j.williams@intel.com>
Subject: [RFC QEMU PATCH v2 04/10] nvdimm acpi: do not use fw_cfg on Xen
Date: Mon, 20 Mar 2017 08:12:43 +0800 [thread overview]
Message-ID: <20170320001249.25521-5-haozhong.zhang@intel.com> (raw)
In-Reply-To: <20170320001249.25521-1-haozhong.zhang@intel.com>
Xen relies on QEMU to build guest ACPI for NVDIMM. However, no fw_cfg
is created when QEMU is used as Xen device model, so QEMU should avoid
using fw_cfg on Xen.
Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
---
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Cc: Xiao Guangrong <guangrong.xiao@linux.intel.com>
---
hw/acpi/aml-build.c | 9 ++++++---
hw/acpi/nvdimm.c | 5 +++--
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c
index c6f2032dec..3925f261ad 100644
--- a/hw/acpi/aml-build.c
+++ b/hw/acpi/aml-build.c
@@ -1530,9 +1530,12 @@ build_header(BIOSLinker *linker, GArray *table_data,
h->oem_revision = cpu_to_le32(1);
memcpy(h->asl_compiler_id, ACPI_BUILD_APPNAME4, 4);
h->asl_compiler_revision = cpu_to_le32(1);
- /* Checksum to be filled in by Guest linker */
- bios_linker_loader_add_checksum(linker, ACPI_BUILD_TABLE_FILE,
- tbl_offset, len, checksum_offset);
+ /* No linker when used as Xen device model */
+ if (linker) {
+ /* Checksum to be filled in by Guest linker */
+ bios_linker_loader_add_checksum(linker, ACPI_BUILD_TABLE_FILE,
+ tbl_offset, len, checksum_offset);
+ }
}
void *acpi_data_push(GArray *table_data, unsigned size)
diff --git a/hw/acpi/nvdimm.c b/hw/acpi/nvdimm.c
index 8e7d6ec034..bb45452e70 100644
--- a/hw/acpi/nvdimm.c
+++ b/hw/acpi/nvdimm.c
@@ -889,8 +889,9 @@ void nvdimm_init_acpi_state(AcpiNVDIMMState *state, MemoryRegion *io,
state->dsm_mem = g_array_new(false, true /* clear */, 1);
acpi_data_push(state->dsm_mem, sizeof(NvdimmDsmIn));
- fw_cfg_add_file(fw_cfg, NVDIMM_DSM_MEM_FILE, state->dsm_mem->data,
- state->dsm_mem->len);
+ if (fw_cfg)
+ fw_cfg_add_file(fw_cfg, NVDIMM_DSM_MEM_FILE, state->dsm_mem->data,
+ state->dsm_mem->len);
nvdimm_init_fit_buffer(&state->fit_buf);
}
--
2.12.0
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-03-20 0:12 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-20 0:12 [RFC QEMU PATCH v2 00/10] Implement vNVDIMM for Xen HVM guest Haozhong Zhang
2017-03-20 0:12 ` [RFC QEMU PATCH v2 01/10] nvdimm xen: disable label support on Xen Haozhong Zhang
2017-04-01 12:25 ` Konrad Rzeszutek Wilk
2017-03-20 0:12 ` [RFC QEMU PATCH v2 02/10] xen-hvm: initialize DM ACPI Haozhong Zhang
2017-03-20 0:12 ` [RFC QEMU PATCH v2 03/10] xen-hvm: support copying ACPI to guest memory Haozhong Zhang
2017-03-20 0:12 ` Haozhong Zhang [this message]
2017-03-20 0:12 ` [RFC QEMU PATCH v2 05/10] nvdimm acpi: copy NFIT to Xen guest Haozhong Zhang
2017-03-20 0:12 ` [RFC QEMU PATCH v2 06/10] nvdimm acpi: build and copy NVDIMM namespace devices to guest on Xen Haozhong Zhang
2017-03-20 0:12 ` [RFC QEMU PATCH v2 07/10] xen-hvm: initiate building DM ACPI on i386 machine Haozhong Zhang
2017-03-20 0:12 ` [RFC QEMU PATCH v2 08/10] hostmem: add a host memory backend for Xen Haozhong Zhang
2017-03-20 0:12 ` [RFC QEMU PATCH v2 09/10] xen-hvm: create hotplug memory region on Xen Haozhong Zhang
2017-03-20 0:12 ` [RFC QEMU PATCH v2 10/10] qapi: extend 'query-memory-devices' to list devices of specified type Haozhong Zhang
2017-04-11 8:56 ` [Qemu-devel] " Markus Armbruster
2017-03-20 0:26 ` [Qemu-devel] [RFC QEMU PATCH v2 00/10] Implement vNVDIMM for Xen HVM guest no-reply
2017-03-28 13:18 ` 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=20170320001249.25521-5-haozhong.zhang@intel.com \
--to=haozhong.zhang@intel.com \
--cc=dan.j.williams@intel.com \
--cc=guangrong.xiao@linux.intel.com \
--cc=imammedo@redhat.com \
--cc=konrad@darnok.org \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=xen-devel@lists.xen.org \
/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).