From patchwork Wed Nov 2 20:54:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 9409857 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 5465E60585 for ; Wed, 2 Nov 2016 20:56:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4518B2A57D for ; Wed, 2 Nov 2016 20:56:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 391B02A5C0; Wed, 2 Nov 2016 20:56:42 +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.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED 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 9450F2A57D for ; Wed, 2 Nov 2016 20:56:41 +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 1c22Ya-0004Mg-EX; Wed, 02 Nov 2016 20:54:48 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c22YY-0004Lu-RI for xen-devel@lists.xenproject.org; Wed, 02 Nov 2016 20:54:46 +0000 Received: from [85.158.137.68] by server-17.bemta-3.messagelabs.com id 19/90-31715-5925A185; Wed, 02 Nov 2016 20:54:45 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrNLMWRWlGSWpSXmKPExsVybKJsh+7UIKk Igw0hFt+3TGZyYPQ4/OEKSwBjFGtmXlJ+RQJrxvMJSxkLHotU7N+xnKmBca5gFyMXh5DAVEaJ Bc83MEE425kkXjf+Yu1i5ORgEzCU+PtkExuILSIgI9F5aREjiM0s0M8o8f9PDIgtLOAm8aari QXEZhFQlZi6bBYTiM0r4CJxbe4vMFtCQE7i5LHJYDM5BVwlVvWuhFrWyijRt38nK0RRhsS8nj lQtpfEohuXoGw1iavnNjFPYORbwMiwilGjOLWoLLVI19BQL6koMz2jJDcxM0fX0MBYLze1uDg xPTUnMalYLzk/dxMjMFAYgGAH4+rfTocYJTmYlER5Pz+VjBDiS8pPqcxILM6ILyrNSS0+xCjD waEkwRsXKBUhJFiUmp5akZaZAwxZmLQEB4+SCK8ySJq3uCAxtzgzHSJ1ilFRSpxXHiQhAJLIK M2Da4PFySVGWSlhXkagQ4R4ClKLcjNLUOVfMYpzMCoJ86aBTOHJzCuBm/4KaDET0GLzJAmQxS WJCCmpBsYjjI4Rm9c5hlk5dixOc2eK3cLkfHJX7deOm72MpjOO1sZPnjP9ZFfxnOPP6+4oBPy fUJO92HqBVnpK/sYclQWTlM+uETzIb7Kfa+IpuY74Q0eMN27Oy5zfdcmmfuHcpEUyJk8s82Jm H7utMfPF3NBQjqnCOna9/uLuBj2mb06qLVxxcs7uP/1KLMUZiYZazEXFiQC2PmOAjgIAAA== X-Env-Sender: sstabellini@kernel.org X-Msg-Ref: server-4.tower-31.messagelabs.com!1478120083!11832839!1 X-Originating-IP: [198.145.29.136] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.0.13; banners=-,-,- X-VirusChecked: Checked Received: (qmail 31196 invoked from network); 2 Nov 2016 20:54:44 -0000 Received: from mail.kernel.org (HELO mail.kernel.org) (198.145.29.136) by server-4.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 2 Nov 2016 20:54:44 -0000 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2B93C203AE; Wed, 2 Nov 2016 20:54:42 +0000 (UTC) Received: from sstabellini-ThinkPad-X260.hsd1.ca.comcast.net (96-82-76-110-static.hfc.comcastbusiness.net [96.82.76.110]) (using TLSv1.2 with cipher AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A42E8203AC; Wed, 2 Nov 2016 20:54:40 +0000 (UTC) From: Stefano Stabellini To: peter.maydell@linaro.org Date: Wed, 2 Nov 2016 13:54:37 -0700 Message-Id: <1478120077-390-2-git-send-email-sstabellini@kernel.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1478120077-390-1-git-send-email-sstabellini@kernel.org> References: <1478120077-390-1-git-send-email-sstabellini@kernel.org> X-Virus-Scanned: ClamAV using ClamSMTP Cc: anthony.perard@citrix.com, xen-devel@lists.xenproject.org, sstabellini@kernel.org, Wei Liu , qemu-devel@nongnu.org Subject: [Xen-devel] [PULL 2/2] PCMachineState: introduce acpi_build_enabled field 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 From: Wei Liu Introduce this field to control whether ACPI build is enabled by a particular machine or accelerator. It defaults to true if the machine itself supports ACPI build. Xen accelerator will disable it because Xen is in charge of building ACPI tables for the guest. Signed-off-by: Wei Liu Signed-off-by: Stefano Stabellini Reviewed-by: Stefano Stabellini Reviewed-by: Eduardo Habkost Tested-by: Sander Eikelenboom --- hw/i386/acpi-build.c | 2 +- hw/i386/pc.c | 2 ++ include/hw/i386/pc.h | 2 ++ xen-common.c | 6 ++++++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 5cd1da9..13cbbde 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -2953,7 +2953,7 @@ void acpi_setup(void) return; } - if (!pcmc->has_acpi_build) { + if (!pcms->acpi_build_enabled) { ACPI_BUILD_DPRINTF("ACPI build disabled. Bailing out.\n"); return; } diff --git a/hw/i386/pc.c b/hw/i386/pc.c index f56ea0f..fbd9aed 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -2159,6 +2159,8 @@ static void pc_machine_initfn(Object *obj) pcms->vmport = ON_OFF_AUTO_AUTO; /* nvdimm is disabled on default. */ pcms->acpi_nvdimm_state.is_enabled = false; + /* acpi build is enabled by default if machine supports it */ + pcms->acpi_build_enabled = PC_MACHINE_GET_CLASS(pcms)->has_acpi_build; } static void pc_machine_reset(void) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 98dc772..8eb517f 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -62,6 +62,8 @@ struct PCMachineState { AcpiNVDIMMState acpi_nvdimm_state; + bool acpi_build_enabled; + /* RAM information (sizes, addresses, configuration): */ ram_addr_t below_4g_mem_size, above_4g_mem_size; diff --git a/xen-common.c b/xen-common.c index 9099760..bacf962 100644 --- a/xen-common.c +++ b/xen-common.c @@ -9,6 +9,7 @@ */ #include "qemu/osdep.h" +#include "hw/i386/pc.h" #include "hw/xen/xen_backend.h" #include "qmp-commands.h" #include "sysemu/char.h" @@ -114,6 +115,11 @@ static void xen_change_state_handler(void *opaque, int running, static int xen_init(MachineState *ms) { + PCMachineState *pcms = PC_MACHINE(ms); + + /* Disable ACPI build because Xen handles it */ + pcms->acpi_build_enabled = false; + xen_xc = xc_interface_open(0, 0, 0); if (xen_xc == NULL) { xen_pv_printf(NULL, 0, "can't open xen interface\n");