From patchwork Mon Nov 21 10:21:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 13050586 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EE6A9C4332F for ; Mon, 21 Nov 2022 10:33:54 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.446478.702063 (Exim 4.92) (envelope-from ) id 1ox47D-0000vX-NI; Mon, 21 Nov 2022 10:33:27 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 446478.702063; Mon, 21 Nov 2022 10:33:27 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ox47D-0000vQ-KS; Mon, 21 Nov 2022 10:33:27 +0000 Received: by outflank-mailman (input) for mailman id 446478; Mon, 21 Nov 2022 10:33:26 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ox47B-0000fJ-W0 for xen-devel@lists.xenproject.org; Mon, 21 Nov 2022 10:33:26 +0000 Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com [216.71.145.153]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id ed4de6b3-6987-11ed-91b6-6bf2151ebd3b; Mon, 21 Nov 2022 11:33:24 +0100 (CET) Received: from mail-mw2nam12lp2049.outbound.protection.outlook.com (HELO NAM12-MW2-obe.outbound.protection.outlook.com) ([104.47.66.49]) by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 21 Nov 2022 05:33:22 -0500 Received: from SJ0PR03MB6360.namprd03.prod.outlook.com (2603:10b6:a03:395::11) by BL1PR03MB6102.namprd03.prod.outlook.com (2603:10b6:208:31c::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5834.9; Mon, 21 Nov 2022 10:33:20 +0000 Received: from SJ0PR03MB6360.namprd03.prod.outlook.com ([fe80::740b:4e0a:7de4:5ab1]) by SJ0PR03MB6360.namprd03.prod.outlook.com ([fe80::740b:4e0a:7de4:5ab1%7]) with mapi id 15.20.5834.015; Mon, 21 Nov 2022 10:33:20 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: ed4de6b3-6987-11ed-91b6-6bf2151ebd3b DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1669026804; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=YHPGugGitXvHZlE1d9kV/h0t+sD3euQGc1fPgzWqA5o=; b=aJsuR9+Lw+jiGV+wWDHyrpYQOsd/QQOl/cJmV9QcgzSbDlM57W5Tm/It BW/hQJ+YuTj0/LF/ySfaZNV3HmzZU3IDZqnOxL2nT+bfe092rSuTQr98Z yDImM9Fi6lLbXb3yZVD0RjwwElpbaOwKBfs4HmPkRNivxHq3BfBcAStMz E=; X-IronPort-RemoteIP: 104.47.66.49 X-IronPort-MID: 85257541 X-IronPort-Reputation: None X-IronPort-Listener: OutboundMail X-IronPort-SenderGroup: RELAY_O365 X-IronPort-MailFlowPolicy: $RELAYED IronPort-Data: A9a23:46A+dq0vDFv1o4vKu/bD5fpxkn2cJEfYwER7XKvMYLTBsI5bp2RUy DEbU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8p9haNJm+zU/ 3a7HEhF1F74gn6BIgKPApx+VI7SsV9EhSpTFUQR0ZyAghDPva7HAH8jSqYK IronPort-HdrOrdr: A9a23:lLr1CqHA5d/qxkw5pLqFiJLXdLJyesId70hD6qkvc3Fom52j/f xGws5x6faVslkssb8b6LK90c67MAnhHP9OkPIs1NKZMDUO11HYSL2KgbGD/9SkIVyGygc/79 YeT0EBMqyWMbESt6+TjmiF+pQbsaG6GciT9JvjJhxWPGRXgs9bnmRE4lHxKDwKeOAKP+tOKL Osou584xawc3Ueacq2QlEDQuj4vtXO0L72fBIcABYjyQ+WyRel8qTzHRS01goXF2on+8ZpzU H11yjCoomzufCyzRHRk0fV8pRtgdPkjvdTGcCWjcARCzP0ziKlfp5oVbGutC085Muv9FEput /RpApIBbU511rhOkWO5Tf90Qjp1zgjr1fk1F+jmHPm5ej0XigzBcZtjZ9QNkKx0TtpgPhMlI Zwm06JvZteCh3N2Az7+tjzThlv0m65u2Arn+I/h2FWFaEedLhSh4oC+149KuZIIAvKrKQcVM V+BsDV4/hbNXuccnDip2FqhOehW3widy32N3Qqi4iw6Xx7jXp5x0wXyIg0hXEb7q8wTJFC+q DtLrlovKsmdL5ZUYtNQMM6BeenAG3ERhzBdEiIJ078Ka0BM3XR77bq/bQO4v2wcpBg9up8pH 34aiIZiYcOQTOsNSXXt6c7sCwlAV/NEQgF8/supqSQ4dbHNf/W2S7qciFdryLvmYRaPiThYY fCBHtnOY6cEYLQI/c54+SHYeg1FZA/arxghj9pYSP4nuv7bqvXi8f8TNH/YJLQLBdMYBKNPp JEZkm/GPl9 X-IronPort-AV: E=Sophos;i="5.96,181,1665460800"; d="scan'208";a="85257541" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hIpmqLgd1AzlqK8pqGDec0OLCrIb8xv/yosS8KXL/bN28ieay/LlbgbozxatE+yaEpSP/5jEHN9pLhtBVJUMMR6l4aFVRwFzy8RLH2dm6R7X50SDJ1AdymDDVEikFEql5Wz4UvTq12t2jjyiVgGllJFXnyoKmD3FzC/b4J02dRCwosWGXM9lDovQ55YPl3YAtMnOZv1oRA33Y0ZEhk8jSWyAL0rFMTWBFLm07aN77FpROiurpmNQDgahonxNPdRcMr2rOvMZ+29EG0N1DCTwKHOiUWxXmO5c8m7PFBmfO1P1hkChGxUwzEAXzMnNvl9bRik8/oq5ksYSHYHYe8CWsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=V+3B4L6OirXeCSTJWk4PnCTnlFvaE8OXfvZ/IgYSk6A=; b=hyS4BGKh9pbxAsdhDiynwJfs//zih3895saqEs31lA8EjCdrifxFamaePSaUV1TQ+fOseJISzrQXxTA9mDKlYNG+nBEQn7ovwKa6Ov+PXQSFADOKpN6PQLegN8x0OMZ58BVD4uiekB9R3voNssMF+UoFhKZxKaxF0CdPWHuw1+5o+c51NZZNZvM52ts5lxu+nzXe3Mk0JgjLzTJ1kJuu2yfn32H6lW07hzt1OFAGdx8/3Z+954mGlP7sOu/5Rm+8s4ygcnCp1gv/7DUwEOWsXrl+PZCjNFKkwwj+VRE1mpBmogkLszhgwEHomKk15P5ioKFYQeJWJznorpXCXgVTGg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=V+3B4L6OirXeCSTJWk4PnCTnlFvaE8OXfvZ/IgYSk6A=; b=wqJSgE7utIsmTSsPzikIXUv6qWUXOLiRiXZxWZtmP41BM1KbEuml7ofsPfHvq6XbAVtkWZNut1r5RbeOI9Bk6Wd/fup4aPcMaCNWTAs1A4TJdrfi7bLFDiJVrQiI0WEaH7SZ9KgBAM6Olq9CHQlNZt9G1P+0aFAJ7x6LG6XGvZU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com; From: Roger Pau Monne To: linux-kernel@vger.kernel.org Cc: xen-devel@lists.xenproject.org, jgross@suse.com, Roger Pau Monne , Boris Ostrovsky , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , "Rafael J. Wysocki" , Len Brown , Alex Chiang , Venkatesh Pallipadi , linux-acpi@vger.kernel.org Subject: [PATCH 1/3] acpi/processor: fix evaluating _PDC method when running as Xen dom0 Date: Mon, 21 Nov 2022 11:21:10 +0100 Message-Id: <20221121102113.41893-2-roger.pau@citrix.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221121102113.41893-1-roger.pau@citrix.com> References: <20221121102113.41893-1-roger.pau@citrix.com> X-ClientProxiedBy: LO6P123CA0041.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:2fe::12) To SJ0PR03MB6360.namprd03.prod.outlook.com (2603:10b6:a03:395::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR03MB6360:EE_|BL1PR03MB6102:EE_ X-MS-Office365-Filtering-Correlation-Id: fe416c5d-484e-4b08-2ed8-08dacbabcef7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rnbkGf486ctDaemLQOehJivg6yriyrtrll6TV8wRURi3pxnCLqz4yDd+uARn4d65Rkcm/so0lxHNrLybHIeaAvO0jJjwMm1ym5KgNxVOrdlTUZOwbV3LWQIZEiNOLf3pSlwJF0GLydgNx9IOH1BnCnbjtY2FVfWHOm6+3w1MFiL6ljwsSQcQLVsU06uRW8BLc9ixfKUz28MvWxxCyBFnQlIFi+y+5TQVc0mFuPwwarhhtQj38+l9JscUTZDcOLPv8sJ4/oayunvazhPhVkS0tlmazQs3gHWqk4opUg6UCc9Ap9DkDO1ofIa4TGqyOryf34Tke5XzvyPxdAJtgga93nt0clHpyULbX81Pkp2FHIawWNkAniwqO3+TSdLCk6u4eLKepm79kdJc6LITvuMMOCvwGwWT+zUXPj82pEU/Ae8eDv0UjZEzOK/GU8e+i+kMi/nqDdkutkqWfg5y5gAirrQVb+JRVcPagtrA2G9Kn59IS5l1W2qpRIWykW0T09wvzmqQ883PvBMMOIBscphoh/3m2k/tsiU95LMiLyLyA9pI59MtdRjosN0pKfS1Pppaeo0cd/8SxBafCJF5duJm8q44YqF/kOdRhbnFr9RYbFbRXfj3tnfe+Lh9zRSjCdDYpWtBTo74J9DooVYWIEn5Sg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6360.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(376002)(396003)(39860400002)(346002)(136003)(366004)(451199015)(478600001)(6666004)(6506007)(6486002)(54906003)(38100700002)(66946007)(66476007)(26005)(316002)(8676002)(86362001)(6512007)(83380400001)(6916009)(66556008)(4326008)(82960400001)(7416002)(5660300002)(186003)(41300700001)(8936002)(2906002)(1076003)(36756003)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?jyAvvgZLrjRLlkLlAUHBQGylZ4mF?= =?utf-8?q?lVuV9MNEEcKurgziqsL+AfXDU9SDyKETGpS9RCY3TLUgwpVbwkPSVqANNsKr8ix1H?= =?utf-8?q?Bc5RamTZOT/qkBpeWHhWZauWgG1eaUb48AGvb66631dIOQFZf4gOWJ/CJ363DN6Oa?= =?utf-8?q?8eL7sjS1w3S+rG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V8nFUQ=3D=3D?= X-OriginatorOrg: citrix.com X-MS-Exchange-CrossTenant-Network-Message-Id: fe416c5d-484e-4b08-2ed8-08dacbabcef7 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6360.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Nov 2022 10:33:20.7252 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: pZiemV/SDoG9Ln0GCEvmTh/MKvi7TdyjpgEzrjy7YSpSf4s5gYtxgOLxo2nztL/rkYGuKuVGXmY4oSrqIuXXNw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR03MB6102 When running as a Xen dom0 the number of CPUs available to Linux can be different from the number of CPUs present on the system, but in order to properly fetch processor performance related data _PDC must be executed on all the physical CPUs online on the system. The current checks in processor_physically_present() result in some processor objects not getting their _PDC methods evaluated when Linux is running as Xen dom0. Fix this by introducing a custom function to use when running as Xen dom0 in order to check whether a processor object matches a CPU that's online. Fixes: 5d554a7bb064 ('ACPI: processor: add internal processor_physically_present()') Signed-off-by: Roger Pau Monné --- arch/x86/include/asm/xen/hypervisor.h | 10 ++++++++++ arch/x86/xen/enlighten.c | 27 +++++++++++++++++++++++++++ drivers/acpi/processor_pdc.c | 11 +++++++++++ 3 files changed, 48 insertions(+) diff --git a/arch/x86/include/asm/xen/hypervisor.h b/arch/x86/include/asm/xen/hypervisor.h index 16f548a661cf..b9f512138043 100644 --- a/arch/x86/include/asm/xen/hypervisor.h +++ b/arch/x86/include/asm/xen/hypervisor.h @@ -61,4 +61,14 @@ void __init xen_pvh_init(struct boot_params *boot_params); void __init mem_map_via_hcall(struct boot_params *boot_params_p); #endif +#ifdef CONFIG_XEN_DOM0 +bool __init xen_processor_present(uint32_t acpi_id); +#else +static inline bool xen_processor_present(uint32_t acpi_id) +{ + BUG(); + return false; +} +#endif + #endif /* _ASM_X86_XEN_HYPERVISOR_H */ diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index b8db2148c07d..d4c44361a26c 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c @@ -346,3 +346,30 @@ void xen_arch_unregister_cpu(int num) } EXPORT_SYMBOL(xen_arch_unregister_cpu); #endif + +#ifdef CONFIG_XEN_DOM0 +bool __init xen_processor_present(uint32_t acpi_id) +{ + unsigned int i, maxid; + struct xen_platform_op op = { + .cmd = XENPF_get_cpuinfo, + .interface_version = XENPF_INTERFACE_VERSION, + }; + int ret = HYPERVISOR_platform_op(&op); + + if (ret) + return false; + + maxid = op.u.pcpu_info.max_present; + for (i = 0; i <= maxid; i++) { + op.u.pcpu_info.xen_cpuid = i; + ret = HYPERVISOR_platform_op(&op); + if (ret) + continue; + if (op.u.pcpu_info.acpi_id == acpi_id) + return op.u.pcpu_info.flags & XEN_PCPU_FLAGS_ONLINE; + } + + return false; +} +#endif diff --git a/drivers/acpi/processor_pdc.c b/drivers/acpi/processor_pdc.c index 8c3f82c9fff3..18fb04523f93 100644 --- a/drivers/acpi/processor_pdc.c +++ b/drivers/acpi/processor_pdc.c @@ -14,6 +14,8 @@ #include #include +#include + #include "internal.h" static bool __init processor_physically_present(acpi_handle handle) @@ -47,6 +49,15 @@ static bool __init processor_physically_present(acpi_handle handle) return false; } + if (xen_initial_domain()) + /* + * When running as a Xen dom0 the number of processors Linux + * sees can be different from the real number of processors on + * the system, and we still need to execute _PDC for all of + * them. + */ + return xen_processor_present(acpi_id); + type = (acpi_type == ACPI_TYPE_DEVICE) ? 1 : 0; cpuid = acpi_get_cpuid(handle, type, acpi_id); From patchwork Mon Nov 21 10:21:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 13050585 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9E0EDC4332F for ; Mon, 21 Nov 2022 10:33:49 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.446479.702074 (Exim 4.92) (envelope-from ) id 1ox47K-0001Es-05; Mon, 21 Nov 2022 10:33:34 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 446479.702074; Mon, 21 Nov 2022 10:33:33 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ox47J-0001El-SU; Mon, 21 Nov 2022 10:33:33 +0000 Received: by outflank-mailman (input) for mailman id 446479; Mon, 21 Nov 2022 10:33:32 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ox47I-0000fJ-BZ for xen-devel@lists.xenproject.org; Mon, 21 Nov 2022 10:33:32 +0000 Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com [216.71.145.153]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id f1144f7e-6987-11ed-91b6-6bf2151ebd3b; Mon, 21 Nov 2022 11:33:30 +0100 (CET) Received: from mail-mw2nam12lp2041.outbound.protection.outlook.com (HELO NAM12-MW2-obe.outbound.protection.outlook.com) ([104.47.66.41]) by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 21 Nov 2022 05:33:28 -0500 Received: from SJ0PR03MB6360.namprd03.prod.outlook.com (2603:10b6:a03:395::11) by BL1PR03MB6102.namprd03.prod.outlook.com (2603:10b6:208:31c::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5834.9; Mon, 21 Nov 2022 10:33:27 +0000 Received: from SJ0PR03MB6360.namprd03.prod.outlook.com ([fe80::740b:4e0a:7de4:5ab1]) by SJ0PR03MB6360.namprd03.prod.outlook.com ([fe80::740b:4e0a:7de4:5ab1%7]) with mapi id 15.20.5834.015; Mon, 21 Nov 2022 10:33:27 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: f1144f7e-6987-11ed-91b6-6bf2151ebd3b DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1669026810; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=OhG1pbo0HKf03bdp7i14jI3MJOhmG5fyzzDFeRToEuM=; b=hE8NIDMac0HPpquAYtkSWW6pO/Q3GcLpMK8k/P0ytvUFmxLR1ic0NzR5 6a9btmlSVCfIrekB6ilYLIAdOoq4GWpbA3q1/bKjDLPYLL5jV9hBJdXvd 7pbrlTfbVyfOA7ZhdPmLQh9OtL4TOVZmQWXi8xdYinq8ZFq0Y+dtgWike I=; X-IronPort-RemoteIP: 104.47.66.41 X-IronPort-MID: 85257545 X-IronPort-Reputation: None X-IronPort-Listener: OutboundMail X-IronPort-SenderGroup: RELAY_O365 X-IronPort-MailFlowPolicy: $RELAYED IronPort-Data: A9a23:yb8t2KsqbvNlQZnNRYyVSp0py+fnVEZeMUV32f8akzHdYApBsoF/q tZmKWzXbPzbYDb8ftknaozkoxwGupeEn9IwSwFp+CExF3hA+JbJXdiXEBz9bniYRiHhoOCLz O1FM4Wdc5pkJpP4jk3wWlQ0hSAkjcl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04lQ7vn2ZFiY5TiXIra qTdaogviMc6Ax/ZJjvo6HjBEDmewKnyXcV2/hrAV7GZmXbUQSTXeVfBOfZowEIXheOj9K1tp 0QDJSWdueAamSS5PySiGfYLz9j+qj+zEnBv5aj854Hd3AOV0gP1XYbNu7NeXcGOTWuSKBJYq a0145inX6NaH4XZsO0Cj0sWPXCncTCkNbLcAMLHBku7SiJlHeN5KThGxaV8x8CW3cXqI1Su1 Ttokjc3OGOovu7whjT2yv66IlXosLozp9uFdGBkc8cLxTrk0KNaJ56U7OPkTgpqKWE6Uoskv PLvxA8Vv4DoE/5TyWQm1/AygPg2DEh5zvLzkKZu2LqpYjcSCghA8RMqIpFel+BgnBQ9O1U4e Zu5Sa0ppBXBRTPkGDU4MXJbQhjkg6RrWA5meAeonRDWc81aaNXr6YY4ERJea1wVR7S2cQCKq 1DHcvc7PFZfRezaG3YhHBmxJiWUnE6Dn69Mz0/k/3Q9wITsGFyzkMeysBatGwH7ogBR55N4P mBGrh0lZlVJ/VmI55VNaMke4+aG2bNSRXDPCa5OlL8DpwKPHrLttre/Kg13ue3Y5YFpaFC16 gpaGko9VLaRnieSvFnhPZwg1LwqSSGLHjQI/hlltlEUuaWfsuvDcWBIGpe4fdI7c9vRvEzYM zDSK6+M8WTU1cGJrw5rjEWI6MiT0X2cPdlzurTCGj+1f7jG8nNitHxVsr1Cf7ELQsEM1mPcU frGgKDafl90g== X-IronPort-AV: E=Sophos;i="5.96,181,1665460800"; d="scan'208";a="85257545" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AvScgZsGqDa0NR2KIR7n5fVNr0diVh/savKaYpSfFFxvqyuJM6azyU+/FRCEzzJO8a+hm8DmeGQusqvj++TYP3vwpreShwlPGrYiJpsh2HN2EQNrNSdrNbW/oQKttzeusjbD7slYu+dRlU4bZoDuxZ/V09uRdE27d35zjgeWl9hwY8mCqRgylctDeCSbm/AgViwmq1M091Vx4blPlG3dQB5JvC0YELHPdLqDp3ekEftmEtJwGcbyse42d5dVRTGxtIfkKl+BSEeXbPKJTyCSgAAr01cgTwOKKKZ96CzUsVgP3vZpMjjQT0TiXDarx9phC6WOEFEH12vkuUZGquXMSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Vg+rjiccX1faa/xjxY+0Qw0fO6LNKDvwiUc3ugbC6P0=; b=Py3N2rqEMs/y1gkTEcMh/PjCOddExM1RzWa67Z7mN80rLzUhIFE5qExWUwMD+yXd7IZ8I/OI53QFkQw6SL7Lr3gP8fwz2ooHKf9lhLSy3gg3r2DDeRJfZLJAU1gnywePhVHGg+91ru65G4RGSFAvPeBEivCtztzQNg2+HZaBvqNGbMBWNvLjeFDeFqI85SUkm8QR7xQy4zNSYcAkBG6DMeSPx7Va0NEVFi9l8tH+6fIaf/qlK502RIIRe3Dj9aWJ9PyyevadtNt3dDjxPoMphuzbopdQPlCqQOVIiJClWNJEvAPinqPDcNExFNYFEC7e4fWuHJPFYAHhpkeoCWgyFg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Vg+rjiccX1faa/xjxY+0Qw0fO6LNKDvwiUc3ugbC6P0=; b=bROBq+vzMaJTAxcK/2L/Upt6iBUzd4VaYgeEazMlekeqA9ESeQAflW+CyimXXv793g+E4NW/rwqqgSHpSx8Tv/BwkprMRmz0pprW+E7HDcdUcSAUFkSKfiNjW8KFgZPcqAoC6D0M4TFPFQPzF+KZADKhkfeS4iUMeI8fUcSeeQw= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com; From: Roger Pau Monne To: linux-kernel@vger.kernel.org Cc: xen-devel@lists.xenproject.org, jgross@suse.com, Roger Pau Monne , stable@vger.kernel.org, Boris Ostrovsky , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , "Rafael J. Wysocki" , Len Brown , linux-acpi@vger.kernel.org Subject: [PATCH 2/3] acpi/processor: sanitize _PDC buffer bits when running as Xen dom0 Date: Mon, 21 Nov 2022 11:21:11 +0100 Message-Id: <20221121102113.41893-3-roger.pau@citrix.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221121102113.41893-1-roger.pau@citrix.com> References: <20221121102113.41893-1-roger.pau@citrix.com> X-ClientProxiedBy: LO4P123CA0273.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:195::8) To SJ0PR03MB6360.namprd03.prod.outlook.com (2603:10b6:a03:395::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR03MB6360:EE_|BL1PR03MB6102:EE_ X-MS-Office365-Filtering-Correlation-Id: dccdf515-9599-4924-fbb9-08dacbabd331 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Lea1d1MD2u4Fp0UglumcYiXvBnRvEZ5AAHOuqAVmAQSC0xxngLaohYJcCpofPr1Ktxqx6Iz24PpBB1dH+wEPvPoqEiqSChtGDpGMVevhDsTVUufyoZUV5w/ELvvKC89yE1prq2Uk6tqBPr+HwuJ2+2EvIORL6sHOqzXnAF7Sd1qZewPHSyc8MGyPt4fL4rDhzDXmeqKO9Vie7xFLHIAdSvZgqm1uc4PJIa/9I9q0K6AvKpXqGYzBYeEHmyFOcYvN1OXL7KDHk8kPzSPeyPWWgpYoPGfCKQ1YA9GqYaupkkHaVJr2H/vApoMroBF3RRi7chNaFgTOOEjfhDLdaNCzorUL32Z/ygf1jfgJkN2xSxq/C/UeMAQXPHXI7dTZL5A0ZHBbmPL9X+0A/u0/ENcrc2H5mWE48QTNkpzrZyVGcw9a5ake6tYALhZE8ZwvwCff6NUJcMpNWnlRGxm5E/bfjH1w9kgjA53IaddG4mj6Yc0DmYo6J0jKdk/56x4QZ/O9y7hUmekiToAGnOcc/8VATzHl4/BGRw16l+7m7X+fyCVgi9lOhtMEpnDW0OU9gAcWBx0FmH6k8i+f66g/xOo5rEKDreaIrOaPh2+d1iyyGvve5IMI35xCk7+Z68L3AZQcAM4SqqPTPD2QtmGfIU/pMw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6360.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(376002)(396003)(39860400002)(346002)(136003)(366004)(451199015)(478600001)(6666004)(6506007)(6486002)(54906003)(38100700002)(66946007)(66476007)(26005)(316002)(8676002)(86362001)(6512007)(83380400001)(6916009)(66556008)(4326008)(82960400001)(7416002)(5660300002)(186003)(41300700001)(8936002)(2906002)(1076003)(36756003)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?Sfl39oyQjCPHnqiRdOW0o0loDiiN?= =?utf-8?q?VVHbcWT57dvoNLzgpulmM391UY3FBTXxL4i1pXR/8qul1Tg4ebyEs1PcA60bZWD4J?= =?utf-8?q?RJkKt+jC9WX/4oAb/TLO9qt38lKdNtmCjUFgjtS5haFlmss8i7Jpv2pWMtmDcMobq?= =?utf-8?q?2rKEdBPbGm4GrvvPUpYw3TE+BcaPafh3oRhSJfiTK9d39Yn/Swo0X4NtAzFd0BpU+?= =?utf-8?q?83rya8NMeaHB9o8YdKN3ixRE4JTb4Np8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AiqUVpzE2zznlb9xW7y3cQI?= =?utf-8?q?4Unw9k6Wm3Z3w1PZZM1GEQIav5Pki2gI++tgvITdiYk07H1Zt51mnWpRlS6NcBCwF?= =?utf-8?q?L/jy2sMd5iDhZg5z0KH2Aw/NLgAsG1wPoMH6uOhYAQPAdRXId5McD1vIeUprUEPZj?= =?utf-8?q?bq8mRcfyqyZdKPrWov8ozbdPf5J2Oz9OoPmVFtIIwQC7E9z7GcmXp8W/zLycaaAVV?= =?utf-8?q?X33Mvp7KYlwfT0a7ebav9FkkAI6NEN0qMBI4Hc4a7wDG1JKoJv/grvgg3Ov9bGEja?= =?utf-8?q?v0da3n2upPdjrKdEWI7bJoJv9x8rMeho6AWNvpyCQdQMCyfF9MEYrjEyKUHmyxupZ?= =?utf-8?q?+E4pe2TbKQ5u4A9NJ6xVOysUZceI5/Wirnf1YctdbRSxLbLONKKgC3HmYVmPnXyqk?= =?utf-8?q?GobWoj01hTtV?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: =?utf-8?q?Z6jxbOZbnXUCM+HB?= =?utf-8?q?HBMxbdTQHKZgMZMivB2pcgZufrDuKLrKKmZt9N7D12S3e1e40ZNMGpT3yR5Ix2oXW?= =?utf-8?q?8xB+ErwVWsK0Mcp1dAthQ+uFjFIDOPC7ssV3wev/dKlvRewooNfUiiEMwKMWfhpBS?= =?utf-8?q?y5usrRd75J/R8t1ZLY1j2ksuhc4jQZcNniUQMkcSlolSovleOjru0jpSy943/vkS3?= =?utf-8?q?e7roMwRmtMTVltr9uASqzlNa4RsvweDbHQKTVMwBH0DcAqLwWYIHHNKj5rfRQLIS2?= =?utf-8?q?noOibDMNEzFQYFCvgplFBofLq3rFeVRnJUXTv6xSITwkNOpoEpFVh11sodDG4Q7iK?= =?utf-8?q?eGSd7cnaTx4gO+0ATVWxAGaOOxaJNrqEZs56SWO73jK/UJzD4mOPZ4/tOWkv9CutV?= =?utf-8?q?57SpUIY+XPpSvHbgnXuatTOwfop/edwsieK2l54rQ47HRBkcnYomqSEGug+6YC6e/?= =?utf-8?q?pJmJhnFvpYjbueGyHAFLMF9T2JtaqwhqThIAs6QaBNJhya4lcmMcjbJO/Gya1sXWd?= =?utf-8?q?3/SXQ6XQ3Trn3OgpPoQXRrcH5JcwYmRjM4vZFTAjdi4oo/lfsievphYFE3MMeZm08?= =?utf-8?q?a87wKEhwhO+ZpHCml5oq5bCUXzLpTefdQOSe09ajckc4tx9Dx2VowwR9CVj1PSPrl?= =?utf-8?q?TihUY2LpFVLTAEOKb12OgMLx4lHVcJPeqIR43f4+lOg9czqiJA+NvQRW/7zvydvCL?= =?utf-8?q?mdmb5mQ2HfQxve7mzAPArbjBPvyAbLH4sKtDzsGAsjG4wV5vTDy+YJr3KGmVuJmRG?= =?utf-8?q?RA5yZ2/Nj35G2yIWjAAa6wl8Lm1mlIy94hosC0RgP6Zz8slwszO7vEvWgFLJgWGKD?= =?utf-8?q?pYxdpZ7LKS5iDiUFN64erZ4rfiGMlkSb4ujdcJp0EwOt46WkImpLApvl7Z+8CyVBZ?= =?utf-8?q?yz5i030woqTFzFY2c1bW0DpZuu+xnFWUnnX32qgjjrr7culuVlR5C32lfZ4bGtN0y?= =?utf-8?q?6Ma5r/VGC0+mEu8RejSOWTG80heFDiUvQooz9mzA6wlXarksFqwVCEzHNRth9RjcO?= =?utf-8?q?IHn6X6Mznbhp1/cv/JYuvh4wLdETUk5lcwVXx77UUlzmT1XvgWphgWbJ0yMiZO3Ru?= =?utf-8?q?Iz8uNMz4fCJbUwP6/lLVYZ/BtM84nwZGLt7Bt4mI0+1fyNewLYFN2a/2n5waYyZ2w?= =?utf-8?q?OJ/9Sf/pV8MQJg5teft1PXWZ/Y/514hQcJMYwR+dSaXASgbrkNXA=3D=3D?= X-OriginatorOrg: citrix.com X-MS-Exchange-CrossTenant-Network-Message-Id: dccdf515-9599-4924-fbb9-08dacbabd331 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6360.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Nov 2022 10:33:27.1804 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: j9QCyLUjfjXEGBx7UlRAyBtNMf5Q6/y0WQFVbwDgLK1TWirOJP5fSUmLL397XKna5j2ailLu9tQha84uY7bT+A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR03MB6102 The Processor _PDC buffer bits notify ACPI of the OS capabilities, and so ACPI can adjust the return of other Processor methods taking the OS capabilities into account. When Linux is running as a Xen dom0, it's the hypervisor the entity in charge of processor power management, and hence Xen needs to make sure the capabilities reported in the _PDC buffer match the capabilities of the driver in Xen. Introduce a small helper to sanitize the buffer when running as Xen dom0. Signed-off-by: Roger Pau Monné Cc: stable@vger.kernel.org --- arch/x86/include/asm/xen/hypervisor.h | 2 ++ arch/x86/xen/enlighten.c | 17 +++++++++++++++++ drivers/acpi/processor_pdc.c | 8 ++++++++ 3 files changed, 27 insertions(+) diff --git a/arch/x86/include/asm/xen/hypervisor.h b/arch/x86/include/asm/xen/hypervisor.h index b9f512138043..b4ed90ef5e68 100644 --- a/arch/x86/include/asm/xen/hypervisor.h +++ b/arch/x86/include/asm/xen/hypervisor.h @@ -63,12 +63,14 @@ void __init mem_map_via_hcall(struct boot_params *boot_params_p); #ifdef CONFIG_XEN_DOM0 bool __init xen_processor_present(uint32_t acpi_id); +void xen_sanitize_pdc(uint32_t *buf); #else static inline bool xen_processor_present(uint32_t acpi_id) { BUG(); return false; } +static inline void xen_sanitize_pdc(uint32_t *buf) { BUG(); } #endif #endif /* _ASM_X86_XEN_HYPERVISOR_H */ diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index d4c44361a26c..394dd6675113 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c @@ -372,4 +372,21 @@ bool __init xen_processor_present(uint32_t acpi_id) return false; } + +void xen_sanitize_pdc(uint32_t *buf) +{ + struct xen_platform_op op = { + .cmd = XENPF_set_processor_pminfo, + .interface_version = XENPF_INTERFACE_VERSION, + .u.set_pminfo.id = -1, + .u.set_pminfo.type = XEN_PM_PDC, + }; + int ret; + + set_xen_guest_handle(op.u.set_pminfo.pdc, buf); + ret = HYPERVISOR_platform_op(&op); + if (ret) + pr_info("sanitize of _PDC buffer bits from Xen failed: %d\n", + ret); +} #endif diff --git a/drivers/acpi/processor_pdc.c b/drivers/acpi/processor_pdc.c index 18fb04523f93..58f4c208517a 100644 --- a/drivers/acpi/processor_pdc.c +++ b/drivers/acpi/processor_pdc.c @@ -137,6 +137,14 @@ acpi_processor_eval_pdc(acpi_handle handle, struct acpi_object_list *pdc_in) buffer[2] &= ~(ACPI_PDC_C_C2C3_FFH | ACPI_PDC_C_C1_FFH); } + if (xen_initial_domain()) + /* + * When Linux is running as Xen dom0 it's the hypervisor the + * entity in charge of the processor power management, and so + * Xen needs to check the OS capabilities reported in the _PDC + * buffer matches what the hypervisor driver supports. + */ + xen_sanitize_pdc((uint32_t *)pdc_in->pointer->buffer.pointer); status = acpi_evaluate_object(handle, "_PDC", pdc_in, NULL); if (ACPI_FAILURE(status)) From patchwork Mon Nov 21 10:21:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 13050588 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 52DFBC433FE for ; Mon, 21 Nov 2022 10:33:58 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.446483.702085 (Exim 4.92) (envelope-from ) id 1ox47Y-0001uI-EL; Mon, 21 Nov 2022 10:33:48 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 446483.702085; Mon, 21 Nov 2022 10:33:48 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ox47Y-0001u9-Al; Mon, 21 Nov 2022 10:33:48 +0000 Received: by outflank-mailman (input) for mailman id 446483; Mon, 21 Nov 2022 10:33:47 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ox47W-0000fJ-RT for xen-devel@lists.xenproject.org; Mon, 21 Nov 2022 10:33:47 +0000 Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com [216.71.155.144]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id f83dcec6-6987-11ed-91b6-6bf2151ebd3b; Mon, 21 Nov 2022 11:33:44 +0100 (CET) Received: from mail-bn8nam12lp2171.outbound.protection.outlook.com (HELO NAM12-BN8-obe.outbound.protection.outlook.com) ([104.47.55.171]) by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 21 Nov 2022 05:33:38 -0500 Received: from SJ0PR03MB6360.namprd03.prod.outlook.com (2603:10b6:a03:395::11) by BL1PR03MB6102.namprd03.prod.outlook.com (2603:10b6:208:31c::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5834.9; Mon, 21 Nov 2022 10:33:35 +0000 Received: from SJ0PR03MB6360.namprd03.prod.outlook.com ([fe80::740b:4e0a:7de4:5ab1]) by SJ0PR03MB6360.namprd03.prod.outlook.com ([fe80::740b:4e0a:7de4:5ab1%7]) with mapi id 15.20.5834.015; Mon, 21 Nov 2022 10:33:35 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: f83dcec6-6987-11ed-91b6-6bf2151ebd3b DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1669026823; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=4p0/tD9nmKeKYFF9dxbiWoNZZF40bde8hOcTGuaiPP4=; b=iQg9tqmOlIy2o01WqXUyHlSH4ZRndieNTRdY67CuJc6QNlmvQ1uzidrD k0A+eIIotpXPf/vCxt5iSWgwSnSREGwcKNba/goGqurbg19J0yufPC8tv Xrs0gnN/GpCEaPhGaiO5K09MsjTZ9McHvgeLUwxwLzj5DDTjZPEaNojTV M=; X-IronPort-RemoteIP: 104.47.55.171 X-IronPort-MID: 87779431 X-IronPort-Reputation: None X-IronPort-Listener: OutboundMail X-IronPort-SenderGroup: RELAY_O365 X-IronPort-MailFlowPolicy: $RELAYED IronPort-Data: A9a23:yCsLaKweCgdYjLlgNDt6t+dHxirEfRIJ4+MujC+fZmUNrF6WrkVVz mtNWDiOa/yPZGbwL49wbIy+9x8B6seDmIVnGQBsriAxQypGp/SeCIXCJC8cHc8wwu7rFxs7s ppEOrEsCOhuExcwcz/0auCJQUFUjP3OHfykTbaeYUidfCc8IA85kxVvhuUltYBhhNm9Emult Mj75sbSIzdJ4RYtWo4vw//F+U0HUMja4mtC5AVnP6kT5TcyqlFOZH4hDfDpR5fHatE88t6SH 47r0Ly/92XFyBYhYvvNfmHTKxBirhb6ZGBiu1IOM0SQqkEqSh8ai87XAME0e0ZP4whlqvgqo Dl7WT5cfi9yVkHEsLx1vxC1iEiSN4Uek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oqwCwIKBsQaeLsjwZqPymrHwqjN 7PiRE9ONkb0QKbQkiF5T/WnyXw2jcn7HHvjXeenHvYuMT8ABY3EdBIi451egbQrxNIhqA17I t7m0ai87ZHBxLJmyrwo/DOShFRj0Kx5V4vi/QagXBzWZYXLJVRsYsc1kVIF4poJlOy1KkXVM 1VSO3M7vdfdl2XK1jfo2lU2dSpGk8+Gx+XK3Jyz/C94nxzpjRU3kEYzMsQkjMr75QmUaRJ4O zCL+BBiKxOZtV+V9MyOM4xBe+MTkDdSxPFN2yfZX79ErscBn7Lo5nrpJ0o+eCRfoASxpdaou WPbLphjx9zR6vSM7zM4HUSmSq9AllVHA6dhv223qIJ+4EVH9HQQGi+oFNHqbrTnxxQOLyeZx +JAuMnPxbSFxqRJW935XyOZ3ArEwh5bCQ0gKdOZ7vcmLO9FqTa8srmTd30GJ3BVR4ZZ0KXOA pxYNG0HrQM0nyW X-IronPort-AV: E=Sophos;i="5.96,181,1665460800"; d="scan'208";a="87779431" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OfMIqcuWdpLfMQRAAJ0ptLB/TEY+azYR7NbmuoX4NlbyKWzvGRST88tR6rNQebex0ROMS1llOigF5ojuIyUFNnhf6101FPpM0V9HcoDy39NJnUvSJfbLzPfXckeB2cYVioN9VYtXSwSzErnk0QrjhESs43UvLj4zRBE8bxIYnM+9rDgAJHGQ9Agepr69JBL+CBEO+8yqAPsQ2nlqlt1gD0+LzsCdpYgxnx+zjFWOeP2qe9+8io0CdciMRaEt5nFKOtvnejvQoKMsk1jNSP7uYZuiDIay7ZCiAzMhmF16FH8U34C0RQkg6lF0AZJGntwutgAKdavrqaSmB82LmMxgHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Z49Tu1Ypmjei/9l5AHd8zeioUpwinUkwsOpJU7h/0Lo=; b=E39mtrVFOK3jj4DcwYxCysmTucj+7wzgSPcyqjqvsrrRP4tFobQOAo2ICYf27WsCXr3HeGP2FRaDwc/IHjegd56//DNQfE/FINkbhPAJQFhwRo9YxMnGuQXU3bavViNamNqykmEHuIjUoHCPBv8BtdSwjClJHi+jD7qJQ6qHfUX4c3CJ7nCKJPZe21vxe2N4fgsgDNGuUQYRxOIAAxEZjJfbJICbCwHAQUp/Xst7YEhZwfo8X3bfJZ8ws7BFQMn/NPQjNtTtWvRXU04KN9TWfBY0KAU+wiNtYriaB8tQX1S9vEbOleaIE6+NCePZQiHOROBfJQHrq7xbswh3afbVOQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Z49Tu1Ypmjei/9l5AHd8zeioUpwinUkwsOpJU7h/0Lo=; b=nNwZLtkZ0BWg8TmOLyqJmlvcVxsJCRq8MRKF9ORweR4QIOlhcF7WyXBhTCRS3Q5M+D8j7r+j31POxrZxhJAw4/FKCCWLsqhwhD3k+sbL/zf3IujFLtMS1re7YAvXnSDiJtI20/zD4HBucxT/UYGDWbPPDGRNYoka6rlbhQd428I= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com; From: Roger Pau Monne To: linux-kernel@vger.kernel.org Cc: xen-devel@lists.xenproject.org, jgross@suse.com, Roger Pau Monne , Boris Ostrovsky , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Stefano Stabellini , Oleksandr Tyshchenko Subject: [PATCH 3/3] xen/acpi: upload power and performance related data from a PVH dom0 Date: Mon, 21 Nov 2022 11:21:12 +0100 Message-Id: <20221121102113.41893-4-roger.pau@citrix.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221121102113.41893-1-roger.pau@citrix.com> References: <20221121102113.41893-1-roger.pau@citrix.com> X-ClientProxiedBy: LO4P123CA0620.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:294::16) To SJ0PR03MB6360.namprd03.prod.outlook.com (2603:10b6:a03:395::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR03MB6360:EE_|BL1PR03MB6102:EE_ X-MS-Office365-Filtering-Correlation-Id: f52a8980-9f7b-42ce-36c5-08dacbabd6d6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cRDCH1YOIuHSOcCwvQrsm1XnPDPZS7doelFmQeTvhuvelNoHhlW2HHDKdaoytEMkRCTaG88RaQA5eqQsldhaMYnEHkknLvV8P3PbqNcvABi+KdedVWQLy+S/sLnAqcYIN6GD2ZJs5+55Y8yhzkeBHk+NuxQK5eY3bdndUJ4X4azAYbstAxFRtVvCCZNEUitElQ84IllbMTy817sELMJTm9AWIuebtM6vtF2offbGM82po5/YNZs4K2TARSmrwukArSWN7TR/WB4iyWj4A9LoycjuB05OfGfJmZJ+YCqFPfFw3vyOHXhHYiHtjBaCnD2Umhnq8+tlySAYXce5msVdwN/d6tC3v95aOqaSELAAvSstsgVWTWFwdYou+9CyHvktvvfGBu/sQCBzDLset++NxOG/uBEx2PskJC/Tz7qD96XFNUQsvp5qWq73a41XjGphbdUE7TqIY+GT8QyNxmRibaIQqgJkp30v40s8i8FLad6YGeJTjeZngzUulp0tC4zq33vf9fGNCQfLS/co7dOwmMziwjpUOM1gHfaGiZrighULF70rm085GGlCP1QlaUhF31iSwKmlfFPx27pGJn7sKBQCU6x1jg9IQF6Vw3+v7NgExFJcfGOPwtfKCNyjCG2NidLmjut6x+RBnJ0jBPxkRw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6360.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(376002)(396003)(39860400002)(346002)(136003)(366004)(451199015)(478600001)(6666004)(6506007)(6486002)(54906003)(38100700002)(66946007)(66476007)(26005)(316002)(8676002)(86362001)(30864003)(6512007)(83380400001)(6916009)(66556008)(4326008)(82960400001)(7416002)(5660300002)(186003)(41300700001)(8936002)(2906002)(1076003)(36756003)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?d+pvtcbOlkYd+H9m5ucTkmZ45Bkt?= =?utf-8?q?j30ic8LCW4y7LMBxnzuiN117N6w7ioIiG3LXwCH1vzUkMwGntk53Kutc2uNpqclwR?= =?utf-8?q?IxW7C9TnjR2kFJKLiLFSix2vv6UW5fae/mOTyJ6jIpwofFoh/v5YRb72erp5gcsMS?= =?utf-8?q?HrkW3wkD3Nxu/rCAjvEcG5fs+nof0r6oAsFeYVJNuvX4WbUcHlI+CCWt2XDrxnI5z?= =?utf-8?q?WLJGD/n1CCLqa5upHrnJS72YLFsrdKvGfGybox3dcJmK/FHs8uaraXQlFAR0Febwl?= =?utf-8?q?pkFjEa6RxPHoNUjDMI6bZwAs88MkDtW42zUqYP06Ftl61C+fcpV6/HLCaAwBlCZh8?= =?utf-8?q?VzPJGZ13uU/W2LLrDb5oe+G1PTMxa0VuRhphGMUDDzUHkJ1klUwpkyntgYmBJohRf?= =?utf-8?q?D8TSpYmddIpSkQ2FZXR+2mRTeN8vg40uqainvS59n/Ht1Pk9nlXNx1ouC+PJNyolU?= =?utf-8?q?58TwHJLz7eWbMtrzlCCWUHzN7QcHjN/7DFH5pImjB7pkxPmymLVl6dH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?q?9APrsxmM/Rih//C8dQmQYN5/pH47/IQiV0Ds9+cQPQpcREPTVjY27t9fzlCeB1FSU?= =?utf-8?q?AY8ZfplToGxsgizFdQs2P58zs3yf9m+7AejPAJdLHH6YL+Swxt4hai2xx4MYkD61x?= =?utf-8?q?LpRV9xxae4DM?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: =?utf-8?q?Qy+uYaTVKor++U6V?= =?utf-8?q?YcwEc7/jmdEuKJPg3/egbcgBlQ7SeWa7gpqVEHXtD0t7/0Ylt93ET/pGsWMieZ2pc?= =?utf-8?q?cOYJhnHTj0JH7CVJwJYJuxODUwIs5IG5nLrZocOvKxb5w6USKSRId7ZRNvYTd+pj6?= =?utf-8?q?3kgYx7pi6B7bSr7K71wztFXFlEthiD56jWJePCsRGySoWorUbjeczbq04zODeNzWm?= =?utf-8?q?ew8Yf1xXKNe7/bCaPsYoEqRfTC3xclkzXsHa8X6Zm/ENjxazn9EkTBr+xC5maQNm/?= =?utf-8?q?YDZQdO+B7W6k/0Px41ZCsAptkAtGzP30k2G1zLZENUxg8e4OHNZddC7ssHxfcd3XZ?= =?utf-8?q?Ap5wuprGrVv8drDAaTZWCrp0BieOl6NX/CxSQJBCvn+RFLv5s9fMEEtNcX80x+ovp?= =?utf-8?q?qzb54evIYOY0wADWFK4mRvEmGxaQA04VCMNbIyz7wkRW4HU6zQmITT9ntePI8bLlS?= =?utf-8?q?ms2DCVLNgyjiQ7Fdqh9B7P9oNw7GEJ8I3MVIVAWSOiWJmp1EREsP1shu7wFaS3OwN?= =?utf-8?q?7EF8BcMzBQg4kHglkd/GDFSLHFOzfgcFRgspa4lA+M9VHu9voLmxBxUWZOjPoNW+h?= =?utf-8?q?6JExzA4el/RlYyTMZf4POYURKDv6y8sA8NhUu3T2YoWZA6CNlIr/y+rJaMVABqQoX?= =?utf-8?q?rmpjGTuHqd7UwMUWxxfgHs+xB0rjlG1A0rRsL+nYiyrBAFMMd5qcH0HwqNk/B3pFI?= =?utf-8?q?yWl5XRqhMygnC4KFAQUWHJQhocbUtne1uoO4xPG9MyeRRQeF+tsj/xyDDzrxcafd8?= =?utf-8?q?HeClGtj8RgZW4Ok1tu4ict8CKaGNpbiQ4RvxGJ88oD/vpij2MkCfsEa3OgUh9h75I?= =?utf-8?q?3mS83ZM0m8RTxzqXrk+9J8fDscxz3XBCC5UN1PYS6RmhjrOcgXi46QzYXi/sZgdYH?= =?utf-8?q?hVJwENCS6CsgFWXVrtvy136LLc/wB+gneFF0adszWWun/+Uh8enZdVAS2CIRFnCgh?= =?utf-8?q?m5xfCJ3jkrlLSZRuwjHX35oest6flm+guwjQreXHKF3FbJxCTZn7TcQGRh6fwjS8W?= =?utf-8?q?uR7D6HvJry1V9o5xlnm/fgl3p4HzAGa2NAZRTAnCz+OGIgPfkJphPu7y7i2vDAnqy?= =?utf-8?q?dn8rWxsN4+uxj6vDjotUv4HVJovMAVa?= X-OriginatorOrg: citrix.com X-MS-Exchange-CrossTenant-Network-Message-Id: f52a8980-9f7b-42ce-36c5-08dacbabd6d6 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6360.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Nov 2022 10:33:35.3402 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: QiNvpLKeXFZVMe+yZgJqgi5Cw+9ORRg4KdRxKLVqfxVrY7Z271NSXb8rsyxm6IfO5DCxa2zzK9hFoilN0K2jOQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR03MB6102 When running as a PVH dom0 the ACPI MADT is crafted by Xen in order to report the correct numbers of vCPUs that dom0 has, so the host MADT is not provided to dom0. This creates issues when parsing the power and performance related data from ACPI dynamic tables, as the ACPI Processor UIDs found on the dynamic code are likely to not match the ones crafted by Xen in the dom0 MADT. Xen would rely on Linux having filled at least the power and performance related data of the vCPUs on the system, and would clone that information in order to setup the remaining pCPUs on the system if dom0 vCPUs < pCPUs. However when running as PVH dom0 it's likely that none of dom0 CPUs will have the power and performance data filled, and hence the Xen ACPI Processor driver needs to fetch that information by itself. In order to do so correctly, introduce a new helper to fetch the _CST data without taking into account the system capabilities from the CPUID output, as the capabilities reported to dom0 in CPUID might be different from the ones on the host. Note that the newly introduced code will only fetch the _CST, _PSS, _PPC and _PCT from a single CPU, and clone that information for all the other Processors. This won't work on an heterogeneous system with Processors having different power and performance related data between them. Signed-off-by: Roger Pau Monné --- arch/x86/include/asm/xen/hypervisor.h | 2 +- arch/x86/xen/enlighten.c | 2 +- drivers/xen/xen-acpi-processor.c | 225 ++++++++++++++++++++++++-- 3 files changed, 211 insertions(+), 18 deletions(-) diff --git a/arch/x86/include/asm/xen/hypervisor.h b/arch/x86/include/asm/xen/hypervisor.h index b4ed90ef5e68..1ead5253bc6c 100644 --- a/arch/x86/include/asm/xen/hypervisor.h +++ b/arch/x86/include/asm/xen/hypervisor.h @@ -62,7 +62,7 @@ void __init mem_map_via_hcall(struct boot_params *boot_params_p); #endif #ifdef CONFIG_XEN_DOM0 -bool __init xen_processor_present(uint32_t acpi_id); +bool xen_processor_present(uint32_t acpi_id); void xen_sanitize_pdc(uint32_t *buf); #else static inline bool xen_processor_present(uint32_t acpi_id) diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index 394dd6675113..a7b41103d3e5 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c @@ -348,7 +348,7 @@ EXPORT_SYMBOL(xen_arch_unregister_cpu); #endif #ifdef CONFIG_XEN_DOM0 -bool __init xen_processor_present(uint32_t acpi_id) +bool xen_processor_present(uint32_t acpi_id) { unsigned int i, maxid; struct xen_platform_op op = { diff --git a/drivers/xen/xen-acpi-processor.c b/drivers/xen/xen-acpi-processor.c index 9cb61db67efd..b189ea69d557 100644 --- a/drivers/xen/xen-acpi-processor.c +++ b/drivers/xen/xen-acpi-processor.c @@ -48,6 +48,8 @@ static unsigned long *acpi_id_cst_present; /* Which ACPI P-State dependencies for a enumerated processor */ static struct acpi_psd_package *acpi_psd; +static bool pr_initialized; + static int push_cxx_to_hypervisor(struct acpi_processor *_pr) { struct xen_platform_op op = { @@ -172,8 +174,13 @@ static int xen_copy_psd_data(struct acpi_processor *_pr, /* 'acpi_processor_preregister_performance' does not parse if the * num_processors <= 1, but Xen still requires it. Do it manually here. + * + * Also init the field if not set, as that's possible if the physical + * CPUs on the system doesn't match the data provided in the MADT when + * running as a PVH dom0. */ - if (pdomain->num_processors <= 1) { + if (pdomain->num_processors <= 1 || + dst->shared_type == CPUFREQ_SHARED_TYPE_NONE) { if (pdomain->coord_type == DOMAIN_COORD_TYPE_SW_ALL) dst->shared_type = CPUFREQ_SHARED_TYPE_ALL; else if (pdomain->coord_type == DOMAIN_COORD_TYPE_HW_ALL) @@ -313,6 +320,155 @@ static unsigned int __init get_max_acpi_id(void) pr_debug("Max ACPI ID: %u\n", max_acpi_id); return max_acpi_id; } + +/* + * Custom version of the native acpi_processor_evaluate_cst() function, to + * avoid some sanity checks done based on the CPUID data. When running as a + * Xen domain the CPUID data provided to dom0 is not the native one, so C + * states cannot be sanity checked. Leave it to the hypervisor which is also + * the entity running the driver. + */ +static int xen_acpi_processor_evaluate_cst(acpi_handle handle, + struct acpi_processor_power *info) +{ + struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; + union acpi_object *cst; + acpi_status status; + u64 count; + int last_index = 0; + int i, ret = 0; + + status = acpi_evaluate_object(handle, "_CST", NULL, &buffer); + if (ACPI_FAILURE(status)) { + acpi_handle_debug(handle, "No _CST\n"); + return -ENODEV; + } + + cst = buffer.pointer; + + /* There must be at least 2 elements. */ + if (!cst || cst->type != ACPI_TYPE_PACKAGE || cst->package.count < 2) { + acpi_handle_warn(handle, "Invalid _CST output\n"); + ret = -EFAULT; + goto end; + } + + count = cst->package.elements[0].integer.value; + + /* Validate the number of C-states. */ + if (count < 1 || count != cst->package.count - 1) { + acpi_handle_warn(handle, "Inconsistent _CST data\n"); + ret = -EFAULT; + goto end; + } + + for (i = 1; i <= count; i++) { + union acpi_object *element; + union acpi_object *obj; + struct acpi_power_register *reg; + struct acpi_processor_cx cx; + + /* + * If there is not enough space for all C-states, skip the + * excess ones and log a warning. + */ + if (last_index >= ACPI_PROCESSOR_MAX_POWER - 1) { + acpi_handle_warn(handle, "No room for more idle states (limit: %d)\n", + ACPI_PROCESSOR_MAX_POWER - 1); + break; + } + + memset(&cx, 0, sizeof(cx)); + + element = &cst->package.elements[i]; + if (element->type != ACPI_TYPE_PACKAGE) { + acpi_handle_info(handle, "_CST C%d type(%x) is not package, skip...\n", + i, element->type); + continue; + } + + if (element->package.count != 4) { + acpi_handle_info(handle, "_CST C%d package count(%d) is not 4, skip...\n", + i, element->package.count); + continue; + } + + obj = &element->package.elements[0]; + + if (obj->type != ACPI_TYPE_BUFFER) { + acpi_handle_info(handle, "_CST C%d package element[0] type(%x) is not buffer, skip...\n", + i, obj->type); + continue; + } + + reg = (struct acpi_power_register *)obj->buffer.pointer; + + obj = &element->package.elements[1]; + if (obj->type != ACPI_TYPE_INTEGER) { + acpi_handle_info(handle, "_CST C[%d] package element[1] type(%x) is not integer, skip...\n", + i, obj->type); + continue; + } + + cx.type = obj->integer.value; + /* + * There are known cases in which the _CST output does not + * contain C1, so if the type of the first state found is not + * C1, leave an empty slot for C1 to be filled in later. + */ + if (i == 1 && cx.type != ACPI_STATE_C1) + last_index = 1; + + cx.address = reg->address; + cx.index = last_index + 1; + + switch (reg->space_id) { + case ACPI_ADR_SPACE_FIXED_HARDWARE: + cx.entry_method = ACPI_CSTATE_FFH; + break; + + case ACPI_ADR_SPACE_SYSTEM_IO: + cx.entry_method = ACPI_CSTATE_SYSTEMIO; + break; + + default: + acpi_handle_info(handle, "_CST C%d space_id(%x) neither FIXED_HARDWARE nor SYSTEM_IO, skip...\n", + i, reg->space_id); + continue; + } + + if (cx.type == ACPI_STATE_C1) + cx.valid = 1; + + obj = &element->package.elements[2]; + if (obj->type != ACPI_TYPE_INTEGER) { + acpi_handle_info(handle, "_CST C%d package element[2] type(%x) not integer, skip...\n", + i, obj->type); + continue; + } + + cx.latency = obj->integer.value; + + obj = &element->package.elements[3]; + if (obj->type != ACPI_TYPE_INTEGER) { + acpi_handle_info(handle, "_CST C%d package element[3] type(%x) not integer, skip...\n", + i, obj->type); + continue; + } + + memcpy(&info->states[++last_index], &cx, sizeof(cx)); + } + + acpi_handle_info(handle, "Found %d idle states\n", last_index); + + info->count = last_index; + +end: + kfree(buffer.pointer); + + return ret; +} + /* * The read_acpi_id and check_acpi_ids are there to support the Xen * oddity of virtual CPUs != physical CPUs in the initial domain. @@ -354,24 +510,44 @@ read_acpi_id(acpi_handle handle, u32 lvl, void *context, void **rv) default: return AE_OK; } - if (invalid_phys_cpuid(acpi_get_phys_id(handle, - acpi_type == ACPI_TYPE_DEVICE, - acpi_id))) { + + if (!xen_processor_present(acpi_id)) { pr_debug("CPU with ACPI ID %u is unavailable\n", acpi_id); return AE_OK; } - /* There are more ACPI Processor objects than in x2APIC or MADT. - * This can happen with incorrect ACPI SSDT declerations. */ - if (acpi_id >= nr_acpi_bits) { - pr_debug("max acpi id %u, trying to set %u\n", - nr_acpi_bits - 1, acpi_id); - return AE_OK; - } + /* OK, There is a ACPI Processor object */ __set_bit(acpi_id, acpi_id_present); pr_debug("ACPI CPU%u w/ PBLK:0x%lx\n", acpi_id, (unsigned long)pblk); + if (!pr_initialized) { + struct acpi_processor *pr = context; + int rc; + + /* + * There's no CPU on the system that has any performance or + * power related data, initialize all the required fields by + * fetching that info here. + * + * Note such information is only fetched once, and then reused + * for all pCPUs. This won't work on heterogeneous systems + * with different Cx anb/or Px states between CPUs. + */ + + pr->handle = handle; + + rc = acpi_processor_get_performance_info(pr); + if (rc) + pr_debug("ACPI CPU%u failed to get performance data\n", + acpi_id); + rc = xen_acpi_processor_evaluate_cst(handle, &pr->power); + if (rc) + pr_debug("ACPI CPU%u failed to get _CST data\n", acpi_id); + + pr_initialized = true; + } + /* It has P-state dependencies */ if (!acpi_processor_get_psd(handle, &acpi_psd[acpi_id])) { pr_debug("ACPI CPU%u w/ PST:coord_type = %llu domain = %llu\n", @@ -392,8 +568,7 @@ read_acpi_id(acpi_handle handle, u32 lvl, void *context, void **rv) static int check_acpi_ids(struct acpi_processor *pr_backup) { - if (!pr_backup) - return -ENODEV; + BUG_ON(!pr_backup); if (acpi_id_present && acpi_id_cst_present) /* OK, done this once .. skip to uploading */ @@ -422,8 +597,8 @@ static int check_acpi_ids(struct acpi_processor *pr_backup) acpi_walk_namespace(ACPI_TYPE_PROCESSOR, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, - read_acpi_id, NULL, NULL, NULL); - acpi_get_devices(ACPI_PROCESSOR_DEVICE_HID, read_acpi_id, NULL, NULL); + read_acpi_id, NULL, pr_backup, NULL); + acpi_get_devices(ACPI_PROCESSOR_DEVICE_HID, read_acpi_id, pr_backup, NULL); upload: if (!bitmap_equal(acpi_id_present, acpi_ids_done, nr_acpi_bits)) { @@ -464,6 +639,7 @@ static int xen_upload_processor_pm_data(void) struct acpi_processor *pr_backup = NULL; int i; int rc = 0; + bool free_perf = false; pr_info("Uploading Xen processor PM info\n"); @@ -475,13 +651,30 @@ static int xen_upload_processor_pm_data(void) if (!pr_backup) { pr_backup = kzalloc(sizeof(struct acpi_processor), GFP_KERNEL); - if (pr_backup) + if (pr_backup) { memcpy(pr_backup, _pr, sizeof(struct acpi_processor)); + pr_initialized = true; + } } (void)upload_pm_data(_pr); } + if (!pr_backup) { + pr_backup = kzalloc(sizeof(struct acpi_processor), GFP_KERNEL); + if (!pr_backup) + return -ENOMEM; + pr_backup->performance = kzalloc(sizeof(struct acpi_processor_performance), + GFP_KERNEL); + if (!pr_backup->performance) { + kfree(pr_backup); + return -ENOMEM; + } + free_perf = true; + } + rc = check_acpi_ids(pr_backup); + if (free_perf) + kfree(pr_backup->performance); kfree(pr_backup); return rc;