From patchwork Mon Mar 20 00:12:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haozhong Zhang X-Patchwork-Id: 9632879 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CE1EB6020B for ; Mon, 20 Mar 2017 00:15:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C284327F8C for ; Mon, 20 Mar 2017 00:15:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B75E72807E; Mon, 20 Mar 2017 00:15:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6D32E27F8C for ; Mon, 20 Mar 2017 00:15:49 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cpkwi-0006TV-Go; Mon, 20 Mar 2017 00:13:12 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cpkwh-0006Rw-7R for xen-devel@lists.xen.org; Mon, 20 Mar 2017 00:13:11 +0000 Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id 9A/4F-12861-69E1FC85; Mon, 20 Mar 2017 00:13:10 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpjkeJIrShJLcpLzFFi42I5YG5SrDtN7ny EwdnXvBZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa8aVJ69ZC27zV7z8O5W1gfE+TxcjFweLwC0m iasLFrKCOEIC0xklXv3ezNzFyMkhIcArcWTZDFYI20/i5fLPYLaQQC+jxKdmFhCbTUBfYsXjg 0BxDg4RAWOJtpvOIHOYBZqZJA5ObWUHqREW8JDo+jcdzGYRUJX4Mv8UI4jNK2ArcW5CK9QueY kLV0+xgMzhFLCT6JjtBrHKVuLHqsksExj5FjAyrGLUKE4tKkst0jW01EsqykzPKMlNzMzRNTQ w1stNLS5OTE/NSUwq1kvOz93ECAyTegYGxh2Mv4/7HWKU5GBSEuX9p34uQogvKT+lMiOxOCO+ qDQntfgQowwHh5IEb63s+QghwaLU9NSKtMwcYMDCpCU4eJREeOWAQSvEW1yQmFucmQ6ROsWoy zFn9u43TEIsefl5qVLivDNAZgiAFGWU5sGNgEXPJUZZKWFeRgYGBiGegtSi3MwSVPlXjOIcjE rCvF0gU3gy80rgNr0COoIJ6IhlN86AHFGSiJCSamAUath/p55jma/+4nv8n35GfTVYu3h/1r/ g5HNsAer9UmKWqZP/WgUEmfpNdWO6b51v8ijs2aZt+r7P7kToLugznf961drlwuY+hd1TQzen WjNf+S6jcFX/1hUlo/K5V+VaVT/O5L/amWFo8NYwdQHv98yfjnzznJNW3Dx+Mlfvaes7nY+bX x1QYinOSDTUYi4qTgQASX6a+5kCAAA= X-Env-Sender: haozhong.zhang@intel.com X-Msg-Ref: server-3.tower-31.messagelabs.com!1489968786!90971295!3 X-Originating-IP: [192.55.52.115] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.2.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 20862 invoked from network); 20 Mar 2017 00:13:09 -0000 Received: from mga14.intel.com (HELO mga14.intel.com) (192.55.52.115) by server-3.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 20 Mar 2017 00:13:09 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=intel.com; i=@intel.com; q=dns/txt; s=intel; t=1489968789; x=1521504789; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=dmuO9j9h1jpg7c3kTv53TZ/X+g+Nf0pFM0ZIicdT7Ak=; b=lrXuMJVtVsSmHzNaACeIMXGZyfoveT+vmQFBSN5y9Ox7SSc/DDtgbvzC DiR4KX4iYjcbQZ7VysHQa6tWYS6ukw==; Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Mar 2017 17:13:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.36,191,1486454400"; d="scan'208";a="78799163" Received: from hz-desktop.sh.intel.com (HELO localhost) ([10.239.159.153]) by fmsmga006.fm.intel.com with ESMTP; 19 Mar 2017 17:13:06 -0700 From: Haozhong Zhang To: qemu-devel@nongnu.org, xen-devel@lists.xen.org Date: Mon, 20 Mar 2017 08:12:43 +0800 Message-Id: <20170320001249.25521-5-haozhong.zhang@intel.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20170320001249.25521-1-haozhong.zhang@intel.com> References: <20170320001249.25521-1-haozhong.zhang@intel.com> Cc: Haozhong Zhang , Xiao Guangrong , "Michael S. Tsirkin" , Igor Mammedov , Konrad Rzeszutek Wilk , Dan Williams Subject: [Xen-devel] [RFC QEMU PATCH v2 04/10] nvdimm acpi: do not use fw_cfg on Xen X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- Cc: "Michael S. Tsirkin" Cc: Igor Mammedov Cc: Xiao Guangrong --- 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); }