From patchwork Thu Aug 31 05:01:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "lan,Tianyu" X-Patchwork-Id: 9931905 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 4339C6016C for ; Thu, 31 Aug 2017 11:12:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3C0902236A for ; Thu, 31 Aug 2017 11:12:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 30E8A274A3; Thu, 31 Aug 2017 11:12:03 +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=-2.7 required=2.0 tests=BAYES_00, DATE_IN_PAST_06_12, 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 A29612891F for ; Thu, 31 Aug 2017 11:12:02 +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 1dnNM9-0000OH-2e; Thu, 31 Aug 2017 11:09:53 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dnNM7-0000Ne-HW for xen-devel@lists.xen.org; Thu, 31 Aug 2017 11:09:51 +0000 Received: from [85.158.143.35] by server-6.bemta-6.messagelabs.com id DA/27-03423-E7EE7A95; Thu, 31 Aug 2017 11:09:50 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrPLMWRWlGSWpSXmKPExsVywNwkVrfu3fJ IgxX7pSyWfFzM4sDocXT3b6YAxijWzLyk/IoE1ozuB79ZCv4KVbzY28rewHiOr4uRi0NIYDqj xM7ZG9i7GDk5JAR4JY4sm8EKYQdILH40nw2iqJ1RYuLmbrAEm4C6xInFExlBbBEBaYlrny8zg hQxC5xilLj09z8zSEJYwFti/rcusKksAqoSK2b9YAKxeQVcJJbe28kIsUFBYsrD92D1nAKuEg 2TvoHZQkA1LZd2Mk1g5F3AyLCKUb04tagstUjXQi+pKDM9oyQ3MTNH19DATC83tbg4MT01JzG pWC85P3cTIzAgGIBgB+Psy/6HGCU5mJREeR/eXh4pxJeUn1KZkVicEV9UmpNafIhRhoNDSYK3 4C1QTrAoNT21Ii0zBxiaMGkJDh4lEd7Fb4DSvMUFibnFmekQqVOMilLivFIgfQIgiYzSPLg2W DxcYpSVEuZlBDpEiKcgtSg3swRV/hWjOAejkjCvDMgUnsy8Erjpr4AWMwEtjvVaCrK4JBEhJd XAqLvq3vTLogdlT6nOUdu6hWEXc6OpyeZFXcpJmfMdcn6J/nSLO7Egcbu+Tfpup3Zfy0ardY2 1Ft+2XzQ7Nllw7tnj9vk810pWvin18OR2/qu155TeAekzsw8I8J088oyx5RvbjFnPH/Xze0yu vLxmx/TlLGnPPFa/tVi3qcp5yU+Jd7xxvN26i5RYijMSDbWYi4oTAdVYipCCAgAA X-Env-Sender: tianyu.lan@intel.com X-Msg-Ref: server-13.tower-21.messagelabs.com!1504177788!74596525!1 X-Originating-IP: [192.55.52.93] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogMTkyLjU1LjUyLjkzID0+IDMyNDY2NQ==\n X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 48111 invoked from network); 31 Aug 2017 11:09:50 -0000 Received: from mga11.intel.com (HELO mga11.intel.com) (192.55.52.93) by server-13.tower-21.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 31 Aug 2017 11:09:50 -0000 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Aug 2017 04:09:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.41,451,1498546800"; d="scan'208"; a="1190149831" Received: from sky-ws.sh.intel.com (HELO localhost) ([10.239.48.74]) by fmsmga001.fm.intel.com with ESMTP; 31 Aug 2017 04:09:45 -0700 From: Lan Tianyu To: xen-devel@lists.xen.org Date: Thu, 31 Aug 2017 01:01:47 -0400 Message-Id: <1504155709-24276-3-git-send-email-tianyu.lan@intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1504155709-24276-1-git-send-email-tianyu.lan@intel.com> References: <1504155709-24276-1-git-send-email-tianyu.lan@intel.com> Cc: Lan Tianyu , kevin.tian@intel.com, wei.liu2@citrix.com, andrew.cooper3@citrix.com, ian.jackson@eu.citrix.com, jbeulich@suse.com, roger.pau@citrix.com, chao.gao@intel.com Subject: [Xen-devel] [RFC PATCH V2 2/4] Tool/ACPI: DSDT extension to support more vcpus 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 This patch is to change DSDT table for processor object to support >128 vcpus accroding to ACPI spec 8.4 Declaring Processors Signed-off-by: Lan Tianyu --- tools/libacpi/mk_dsdt.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/tools/libacpi/mk_dsdt.c b/tools/libacpi/mk_dsdt.c index 2daf32c..6c4c325 100644 --- a/tools/libacpi/mk_dsdt.c +++ b/tools/libacpi/mk_dsdt.c @@ -24,6 +24,8 @@ #include #endif +#define CPU_NAME_FMT "P%.03X" + static unsigned int indent_level; static bool debug = false; @@ -196,10 +198,14 @@ int main(int argc, char **argv) /* Define processor objects and control methods. */ for ( cpu = 0; cpu < max_cpus; cpu++) { - push_block("Processor", "PR%02X, %d, 0x0000b010, 0x06", cpu, cpu); + unsigned int apic_id = cpu * 2; - stmt("Name", "_HID, \"ACPI0007\""); + if ( apic_id > 255 ) + push_block("Device", CPU_NAME_FMT, cpu); + else + push_block("Processor", CPU_NAME_FMT", %d, 0x0000b010, 0x06", cpu, cpu); + stmt("Name", "_HID, \"ACPI0007\""); stmt("Name", "_UID, %d", cpu); #ifdef CONFIG_ARM_64 pop_block(); @@ -268,15 +274,15 @@ int main(int argc, char **argv) /* Extract current CPU's status: 0=offline; 1=online. */ stmt("And", "Local1, 1, Local2"); /* Check if status is up-to-date in the relevant MADT LAPIC entry... */ - push_block("If", "LNotEqual(Local2, \\_SB.PR%02X.FLG)", cpu); + push_block("If", "LNotEqual(Local2, \\_SB."CPU_NAME_FMT ".FLG)", cpu); /* ...If not, update it and the MADT checksum, and notify OSPM. */ - stmt("Store", "Local2, \\_SB.PR%02X.FLG", cpu); + stmt("Store", "Local2, \\_SB."CPU_NAME_FMT".FLG", cpu); push_block("If", "LEqual(Local2, 1)"); - stmt("Notify", "PR%02X, 1", cpu); /* Notify: Device Check */ + stmt("Notify", CPU_NAME_FMT", 1", cpu); /* Notify: Device Check */ stmt("Subtract", "\\_SB.MSU, 1, \\_SB.MSU"); /* Adjust MADT csum */ pop_block(); push_block("Else", NULL); - stmt("Notify", "PR%02X, 3", cpu); /* Notify: Eject Request */ + stmt("Notify", CPU_NAME_FMT", 3", cpu); /* Notify: Eject Request */ stmt("Add", "\\_SB.MSU, 1, \\_SB.MSU"); /* Adjust MADT csum */ pop_block(); pop_block();