From patchwork Thu Nov 9 15:37:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Boris Ostrovsky X-Patchwork-Id: 10051145 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 CB4E660381 for ; Thu, 9 Nov 2017 15:36:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BBCE228D7F for ; Thu, 9 Nov 2017 15:36:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B08E22AD03; Thu, 9 Nov 2017 15:36:16 +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, UNPARSEABLE_RELAY 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 44BE628D7F for ; Thu, 9 Nov 2017 15:36:15 +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 1eCopz-0003Cz-WB; Thu, 09 Nov 2017 15:33:51 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eCopz-0003Ct-3C for xen-devel@lists.xen.org; Thu, 09 Nov 2017 15:33:51 +0000 Received: from [193.109.254.147] by server-1.bemta-6.messagelabs.com id EF/A9-04165-E55740A5; Thu, 09 Nov 2017 15:33:50 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrPLMWRWlGSWpSXmKPExsUyZ7p8oG5sKUu UwfGzqhZLPi5mcWD0OLr7N1MAYxRrZl5SfkUCa8a5V9YFTfwVG+b7NDA+5e5i5OIQEpjEJLH5 3gl2COcXo8SRSy2MEM56RomZN/qAHE4gp4dRYvmqKhCbTcBI4uzR6WBxEQFpiWufLwPZHBzMA jUSp48agYSFBdwk/jVtZwGxWQRUJabMncQOYvMKeEn8aFoAZksIKEhMefieGcI2lmh/e5FtAi PPAkaGVYwaxalFZalFuoameklFmekZJbmJmTm6hgZmermpxcWJ6ak5iUnFesn5uZsYgV5nAII djN+WBRxilORgUhLllbJkiRLiS8pPqcxILM6ILyrNSS0+xKjBwSGwee3qC4xSLHn5ealKErwc JUB1gkWp6akVaZk5wLCEKZXg4FES4VUDSfMWFyTmFmemQ6ROMRpzPJv5uoGZY9rV1iZmIbBJU uK8V4uBSgVASjNK8+AGweLlEqOslDAvI9CZQjwFqUW5mSWo8q8YxTkYlYR5tUAW8mTmlcDtew V0ChPQKdHsYKeUJCKkpBoYXRMVfLdbnPd+H5EZ6Pal9FLQ1LW/xVYHz5GLLnd+Zn4+QEhLZ3N U6uy8+hOxU0SeHKxP83WZ7PJr7nvu89Ou6zxQ/FJTK7ldxi54Y3hMr7x6Gm9zmfLGxEL1blPz c3tXpy5OOHv17IGZnYrVp906F63PllFhWHTZ+Mr2NMYpMzcF2bE7X5yoxFKckWioxVxUnAgAs PWTypICAAA= X-Env-Sender: boris.ostrovsky@oracle.com X-Msg-Ref: server-10.tower-27.messagelabs.com!1510241628!92578877!1 X-Originating-IP: [156.151.31.81] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTU2LjE1MS4zMS44MSA9PiAyODgzMzk=\n X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 15761 invoked from network); 9 Nov 2017 15:33:49 -0000 Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81) by server-10.tower-27.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 9 Nov 2017 15:33:49 -0000 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id vA9FXiPQ020821 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 9 Nov 2017 15:33:44 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id vA9FXhmS026173 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 9 Nov 2017 15:33:44 GMT Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id vA9FXhq2019896; Thu, 9 Nov 2017 15:33:43 GMT Received: from ovs104.us.oracle.com (/10.149.76.204) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 09 Nov 2017 07:33:42 -0800 From: Boris Ostrovsky To: xen-devel@lists.xen.org Date: Thu, 9 Nov 2017 10:37:53 -0500 Message-Id: <1510241873-24225-1-git-send-email-boris.ostrovsky@oracle.com> X-Mailer: git-send-email 1.8.3.1 X-Source-IP: aserv0022.oracle.com [141.146.126.234] Cc: andrew.cooper3@citrix.com, Boris Ostrovsky , jbeulich@suse.com, roger.pau@citrix.com Subject: [Xen-devel] [PATCH v2] x86/pvh: Do not add DSDT and FACS to PVH dom0 XSDT 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 These tables are pointed to from FADT. Adding them will result in duplicate entries in the guest's tables. Signed-off-by: Boris Ostrovsky Reviewed-by: Jan Beulich Reviewed-by: Roger Pau Monné --- Changes in v2: * Merge (pvh_acpi_table_allowed(sig) && pvh_acpi_table_in_xsdt(sig)) into a single call * Make this call return a boolean expression as opposed to explicit true/false xen/arch/x86/hvm/dom0_build.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c index a67071c..cfcf461 100644 --- a/xen/arch/x86/hvm/dom0_build.c +++ b/xen/arch/x86/hvm/dom0_build.c @@ -818,6 +818,17 @@ static bool __init pvh_acpi_table_allowed(const char *sig) return true; } +static bool __init pvh_acpi_xsdt_table_allowed(const char *sig) +{ + /* + * DSDT and FACS are pointed to from FADT and thus don't belong + * in XSDT. + */ + return pvh_acpi_table_allowed(sig) && + strncmp(sig, ACPI_SIG_DSDT, ACPI_NAME_SIZE) && + strncmp(sig, ACPI_SIG_FACS, ACPI_NAME_SIZE); +} + static int __init pvh_setup_acpi_xsdt(struct domain *d, paddr_t madt_addr, paddr_t *addr) { @@ -841,7 +852,7 @@ static int __init pvh_setup_acpi_xsdt(struct domain *d, paddr_t madt_addr, { const char *sig = acpi_gbl_root_table_list.tables[i].signature.ascii; - if ( pvh_acpi_table_allowed(sig) ) + if ( pvh_acpi_xsdt_table_allowed(sig) ) num_tables++; } @@ -888,7 +899,7 @@ static int __init pvh_setup_acpi_xsdt(struct domain *d, paddr_t madt_addr, { const char *sig = acpi_gbl_root_table_list.tables[i].signature.ascii; - if ( pvh_acpi_table_allowed(sig) ) + if ( pvh_acpi_xsdt_table_allowed(sig) ) xsdt->table_offset_entry[j++] = acpi_gbl_root_table_list.tables[i].address; }