From patchwork Thu Apr 7 08:18:28 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: 12804672 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 7BC15C433F5 for ; Thu, 7 Apr 2022 08:19:13 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.300493.512587 (Exim 4.92) (envelope-from ) id 1ncNLt-0007zb-W4; Thu, 07 Apr 2022 08:18:49 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 300493.512587; Thu, 07 Apr 2022 08:18:49 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ncNLt-0007zU-Su; Thu, 07 Apr 2022 08:18:49 +0000 Received: by outflank-mailman (input) for mailman id 300493; Thu, 07 Apr 2022 08:18:48 +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 1ncNLs-0007zO-K5 for xen-devel@lists.xenproject.org; Thu, 07 Apr 2022 08:18:48 +0000 Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com [216.71.145.142]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 57254402-b64b-11ec-a405-831a346695d4; Thu, 07 Apr 2022 10:18:47 +0200 (CEST) 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: 57254402-b64b-11ec-a405-831a346695d4 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1649319526; h=from:to:cc:subject:date:message-id: content-transfer-encoding:mime-version; bh=qY7FBTagxd4jhkKjTx/xVU9t2OTJ9bU81KNufS2Swck=; b=MjspBlR9jF9dUJC7gjvwzpn//Rz4Y5G9WXaR6z0Vk3npoHVkuSLGwNxu NfvfK8LH0vXJ6OQSQZeCfrMffGwOt48x0noz2YSvZaaNdRC+bj0djeKow BZ+yUvb/4DSbiT9ql5se9nmyasU6Sps/7Sz/Bmkz+zpeFf58Ybs9/cJqP g=; Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com X-SBRS: 5.1 X-MesageID: 68645317 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.83 X-Policy: $RELAYED IronPort-Data: A9a23:45DzuKN8beG7Mg3vrR2Zl8FynXyQoLVcMsEvi/4bfWQNrUoq12RSz mYeCjiAPfrbZGamfdgiPI2w80JVuJWGmtVnTAto+SlhQUwRpJueD7x1DKtR0wB+jCHnZBg6h ynLQoCYdKjYdleF+lH1dOKJQUBUjclkfJKlYAL/En03FFcMpBsJ00o5wbZl2tEw2LBVPivW0 T/Mi5yHULOa82Yc3lI8s8pvfzs24ZweEBtB1rAPTagjUG32zhH5P7pGTU2FFFPqQ5E8IwKPb 72rIIdVXI/u10xF5tuNyt4Xe6CRK1LYFVDmZnF+A8BOjvXez8CbP2lS2Pc0MC9qZzu1c99Zm OgKrIaVTCkQDqjnw7gCThdIHiQlMvgTkFPHCSDXXc27ykTHdz3nwul0DVFwNoodkgp1KTgQr 7pCcmlLN03dwbLtqF64YrAEasALNs7kMZlZonh95TrYEewnUdbIRKCiCdpwgmdu2p0VRKm2i 8wxRwFiZRLBTg12ZU5JK59mvumur1X9bGgNwL6SjfVuuDWCpOBr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rx27pyFeej3emi9f+XigGB81Igp8cWgfF6mI71esMnZ 5j7ia8jd56HBnAlCPy65zjTBdxjHe5pnIkjKo6k2Ffa40Dc7VcxLZvtn+9KK1wUx4S1bpXXt WHVKrnlbdrmBKhHjvkV1BUsZCRti9ZJGbHfqAA0vbloQS+0koJjHfw//Zv70voxKhNNaWs2N 60QpiA7Is+NvP+TZgNcNvpEvHHfVAkf3r3QRGvyBLcZeM6B04= X-IronPort-AV: E=Sophos;i="5.90,241,1643691600"; d="scan'208";a="68645317" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S3sBmV9vxh1iQ8gMCnWSoV2MxsgRIMxnVlrWp8Tw4tZefCemqwJsVyDji9QAYvEmHSQAgN3dackY4FwHz4ONDbRtwaiE8m8Z9L8mLJY5T6qCik/tqOyyx/0W390DOeKMF4RjrW0jgWI3dqbyVAsAHiXqnWnHXCmYK8OJ2STW21N9ED75e5lgMJiMvfGXWG+gvmXWul+sg8zA4/oTFN4oGI0c8Tc/EsLCUJHBSPUIYwPzne8Qyo1dgOr18J5HCOY3Pfd3BM3c7Au9Hhyml8QJrI4/aFfAhingXd+dNmdJcEN6ADEV3T8yCrru2mQxm5VPZgbQfPF6zW0zaUKrEn0fhQ== 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=lnWFLCRmcqKxtQAxn4E6pLSOOXyBQJiiTqwqs5RlTYc=; b=DuC21If1ts/jw96UOCvM4sR8C16DlouV8gPFm4MmnvmF2bKvzWahXr1DT/lRp9i1cNE0hhJMscsFwANM0lnk0PniqKoqOIqUbiLKispA0dPQ8Tn2tVkgUHb2C7idDLD9NuEd47v3COyZnjyHFHJTHbzjGSV/eMqFMw/BTEpgAWJd6wROnfsMiNRyW2+HVuEMjkzHypFnWbA1EgqUL8XwLNUwq0S/Ywp4W4L1yms5+yei9mQhs6XJNZQr8q2+jmSAe4zLsZgpUE/5ncm4sxjQu3UdqQgd7kHnDUzXJIEAMbleh88ETgCpDRr1FSsh8/5c8rNUFJQ5bTm/G/psJ4+lsw== 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=lnWFLCRmcqKxtQAxn4E6pLSOOXyBQJiiTqwqs5RlTYc=; b=BOI8mPQ3UcpHNpmrn6tvFMZ7Qbnlfr8yyxY8CkoDvSMYhv/x44ouD4E6fbi5TvnzPGnvGJ8GemR4d8cLcbBDKi88NvJeBUrlfDBajAuk+JZM3mDl9+RpmggZVnApVE5dBJDsRQjirz00xYPHDr9YF3RphepuhfC6zVDfngr0x/Y= From: Roger Pau Monne To: CC: Roger Pau Monne , Jan Beulich , Andrew Cooper , George Dunlap , Julien Grall , Stefano Stabellini , Wei Liu Subject: [PATCH v2] platform/cpufreq: add public defines for CPUFREQ_SHARED_TYPE_ Date: Thu, 7 Apr 2022 10:18:28 +0200 Message-ID: <20220407081828.38747-1-roger.pau@citrix.com> X-Mailer: git-send-email 2.35.1 X-ClientProxiedBy: LO4P123CA0053.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:152::22) To DS7PR03MB5608.namprd03.prod.outlook.com (2603:10b6:5:2c9::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 66eed729-6337-4ed0-c6fa-08da186f384f X-MS-TrafficTypeDiagnostic: BN6PR03MB3235:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Cc6cjepdoafVUuhOFe9MuilHAMC3tZJv+tYQ5za/z+h+irJRnqicBzUBT+bVfhztkFHl/z6TYhgmGJj6FDzYo6krUO7teH0jCN4lDeonJpNuHwlsvyfysR311xarVmwUfT7Pf6fOn7q/mawqz/KMXJC11X7rxhck6jBk8+ii3KPrt2ne7vhyLD3o0Oh6w/CEWthuueHA094rFbuEftFMYPSnH2snDrlXzVXNlClzMQFUuw6X6sgjXPyHIvEVXi1fsiHdteHS1xefXpu6VckvhDJUOUN/cNNGu65KwVLATsMiIL9pxgzU2keI8zdQ5pNHOpzzH5rFgfmUOK0zrTffA4paasuSwV/rGIvVAbrPhOPhAALUf3hjoSx9cJpsgc/iNpgdPHbvybeaXv5AKpoB381vuT8HyUY+Rg6O+F+E8l/1ESDizVJjYPqW+m29eUH5BGT3ubmRBHpGGda/xXb1Emlixd7nAWUNmi3e5kNDbD8a2NcgAuvOvSBo8fvZYPupiHE7RhWtPOrajsTGh/dejXv25s/Bb6rSxkNldDHWaQiK2MEEoMRYUVjzrxb1/LunHhmHSPxfOGQDeQaGxgz1yZvOtrQ7dpaXB9xS740db27WJF70WKZu7pG6A4s+F5EBoKK1RHC8o2Qq26hnSFF++g== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR03MB5608.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(6512007)(6916009)(54906003)(186003)(86362001)(26005)(83380400001)(2616005)(1076003)(316002)(6486002)(508600001)(6506007)(5660300002)(6666004)(4326008)(82960400001)(8936002)(2906002)(36756003)(8676002)(66556008)(66946007)(38100700002)(66476007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?9LMvVOUk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ant-AuthSource: DS7PR03MB5608.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Apr 2022 08:18:39.3410 (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: S1slDTW3ka4/xtusxo0OB1QNN2hLbgLQJ0WFF2fxYhT2BINgmUSDi0c5RjpwTCsrGFQS5OoLtW6JDJVfwBHHPg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR03MB3235 X-OriginatorOrg: citrix.com The values set in the shared_type field of xen_processor_performance have so far relied on Xen and Linux having the same CPUFREQ_SHARED_TYPE_ defines, as those have never been part of the public interface. Formalize by adding the defines for the allowed values in the public header, while renaming them to use the XEN_CPUPERF_SHARED_TYPE_ prefix for clarity. Set the Xen internal defines for CPUFREQ_SHARED_TYPE_ using the newly introduced XEN_CPUPERF_SHARED_TYPE_ public defines in order to avoid unnecessary code churn. While there also drop CPUFREQ_SHARED_TYPE_NONE as it's unused. Fixes: 2fa7bee0a0 ('Get ACPI Px from dom0 and choose Px controller') Signed-off-by: Roger Pau Monné Reviewed-by: Jan Beulich --- Changes since v1: - Keep CPUFREQ_SHARED_TYPE_ and define them on top of XEN_CPUPERF_SHARED_TYPE_. - Use CPUPERF instead of plain PERF. --- xen/include/acpi/cpufreq/cpufreq.h | 7 +++---- xen/include/public/platform.h | 6 +++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/xen/include/acpi/cpufreq/cpufreq.h b/xen/include/acpi/cpufreq/cpufreq.h index e5e58c6c30..35dcf21e8f 100644 --- a/xen/include/acpi/cpufreq/cpufreq.h +++ b/xen/include/acpi/cpufreq/cpufreq.h @@ -78,10 +78,9 @@ DECLARE_PER_CPU(struct cpufreq_policy *, cpufreq_cpu_policy); extern int __cpufreq_set_policy(struct cpufreq_policy *data, struct cpufreq_policy *policy); -#define CPUFREQ_SHARED_TYPE_NONE (0) /* None */ -#define CPUFREQ_SHARED_TYPE_HW (1) /* HW does needed coordination */ -#define CPUFREQ_SHARED_TYPE_ALL (2) /* All dependent CPUs should set freq */ -#define CPUFREQ_SHARED_TYPE_ANY (3) /* Freq can be set from any dependent CPU*/ +#define CPUFREQ_SHARED_TYPE_HW XEN_CPUPERF_SHARED_TYPE_HW +#define CPUFREQ_SHARED_TYPE_ALL XEN_CPUPERF_SHARED_TYPE_ALL +#define CPUFREQ_SHARED_TYPE_ANY XEN_CPUPERF_SHARED_TYPE_ANY /******************** cpufreq transition notifiers *******************/ diff --git a/xen/include/public/platform.h b/xen/include/public/platform.h index a4c0eb6224..8100133509 100644 --- a/xen/include/public/platform.h +++ b/xen/include/public/platform.h @@ -465,7 +465,11 @@ struct xen_processor_performance { uint32_t state_count; /* total available performance states */ XEN_GUEST_HANDLE(xen_processor_px_t) states; struct xen_psd_package domain_info; - uint32_t shared_type; /* coordination type of this processor */ + /* Coordination type of this processor */ +#define XEN_CPUPERF_SHARED_TYPE_HW 1 /* HW does needed coordination */ +#define XEN_CPUPERF_SHARED_TYPE_ALL 2 /* All dependent CPUs should set freq */ +#define XEN_CPUPERF_SHARED_TYPE_ANY 3 /* Freq can be set from any dependent CPU */ + uint32_t shared_type; }; typedef struct xen_processor_performance xen_processor_performance_t; DEFINE_XEN_GUEST_HANDLE(xen_processor_performance_t);