From nobody Thu Oct 30 23:12:08 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1751858092; cv=pass; d=zohomail.com; s=zohoarc; b=W9PKmovz2+ixEU/Mg2eCQDARO8rnvnpf0PThXjt+yZwD31cICZn1CFqrzO/VUbrv4I4vZvqdBnbeEB1afVk3+ooNB+L7egWexmKriBSl2l2+Qu7c+hBlCWy5o2wWUYnr1Em4lmrtEI1vWmNpBrl8/0r592giKouffnK7B2MFDnQ= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751858092; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=XWDCQOD66ZKbLyRJ3ZdoNMgnP/71ZQbglzYq68MUnMQ=; b=QKRXTUu+Be5a9Mq7v7WZB+4Jrh+YgJJJU6ON5fVMvJMh5WOW7Mdim1tVOBfXFWl1exjzPCZJLOxYfIiqHjN5c+DT7CsGUVqyroz8f9u5V7bGGmkJYzrwb/Y3wwAlYKucOaUVxItBC40/TQmfS975Xhsu9nzK1o0E5caUrDUEJcc= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 175185809225327.50359309799819; Sun, 6 Jul 2025 20:14:52 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1035073.1407272 (Exim 4.92) (envelope-from ) id 1uYcJA-0007Nr-2t; Mon, 07 Jul 2025 03:14:20 +0000 Received: by outflank-mailman (output) from mailman id 1035073.1407272; Mon, 07 Jul 2025 03:14:20 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uYcJ9-0007N9-Vk; Mon, 07 Jul 2025 03:14:19 +0000 Received: by outflank-mailman (input) for mailman id 1035073; Mon, 07 Jul 2025 03:14:18 +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 1uYcJ8-0007KZ-JB for xen-devel@lists.xenproject.org; Mon, 07 Jul 2025 03:14:18 +0000 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on20600.outbound.protection.outlook.com [2a01:111:f403:2412::600]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 76bb2390-5ae0-11f0-a316-13f23c93f187; Mon, 07 Jul 2025 05:14:17 +0200 (CEST) Received: from BYAPR08CA0053.namprd08.prod.outlook.com (2603:10b6:a03:117::30) by MN2PR12MB4176.namprd12.prod.outlook.com (2603:10b6:208:1d5::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8901.24; Mon, 7 Jul 2025 03:14:11 +0000 Received: from SJ5PEPF000001EF.namprd05.prod.outlook.com (2603:10b6:a03:117:cafe::26) by BYAPR08CA0053.outlook.office365.com (2603:10b6:a03:117::30) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8901.26 via Frontend Transport; Mon, 7 Jul 2025 03:14:10 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by SJ5PEPF000001EF.mail.protection.outlook.com (10.167.242.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8901.15 via Frontend Transport; Mon, 7 Jul 2025 03:14:10 +0000 Received: from penny-System-Product-Name.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Sun, 6 Jul 2025 22:14:08 -0500 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 76bb2390-5ae0-11f0-a316-13f23c93f187 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TBaFgp6mHG7EDpWnptSdg3KHXOTDOY3/Q0MA6g8iEd8QlftX8qLMX3keC13sTt+NcPUMse56ucBQzRNqsrOA3rCb1fMcCgPbEBtsV8DLLh9mhPiyZVhcY+4LC9H2r9vgokDD/cYHNHVyFIoLsDTJZltj3nOqNkDB9QD4Q1yEQdIvtWb9BJQAQw0SgfQNW8mGnVAGKdtbLLesfflaI0JPHkre++bf8PDO7Y/3Ae8KvePuTlkfrLFExID8rHkbFG2UgvyyV+FohYir47c/RtNXUx7qmvk55o2sVXHQlz6c8W09FPxApB7gA5SG7juRGUtgqtRI/DrKxfGfyLbVTp5rcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=XWDCQOD66ZKbLyRJ3ZdoNMgnP/71ZQbglzYq68MUnMQ=; b=EsSAQSQEEsdod075iiced8NNLk6tj/2QaIcNGVMM+yOYc9CNfyd9ASIfMmu/gvRN2OcLCvbfxAe5glLVHBn8TZ+R+Om+bAsdWv6k4EvD/yg/MrI99PWx8jdrVA7skJ6HEqDKHtKImdGoaH0MDtS2oiB2zbQOb/CTDwn6Wjmf/wI594lIZmxjXUqgQGJg+E44AbH9ythDQROB7fUs/VOqLhKnEjXRVU8+nkmo17OTiCbmVXAerKaPncArdkBUwvv1/WhG/PB3rGB/Qy4yGuinV+balIxA/Mnv+D56Qs5pHwJGgeFwEBtq30NEtPu3mLFg7Oor2OSVnJ9rasoyvwqzKw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XWDCQOD66ZKbLyRJ3ZdoNMgnP/71ZQbglzYq68MUnMQ=; b=LKR2c2vX9OE+Sl+apku9wqvDYvVMNWVye4CCprwyG8e3eUQadKKzuxej6lCI5md6jjuDrmuaZ17pOdOW/Pb8n6dIaXIfU7WDw9ZG3ArZ1clvH50PEGFvghMPJS2yobS3TW3AKwq8OPTvJZmUFdCPLy/ikS/phUDRBs7YA0CxdAk= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C From: Penny Zheng To: CC: , Penny Zheng , "Daniel P. Smith" , Stefano Stabellini Subject: [PATCH 01/11] xen/xsm: wrap around xsm_sysctl with CONFIG_SYSCTL Date: Mon, 7 Jul 2025 11:13:36 +0800 Message-ID: <20250707031346.901567-2-Penny.Zheng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250707031346.901567-1-Penny.Zheng@amd.com> References: <20250707031346.901567-1-Penny.Zheng@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ5PEPF000001EF:EE_|MN2PR12MB4176:EE_ X-MS-Office365-Filtering-Correlation-Id: 41651e16-6a74-483a-eab8-08ddbd0457ab X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|82310400026|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?DkwXQ/xL+DOIb9X5Z9JMU/8uV3Wmy335zfONCjuKsg1VxN/phQ8sOhdNmBpP?= =?us-ascii?Q?jhuU8B3gkVYSktVo4aorZxDXp5N8VEtv1hXUIM7k2IKU9yfl5354iWEfY/Qp?= =?us-ascii?Q?F2XdX5m90spjlTXwtBGNu+0Y9ALsUM06CwZEVlTZd4OQklKnUd/6u+X4tukZ?= =?us-ascii?Q?rc+tF6CXB6myAbcKF5G8SjMivPSX3nX1IoJ9MUi8w3LwO05HUWGX95AoRtY9?= =?us-ascii?Q?pEpIK5Sd2DY/dw/9Itq5wdmFhTVZQHv0vpMmDCl6UeRTXCi2fYczRW+65/Qg?= =?us-ascii?Q?6wgvSlXi/3pEZb4VdSx7obal6yRZnOWKzTpmmCLD+yhmeifET8DwmHOzmfJs?= =?us-ascii?Q?pZE1TISx7+wBcp02H0Qk4F47dwVQoew8lz86Ul8mkeHDpvSjQwijFvVo9kyx?= =?us-ascii?Q?z+T96IpQ2Li+/PfodH4ay1gU0hlbRD8oTjT0Quh0YWkjaxlPPdNelHq8+hZ0?= =?us-ascii?Q?PIAn8YPoqXJWtW48S+MSTKDVJXm8ypVPjg2cp00uakzoiu5pfeL91h3kNw+L?= =?us-ascii?Q?oOZGQPeQEt234gg7Hv1LQ6FREMiHbu/ftjlT2O/L6U5j8XVbTrL3MHoeDb7I?= =?us-ascii?Q?jfpkBdb7fOQpOa4SXrhpoMMEgpR9a+G6jzc0ruf43AYpk4+609Izb2tjKgCP?= =?us-ascii?Q?wHlHxJJ248BN5Z/+IPloCTYt+RlZiUb8Ztt8uH8R0AngVIr6Ai6lv8mucVTe?= =?us-ascii?Q?uXbEeSdp4DTE7SpPAIurCz2lW6K4r0UGrig9VZHSAnuYSwN2ozOvTSSxZK8c?= =?us-ascii?Q?NUQSIX/VY8MkTNzIQtPZH+Gxk4NauGsm4L2CsZJyKQecy/M5LiQLE477QmJn?= =?us-ascii?Q?vW1X73+BGp7l4tTR8d+w654nnHaW2ccfDmugoUb1nkGP/7t12a/nrV1Q9Sds?= =?us-ascii?Q?S+qVC5gDaf6T9fcfWIm6MVvI0TdzieX4nNuKhS1W9f/brzX59JI8ep6aoF4n?= =?us-ascii?Q?jkITLBympElmuqKVSwgpcvM//k8d1xfOvTk2OUJi2goR3EqoR5b/MtbVegpw?= =?us-ascii?Q?g9P60j9y4eSDpMgDuZ2PRjxzv3iX2/rMZp1K+QU1XWoKhB/ePq288iYWlv15?= =?us-ascii?Q?xcV2DW2shdJLoMfwm8eRquiyu7BV3r1HCjkHfyM5rdtqw3DtStYg824y+K4w?= =?us-ascii?Q?HyICaGCatet3kDfKRWQDFxNJYyWYe+KCvAMI2oJVhwi0n+PlcnsUo0aKB2cN?= =?us-ascii?Q?olDUf6X6e5K20A0v12P1AQRhfXyI3uw0CfHC5ayGYPBGYt2m9J8oPKhK+N3m?= =?us-ascii?Q?vZqg703SiOyRDFwKNzSbJ7QCJ6BgtcyqC18DYCgOhmluYJRkWG0qq282IKMb?= =?us-ascii?Q?WA71U2DNbkHdCEE42eWjaj7GnsGsu98V302QNdwQT2CJzJOYk28PzOxeA8xv?= =?us-ascii?Q?Xh8oUKDasd4SbjYdmGwtCaQbvymXzTjW14RYxU9z/0yW49WJQu/zGYFwaBXQ?= =?us-ascii?Q?Iq3AeHoMRf248GdNxsQrzXAC9RFlTLal6bv1AgjpL9MQUalthNLnrj+DOoNJ?= =?us-ascii?Q?fdg/YyUIQIjYZ2cRa54M9LcgJ9qgejvngCOV?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(82310400026)(1800799024)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2025 03:14:10.3544 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 41651e16-6a74-483a-eab8-08ddbd0457ab X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ5PEPF000001EF.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4176 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1751858094628116600 Content-Type: text/plain; charset="utf-8" As function xsm_sysctl() is solely invoked in sysctl.c, we need to wrap around it with CONFIG_SYSCTL Signed-off-by: Penny Zheng Reviewed-by: Stefano Stabellini --- xen/include/xsm/xsm.h | 4 ++++ xen/xsm/dummy.c | 2 ++ xen/xsm/flask/hooks.c | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h index 24acc16125..22e2429f52 100644 --- a/xen/include/xsm/xsm.h +++ b/xen/include/xsm/xsm.h @@ -261,7 +261,11 @@ static inline int xsm_domctl(xsm_default_t def, struct= domain *d, =20 static inline int xsm_sysctl(xsm_default_t def, int cmd) { +#ifdef CONFIG_SYSCTL return alternative_call(xsm_ops.sysctl, cmd); +#else + return -EOPNOTSUPP; +#endif } =20 static inline int xsm_readconsole(xsm_default_t def, uint32_t clear) diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c index 93fbfc43cc..93a0665ecc 100644 --- a/xen/xsm/dummy.c +++ b/xen/xsm/dummy.c @@ -22,7 +22,9 @@ static const struct xsm_ops __initconst_cf_clobber dummy_= ops =3D { .sysctl_scheduler_op =3D xsm_sysctl_scheduler_op, .set_target =3D xsm_set_target, .domctl =3D xsm_domctl, +#ifdef CONFIG_SYSCTL .sysctl =3D xsm_sysctl, +#endif .readconsole =3D xsm_readconsole, =20 .evtchn_unbound =3D xsm_evtchn_unbound, diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c index 6a53487ea4..3a43e5a1d6 100644 --- a/xen/xsm/flask/hooks.c +++ b/xen/xsm/flask/hooks.c @@ -856,6 +856,7 @@ static int cf_check flask_domctl(struct domain *d, unsi= gned int cmd, } } =20 +#ifdef CONFIG_SYSCTL static int cf_check flask_sysctl(int cmd) { switch ( cmd ) @@ -933,6 +934,7 @@ static int cf_check flask_sysctl(int cmd) return avc_unknown_permission("sysctl", cmd); } } +#endif /* CONFIG_SYSCTL */ =20 static int cf_check flask_readconsole(uint32_t clear) { @@ -1884,7 +1886,9 @@ static const struct xsm_ops __initconst_cf_clobber fl= ask_ops =3D { .sysctl_scheduler_op =3D flask_sysctl_scheduler_op, .set_target =3D flask_set_target, .domctl =3D flask_domctl, +#ifdef CONFIG_SYSCTL .sysctl =3D flask_sysctl, +#endif .readconsole =3D flask_readconsole, =20 .evtchn_unbound =3D flask_evtchn_unbound, --=20 2.34.1 From nobody Thu Oct 30 23:12:08 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1751858093; cv=pass; d=zohomail.com; s=zohoarc; b=dzRgOdWwmw+N+fXVh8vPwEMVuNtkYVKkSytW4LBLz8zmdUo/WBA2PEfEWt+0OpvR94VZdVFMZ1yD8Sy+EfVYi2cDAj6p7x/pFgfQvsC1aL44hX3tN1Wd1VS2qIWkuYMwf3D4T7dLrWi/KpnY/8bVBZnzYYq3LhjEpqf0VrSzPIk= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751858093; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=HRS93Hqoh3N+utDDcTTMVxjdZcKA6NhPk5u7Ncd0IJ8=; b=TCFvfCJwiVrhtcvs4I6fjASVhU+ubTJ0H1rRS4ZhYxwzSrOPys9g4fU08GO1Ft3noaSMJANg2zX/L23CfBdU2hZzjNLKDhkvUAmFaLcDCUZi/E+tgycPNW9f7OKsJtqiujlpOBSbTnuSsVrfITOubJHAU/EwJhq6xBqsDr1eW6k= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1751858093486165.74079717446227; Sun, 6 Jul 2025 20:14:53 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1035074.1407289 (Exim 4.92) (envelope-from ) id 1uYcJD-0007oG-9P; Mon, 07 Jul 2025 03:14:23 +0000 Received: by outflank-mailman (output) from mailman id 1035074.1407289; Mon, 07 Jul 2025 03:14:23 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uYcJD-0007o9-65; Mon, 07 Jul 2025 03:14:23 +0000 Received: by outflank-mailman (input) for mailman id 1035074; Mon, 07 Jul 2025 03:14:21 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uYcJB-0007mT-O9 for xen-devel@lists.xenproject.org; Mon, 07 Jul 2025 03:14:21 +0000 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on20608.outbound.protection.outlook.com [2a01:111:f403:2414::608]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 78462a4e-5ae0-11f0-b894-0df219b8e170; Mon, 07 Jul 2025 05:14:19 +0200 (CEST) Received: from BY3PR10CA0026.namprd10.prod.outlook.com (2603:10b6:a03:255::31) by SJ0PR12MB8140.namprd12.prod.outlook.com (2603:10b6:a03:4e3::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8901.24; Mon, 7 Jul 2025 03:14:13 +0000 Received: from SJ5PEPF000001ED.namprd05.prod.outlook.com (2603:10b6:a03:255:cafe::9b) by BY3PR10CA0026.outlook.office365.com (2603:10b6:a03:255::31) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8901.26 via Frontend Transport; Mon, 7 Jul 2025 03:14:13 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by SJ5PEPF000001ED.mail.protection.outlook.com (10.167.242.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8901.15 via Frontend Transport; Mon, 7 Jul 2025 03:14:13 +0000 Received: from penny-System-Product-Name.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Sun, 6 Jul 2025 22:14:10 -0500 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 78462a4e-5ae0-11f0-b894-0df219b8e170 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=LWQi449MpRBq/6cZUZk44H2KQRCIstvI+a2UOkwB9eExboKKDA0yu65GrA4J5HiM5vZ9z7mfeIU0QZfKZal9wlzW5JTmXV8JbuclbyPXo6m9PnrW2WygdTnDLKIN586CKfU//QLQejvhlbguWEg5tKPxkLplFhByUGMXLl29z15fF9P+fErgN4Ews9ZMLVgUyGV3ylyVEgVcxYlz96grKj1yqoGs5p6h5cIwE43HIkf2I1eTzLJapWblA+qSX58u4phPVMf3WTWfFhKkpZBo4VyAjcnMPs15AC0xpvu3AmoTv5W6/F6eLgiTuX4e8LepXYvsaEfXi7DeFBZ8UzklRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=HRS93Hqoh3N+utDDcTTMVxjdZcKA6NhPk5u7Ncd0IJ8=; b=SWGmk3lTBPnJluHz6bul5zdNgbPe3M4mIzxEveEjaf8IliOiHU0HAQH0Lh3sFMhrOV6Kq9ioQTRmDGHbKzqKv0qppJ/1QDCOVMR3vefzopI5J+Uz5l8dF4ruBbP/mDr9Yp8FHvib9+2A8XxIKcl9VvItqUfJre1TNLCZJT1eTvg4xZZPqIExmw4pLoqHDQhvMXfgTRHmQoJSFt5wnUWfUmQuluaLCvH7UJx1+oPt9LG9KgKxCXrFv9AKryXoUZ7DmqXzFXY+ptdsB3llA1S7IZKI3LM1S8Vu1KYaArO1NUSQyfItySKA8LfH4vG0xpUd8gb7bWrBfnbKh+LyMiv5tw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HRS93Hqoh3N+utDDcTTMVxjdZcKA6NhPk5u7Ncd0IJ8=; b=2KDqq+OKfFAC0LbHyIOn8ifCLAdXFQiCyuum+W1WK2XX8O1Gfgrie5Ncb+2dIv8Bi082tsBNdp/iBXWD0kqblgT1JntXcUlV8TuaelNYp55FYqKhEg7VyhKEhRp4MCk4PvCWtK6QaArIydYoDcpMljA1v2i+7B9RJCWZKx+hmak= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C From: Penny Zheng To: CC: , Penny Zheng , Andrew Cooper , Anthony PERARD , Michal Orzel , Jan Beulich , "Julien Grall" , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Stefano Stabellini , "Daniel P. Smith" Subject: [PATCH 02/11] xen/sysctl: wrap around XEN_SYSCTL_readconsole Date: Mon, 7 Jul 2025 11:13:37 +0800 Message-ID: <20250707031346.901567-3-Penny.Zheng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250707031346.901567-1-Penny.Zheng@amd.com> References: <20250707031346.901567-1-Penny.Zheng@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ5PEPF000001ED:EE_|SJ0PR12MB8140:EE_ X-MS-Office365-Filtering-Correlation-Id: ef75b8a3-8339-4f45-94a5-08ddbd04597d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|1800799024|82310400026|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?PFd4UogxRLqXCD8QLwj45aG0lIlDsPfIqqS0VNLM3IuZ4itof7FWgI+zVj2I?= =?us-ascii?Q?y4QUYZjydHAHnaRsVm99fUPnq6+0u0euz7haYQRrROHCYoFNywedPmXHUoN2?= =?us-ascii?Q?kxA5qPo52MeML/HQwuY5IlBk+axyIq6guOgPNokOnmYvrcmn9Kw+s5y1Cxlz?= =?us-ascii?Q?ZiVSWwBuQ4MuQjg7hVifgTdMz7K/sghP875eBYQcu53lpldQTFa9RMroEhuz?= =?us-ascii?Q?TaFv3Z0zWqy+FlXKNly6M2xdUdJW9lhkxG8umDWXkMOn7ajORzcr8kdBGRyc?= =?us-ascii?Q?LOnHU3JsPPCjdeAmsGByOqDdWKmvHSENmhOQpdkCh19+KJqKyLW8kuhHOMc4?= =?us-ascii?Q?/lRZaW9WWP89xMDNgovJNqtcxMdb0YuI1zBYQgX169sSzq8M5r5HU042e6jo?= =?us-ascii?Q?B3aPmCZvRiTF98Dkj8ikgmMPcODJ1lSLiIjq0IQcJW6ucEmRuh4mYCtQq4A8?= =?us-ascii?Q?RteIc6wIrTKMfAD8gMePyC6kMD6B09LYtn+n645FL5VJm2tp7vp6+RWen12a?= =?us-ascii?Q?IT4VoFDNHdKBUnf7jSl9ORhSOX4z6Zvv58PEuQAkBlzqLN13DoFdzYog9nak?= =?us-ascii?Q?0J69g5MzxJGEkrl57JG90GDKk/BoV37LxEK3mFz2E0NDavIEztVpJwpsP+nu?= =?us-ascii?Q?JFR8dNx20MOFY9WBcp/7YOCKhlfGcAbW+adEaLDkaD7vLGzWOkCPgSY6PruG?= =?us-ascii?Q?wPJRvfJVvmTYODUUDDohMhK916W9dM5KyH5rVxg41ur6F9YVdCqHxw0aLvxn?= =?us-ascii?Q?5QBiDckOnk5CfjE/3hyHt/CQIOUUabt9F3fNjGYx3FBiS0vpJktT115yeF0P?= =?us-ascii?Q?P9VA6//tAVz35FO599HPRAABF1P7etQoFgrKgEDLMGRn79lCbiD7s1elSPb1?= =?us-ascii?Q?nfzLbG14iBhGQFBEJksklfoIncs/CmM6mBhi3S3Wy9InvIjcHyaRMKERdU4B?= =?us-ascii?Q?0x2rlG6c3pFiWeeH2tpGztZ/c0V8n83zag1tcpFcOcqFA9RjcBTTJyU7XECv?= =?us-ascii?Q?amXwnCuwQDX8VFJhQvir924vgHlI1kGdT+Um4qevfnVi/lGkoxmXrtAgLy2N?= =?us-ascii?Q?pIQwPJu+k1BGtQ+HP0cewbrxdk/kNTodlw4yOyocliYBg+pcyw4YTSeUm4Qo?= =?us-ascii?Q?4mew0HhWvw735pjxnl870RCH6vtorKdhn6KP5snkLdp6MRXvX8diV1K+g9Uj?= =?us-ascii?Q?5FyVonMzO+CLfYSQqrEIHXTO1CK8n98FQA1jGJYel4ROzwHEyZFE0Qu+sZ4T?= =?us-ascii?Q?Y23zpqnYzG2OPM8K8koDrVOMfe6USH3UpyoKOVe0246nLx7TBVSbAnb10TCf?= =?us-ascii?Q?sTXsZVtH3a0zbMx+mYETDoBnSx5Nk+mKIY3PsFEmeTOJ4N6/ym28fzES/kKw?= =?us-ascii?Q?lcD+NQCGN6se7K9Vief5lG3EMONRLSI1VZRa8jFc+lYjd1xt18SoK/ptRw+J?= =?us-ascii?Q?WM805tsI1VWocuZfuILAuRlk+JzBfEk/9MnVXETMncy/eMTP7ef8eScLHQDo?= =?us-ascii?Q?KoqfTm7r8qwYTrB2o3a/aabmXyd7VbKVvJAF?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(1800799024)(82310400026)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2025 03:14:13.4060 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ef75b8a3-8339-4f45-94a5-08ddbd04597d X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ5PEPF000001ED.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB8140 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1751858094655116600 Content-Type: text/plain; charset="utf-8" The following functions is to deal with XEN_SYSCTL_readconsole sub-op, and shall be wrapped: - xsm_readconsole() - read_console_ring() Signed-off-by: Penny Zheng Reviewed-by: Stefano Stabellini --- v2 -> v3: - move #endif up ahead of the blank line --- v3 -> v4: - remove transient "#ifdef CONFIG_SYSCTL" --- xen/drivers/char/console.c | 2 ++ xen/include/xsm/xsm.h | 4 ++++ xen/xsm/dummy.c | 2 +- xen/xsm/flask/hooks.c | 4 ++-- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c index ba5a809a99..c5afac9f72 100644 --- a/xen/drivers/char/console.c +++ b/xen/drivers/char/console.c @@ -368,6 +368,7 @@ static void conring_puts(const char *str, size_t len) conringc =3D conringp - conring_size; } =20 +#ifdef CONFIG_SYSCTL long read_console_ring(struct xen_sysctl_readconsole *op) { XEN_GUEST_HANDLE_PARAM(char) str; @@ -410,6 +411,7 @@ long read_console_ring(struct xen_sysctl_readconsole *o= p) =20 return 0; } +#endif /* CONFIG_SYSCTL */ =20 =20 /* diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h index 22e2429f52..042a99449f 100644 --- a/xen/include/xsm/xsm.h +++ b/xen/include/xsm/xsm.h @@ -270,7 +270,11 @@ static inline int xsm_sysctl(xsm_default_t def, int cm= d) =20 static inline int xsm_readconsole(xsm_default_t def, uint32_t clear) { +#ifdef CONFIG_SYSCTL return alternative_call(xsm_ops.readconsole, clear); +#else + return -EOPNOTSUPP; +#endif } =20 static inline int xsm_evtchn_unbound( diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c index 93a0665ecc..cd0e844fcf 100644 --- a/xen/xsm/dummy.c +++ b/xen/xsm/dummy.c @@ -24,8 +24,8 @@ static const struct xsm_ops __initconst_cf_clobber dummy_= ops =3D { .domctl =3D xsm_domctl, #ifdef CONFIG_SYSCTL .sysctl =3D xsm_sysctl, -#endif .readconsole =3D xsm_readconsole, +#endif =20 .evtchn_unbound =3D xsm_evtchn_unbound, .evtchn_interdomain =3D xsm_evtchn_interdomain, diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c index 3a43e5a1d6..df7e10775b 100644 --- a/xen/xsm/flask/hooks.c +++ b/xen/xsm/flask/hooks.c @@ -934,7 +934,6 @@ static int cf_check flask_sysctl(int cmd) return avc_unknown_permission("sysctl", cmd); } } -#endif /* CONFIG_SYSCTL */ =20 static int cf_check flask_readconsole(uint32_t clear) { @@ -945,6 +944,7 @@ static int cf_check flask_readconsole(uint32_t clear) =20 return domain_has_xen(current->domain, perms); } +#endif /* CONFIG_SYSCTL */ =20 static inline uint32_t resource_to_perm(uint8_t access) { @@ -1888,8 +1888,8 @@ static const struct xsm_ops __initconst_cf_clobber fl= ask_ops =3D { .domctl =3D flask_domctl, #ifdef CONFIG_SYSCTL .sysctl =3D flask_sysctl, -#endif .readconsole =3D flask_readconsole, +#endif =20 .evtchn_unbound =3D flask_evtchn_unbound, .evtchn_interdomain =3D flask_evtchn_interdomain, --=20 2.34.1 From nobody Thu Oct 30 23:12:08 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1751858083; cv=pass; d=zohomail.com; s=zohoarc; b=fr1KQ167+3iv4c7MHCv/zkzw6FduA0I13xeAN3Sp+lexC/tNytOXch9OOdMd3XfU7m6++PZ6BtS50pXC9r7u5MQtUwT5nka53kDmNSija2/6MfRV5m50KBx2cXj8dDwh6ml6l2NCBpdVPaZo0h5dCUsgN5VB0Q2TuibbjybQVyM= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751858083; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=NI/6AN7Kc6qmUPgrDZbatiRRdKNwzya65ykPb1EYoB8=; b=Cv8m1KISmZbupb8vQUBV2S7OMQGtYwtfX5DNz7sr7nubZbRqrvqywpz6h3uW9FJihIhu4dU27QW1+rnrT64sa4oaSHAEf/e9n9a8BZhHPJy3JoZ2VlOXoEnSSCw6980xovJUL4OklehJ9QcBZOVA4TOONUm5Xh4Sk/9EjP8pdm8= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1751858083807355.3153929620372; Sun, 6 Jul 2025 20:14:43 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1035075.1407299 (Exim 4.92) (envelope-from ) id 1uYcJH-00085f-HN; Mon, 07 Jul 2025 03:14:27 +0000 Received: by outflank-mailman (output) from mailman id 1035075.1407299; Mon, 07 Jul 2025 03:14: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 1uYcJH-00085T-DW; Mon, 07 Jul 2025 03:14:27 +0000 Received: by outflank-mailman (input) for mailman id 1035075; Mon, 07 Jul 2025 03:14:26 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uYcJF-0007mT-VJ for xen-devel@lists.xenproject.org; Mon, 07 Jul 2025 03:14:25 +0000 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2061f.outbound.protection.outlook.com [2a01:111:f403:2415::61f]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 7b11ad30-5ae0-11f0-b894-0df219b8e170; Mon, 07 Jul 2025 05:14:24 +0200 (CEST) Received: from CH2PR19CA0011.namprd19.prod.outlook.com (2603:10b6:610:4d::21) by CY5PR12MB6273.namprd12.prod.outlook.com (2603:10b6:930:22::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8901.23; Mon, 7 Jul 2025 03:14:21 +0000 Received: from CH1PEPF0000A34C.namprd04.prod.outlook.com (2603:10b6:610:4d:cafe::17) by CH2PR19CA0011.outlook.office365.com (2603:10b6:610:4d::21) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8901.26 via Frontend Transport; Mon, 7 Jul 2025 03:14:21 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by CH1PEPF0000A34C.mail.protection.outlook.com (10.167.244.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8901.15 via Frontend Transport; Mon, 7 Jul 2025 03:14:20 +0000 Received: from penny-System-Product-Name.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Sun, 6 Jul 2025 22:14:12 -0500 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 7b11ad30-5ae0-11f0-b894-0df219b8e170 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=dwRTx31fNS0k+ySHR82pduseSqVnUAloe067dW8j21Qc4k1nYT6lCyFiEcTDYoiHlH1ppsvAzoakpxqsgJ+BVBgtjMMng4DZ36ERXkzHZuX3zj/34vaaoqKl3x9yYnTUVS/uRSak5UzXS/UhMU5CQUhfaOjtDc8uX28ytod7UKOBbv8WGrO3z2urOAPEHK2wXemR6k8hX/imwDB91WNOMywSt6nuTMjprQCmMAzCZMkFMI6DSA/qTvUrm3ZYNRa0Xf6rnL5opaPKzO9llL0JLl4V+SEGC922Y/Z/anWRJ2B14RVUPb7ty7zSMqsTbAmZFcRB3VW81bPA/sQ9enlvXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=NI/6AN7Kc6qmUPgrDZbatiRRdKNwzya65ykPb1EYoB8=; b=GthoU+gVHfqPaPTJGotMGgEjz1u/LuqIyxId0hIsBv81Rd1SNSKyfl2iXOkZEHD7hvJiSKXZ4nXwHJVtVBRfipyMWCz4R2DR9eirFtnVif8KbVVJk1xE43qC8MESp4+Hz0cmQIX/v+npUvWYGJvl/z/ZjJ0FwzM4bqsnYbzWKomOBpkgni8bYTvGuHjbLyr6Et1wc9oT+TLEk9N98WZSoBrsXvPnCxzLyjZWT7JwsutYe4iKm1TMOdmvGM1lSodWGciyHWSNS61S1C0JMVAW4FVDljt3B92lZU7pLB0k4BPQ0r/nFsrXdRCsuY4AVlK8m0BA7DjH3Yauy7nsMb2v6Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NI/6AN7Kc6qmUPgrDZbatiRRdKNwzya65ykPb1EYoB8=; b=uvV1qFgClss0zb9xMQyJYJeQ+bOx/T3onbq+B9rKFw5s/RG2JQggXXG4b1VnYUD3ReK1gzGzcmF8SRBKArw6JTEAsFvji8rn3lPsZuaMYcIyuWciia4I80IHmzDx+miKLRk9hIDpFhJVk5rDNvMV5JPDRMljYor1erelaxYS5ZM= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C From: Penny Zheng To: CC: , Penny Zheng , Dario Faggioli , Juergen Gross , George Dunlap , Stefano Stabellini Subject: [PATCH 03/11] xen/sysctl: wrap around XEN_SYSCTL_sched_id Date: Mon, 7 Jul 2025 11:13:38 +0800 Message-ID: <20250707031346.901567-4-Penny.Zheng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250707031346.901567-1-Penny.Zheng@amd.com> References: <20250707031346.901567-1-Penny.Zheng@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH1PEPF0000A34C:EE_|CY5PR12MB6273:EE_ X-MS-Office365-Filtering-Correlation-Id: d361d738-d802-4d99-7f2a-08ddbd045d9a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|1800799024|36860700013|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?oXXp1ZfmQg310TuFb6ycfi0J6f6FOEGvm8n/cTfFu186HkTzIkqsVD8aYWDd?= =?us-ascii?Q?XVkA1DGF7wNWRnaYpnhaePD4p5MhY2Mr/OMYW5jxQ2azrI21ffdyQcQG1yDE?= =?us-ascii?Q?prSniRK0UTErF74x+y3nnNMiE7YL52nZpS50ciQ6W0mvYyLPBL/O2rpkHoii?= =?us-ascii?Q?Je04d2W85sWHdltiH41jQtZ9LuMyJxroC2Xf0pmpNucKYWy9o1MBBePWfkq1?= =?us-ascii?Q?zZMn4mVWKcpkJdBdjZTK+nqsU9cXYV6NV62XLtJlwmrQkmk1o+9WY0A2CqMl?= =?us-ascii?Q?IN3hpoyXMdBYF7tHI29AUukDFe2OAXSzjWlwWQT7Sgk2ZpQxytzTzrzaCGAz?= =?us-ascii?Q?N1RPWSMSCYegTKpskg+pviQXIKGqR08mRnxbYEDnNxc3gpb2mdmpGg9fPXUT?= =?us-ascii?Q?uDGX20hNDrOzaKeCPb/r1QP16dWmdzDpu0POe0kmNb1OG3WAg7HCkEqoOX2M?= =?us-ascii?Q?t7EucnhTBS898SeKGDfAaBgk1XPeBD8XWFxUJ7cZs4IdyMyLExHDMJbIwN3E?= =?us-ascii?Q?Kjdw/K8fmUgasw2j1UCKrfpNZOC4Dy3Icd/bvvrsxwVA7Dcyl3yQ6nnk0BnS?= =?us-ascii?Q?GGvMkyBEkaPkrbEpAM4YLLSZZTHu38DZul1dqUg7ZlRh/pzNnYK3k+c5p4ff?= =?us-ascii?Q?+JOZWW5frd9jnNFdufXlR8i7C1WFQptxhFadBfc5WS6JHozaqIEBtOZbWMmc?= =?us-ascii?Q?ophiHwM2BhOZcBqBmjlVx1+TLb4u/FzZ8RJRw8YehEQ8ZwfDMtCJ2jTepT/3?= =?us-ascii?Q?MqqXD29q4PViAMEQ45UomDS/FbkJ2r+gkktiyFlaoV/HplJllB8LKi3YdXKz?= =?us-ascii?Q?zzcNLznC4Pp6O+1x9dX+c13y3YcX089Qi3eTKKCvIpr1ZE+sqcicWaLrXDc7?= =?us-ascii?Q?bk1mt9pgcf4y1gg2jFLI4wCy4NMdAY385cd5c11psZaJjBxvhSnj8GiQmrNe?= =?us-ascii?Q?R9Csy3P6SGloeyUWjBOyaWpJtIJlkkfuSWMcgrMzkPaiWDh5DoGtlUMbRy4P?= =?us-ascii?Q?n2hTzKEWwvkRvS1frOhfNEtoj9bzkqqRQlO6MXOmOsS4cMMOAoaRW1O1T0By?= =?us-ascii?Q?lMu9XefUsKvtofY4J85mCERKq+aqp0XdyWF6R0yuQsqHQeaXUnGBNfHmsZF2?= =?us-ascii?Q?329+krS0yXLueS6Jg+T0SHhtn8hxNe66KQP9GQdU+7dDaPx2PosDodXvP2kC?= =?us-ascii?Q?KI42pIL7Ufr8e2NFK2kMcHQG5pe7fXrL1cUYA2NWRqhCrFdQthIewjLK6BX8?= =?us-ascii?Q?TeeEkG3XmFtprvnsgr5FeF8FER4MQWlp+K8l2Bd1NnG3k8vMvnd3pTLnM8X6?= =?us-ascii?Q?yEjBJYFvqzcnisGgr0/RuPpUqUE94b+D9xDL2f6kUg+POiHg+u3cUcjm5kCi?= =?us-ascii?Q?gvxJv8smckfB1N6KcBDFtZwzQcUDK0Egd1kRp/VLgN72/U7qiu1C9FSFdPVS?= =?us-ascii?Q?oF+uMxkCJgqJY5OMt4zlHoQC+W1OdZe9pmtPSXhS6EkCpe1ZYAhs97e7sOFn?= =?us-ascii?Q?iEKhnVPkPGKGPaSw+pmP/87nbMh/65ia+NJ4?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(1800799024)(36860700013)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2025 03:14:20.3866 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d361d738-d802-4d99-7f2a-08ddbd045d9a X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CH1PEPF0000A34C.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6273 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1751858084462116600 Content-Type: text/plain; charset="utf-8" The following function shall be wrapped: - scheduler_id() Signed-off-by: Penny Zheng Reviewed-by: Stefano Stabellini Reviewed-by: Juergen Gross --- v3 -> v4: - remove transient "#ifdef CONFIG_SYSCTL" --- xen/common/sched/core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c index 9043414290..13fdf57e57 100644 --- a/xen/common/sched/core.c +++ b/xen/common/sched/core.c @@ -2069,11 +2069,13 @@ long do_set_timer_op(s_time_t timeout) return 0; } =20 +#ifdef CONFIG_SYSCTL /* scheduler_id - fetch ID of current scheduler */ int scheduler_id(void) { return operations.sched_id; } +#endif =20 /* Adjust scheduling parameter for a given domain. */ long sched_adjust(struct domain *d, struct xen_domctl_scheduler_op *op) --=20 2.34.1 From nobody Thu Oct 30 23:12:08 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1751858088; cv=pass; d=zohomail.com; s=zohoarc; b=KaG6xcooNLe3tO8+FdRI11M1fe1QmhsNuNrYKNqoRiZwGV6hD0UwO1j/CQ3CV07xEjpesiy5U89FwxXyVYQ0GYCJWPEngk7FBzDOMnOcDaX1GabhxaXcLHubpYZN9g6hZdvHJI3G84+bVZA84oePYcpWdDOM+rFTOcEwUeTF+cE= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751858088; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=fjBjwzQvK9KurSiD54b/HMv1xsZfRKNv7qqjNVhJj5E=; b=dW1QP/IQZ6xGdP+8FCOMCyNZm75fnuNrRLnRDN7kLHVJ/efIrqRrebLoSfXcppygC61og8CTk0IRPdUQEqel/kMnUJAulqircOES403qxZlR31OmmKyB89aNKwE7cdO7mzlWsjgBAfZtSBPXIEQgiqSToyg35jJ+bueXNgpRBlk= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1751858088077833.7488694399816; Sun, 6 Jul 2025 20:14:48 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1035077.1407309 (Exim 4.92) (envelope-from ) id 1uYcJJ-0008Na-VS; Mon, 07 Jul 2025 03:14:29 +0000 Received: by outflank-mailman (output) from mailman id 1035077.1407309; Mon, 07 Jul 2025 03:14:29 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uYcJJ-0008NT-QI; Mon, 07 Jul 2025 03:14:29 +0000 Received: by outflank-mailman (input) for mailman id 1035077; Mon, 07 Jul 2025 03:14:28 +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 1uYcJI-0007KZ-Dz for xen-devel@lists.xenproject.org; Mon, 07 Jul 2025 03:14:28 +0000 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on20619.outbound.protection.outlook.com [2a01:111:f403:2009::619]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 7c9d5a6e-5ae0-11f0-a316-13f23c93f187; Mon, 07 Jul 2025 05:14:27 +0200 (CEST) Received: from CH2PR19CA0030.namprd19.prod.outlook.com (2603:10b6:610:4d::40) by MW3PR12MB4428.namprd12.prod.outlook.com (2603:10b6:303:57::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8901.23; Mon, 7 Jul 2025 03:14:23 +0000 Received: from CH1PEPF0000A34C.namprd04.prod.outlook.com (2603:10b6:610:4d:cafe::38) by CH2PR19CA0030.outlook.office365.com (2603:10b6:610:4d::40) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8901.27 via Frontend Transport; Mon, 7 Jul 2025 03:14:22 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by CH1PEPF0000A34C.mail.protection.outlook.com (10.167.244.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8901.15 via Frontend Transport; Mon, 7 Jul 2025 03:14:22 +0000 Received: from penny-System-Product-Name.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Sun, 6 Jul 2025 22:14:15 -0500 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 7c9d5a6e-5ae0-11f0-a316-13f23c93f187 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=GWvNN1xuiqcL0zdnEz7A1PcMZTkLVrf7XTDt1o1Wz1DUoXv3oOMwjUkW8/O4Oh7SHsGrbOuMZSQ6zfTQD7dx5UBd2BS4Z//tSvIJW0bLb4P5N/NXuozcSzgR/CsldwDBAGH1yBaa7C+yHt8xc1gc5op1rgop5CzqqiHKMlgAiYMTZ40pASW8v/CO83z9umN9+Pexn+hh9TVGrSb7mOFKqJkuRgFXcu8pwDzzAHJIRi1TsjjpGxbyEC47Xnbca8HYdanW6x2HJfok7bxNeoqSK8BWUE/ZY2XxZLs9oegOUnNgB/VdCBumpH12hfHJGOj4Em08vLV743+5wnHFky2QZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=fjBjwzQvK9KurSiD54b/HMv1xsZfRKNv7qqjNVhJj5E=; b=eKnJokeGujLZXOEm+PahOwg5hjD3bvp/J84qyPLz2qI8eILgWvvF89uQnZTogKmRx83VFj8YWAfyChMSCDqxbdn5COOTpa6ylnsx2YP7/Xcwuz8VBwzPfZ4DuO0UQ7A6XCY0GqnaYAgwb1q5h20ktNirNniYq+R5ZRUtD8o46zBvC8MjYV4KoXFHVFJzk6FVMVhR/I/FsVMS8FDFmHMtGacUNHbs0YneZQycJpctZxbsH8EtbieC5YKFb6UE8od9mv8zkE/G1sV4C0jPc+ML+M7F66FFx5IKlgnTnxyJJGIFbdobzy1NTizgzcPukRvcYyG58GBRXqvU4mQqxmWCYQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fjBjwzQvK9KurSiD54b/HMv1xsZfRKNv7qqjNVhJj5E=; b=VDpjC5NQz6mm3hOwgGHZoS+1I9S4gZZMprZlXI3NOLL/VazISK039C3fE1WQYe0flWvArwWMcN5+ZAKk9kztnFemOSJ5q7MyaFLWtDReeBlLr3E3EcBRqDVwiAaKrt2giR2UEjXXeBRPxud3pvvZUlfFTbL6zw5IFQPG7nVPGbQ= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C From: Penny Zheng To: CC: , Penny Zheng , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Anthony PERARD , Michal Orzel , "Julien Grall" , Stefano Stabellini Subject: [PATCH 04/11] xen/pmstat: introduce CONFIG_PM_OP Date: Mon, 7 Jul 2025 11:13:39 +0800 Message-ID: <20250707031346.901567-5-Penny.Zheng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250707031346.901567-1-Penny.Zheng@amd.com> References: <20250707031346.901567-1-Penny.Zheng@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH1PEPF0000A34C:EE_|MW3PR12MB4428:EE_ X-MS-Office365-Filtering-Correlation-Id: ed62e7d6-c6b0-4078-e6ee-08ddbd045f08 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|82310400026|36860700013|1800799024; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?fw1w/YlaccOVSqlq34ZATzlpfRCawngNbzC1sGC1+k6gI0NVd6n3oZvgKc2O?= =?us-ascii?Q?bmrz0sE12CAs0tVggwJYIsqBO18UDwbdGVGhQ5jmZfN8gwPw/zTJaSGOrvYr?= =?us-ascii?Q?kthWpAUJn6mtgjz3LbeF31IE+OeiSfv4tfi4Qj0pBSHwSESSdAwNrND9znE1?= =?us-ascii?Q?aGo5W68CBs7Y+nPWUN9Te9kNMCek2bq2tvnTvyPWjkAIBx3IW5PeLV3cOKzi?= =?us-ascii?Q?cdTa9L61fjSYyShKOEXKRBhS1z9j9jHqYqp/VeyH9Syu2QEWMIUaZQtveP9h?= =?us-ascii?Q?M3ix7XA3p3DpUeMDfRBkQZ3NhLAlWK0PdT3NyXHQgw4LZKQ3hhw3RuxfvWsP?= =?us-ascii?Q?9qT6nNrp/H2TMcL4omxM/2kDeGMZ1DNgb0yezf7cB0ZPDrbDe3ZuIAXRiZzW?= =?us-ascii?Q?ctTEtYirf83LLTAwFmUF9hotHzpIO4z4sId4s7x/k61yFy/QOCD+jlG+IGqn?= =?us-ascii?Q?oWsXbhg82ue56KBp+krnCMmuwiBI/iXm7OBAuCpCDkDkoF9oKurfHYa7sybE?= =?us-ascii?Q?d0RdxEIVjM/j/2qzcL4zi/OXCebkNpU9+Lxt/3R+oqfFMs/Ab1locnZf+lO0?= =?us-ascii?Q?YD0y3OxFzNkNuKy6Bi6Zk0T2rO1YwC6q/c9kVFQlKzDjUmlDx80l9CGyvoTx?= =?us-ascii?Q?ntLex0EDfJPW2xO9qvNej5uLIjsDpYx/XkWYjhjIJc5CiyvwkHzkHc51vdQT?= =?us-ascii?Q?U+71o58igSD7rhdeGOVc4AX1RK30oHNEMXGTWvL/u+auLM+m8SFqkDFMKOoF?= =?us-ascii?Q?kZ7qhMnQyrS8BJXuJ0d7IrPFhDkR7eGO1rb6efsf9/mkE7uAcjuQowaoHkwh?= =?us-ascii?Q?180X4eNe7eptRtUo0AazckdUZR0g0+JF3BPq3ViDTcWZyhxQObDSdmSUyAIs?= =?us-ascii?Q?g+xMS2npLgWBwTP6WplG39r/zHJbeRCsLViVtEyjb+DkrIvRnIt5fMwj1whx?= =?us-ascii?Q?IGfDxLmDGXhO3zliRHjPKtUtUuQaws7j5yFR6NzpCN4PgI5lHPrAzH/eeIcT?= =?us-ascii?Q?LADz+HEnwMttIkZhcWe144o1ioOWXMm9WnideaiKS17Y9NNGHnOPXkUWxfr/?= =?us-ascii?Q?PdGyunT7Ep+1sGbWc5JnJZph8xiFQmWOmSh5D3gaPYKK78sOrPpRg2fnO3Ad?= =?us-ascii?Q?GAaZb6FC6mOS/IKKdelJBlGY2tzxfM0zEZJtaMXlQinSQ9+kHPFmQSzsrgc5?= =?us-ascii?Q?02YWxLMFQZtkp/2nyNbIzX1rJ4p5GNgrdNBMoXg7AnXQXF3NZfFs4J5CPK7d?= =?us-ascii?Q?h+A6Fg/bEbkJ3R87r0Hz9Q9hleIKdBB7/Q+iDFB6pJLvq1KDPwFYkQyR2ZVG?= =?us-ascii?Q?SJZ+IOf/JNnkpRqNi+xQL255joIpBf38FIf2ZgnnFpQPX2GtfaNaeQlT9AV9?= =?us-ascii?Q?TMSwYaBZtLTP7n7wroYblobHRZIn4Qw2+xggyEmWnO3MSNw6sq3frlOSZmHc?= =?us-ascii?Q?c0V87ySCzzJ4+g1KBrL+3hE5MCnvLSRz7kCjDrMsjVZEnUwclOx+2PPeqVj2?= =?us-ascii?Q?5euufyd2W2eKa6iG7+J8jA2mgxsmV8egt8FS?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(82310400026)(36860700013)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2025 03:14:22.7876 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ed62e7d6-c6b0-4078-e6ee-08ddbd045f08 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CH1PEPF0000A34C.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4428 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1751858088628116600 Content-Type: text/plain; charset="utf-8" We move the following functions into a new file drivers/acpi/pm-op.c, as they are all more fitting in performance controling and only called by do_pm_op(): - get_cpufreq_para() - set_cpufreq_para() - set_cpufreq_gov() - set_cpufreq_cppc() - cpufreq_driver_getavg() - cpufreq_update_turbo() - cpufreq_get_turbo_status() We introduce a new Kconfig CONFIG_PM_OP to wrap the new file. Also, although the following helpers are only called by do_pm_op(), they ha= ve dependency on local variable, we wrap them with CONFIG_PM_OP in place: - write_userspace_scaling_setspeed() - write_ondemand_sampling_rate() - write_ondemand_up_threshold() - get_cpufreq_ondemand_para() - cpufreq_driver.update() - get_hwp_para() Various style corrections shall be applied at the same time while moving th= ese functions, including: - add extra space before and after bracket of if() and switch() - fix indentation - drop all the unnecessary inner figure braces We shall also provide "# CONFIG_PM_OP is not set" in preset configs for PV shim on x86. Signed-off-by: Penny Zheng Reviewed-by: Stefano Stabellini Acked-by: Jan Beulich --- v2 -> v3 - new commit --- v3 -> v4: - rename the file to pm-op.c - drop all the unnecessary inner figure braces - be consistent with the comment on the #endif --- v4 -> v5: - add blank line before endmenu --- v5 -> v6: - rebase changes from "xen/cpufreq: normalize hwp driver check with hwp_act= ive()" and "xen/cpufreq: move "init" flag into common structure" - add "# CONFIG_PM_OP is not set" in preset configs for PV shim on x86 --- xen/arch/x86/acpi/cpufreq/hwp.c | 6 + xen/arch/x86/acpi/cpufreq/powernow.c | 4 + xen/arch/x86/configs/pvshim_defconfig | 1 + xen/common/Kconfig | 8 + xen/common/sysctl.c | 2 + xen/drivers/acpi/Makefile | 1 + xen/drivers/acpi/pm-op.c | 395 +++++++++++++++++++ xen/drivers/acpi/pmstat.c | 355 ----------------- xen/drivers/cpufreq/cpufreq_misc_governors.c | 2 + xen/drivers/cpufreq/cpufreq_ondemand.c | 2 + xen/drivers/cpufreq/utility.c | 41 -- xen/include/acpi/cpufreq/cpufreq.h | 3 - 12 files changed, 421 insertions(+), 399 deletions(-) create mode 100644 xen/drivers/acpi/pm-op.c diff --git a/xen/arch/x86/acpi/cpufreq/hwp.c b/xen/arch/x86/acpi/cpufreq/hw= p.c index d5fa3d47ca..e4c09244ab 100644 --- a/xen/arch/x86/acpi/cpufreq/hwp.c +++ b/xen/arch/x86/acpi/cpufreq/hwp.c @@ -466,6 +466,7 @@ static int cf_check hwp_cpufreq_cpu_exit(struct cpufreq= _policy *policy) return 0; } =20 +#ifdef CONFIG_PM_OP /* * The SDM reads like turbo should be disabled with MSR_IA32_PERF_CTL and * PERF_CTL_TURBO_DISENGAGE, but that does not seem to actually work, at l= east @@ -508,6 +509,7 @@ static int cf_check hwp_cpufreq_update(unsigned int cpu= , struct cpufreq_policy * =20 return per_cpu(hwp_drv_data, cpu)->ret; } +#endif /* CONFIG_PM_OP */ =20 static const struct cpufreq_driver __initconst_cf_clobber hwp_cpufreq_driver =3D { @@ -516,9 +518,12 @@ hwp_cpufreq_driver =3D { .target =3D hwp_cpufreq_target, .init =3D hwp_cpufreq_cpu_init, .exit =3D hwp_cpufreq_cpu_exit, +#ifdef CONFIG_PM_OP .update =3D hwp_cpufreq_update, +#endif }; =20 +#ifdef CONFIG_PM_OP int get_hwp_para(unsigned int cpu, struct xen_cppc_para *cppc_para) { @@ -639,6 +644,7 @@ int set_hwp_para(struct cpufreq_policy *policy, =20 return hwp_cpufreq_target(policy, 0, 0); } +#endif /* CONFIG_PM_OP */ =20 int __init hwp_register_driver(void) { diff --git a/xen/arch/x86/acpi/cpufreq/powernow.c b/xen/arch/x86/acpi/cpufr= eq/powernow.c index 69364e1855..12fca45b45 100644 --- a/xen/arch/x86/acpi/cpufreq/powernow.c +++ b/xen/arch/x86/acpi/cpufreq/powernow.c @@ -49,6 +49,7 @@ static void cf_check transition_pstate(void *pstate) wrmsrl(MSR_PSTATE_CTRL, *(unsigned int *)pstate); } =20 +#ifdef CONFIG_PM_OP static void cf_check update_cpb(void *data) { struct cpufreq_policy *policy =3D data; @@ -77,6 +78,7 @@ static int cf_check powernow_cpufreq_update( =20 return 0; } +#endif /* CONFIG_PM_OP */ =20 static int cf_check powernow_cpufreq_target( struct cpufreq_policy *policy, @@ -324,7 +326,9 @@ powernow_cpufreq_driver =3D { .target =3D powernow_cpufreq_target, .init =3D powernow_cpufreq_cpu_init, .exit =3D powernow_cpufreq_cpu_exit, +#ifdef CONFIG_PM_OP .update =3D powernow_cpufreq_update +#endif }; =20 unsigned int __init powernow_register_driver(void) diff --git a/xen/arch/x86/configs/pvshim_defconfig b/xen/arch/x86/configs/p= vshim_defconfig index 2ad27f898e..bacd04c963 100644 --- a/xen/arch/x86/configs/pvshim_defconfig +++ b/xen/arch/x86/configs/pvshim_defconfig @@ -26,3 +26,4 @@ CONFIG_EXPERT=3Dy # CONFIG_INTEL_IOMMU is not set # CONFIG_DEBUG is not set # CONFIG_GDBSX is not set +# CONFIG_PM_OP is not set diff --git a/xen/common/Kconfig b/xen/common/Kconfig index 6d784da839..ed907de268 100644 --- a/xen/common/Kconfig +++ b/xen/common/Kconfig @@ -620,4 +620,12 @@ config SYSCTL =20 endmenu =20 +config PM_OP + bool "Enable Performance Management Operation" + depends on ACPI && HAS_CPUFREQ && SYSCTL + default y + help + This option shall enable userspace performance management control + to do power/performance analyzing and tuning. + endmenu diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c index c2d99ae12e..daf57fbe56 100644 --- a/xen/common/sysctl.c +++ b/xen/common/sysctl.c @@ -174,7 +174,9 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_s= ysctl) case XEN_SYSCTL_get_pmstat: ret =3D do_get_pm_info(&op->u.get_pmstat); break; +#endif =20 +#ifdef CONFIG_PM_OP case XEN_SYSCTL_pm_op: ret =3D do_pm_op(&op->u.pm_op); if ( ret =3D=3D -EAGAIN ) diff --git a/xen/drivers/acpi/Makefile b/xen/drivers/acpi/Makefile index 2fc5230253..1d811a51a7 100644 --- a/xen/drivers/acpi/Makefile +++ b/xen/drivers/acpi/Makefile @@ -6,6 +6,7 @@ obj-bin-y +=3D tables.init.o obj-$(CONFIG_ACPI_NUMA) +=3D numa.o obj-y +=3D osl.o obj-$(CONFIG_HAS_CPUFREQ) +=3D pmstat.o +obj-$(CONFIG_PM_OP) +=3D pm-op.o =20 obj-$(CONFIG_X86) +=3D hwregs.o obj-$(CONFIG_X86) +=3D reboot.o diff --git a/xen/drivers/acpi/pm-op.c b/xen/drivers/acpi/pm-op.c new file mode 100644 index 0000000000..a1f3c4193f --- /dev/null +++ b/xen/drivers/acpi/pm-op.c @@ -0,0 +1,395 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +/* + * 1. Get PM parameter + * 2. Provide user PM control + */ +static int cpufreq_update_turbo(unsigned int cpu, int new_state) +{ + struct cpufreq_policy *policy; + int curr_state; + int ret =3D 0; + + if ( new_state !=3D CPUFREQ_TURBO_ENABLED && + new_state !=3D CPUFREQ_TURBO_DISABLED ) + return -EINVAL; + + policy =3D per_cpu(cpufreq_cpu_policy, cpu); + if ( !policy ) + return -EACCES; + + if ( policy->turbo =3D=3D CPUFREQ_TURBO_UNSUPPORTED ) + return -EOPNOTSUPP; + + curr_state =3D policy->turbo; + if ( curr_state =3D=3D new_state ) + return 0; + + policy->turbo =3D new_state; + if ( cpufreq_driver.update ) + { + ret =3D alternative_call(cpufreq_driver.update, cpu, policy); + if ( ret ) + policy->turbo =3D curr_state; + } + + return ret; +} + +static int cpufreq_get_turbo_status(unsigned int cpu) +{ + struct cpufreq_policy *policy; + + policy =3D per_cpu(cpufreq_cpu_policy, cpu); + return policy && policy->turbo =3D=3D CPUFREQ_TURBO_ENABLED; +} + +static int read_scaling_available_governors(char *scaling_available_govern= ors, + unsigned int size) +{ + unsigned int i =3D 0; + struct cpufreq_governor *t; + + if ( !scaling_available_governors ) + return -EINVAL; + + list_for_each_entry(t, &cpufreq_governor_list, governor_list) + { + i +=3D scnprintf(&scaling_available_governors[i], + CPUFREQ_NAME_LEN, "%s ", t->name); + if ( i > size ) + return -EINVAL; + } + scaling_available_governors[i-1] =3D '\0'; + + return 0; +} + +static int get_cpufreq_para(struct xen_sysctl_pm_op *op) +{ + uint32_t ret =3D 0; + const struct processor_pminfo *pmpt; + struct cpufreq_policy *policy; + uint32_t gov_num =3D 0; + uint32_t *data; + char *scaling_available_governors; + struct list_head *pos; + unsigned int cpu, i =3D 0; + + pmpt =3D processor_pminfo[op->cpuid]; + policy =3D per_cpu(cpufreq_cpu_policy, op->cpuid); + + if ( !pmpt || !pmpt->perf.states || + !policy || !policy->governor ) + return -EINVAL; + + list_for_each(pos, &cpufreq_governor_list) + gov_num++; + + if ( (op->u.get_para.cpu_num !=3D cpumask_weight(policy->cpus)) || + (op->u.get_para.freq_num !=3D pmpt->perf.state_count) || + (op->u.get_para.gov_num !=3D gov_num) ) + { + op->u.get_para.cpu_num =3D cpumask_weight(policy->cpus); + op->u.get_para.freq_num =3D pmpt->perf.state_count; + op->u.get_para.gov_num =3D gov_num; + return -EAGAIN; + } + + if ( !(data =3D xzalloc_array(uint32_t, + max(op->u.get_para.cpu_num, + op->u.get_para.freq_num))) ) + return -ENOMEM; + + for_each_cpu(cpu, policy->cpus) + data[i++] =3D cpu; + ret =3D copy_to_guest(op->u.get_para.affected_cpus, + data, op->u.get_para.cpu_num); + + for ( i =3D 0; i < op->u.get_para.freq_num; i++ ) + data[i] =3D pmpt->perf.states[i].core_frequency * 1000; + ret +=3D copy_to_guest(op->u.get_para.scaling_available_frequencies, + data, op->u.get_para.freq_num); + + xfree(data); + if ( ret ) + return -EFAULT; + + op->u.get_para.cpuinfo_cur_freq =3D + cpufreq_driver.get ? alternative_call(cpufreq_driver.get, op->cpui= d) + : policy->cur; + op->u.get_para.cpuinfo_max_freq =3D policy->cpuinfo.max_freq; + op->u.get_para.cpuinfo_min_freq =3D policy->cpuinfo.min_freq; + op->u.get_para.turbo_enabled =3D cpufreq_get_turbo_status(op->cpuid); + + if ( cpufreq_driver.name[0] ) + strlcpy(op->u.get_para.scaling_driver, + cpufreq_driver.name, CPUFREQ_NAME_LEN); + else + strlcpy(op->u.get_para.scaling_driver, "Unknown", CPUFREQ_NAME_LEN= ); + + if ( hwp_active() ) + ret =3D get_hwp_para(policy->cpu, &op->u.get_para.u.cppc_para); + else + { + if ( !(scaling_available_governors =3D + xzalloc_array(char, gov_num * CPUFREQ_NAME_LEN)) ) + return -ENOMEM; + if ( (ret =3D read_scaling_available_governors( + scaling_available_governors, + (gov_num * CPUFREQ_NAME_LEN * + sizeof(*scaling_available_governors)))) ) + { + xfree(scaling_available_governors); + return ret; + } + ret =3D copy_to_guest(op->u.get_para.scaling_available_governors, + scaling_available_governors, + gov_num * CPUFREQ_NAME_LEN); + xfree(scaling_available_governors); + if ( ret ) + return -EFAULT; + + op->u.get_para.u.s.scaling_cur_freq =3D policy->cur; + op->u.get_para.u.s.scaling_max_freq =3D policy->max; + op->u.get_para.u.s.scaling_min_freq =3D policy->min; + + if ( policy->governor->name[0] ) + strlcpy(op->u.get_para.u.s.scaling_governor, + policy->governor->name, CPUFREQ_NAME_LEN); + else + strlcpy(op->u.get_para.u.s.scaling_governor, "Unknown", + CPUFREQ_NAME_LEN); + + /* governor specific para */ + if ( !strncasecmp(op->u.get_para.u.s.scaling_governor, + "userspace", CPUFREQ_NAME_LEN) ) + op->u.get_para.u.s.u.userspace.scaling_setspeed =3D policy->cu= r; + + if ( !strncasecmp(op->u.get_para.u.s.scaling_governor, + "ondemand", CPUFREQ_NAME_LEN) ) + ret =3D get_cpufreq_ondemand_para( + &op->u.get_para.u.s.u.ondemand.sampling_rate_max, + &op->u.get_para.u.s.u.ondemand.sampling_rate_min, + &op->u.get_para.u.s.u.ondemand.sampling_rate, + &op->u.get_para.u.s.u.ondemand.up_threshold); + } + + return ret; +} + +static int set_cpufreq_gov(struct xen_sysctl_pm_op *op) +{ + struct cpufreq_policy new_policy, *old_policy; + + old_policy =3D per_cpu(cpufreq_cpu_policy, op->cpuid); + if ( !old_policy ) + return -EINVAL; + + memcpy(&new_policy, old_policy, sizeof(struct cpufreq_policy)); + + new_policy.governor =3D __find_governor(op->u.set_gov.scaling_governor= ); + if ( new_policy.governor =3D=3D NULL ) + return -EINVAL; + + return __cpufreq_set_policy(old_policy, &new_policy); +} + +static int set_cpufreq_para(struct xen_sysctl_pm_op *op) +{ + int ret =3D 0; + struct cpufreq_policy *policy; + + policy =3D per_cpu(cpufreq_cpu_policy, op->cpuid); + + if ( !policy || !policy->governor ) + return -EINVAL; + + if ( hwp_active() ) + return -EOPNOTSUPP; + + switch( op->u.set_para.ctrl_type ) + { + case SCALING_MAX_FREQ: + { + struct cpufreq_policy new_policy; + + memcpy(&new_policy, policy, sizeof(struct cpufreq_policy)); + new_policy.max =3D op->u.set_para.ctrl_value; + ret =3D __cpufreq_set_policy(policy, &new_policy); + + break; + } + + case SCALING_MIN_FREQ: + { + struct cpufreq_policy new_policy; + + memcpy(&new_policy, policy, sizeof(struct cpufreq_policy)); + new_policy.min =3D op->u.set_para.ctrl_value; + ret =3D __cpufreq_set_policy(policy, &new_policy); + + break; + } + + case SCALING_SETSPEED: + { + unsigned int freq =3Dop->u.set_para.ctrl_value; + + if ( !strncasecmp(policy->governor->name, + "userspace", CPUFREQ_NAME_LEN) ) + ret =3D write_userspace_scaling_setspeed(op->cpuid, freq); + else + ret =3D -EINVAL; + + break; + } + + case SAMPLING_RATE: + { + unsigned int sampling_rate =3D op->u.set_para.ctrl_value; + + if ( !strncasecmp(policy->governor->name, + "ondemand", CPUFREQ_NAME_LEN) ) + ret =3D write_ondemand_sampling_rate(sampling_rate); + else + ret =3D -EINVAL; + + break; + } + + case UP_THRESHOLD: + { + unsigned int up_threshold =3D op->u.set_para.ctrl_value; + + if ( !strncasecmp(policy->governor->name, + "ondemand", CPUFREQ_NAME_LEN) ) + ret =3D write_ondemand_up_threshold(up_threshold); + else + ret =3D -EINVAL; + + break; + } + + default: + ret =3D -EINVAL; + break; + } + + return ret; +} + +static int set_cpufreq_cppc(struct xen_sysctl_pm_op *op) +{ + struct cpufreq_policy *policy =3D per_cpu(cpufreq_cpu_policy, op->cpui= d); + + if ( !policy || !policy->governor ) + return -ENOENT; + + if ( !hwp_active() ) + return -EOPNOTSUPP; + + return set_hwp_para(policy, &op->u.set_cppc); +} + +int do_pm_op(struct xen_sysctl_pm_op *op) +{ + int ret =3D 0; + const struct processor_pminfo *pmpt; + + switch ( op->cmd ) + { + case XEN_SYSCTL_pm_op_set_sched_opt_smt: + { + uint32_t saved_value =3D sched_smt_power_savings; + + if ( op->cpuid !=3D 0 ) + return -EINVAL; + sched_smt_power_savings =3D !!op->u.set_sched_opt_smt; + op->u.set_sched_opt_smt =3D saved_value; + return 0; + } + + case XEN_SYSCTL_pm_op_get_max_cstate: + BUILD_BUG_ON(XEN_SYSCTL_CX_UNLIMITED !=3D UINT_MAX); + if ( op->cpuid =3D=3D 0 ) + op->u.get_max_cstate =3D acpi_get_cstate_limit(); + else if ( op->cpuid =3D=3D 1 ) + op->u.get_max_cstate =3D acpi_get_csubstate_limit(); + else + ret =3D -EINVAL; + return ret; + + case XEN_SYSCTL_pm_op_set_max_cstate: + if ( op->cpuid =3D=3D 0 ) + acpi_set_cstate_limit(op->u.set_max_cstate); + else if ( op->cpuid =3D=3D 1 ) + acpi_set_csubstate_limit(op->u.set_max_cstate); + else + ret =3D -EINVAL; + return ret; + } + + if ( op->cpuid >=3D nr_cpu_ids || !cpu_online(op->cpuid) ) + return -EINVAL; + pmpt =3D processor_pminfo[op->cpuid]; + + switch ( op->cmd & PM_PARA_CATEGORY_MASK ) + { + case CPUFREQ_PARA: + if ( !(xen_processor_pmbits & XEN_PROCESSOR_PM_PX) ) + return -ENODEV; + if ( !pmpt || !(pmpt->init & XEN_PX_INIT) ) + return -EINVAL; + break; + } + + switch ( op->cmd ) + { + case GET_CPUFREQ_PARA: + ret =3D get_cpufreq_para(op); + break; + + case SET_CPUFREQ_GOV: + ret =3D set_cpufreq_gov(op); + break; + + case SET_CPUFREQ_PARA: + ret =3D set_cpufreq_para(op); + break; + + case SET_CPUFREQ_CPPC: + ret =3D set_cpufreq_cppc(op); + break; + + case GET_CPUFREQ_AVGFREQ: + op->u.get_avgfreq =3D cpufreq_driver_getavg(op->cpuid, USR_GETAVG); + break; + + case XEN_SYSCTL_pm_op_enable_turbo: + ret =3D cpufreq_update_turbo(op->cpuid, CPUFREQ_TURBO_ENABLED); + break; + + case XEN_SYSCTL_pm_op_disable_turbo: + ret =3D cpufreq_update_turbo(op->cpuid, CPUFREQ_TURBO_DISABLED); + break; + + default: + printk("not defined sub-hypercall @ do_pm_op\n"); + ret =3D -ENOSYS; + break; + } + + return ret; +} diff --git a/xen/drivers/acpi/pmstat.c b/xen/drivers/acpi/pmstat.c index e276d55c97..da7a1f81e1 100644 --- a/xen/drivers/acpi/pmstat.c +++ b/xen/drivers/acpi/pmstat.c @@ -337,358 +337,3 @@ int do_get_pm_info(struct xen_sysctl_get_pmstat *op) =20 return ret; } - -/* - * 1. Get PM parameter - * 2. Provide user PM control - */ -static int read_scaling_available_governors(char *scaling_available_govern= ors, - unsigned int size) -{ - unsigned int i =3D 0; - struct cpufreq_governor *t; - - if ( !scaling_available_governors ) - return -EINVAL; - - list_for_each_entry(t, &cpufreq_governor_list, governor_list) - { - i +=3D scnprintf(&scaling_available_governors[i], - CPUFREQ_NAME_LEN, "%s ", t->name); - if ( i > size ) - return -EINVAL; - } - scaling_available_governors[i-1] =3D '\0'; - - return 0; -} - -static int get_cpufreq_para(struct xen_sysctl_pm_op *op) -{ - uint32_t ret =3D 0; - const struct processor_pminfo *pmpt; - struct cpufreq_policy *policy; - uint32_t gov_num =3D 0; - uint32_t *data; - char *scaling_available_governors; - struct list_head *pos; - unsigned int cpu, i =3D 0; - - pmpt =3D processor_pminfo[op->cpuid]; - policy =3D per_cpu(cpufreq_cpu_policy, op->cpuid); - - if ( !pmpt || !pmpt->perf.states || - !policy || !policy->governor ) - return -EINVAL; - - list_for_each(pos, &cpufreq_governor_list) - gov_num++; - - if ( (op->u.get_para.cpu_num !=3D cpumask_weight(policy->cpus)) || - (op->u.get_para.freq_num !=3D pmpt->perf.state_count) || - (op->u.get_para.gov_num !=3D gov_num) ) - { - op->u.get_para.cpu_num =3D cpumask_weight(policy->cpus); - op->u.get_para.freq_num =3D pmpt->perf.state_count; - op->u.get_para.gov_num =3D gov_num; - return -EAGAIN; - } - - if ( !(data =3D xzalloc_array(uint32_t, - max(op->u.get_para.cpu_num, - op->u.get_para.freq_num))) ) - return -ENOMEM; - - for_each_cpu(cpu, policy->cpus) - data[i++] =3D cpu; - ret =3D copy_to_guest(op->u.get_para.affected_cpus, - data, op->u.get_para.cpu_num); - - for ( i =3D 0; i < op->u.get_para.freq_num; i++ ) - data[i] =3D pmpt->perf.states[i].core_frequency * 1000; - ret +=3D copy_to_guest(op->u.get_para.scaling_available_frequencies, - data, op->u.get_para.freq_num); - - xfree(data); - if ( ret ) - return -EFAULT; - - op->u.get_para.cpuinfo_cur_freq =3D - cpufreq_driver.get ? alternative_call(cpufreq_driver.get, op->cpui= d) - : policy->cur; - op->u.get_para.cpuinfo_max_freq =3D policy->cpuinfo.max_freq; - op->u.get_para.cpuinfo_min_freq =3D policy->cpuinfo.min_freq; - op->u.get_para.turbo_enabled =3D cpufreq_get_turbo_status(op->cpuid); - - if ( cpufreq_driver.name[0] ) - strlcpy(op->u.get_para.scaling_driver, - cpufreq_driver.name, CPUFREQ_NAME_LEN); - else - strlcpy(op->u.get_para.scaling_driver, "Unknown", CPUFREQ_NAME_LEN= ); - - if ( hwp_active() ) - ret =3D get_hwp_para(policy->cpu, &op->u.get_para.u.cppc_para); - else - { - if ( !(scaling_available_governors =3D - xzalloc_array(char, gov_num * CPUFREQ_NAME_LEN)) ) - return -ENOMEM; - if ( (ret =3D read_scaling_available_governors( - scaling_available_governors, - (gov_num * CPUFREQ_NAME_LEN * - sizeof(*scaling_available_governors)))) ) - { - xfree(scaling_available_governors); - return ret; - } - ret =3D copy_to_guest(op->u.get_para.scaling_available_governors, - scaling_available_governors, - gov_num * CPUFREQ_NAME_LEN); - xfree(scaling_available_governors); - if ( ret ) - return -EFAULT; - - op->u.get_para.u.s.scaling_cur_freq =3D policy->cur; - op->u.get_para.u.s.scaling_max_freq =3D policy->max; - op->u.get_para.u.s.scaling_min_freq =3D policy->min; - - if ( policy->governor->name[0] ) - strlcpy(op->u.get_para.u.s.scaling_governor, - policy->governor->name, CPUFREQ_NAME_LEN); - else - strlcpy(op->u.get_para.u.s.scaling_governor, "Unknown", - CPUFREQ_NAME_LEN); - - /* governor specific para */ - if ( !strncasecmp(op->u.get_para.u.s.scaling_governor, - "userspace", CPUFREQ_NAME_LEN) ) - op->u.get_para.u.s.u.userspace.scaling_setspeed =3D policy->cu= r; - - if ( !strncasecmp(op->u.get_para.u.s.scaling_governor, - "ondemand", CPUFREQ_NAME_LEN) ) - ret =3D get_cpufreq_ondemand_para( - &op->u.get_para.u.s.u.ondemand.sampling_rate_max, - &op->u.get_para.u.s.u.ondemand.sampling_rate_min, - &op->u.get_para.u.s.u.ondemand.sampling_rate, - &op->u.get_para.u.s.u.ondemand.up_threshold); - } - - return ret; -} - -static int set_cpufreq_gov(struct xen_sysctl_pm_op *op) -{ - struct cpufreq_policy new_policy, *old_policy; - - old_policy =3D per_cpu(cpufreq_cpu_policy, op->cpuid); - if ( !old_policy ) - return -EINVAL; - - memcpy(&new_policy, old_policy, sizeof(struct cpufreq_policy)); - - new_policy.governor =3D __find_governor(op->u.set_gov.scaling_governor= ); - if (new_policy.governor =3D=3D NULL) - return -EINVAL; - - return __cpufreq_set_policy(old_policy, &new_policy); -} - -static int set_cpufreq_para(struct xen_sysctl_pm_op *op) -{ - int ret =3D 0; - struct cpufreq_policy *policy; - - policy =3D per_cpu(cpufreq_cpu_policy, op->cpuid); - - if ( !policy || !policy->governor ) - return -EINVAL; - - if ( hwp_active() ) - return -EOPNOTSUPP; - - switch(op->u.set_para.ctrl_type) - { - case SCALING_MAX_FREQ: - { - struct cpufreq_policy new_policy; - - memcpy(&new_policy, policy, sizeof(struct cpufreq_policy)); - new_policy.max =3D op->u.set_para.ctrl_value; - ret =3D __cpufreq_set_policy(policy, &new_policy); - - break; - } - - case SCALING_MIN_FREQ: - { - struct cpufreq_policy new_policy; - - memcpy(&new_policy, policy, sizeof(struct cpufreq_policy)); - new_policy.min =3D op->u.set_para.ctrl_value; - ret =3D __cpufreq_set_policy(policy, &new_policy); - - break; - } - - case SCALING_SETSPEED: - { - unsigned int freq =3Dop->u.set_para.ctrl_value; - - if ( !strncasecmp(policy->governor->name, - "userspace", CPUFREQ_NAME_LEN) ) - ret =3D write_userspace_scaling_setspeed(op->cpuid, freq); - else - ret =3D -EINVAL; - - break; - } - - case SAMPLING_RATE: - { - unsigned int sampling_rate =3D op->u.set_para.ctrl_value; - - if ( !strncasecmp(policy->governor->name, - "ondemand", CPUFREQ_NAME_LEN) ) - ret =3D write_ondemand_sampling_rate(sampling_rate); - else - ret =3D -EINVAL; - - break; - } - - case UP_THRESHOLD: - { - unsigned int up_threshold =3D op->u.set_para.ctrl_value; - - if ( !strncasecmp(policy->governor->name, - "ondemand", CPUFREQ_NAME_LEN) ) - ret =3D write_ondemand_up_threshold(up_threshold); - else - ret =3D -EINVAL; - - break; - } - - default: - ret =3D -EINVAL; - break; - } - - return ret; -} - -static int set_cpufreq_cppc(struct xen_sysctl_pm_op *op) -{ - struct cpufreq_policy *policy =3D per_cpu(cpufreq_cpu_policy, op->cpui= d); - - if ( !policy || !policy->governor ) - return -ENOENT; - - if ( !hwp_active() ) - return -EOPNOTSUPP; - - return set_hwp_para(policy, &op->u.set_cppc); -} - -int do_pm_op(struct xen_sysctl_pm_op *op) -{ - int ret =3D 0; - const struct processor_pminfo *pmpt; - - switch ( op->cmd ) - { - case XEN_SYSCTL_pm_op_set_sched_opt_smt: - { - uint32_t saved_value =3D sched_smt_power_savings; - - if ( op->cpuid !=3D 0 ) - return -EINVAL; - sched_smt_power_savings =3D !!op->u.set_sched_opt_smt; - op->u.set_sched_opt_smt =3D saved_value; - return 0; - } - - case XEN_SYSCTL_pm_op_get_max_cstate: - BUILD_BUG_ON(XEN_SYSCTL_CX_UNLIMITED !=3D UINT_MAX); - if ( op->cpuid =3D=3D 0 ) - op->u.get_max_cstate =3D acpi_get_cstate_limit(); - else if ( op->cpuid =3D=3D 1 ) - op->u.get_max_cstate =3D acpi_get_csubstate_limit(); - else - ret =3D -EINVAL; - return ret; - - case XEN_SYSCTL_pm_op_set_max_cstate: - if ( op->cpuid =3D=3D 0 ) - acpi_set_cstate_limit(op->u.set_max_cstate); - else if ( op->cpuid =3D=3D 1 ) - acpi_set_csubstate_limit(op->u.set_max_cstate); - else - ret =3D -EINVAL; - return ret; - } - - if ( op->cpuid >=3D nr_cpu_ids || !cpu_online(op->cpuid) ) - return -EINVAL; - pmpt =3D processor_pminfo[op->cpuid]; - - switch ( op->cmd & PM_PARA_CATEGORY_MASK ) - { - case CPUFREQ_PARA: - if ( !(xen_processor_pmbits & XEN_PROCESSOR_PM_PX) ) - return -ENODEV; - if ( !pmpt || !(pmpt->init & XEN_PX_INIT) ) - return -EINVAL; - break; - } - - switch ( op->cmd ) - { - case GET_CPUFREQ_PARA: - { - ret =3D get_cpufreq_para(op); - break; - } - - case SET_CPUFREQ_GOV: - { - ret =3D set_cpufreq_gov(op); - break; - } - - case SET_CPUFREQ_PARA: - { - ret =3D set_cpufreq_para(op); - break; - } - - case SET_CPUFREQ_CPPC: - ret =3D set_cpufreq_cppc(op); - break; - - case GET_CPUFREQ_AVGFREQ: - { - op->u.get_avgfreq =3D cpufreq_driver_getavg(op->cpuid, USR_GETAVG); - break; - } - - case XEN_SYSCTL_pm_op_enable_turbo: - { - ret =3D cpufreq_update_turbo(op->cpuid, CPUFREQ_TURBO_ENABLED); - break; - } - - case XEN_SYSCTL_pm_op_disable_turbo: - { - ret =3D cpufreq_update_turbo(op->cpuid, CPUFREQ_TURBO_DISABLED); - break; - } - - default: - printk("not defined sub-hypercall @ do_pm_op\n"); - ret =3D -ENOSYS; - break; - } - - return ret; -} diff --git a/xen/drivers/cpufreq/cpufreq_misc_governors.c b/xen/drivers/cpu= freq/cpufreq_misc_governors.c index 0327fad23b..e5cb9ab02f 100644 --- a/xen/drivers/cpufreq/cpufreq_misc_governors.c +++ b/xen/drivers/cpufreq/cpufreq_misc_governors.c @@ -64,6 +64,7 @@ static int cf_check cpufreq_governor_userspace( return ret; } =20 +#ifdef CONFIG_PM_OP int write_userspace_scaling_setspeed(unsigned int cpu, unsigned int freq) { struct cpufreq_policy *policy; @@ -80,6 +81,7 @@ int write_userspace_scaling_setspeed(unsigned int cpu, un= signed int freq) =20 return __cpufreq_driver_target(policy, freq, CPUFREQ_RELATION_L); } +#endif /* CONFIG_PM_OP */ =20 static bool __init cf_check cpufreq_userspace_handle_option(const char *name, const char *val) diff --git a/xen/drivers/cpufreq/cpufreq_ondemand.c b/xen/drivers/cpufreq/c= pufreq_ondemand.c index 06cfc88d30..0126a3f5d9 100644 --- a/xen/drivers/cpufreq/cpufreq_ondemand.c +++ b/xen/drivers/cpufreq/cpufreq_ondemand.c @@ -57,6 +57,7 @@ static struct dbs_tuners { =20 static DEFINE_PER_CPU(struct timer, dbs_timer); =20 +#ifdef CONFIG_PM_OP int write_ondemand_sampling_rate(unsigned int sampling_rate) { if ( (sampling_rate > MAX_SAMPLING_RATE / MICROSECS(1)) || @@ -93,6 +94,7 @@ int get_cpufreq_ondemand_para(uint32_t *sampling_rate_max, =20 return 0; } +#endif /* CONFIG_PM_OP */ =20 static void dbs_check_cpu(struct cpu_dbs_info_s *this_dbs_info) { diff --git a/xen/drivers/cpufreq/utility.c b/xen/drivers/cpufreq/utility.c index 723045b240..987c3b5929 100644 --- a/xen/drivers/cpufreq/utility.c +++ b/xen/drivers/cpufreq/utility.c @@ -224,47 +224,6 @@ int cpufreq_driver_getavg(unsigned int cpu, unsigned i= nt flag) return policy->cur; } =20 -int cpufreq_update_turbo(unsigned int cpu, int new_state) -{ - struct cpufreq_policy *policy; - int curr_state; - int ret =3D 0; - - if (new_state !=3D CPUFREQ_TURBO_ENABLED && - new_state !=3D CPUFREQ_TURBO_DISABLED) - return -EINVAL; - - policy =3D per_cpu(cpufreq_cpu_policy, cpu); - if (!policy) - return -EACCES; - - if (policy->turbo =3D=3D CPUFREQ_TURBO_UNSUPPORTED) - return -EOPNOTSUPP; - - curr_state =3D policy->turbo; - if (curr_state =3D=3D new_state) - return 0; - - policy->turbo =3D new_state; - if (cpufreq_driver.update) - { - ret =3D alternative_call(cpufreq_driver.update, cpu, policy); - if (ret) - policy->turbo =3D curr_state; - } - - return ret; -} - - -int cpufreq_get_turbo_status(unsigned int cpu) -{ - struct cpufreq_policy *policy; - - policy =3D per_cpu(cpufreq_cpu_policy, cpu); - return policy && policy->turbo =3D=3D CPUFREQ_TURBO_ENABLED; -} - /********************************************************************* * POLICY * *********************************************************************/ diff --git a/xen/include/acpi/cpufreq/cpufreq.h b/xen/include/acpi/cpufreq/= cpufreq.h index 241117a9af..0742aa9f44 100644 --- a/xen/include/acpi/cpufreq/cpufreq.h +++ b/xen/include/acpi/cpufreq/cpufreq.h @@ -143,9 +143,6 @@ extern int cpufreq_driver_getavg(unsigned int cpu, unsi= gned int flag); #define CPUFREQ_TURBO_UNSUPPORTED 0 #define CPUFREQ_TURBO_ENABLED 1 =20 -int cpufreq_update_turbo(unsigned int cpu, int new_state); -int cpufreq_get_turbo_status(unsigned int cpu); - static inline int __cpufreq_governor(struct cpufreq_policy *policy, unsigned int event) { --=20 2.34.1 From nobody Thu Oct 30 23:12:08 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1751858093; cv=pass; d=zohomail.com; s=zohoarc; b=KOycFjI1WIePcm0OUqOnR4hZ5eHrOuITKGYk/NCciaf1lYIoDH8QHGKu2EXaAsNqXwlMytDRKRpTDn/I2LnKOZThrI6ax/2kJMzR0HBvcqaNGvjYAw9EbK7nC3DyC2rF09uCMGanurR4qok1qMf3dyfKk1OgYYdbDgK2hVK0PVs= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751858093; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=I/xn6mKm/IwhMKSwPcUVG9tTIdnkVLy/smOfyn2Vqts=; b=J+VSHEsjN2MW5Tg/IaH+gnSaZPWKxQpcrzTll+XnBsDmZoNWNF4EVgGqsaI4H5PEecPuSIBolZbIFzmTVCo0tQpINTriu6K0Afkr5ZMRdhAFCEkDiptePY24PBDABGzDlnkANhGny+ac37wpR4iT7X+sy0JwZ+Uv29bMztWSEZY= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1751858093347518.9466054176177; Sun, 6 Jul 2025 20:14:53 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1035079.1407329 (Exim 4.92) (envelope-from ) id 1uYcJM-0000UR-Mi; Mon, 07 Jul 2025 03:14:32 +0000 Received: by outflank-mailman (output) from mailman id 1035079.1407329; Mon, 07 Jul 2025 03:14:32 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uYcJM-0000UC-JR; Mon, 07 Jul 2025 03:14:32 +0000 Received: by outflank-mailman (input) for mailman id 1035079; Mon, 07 Jul 2025 03:14:31 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uYcJL-0007mT-22 for xen-devel@lists.xenproject.org; Mon, 07 Jul 2025 03:14:31 +0000 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on20622.outbound.protection.outlook.com [2a01:111:f403:2417::622]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 7dea3b30-5ae0-11f0-b894-0df219b8e170; Mon, 07 Jul 2025 05:14:29 +0200 (CEST) Received: from CH2PR19CA0005.namprd19.prod.outlook.com (2603:10b6:610:4d::15) by BL3PR12MB6617.namprd12.prod.outlook.com (2603:10b6:208:38c::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8901.25; Mon, 7 Jul 2025 03:14:23 +0000 Received: from CH1PEPF0000A34C.namprd04.prod.outlook.com (2603:10b6:610:4d:cafe::37) by CH2PR19CA0005.outlook.office365.com (2603:10b6:610:4d::15) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8901.26 via Frontend Transport; Mon, 7 Jul 2025 03:14:23 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by CH1PEPF0000A34C.mail.protection.outlook.com (10.167.244.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8901.15 via Frontend Transport; Mon, 7 Jul 2025 03:14:23 +0000 Received: from penny-System-Product-Name.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Sun, 6 Jul 2025 22:14:18 -0500 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 7dea3b30-5ae0-11f0-b894-0df219b8e170 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NopGuo+MqNxq6ffPFEkWBiYGhAF85wau8c+pJ4S2eXfaHlfBw/aWDh+skC71ct9qIcRN3jcfHsom8qkhK6cbkUEKvzKKuS3g8DjTTXRagRnujTiu0FAyfh+pTv21m0JBQfJ8Fvcggao12YQ/U9bv340md0lEtdEr1iEJGdSa2OrepCB9OJWiMmtnCsA9/8Ug2UIB3Dl+v7tyyEaH1Dj6jkC+tPtO+5JDXt7VjWj1+o/UMRykHdYa4qtKLDUh7nawBLS3MwEs6mUiP8DWUG+BnW+7tTnCUqWnUtAUUG6l+8eLDf2PVHnXKigws+08+ugGXzEsFnZ1MyYs/qVHABYUyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=I/xn6mKm/IwhMKSwPcUVG9tTIdnkVLy/smOfyn2Vqts=; b=uPHGAo7adF0ZxJd8RFXYan7rZLHTngiHpwMHcjb34KvpztjvbYkofII4SlH1WY5Ijpvl2WiV+TJyS76vIn34E/iWScZT/5Y4fJlNuTneDjUIod6YcTn7lC2oETOWdEofgJa2hcyQYVU5XXx6K+uvSZV0K+elLTkBcOb5ePYec4OU9T+AdbNRX5SPP0JI1cPcg3hHFHbREJS3ClinRxOMofYwK3wKdtKM79GVDmH6XWNNE4rYjsHkGj6NdeLkyQfunsdYOw/d/84OYjeZ+AWtCKtjPx1JFdbbubBpU+zDmkGcIIdgibIWPYJYdVl0dko/H1OY2c1UeRxWjWcq8h5OIQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=I/xn6mKm/IwhMKSwPcUVG9tTIdnkVLy/smOfyn2Vqts=; b=sJDzkl+/ijYY1F3VSh3jQKjbF5JOfDqd+MtzA9BzKxcpcT9qCI3lr+W8vyLhVqPGaw3nccbsgPaXG7PNRZcSCXlSy3D+U+3mL3AfD0KeTcsKksXQ9O7ljxybn6HLlQgOEY4oiMR8DrU9+elYQSzySdIKoxnscwo14xk8Jo6Xppg= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C From: Penny Zheng To: CC: , Penny Zheng , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Anthony PERARD , Michal Orzel , "Julien Grall" , Stefano Stabellini Subject: [PATCH 05/11] xen/sysctl: introduce CONFIG_PM_STATS Date: Mon, 7 Jul 2025 11:13:40 +0800 Message-ID: <20250707031346.901567-6-Penny.Zheng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250707031346.901567-1-Penny.Zheng@amd.com> References: <20250707031346.901567-1-Penny.Zheng@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH1PEPF0000A34C:EE_|BL3PR12MB6617:EE_ X-MS-Office365-Filtering-Correlation-Id: 4bb2bd20-ce1d-4083-51af-08ddbd045f8b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|1800799024|376014|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?FJw+HFG+/hpxWHDsFFg81TIOT6PeqYvClLj5alS494T9muf4ksCcYyKudTx7?= =?us-ascii?Q?Rbfyf38QOoI7RcUzwRDxsAhSGCOiUtQ9tsnyM12aVVkosstpFiTDP2WFYKa7?= =?us-ascii?Q?CsTFdCBw+dUKgaA9ZC9jk2tbcm65PO1a5F12b95eCeB0zk43O0RNyTnfa1vh?= =?us-ascii?Q?cevGr9DC0Ws1uQjHf3BJV3ewHdmJtANWPi+ZaCEzZ6jwESh/tBdD1R2xZW7l?= =?us-ascii?Q?DSXE7g8KV9t7uTGUYeeDBcgKTYSk0jiDUza9sO21oAcZiYFJBgUH/c6nT11K?= =?us-ascii?Q?7WTLEvqmpEovlRJbAD/rJ22ezOYnfZn8DXa71pFCItniR6pyiSc4KB6KHMYO?= =?us-ascii?Q?I4BKDop5QvY0mSE4Z6szlSabrV+ZU6G40ClSRrEf9shX93POPqcLOJSZlg3s?= =?us-ascii?Q?8lf9wlQxRbqD6+jAWKrAaYrJLy1TxJD9BLdEfiPUrAjneAl9XBbALy5pbmPQ?= =?us-ascii?Q?ZV/TJvCXcUoUu1tjIZd7fkFfqN7+uQ0hkHOl7KH8zXNwJxP6abY6dhakgWKG?= =?us-ascii?Q?Drfb8ZmnJ4crkck14b+RxSAiPdhbsjiyPVHDmmITgbRtpeRNejGYbpVfyzRs?= =?us-ascii?Q?gmir80yHYQxFDOpU3StRZqAyKSz+thlCGjGoKnVcnNoS2b6pxE5BrURR96ka?= =?us-ascii?Q?SjomJRjjhUP2UJqv6O5poJrRjTSvq+kPL5toA/pg0vYQFBu0LW+lOSfg7j2p?= =?us-ascii?Q?5nWGOi7EYmmFJ1NyjRhwWN7bqsy/tNA4p7kxvh8SaV5FyKmfGg5LOajsEGbQ?= =?us-ascii?Q?vserKpa79KtOai26FqEA5S5tDC6F4aG2DykSrS7UIfmuMDnXE2lOxv2vNB9M?= =?us-ascii?Q?SrB3S+UMdQQwGqxNuX5TZul6t0v7AKJrHgS8FBWQ4mFiKr6iMDy1P5yflaAb?= =?us-ascii?Q?MrcztEaLqxaVQivExGYdrNzcQ918Td4H6F1SC8chmm8nPdQ+FL4hpbwkFp6D?= =?us-ascii?Q?O0kxNZzTxYP5+38YDSP5lHdYiRdiiR65GuUMmlusTcFCQCffStH83GnKxeom?= =?us-ascii?Q?hiMq8unxt1aFznVbI0XPKhSDqB5qEVkLJ0+JxWy7v86yqDumsbwvTFmpBt0e?= =?us-ascii?Q?1uz9aLNm4+/2qcmDOwIL+TDYKAU6O79SiW45Zod8tyinY9hKnUbG7tJziBWh?= =?us-ascii?Q?Gach4Txzertv+udFydOSijLGCvWkfG//DTX3GSgDvSWuez/bvYugQUyikuFZ?= =?us-ascii?Q?LTVopgCau27exDtRJMqKNGxCCkNPZzvf03HNkLj1jncJtlmot/erjo/UQqPp?= =?us-ascii?Q?CAKhsUNRZj1TYnAmqwvD6m5qddCvwT10W5IfEToTvpTmP+pVyFgoRcrCYvfk?= =?us-ascii?Q?w97tMS4TVvv+hG4vhOl9dCTwIZ/afoaD4uHV+WtpqLAFzkjmmCvevOUfKyvf?= =?us-ascii?Q?vQ1mo8pLj682IwL+h+7TuFLZ7y+SLPiLOB7SXakaWmYljbNTQ+xxm3xaYvzo?= =?us-ascii?Q?gTorEQKwfE801ohEU0yItf7Vx0q2+rS8kVOmDRd34np/CY4nozLEnTmp/0Lc?= =?us-ascii?Q?TzKtBOIlCTwCKBoe4surVnw5SyYYWFRW5moN?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(1800799024)(376014)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2025 03:14:23.6428 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4bb2bd20-ce1d-4083-51af-08ddbd045f8b X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CH1PEPF0000A34C.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR12MB6617 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1751858094563116600 Content-Type: text/plain; charset="utf-8" We introduce a new Kconfig CONFIG_PM_STATS for wrapping all operations regarding performance management statistics. The major codes reside in xen/drivers/acpi/pmstat.c, including the pm-statistic-related sysctl op: do_get_pm_info(). CONFIG_PM_STATS also shall depend on CONFIG_SYSCTL We shall also provide "# CONFIG_PM_STATS is not set" in preset configs for PV shim on x86. Signed-off-by: Penny Zheng Reviewed-by: Stefano Stabellini Acked-by: Jan Beulich --- v1 -> v2: - rename to CONFIG_PM_STATS - fix indention and stray semicolon - make code movements into a new commit - No need to wrap inline functions and declarations --- v2 -> v3: - sepearte functions related to do_pm_op() into a new commit - both braces shall be moved to the line with the closing parenthesis --- v3 -> v4: - be consistent with the comment on the #endif --- v4 -> v5 - add blank line before endmenu --- v5 -> v6 - add "# CONFIG_PM_STATS is not set" in preset configs for PV shim on x86 --- xen/arch/x86/acpi/cpu_idle.c | 2 ++ xen/arch/x86/configs/pvshim_defconfig | 1 + xen/common/Kconfig | 8 ++++++++ xen/common/sysctl.c | 2 +- xen/drivers/acpi/Makefile | 2 +- xen/include/acpi/cpufreq/processor_perf.h | 10 ++++++++++ 6 files changed, 23 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/acpi/cpu_idle.c b/xen/arch/x86/acpi/cpu_idle.c index e50a9234a0..6551f360fc 100644 --- a/xen/arch/x86/acpi/cpu_idle.c +++ b/xen/arch/x86/acpi/cpu_idle.c @@ -1476,6 +1476,7 @@ static void amd_cpuidle_init(struct acpi_processor_po= wer *power) vendor_override =3D -1; } =20 +#ifdef CONFIG_PM_STATS uint32_t pmstat_get_cx_nr(unsigned int cpu) { return processor_powers[cpu] ? processor_powers[cpu]->count : 0; @@ -1595,6 +1596,7 @@ int pmstat_reset_cx_stat(unsigned int cpu) { return 0; } +#endif /* CONFIG_PM_STATS */ =20 void cpuidle_disable_deep_cstate(void) { diff --git a/xen/arch/x86/configs/pvshim_defconfig b/xen/arch/x86/configs/p= vshim_defconfig index bacd04c963..9dc91c33e3 100644 --- a/xen/arch/x86/configs/pvshim_defconfig +++ b/xen/arch/x86/configs/pvshim_defconfig @@ -27,3 +27,4 @@ CONFIG_EXPERT=3Dy # CONFIG_DEBUG is not set # CONFIG_GDBSX is not set # CONFIG_PM_OP is not set +# CONFIG_PM_STATS is not set diff --git a/xen/common/Kconfig b/xen/common/Kconfig index ed907de268..65f07289dd 100644 --- a/xen/common/Kconfig +++ b/xen/common/Kconfig @@ -628,4 +628,12 @@ config PM_OP This option shall enable userspace performance management control to do power/performance analyzing and tuning. =20 +config PM_STATS + bool "Enable Performance Management Statistics" + depends on ACPI && HAS_CPUFREQ && SYSCTL + default y + help + Enable collection of performance management statistics to aid in + analyzing and tuning power/performance characteristics of the system + endmenu diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c index daf57fbe56..5207664252 100644 --- a/xen/common/sysctl.c +++ b/xen/common/sysctl.c @@ -170,7 +170,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_s= ysctl) op->u.availheap.avail_bytes <<=3D PAGE_SHIFT; break; =20 -#if defined (CONFIG_ACPI) && defined (CONFIG_HAS_CPUFREQ) +#ifdef CONFIG_PM_STATS case XEN_SYSCTL_get_pmstat: ret =3D do_get_pm_info(&op->u.get_pmstat); break; diff --git a/xen/drivers/acpi/Makefile b/xen/drivers/acpi/Makefile index 1d811a51a7..477408afbe 100644 --- a/xen/drivers/acpi/Makefile +++ b/xen/drivers/acpi/Makefile @@ -5,7 +5,7 @@ obj-$(CONFIG_X86) +=3D apei/ obj-bin-y +=3D tables.init.o obj-$(CONFIG_ACPI_NUMA) +=3D numa.o obj-y +=3D osl.o -obj-$(CONFIG_HAS_CPUFREQ) +=3D pmstat.o +obj-$(CONFIG_PM_STATS) +=3D pmstat.o obj-$(CONFIG_PM_OP) +=3D pm-op.o =20 obj-$(CONFIG_X86) +=3D hwregs.o diff --git a/xen/include/acpi/cpufreq/processor_perf.h b/xen/include/acpi/c= pufreq/processor_perf.h index fa28b14faf..caa768626c 100644 --- a/xen/include/acpi/cpufreq/processor_perf.h +++ b/xen/include/acpi/cpufreq/processor_perf.h @@ -9,9 +9,19 @@ =20 unsigned int powernow_register_driver(void); unsigned int get_measured_perf(unsigned int cpu, unsigned int flag); +#ifdef CONFIG_PM_STATS void cpufreq_statistic_update(unsigned int cpu, uint8_t from, uint8_t to); int cpufreq_statistic_init(unsigned int cpu); void cpufreq_statistic_exit(unsigned int cpu); +#else +static inline void cpufreq_statistic_update(unsigned int cpu, uint8_t from, + uint8_t to) {} +static inline int cpufreq_statistic_init(unsigned int cpu) +{ + return 0; +} +static inline void cpufreq_statistic_exit(unsigned int cpu) {} +#endif /* CONFIG_PM_STATS */ =20 int cpufreq_limit_change(unsigned int cpu); =20 --=20 2.34.1 From nobody Thu Oct 30 23:12:08 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1751858096; cv=pass; d=zohomail.com; s=zohoarc; b=NlJO/3/ew2fbHHNlj6daceg3/Za7MZStksXKl2C8SPGusYLWBBkCLotYm4WiMHBej5KgtttmzGbQ6tQIb4evq7ooEU0Hr3svMKUPqEe3PYBvbHIt3JRL0DD7ysIVkZ/R5xJfmTIAVzlDHloMGiVVN5em7jL02TpFERg4Amn0XEI= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751858096; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=vyQBDL0uFgow+1a2Y3dSLlMZH4IZJahaUJN2J/+JEcc=; b=mQXIfQ69w+EV3/6OAZpgWriSgcTPpj+HMP3GAHckVN44aU3tzngO5ALT1M2150N3DCt2HTVjwL9OdLE+9pA9tsUdSuFA0xs3fLJNa0gPce819fehC2JTA8Z2tMyfLYw0RsZd3PMhbCt7bzLH9D4qjSVxJUgHKKFNrtG/Roeq0PE= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1751858096487137.32948616530143; Sun, 6 Jul 2025 20:14:56 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1035078.1407319 (Exim 4.92) (envelope-from ) id 1uYcJL-0000DJ-Di; Mon, 07 Jul 2025 03:14:31 +0000 Received: by outflank-mailman (output) from mailman id 1035078.1407319; Mon, 07 Jul 2025 03:14:31 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uYcJL-0000D4-9q; Mon, 07 Jul 2025 03:14:31 +0000 Received: by outflank-mailman (input) for mailman id 1035078; Mon, 07 Jul 2025 03:14:30 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uYcJK-0007mT-1t for xen-devel@lists.xenproject.org; Mon, 07 Jul 2025 03:14:30 +0000 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on20602.outbound.protection.outlook.com [2a01:111:f403:2414::602]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 7d9be8ea-5ae0-11f0-b894-0df219b8e170; Mon, 07 Jul 2025 05:14:28 +0200 (CEST) Received: from CH2PR19CA0018.namprd19.prod.outlook.com (2603:10b6:610:4d::28) by SA3PR12MB7974.namprd12.prod.outlook.com (2603:10b6:806:307::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8901.24; Mon, 7 Jul 2025 03:14:24 +0000 Received: from CH1PEPF0000A34C.namprd04.prod.outlook.com (2603:10b6:610:4d:cafe::5) by CH2PR19CA0018.outlook.office365.com (2603:10b6:610:4d::28) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8901.26 via Frontend Transport; Mon, 7 Jul 2025 03:14:24 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by CH1PEPF0000A34C.mail.protection.outlook.com (10.167.244.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8901.15 via Frontend Transport; Mon, 7 Jul 2025 03:14:24 +0000 Received: from penny-System-Product-Name.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Sun, 6 Jul 2025 22:14:21 -0500 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 7d9be8ea-5ae0-11f0-b894-0df219b8e170 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=KDHaP+kjDFXVs7HOmHTqlKpXs9K1mp9vu08xidNWHf6O4bDNBgRVvRHOBCcRHfrpNU2Z5Xu2TbfYssU0TPst2NMcAXPZYiN7iNQWJOgHIRyoe/7ATvOpYHeEfifMK2lQovXqOpFYGvLqr4j1tdfoA4kqvlNNO3vhy6+EvZVbWveHUbFaVeZSYGBUVfGd1w0KEs7xsWovspJERNhtK6QP6MPfAOb7SmlJMsVRbirWQ7g4PSRBazKetWixBaWV69J0ES6EU9d987Oe0w4gYv8/tlhZ1/Mgz58JBW0LbzacWb+Hh4jcc5P4Omeudh9b6oO6VmfeCmJht1kPFjFaRzK3eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=vyQBDL0uFgow+1a2Y3dSLlMZH4IZJahaUJN2J/+JEcc=; b=W0Bv4Wzq7nt7aURF/Lkza9oMaq2Dt7qEBpkKgIm9dM3iSOtt/FEafZu5VJ8QwGgW6VlSx/r4V3Lq8hOb6SMAebJemffOcjCN++QcpQqsCcAZ6vaG4bA0ReMaF1txkwCzY416oKvcuSX7hztduFVJxg6AkR4COn+iXDkVF3tXWTbb+ICpKg2ER2Ppxnuq4hoTa35sAvz+Va9FBB+ReySllt14YIR+x8IbzKc66t3GcLGJKDg0WrWyIwh3s8YXzF0xbNAO86ZrAcrMmdsOFu4eLzOVbEnIXyumkp55eSObOSUasMnsAD4Yqb2kl6wQhy5fkbD0yCVnbvvc8IxvAMSUgg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vyQBDL0uFgow+1a2Y3dSLlMZH4IZJahaUJN2J/+JEcc=; b=ZfsWXBwpwA2L4FVUAgYpOSsX33xPgwaWyIuv+YhyutQ8USJMLOSJqFOgIDvM3aN77cxSUv3nZH5CVWq1e770QmxYQqNiCFcO1YTXuujMnAEr9WYfxB1zz809E68Grj30hx8Q9P8yTwRlxxeDP2ZiQuUqe32HGUWzcQim4eLuvAU= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C From: Penny Zheng To: CC: , Penny Zheng , Andrew Cooper , Anthony PERARD , Michal Orzel , Jan Beulich , "Julien Grall" , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Stefano Stabellini , "Daniel P. Smith" Subject: [PATCH 06/11] xen/sysctl: wrap around XEN_SYSCTL_page_offline_op Date: Mon, 7 Jul 2025 11:13:41 +0800 Message-ID: <20250707031346.901567-7-Penny.Zheng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250707031346.901567-1-Penny.Zheng@amd.com> References: <20250707031346.901567-1-Penny.Zheng@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH1PEPF0000A34C:EE_|SA3PR12MB7974:EE_ X-MS-Office365-Filtering-Correlation-Id: 1171b663-dadb-4878-094c-08ddbd045fd2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|1800799024|376014|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?Og5nANhvB9LlUAvDWjvxtUjq44U5Xea/cUyvdCuJICk4kMXi8ockZ6jEv+5e?= =?us-ascii?Q?9bCW7PZut8BAhHYyfs9gba+yNV0+xIw4P+PlcBnzx4CTtsKv30FqtzAjif2V?= =?us-ascii?Q?nw53rK8u5eggyHU83HGYRfTCNg9in7jdX2Y++QXBiiv52/AOrPvQaQqMcPf6?= =?us-ascii?Q?j0T+5MwQAQUuHHe//JLcY5tBe3XDTxYnxJP1Zo/ykdkmQshDcIb8GrI4BBOr?= =?us-ascii?Q?Jx2vAr9iPAH0F9gTofWX0aFVGJa4DDLjgorMhLdZlZX1U4CNs9DQq0Z0r2ZJ?= =?us-ascii?Q?xEqtREJ3Js3N1ygClWVUaNfF6CaBvL59Yr/x9vOApk93akvETnn4Y2PURd08?= =?us-ascii?Q?Ka3qOt5NA0ENtvnMUWNEPFcq5lPJ5JgtXIpxrjmJVtTGQQ4fTYkGzHkkA8Ug?= =?us-ascii?Q?7Xjmdn9DCzpcph/W+S7a7Wfe0ZU4g6IpvOWHYzYRYL319Zp1GGL0hGz6yV9p?= =?us-ascii?Q?OwDqb3V1qpj3mbK0LvTBie1A7xVlP0W2/RxEzU4qPCFuDiC5qGOsMJqVdhtC?= =?us-ascii?Q?yuh1rwJTiJ8IN6CBXlxKMjluGUBs2lNxtELnVrk5tpw5zd+9w/n+ivNxZHag?= =?us-ascii?Q?RUgZOmOWbzOFk0H1fu7Sb2ge/1XuKJNN/EbUWPRkSUv3Y7N7yAtuDeQjqFt5?= =?us-ascii?Q?xYSRylcuQaQPsvgGU/XU2F55vGgvH52LJWlxIYfdwQ+LhicAm1ZD9nZVnIj1?= =?us-ascii?Q?kRyak3PDTTgHi26Hqckkr52B5xYsDPeRNhW0QuS6Fr5iVWxbZft8rSUBocrQ?= =?us-ascii?Q?WnpyK31DHi5Ncen58W0sjDBSCCFPCgt4qIWVic2oW7TOQkHEIo40AJjrl0DV?= =?us-ascii?Q?t7JhK2QhxkJtBx/qqfxlZszoBMLuQg65/nQyBKE1yKsRJhelq50X4RthlIe9?= =?us-ascii?Q?DSyNl6QNeg2CsTzNEjP9wyyOszJNRibqao6629nXVMYIHDV2kb650mo5Geky?= =?us-ascii?Q?fKLqcbycBQ7bfDWi+pAPDUOQDFzVsZ0Mvr5tAfabXGmgJckQLuaOsAE0geAz?= =?us-ascii?Q?IWzRsQGc4ET5fb/CoNEVQqI5i/InKf6cqchZDX6lkV3rCsl2WUO816YG9ISR?= =?us-ascii?Q?r8SAyzNqq7NhvC4jFTUKXazlEiCiHzjDx+o7s0QU49HUjuZf9WELMmibPV+A?= =?us-ascii?Q?Cqpvyj3SjSLYbv7k9FUG0FSbuJnLrI9uV0BaeZbhFyf8M5T1jEnPTewb4C3m?= =?us-ascii?Q?lGoqsNhtnNUwJCTQ65jabTNiCS7zlv0rS6ws9Fa8apndrOgAPrlEx0rsWphE?= =?us-ascii?Q?54r7Tm62vPoJU+fSKFGRUWNfXQvLJ0/ZgvhLy3px0Fxb+KUqK3bGkvmBUSsU?= =?us-ascii?Q?zNXDotl+jYwJBwduK5qLMRg8pSYXMp4oJ8oQZcB8JNMBfZEek7rAYLj9fUYE?= =?us-ascii?Q?ZtNOHuPUcGR1aoUsKqu36SPKm8SuQrxQmWeV2U5yHthtPHS/cBdKDMq5VvoF?= =?us-ascii?Q?e/aNeN4LtPBEv6IRk14Ie4spcRRzeOv4ZCew+XS8eqeCom88l5R7EcwK+xBa?= =?us-ascii?Q?Tcl4MxARMPQ9m7yi3uLQZ01SqkufckS1Lamf?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(1800799024)(376014)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2025 03:14:24.1057 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1171b663-dadb-4878-094c-08ddbd045fd2 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CH1PEPF0000A34C.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB7974 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1751858098818116600 Content-Type: text/plain; charset="utf-8" The following functions are only to deal with XEN_SYSCTL_page_offline_op, then shall be wrapped: - xsm_page_offline() - online_page() - query_page_offline() Signed-off-by: Penny Zheng Reviewed-by: Stefano Stabellini --- v1 -> v2: - add transient #ifdef in sysctl.c for correct compilation - no need to wrap declarations - place the #ifdef inside the function body to have less redundancy --- v3 -> v4: - remove transient "#ifdef CONFIG_SYSCTL" --- xen/common/page_alloc.c | 2 ++ xen/include/xsm/xsm.h | 6 ++++++ xen/xsm/dummy.c | 2 ++ xen/xsm/flask/hooks.c | 6 ++++++ 4 files changed, 16 insertions(+) diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c index 8f93a4c354..8177d12f50 100644 --- a/xen/common/page_alloc.c +++ b/xen/common/page_alloc.c @@ -1781,6 +1781,7 @@ int offline_page(mfn_t mfn, int broken, uint32_t *sta= tus) return 0; } =20 +#ifdef CONFIG_SYSCTL /* * Online the memory. * The caller should make sure end_pfn <=3D max_page, @@ -1865,6 +1866,7 @@ int query_page_offline(mfn_t mfn, uint32_t *status) =20 return 0; } +#endif /* CONFIG_SYSCTL */ =20 /* * This function should only be called with valid pages from the same NUMA diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h index 042a99449f..5ac99904c4 100644 --- a/xen/include/xsm/xsm.h +++ b/xen/include/xsm/xsm.h @@ -138,7 +138,9 @@ struct xsm_ops { int (*resource_setup_gsi)(int gsi); int (*resource_setup_misc)(void); =20 +#ifdef CONFIG_SYSCTL int (*page_offline)(uint32_t cmd); +#endif int (*hypfs_op)(void); =20 long (*do_xsm_op)(XEN_GUEST_HANDLE_PARAM(void) op); @@ -597,7 +599,11 @@ static inline int xsm_resource_setup_misc(xsm_default_= t def) =20 static inline int xsm_page_offline(xsm_default_t def, uint32_t cmd) { +#ifdef CONFIG_SYSCTL return alternative_call(xsm_ops.page_offline, cmd); +#else + return -EOPNOTSUPP; +#endif } =20 static inline int xsm_hypfs_op(xsm_default_t def) diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c index cd0e844fcf..d46413ad8c 100644 --- a/xen/xsm/dummy.c +++ b/xen/xsm/dummy.c @@ -96,7 +96,9 @@ static const struct xsm_ops __initconst_cf_clobber dummy_= ops =3D { .resource_setup_gsi =3D xsm_resource_setup_gsi, .resource_setup_misc =3D xsm_resource_setup_misc, =20 +#ifdef CONFIG_SYSCTL .page_offline =3D xsm_page_offline, +#endif .hypfs_op =3D xsm_hypfs_op, .hvm_param =3D xsm_hvm_param, .hvm_param_altp2mhvm =3D xsm_hvm_param_altp2mhvm, diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c index df7e10775b..45c12aa662 100644 --- a/xen/xsm/flask/hooks.c +++ b/xen/xsm/flask/hooks.c @@ -1206,10 +1206,12 @@ static int cf_check flask_resource_unplug_core(void) return avc_current_has_perm(SECINITSID_DOMXEN, SECCLASS_RESOURCE, RESO= URCE__UNPLUG, NULL); } =20 +#ifdef CONFIG_SYSCTL static int flask_resource_use_core(void) { return avc_current_has_perm(SECINITSID_DOMXEN, SECCLASS_RESOURCE, RESO= URCE__USE, NULL); } +#endif /* CONFIG_SYSCTL */ =20 static int cf_check flask_resource_plug_pci(uint32_t machine_bdf) { @@ -1274,6 +1276,7 @@ static int cf_check flask_resource_setup_misc(void) return avc_current_has_perm(SECINITSID_XEN, SECCLASS_RESOURCE, RESOURC= E__SETUP, NULL); } =20 +#ifdef CONFIG_SYSCTL static inline int cf_check flask_page_offline(uint32_t cmd) { switch ( cmd ) @@ -1288,6 +1291,7 @@ static inline int cf_check flask_page_offline(uint32_= t cmd) return avc_unknown_permission("page_offline", cmd); } } +#endif /* CONFIG_SYSCTL */ =20 static inline int cf_check flask_hypfs_op(void) { @@ -1948,7 +1952,9 @@ static const struct xsm_ops __initconst_cf_clobber fl= ask_ops =3D { .resource_setup_gsi =3D flask_resource_setup_gsi, .resource_setup_misc =3D flask_resource_setup_misc, =20 +#ifdef CONFIG_SYSCTL .page_offline =3D flask_page_offline, +#endif .hypfs_op =3D flask_hypfs_op, .hvm_param =3D flask_hvm_param, .hvm_param_altp2mhvm =3D flask_hvm_param_altp2mhvm, --=20 2.34.1 From nobody Thu Oct 30 23:12:08 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1751858102; cv=pass; d=zohomail.com; s=zohoarc; b=l9VXfFpBxqlRIuioTfpOL7PnsxAQ9jAiyFKG+7gzIEYvCsV4KT73X6g7OWVHyd+XbAuuMQbN6vQdcgbN0qYB30L1NkRlzJHjSppdgS1uINHQM3NzHXlkuFprwlz9bf3cEN2ulI+l/1ZyzsSizVIc3tjvK/gAvtPv6trgst3zNpQ= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751858102; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=IdgLxZJojMqTzA4uMqMuY2FrEHyVqR+LGLe1iCymvs4=; b=Cthz9EB8tnhqDQDIGzyMuBhgdFtNgffYxVF59xKpFCxUu5bPs9GE2+mkghgyNSFfQTEKnNsmz9PoKfxHZB/+VLOK1ClZapkGj+e9JWYmUi4g6yEmYcP3kuQ90QXdEW1wN73GXYPbIV9zZgMnpHa+c2WmmIqcN8O0pEURImEoa0Q= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1751858102779726.3077196630267; Sun, 6 Jul 2025 20:15:02 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1035081.1407339 (Exim 4.92) (envelope-from ) id 1uYcJU-00018t-08; Mon, 07 Jul 2025 03:14:40 +0000 Received: by outflank-mailman (output) from mailman id 1035081.1407339; Mon, 07 Jul 2025 03:14:39 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uYcJT-00018g-T1; Mon, 07 Jul 2025 03:14:39 +0000 Received: by outflank-mailman (input) for mailman id 1035081; Mon, 07 Jul 2025 03:14:38 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uYcJS-0007mT-Hx for xen-devel@lists.xenproject.org; Mon, 07 Jul 2025 03:14:38 +0000 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2060b.outbound.protection.outlook.com [2a01:111:f403:2412::60b]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 80873347-5ae0-11f0-b894-0df219b8e170; Mon, 07 Jul 2025 05:14:33 +0200 (CEST) Received: from MW4PR03CA0240.namprd03.prod.outlook.com (2603:10b6:303:b9::35) by DS7PR12MB5958.namprd12.prod.outlook.com (2603:10b6:8:7d::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8901.26; Mon, 7 Jul 2025 03:14:28 +0000 Received: from SJ5PEPF000001EA.namprd05.prod.outlook.com (2603:10b6:303:b9:cafe::c1) by MW4PR03CA0240.outlook.office365.com (2603:10b6:303:b9::35) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8901.26 via Frontend Transport; Mon, 7 Jul 2025 03:14:27 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by SJ5PEPF000001EA.mail.protection.outlook.com (10.167.242.198) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8901.15 via Frontend Transport; Mon, 7 Jul 2025 03:14:26 +0000 Received: from penny-System-Product-Name.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Sun, 6 Jul 2025 22:14:24 -0500 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 80873347-5ae0-11f0-b894-0df219b8e170 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=xrgvaVU2jtvtaYZ6GeFx8L2KNI8KtGcGxw3q4vFpyXp9+NF9Udn/IAd3ROt34D6sDqNh1e4aCsp03IbqMthztyPwZogodNmZvMXgfxvNalrkW/PdGXXoOBaVNxuj3pOAMtGugnRSp51FHjuUf5ZoV95bVtiwaE/9eH/+0NZClXCaHnjxPDVNO1qbbA96YoX+Rtrb/8RGxLmz4wl05le/QU5eI87vs6WYvFj7O6Fpp6gPJ9myX4aG6RY3adyL+xg4b9PNsDTiBcfuZXwwep1EbLQCcDZlSh72mMSLH6NQoAt3rcHxhQ6c0Oby35yWNF9tjKcAVrFyzOxksEd/V4KjTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=IdgLxZJojMqTzA4uMqMuY2FrEHyVqR+LGLe1iCymvs4=; b=w7VfKPV5vCeBG+vIYSxDzehLtLf2WYR2UmMC+nwS5I3nu5xSzok3r4yop5jKTC8r8cRSvbRy7nwaFdk6VpJbQuu81yw6c5cVovBZfPBVZ67hFlRey8NQGc4VZ9tM8ir/W7gG/wXakSdNaWoH8shuwJOYaoFQZGZzS1yfysxShvPPChkchyoR9QOfYILq9y7+JMRVMvcyejxiugh3ivp/rsQz5lWCHuQH+UTsqzdWK4Nte1BxwigJcGPF+gBzq+S5oHu8P1L4fFn7BtrHtFZW65ULAIcWoXKPToWYbPSvIRWt3CgzvrK7SBcX4QdkQKerxlUUTsExkReFQefqiB3JgQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IdgLxZJojMqTzA4uMqMuY2FrEHyVqR+LGLe1iCymvs4=; b=vjmC5+hqqJuGD+7PANMIrgV1Hsl0PEzVOWB0A9LsnzZN1LEOfkzianCxPDi47Wsr+ZJvwpSu51D33sDK2H3ptaTbFz0KgmnvENcbq0nLF5uqdOsZsLQDgNJUYwvWaus3M6rH9HBrSvDSgotHowfJIbxtCzJK+rBhZe+6DWmrYnI= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C From: Penny Zheng To: CC: , Penny Zheng , Dario Faggioli , Juergen Gross , George Dunlap , Stefano Stabellini Subject: [PATCH 07/11] xen/sysctl: wrap around XEN_SYSCTL_cpupool_op Date: Mon, 7 Jul 2025 11:13:42 +0800 Message-ID: <20250707031346.901567-8-Penny.Zheng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250707031346.901567-1-Penny.Zheng@amd.com> References: <20250707031346.901567-1-Penny.Zheng@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ5PEPF000001EA:EE_|DS7PR12MB5958:EE_ X-MS-Office365-Filtering-Correlation-Id: b39db9b2-9970-42d3-a69d-08ddbd046169 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|36860700013|376014|1800799024; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?Pxa++nRdScc4IMsg16V32iwWwYep5Nd4/JauVoUe/V2NEAA9aFwN6UQtu1V6?= =?us-ascii?Q?2aTHlVKeGV5DB5hzTFvUM3taRLudMbXFUDGDgQZhfCc9zN/5ho54ucVSbrOG?= =?us-ascii?Q?KlWWD8/BuUm/NrBZzbdAZ9LVpnNyVVGDx/ErOa2IwBAs/CglJuMjqVORkHFT?= =?us-ascii?Q?p7IiHdsxLI1imctACKnpmSVOaD1A1fo9ns2huyWyrIeiKUP88jKTWQetnI4X?= =?us-ascii?Q?pYQx4nGwBaxJVBjnfdovE3axAmFI3ikd3W/zzF5ewLEkwIJA2Q5zvJa4oPVz?= =?us-ascii?Q?7AJMHJRThLkTGa2P5KsLw9xDCflUuoCEfbb0S8kKHg/XqdiRksckgl7fM6rv?= =?us-ascii?Q?yRNKXkdqp/udiHsI+0y6HKbD3HW21raloBLtgKy7zpRI6Yh0+2T7pKCHVFpx?= =?us-ascii?Q?3p5cLFtXHq7Qa+6M9XiBIaOrMa1FU79/V2hYhePcPOPm/XIdCDD1nn5YVBoI?= =?us-ascii?Q?yMOcjXEsWQTJGoqOghA30PGf7Hi1W9Xu4q+QdTx9Da45VMq/HzSdHd0IaWTz?= =?us-ascii?Q?4Gn6lQEBbxKmUhG8TJd9p0dcztz+s5GbbVBSGvPfo4b6+BHKDfbNIodb/+Pb?= =?us-ascii?Q?giOpHuDUsvR/bTnlPkIRIv1tmUQCQ9gsKKpcfBaW9bt4anJmNFMGlaQtvySy?= =?us-ascii?Q?cddlLqLkWh5OKcvQxPITf/HZ2zLCtp8NikHO0qw0Y/m6+EswS88nhzdN/iNE?= =?us-ascii?Q?XZDmuRsSajlL6HBesn5zK6qpOYn1W9FZp/NAFVLsBFSIS3v8YYVZQXBMpKcj?= =?us-ascii?Q?U12+OFtdLxUrQy1U48lBH9XKWUxB4WBRlHKinWN9eC4MwjgSSdopJOGsMXwr?= =?us-ascii?Q?TeIq8b45ZILXxoo1kKZHcSF3R/IVogbCGaxIEGbOIo+pf32blEHrVJFNW7bQ?= =?us-ascii?Q?ynyHjsVO52GPXAGX1bO8+Ne6RF7DUkQ0NsFG0bf0ATpWm+L2Hpmm8MVim3L9?= =?us-ascii?Q?0AVdJKFIJpqbePKNwvZbw3H+nizHuxgH6GnqcL1aev72OkTyIvFopCZMzx5r?= =?us-ascii?Q?j6nvCGzaNejGec3uVJ0x77y2m/IbXzmWWfH1+yxBESstK1YqXlme7403bNux?= =?us-ascii?Q?eIzobuQhzeNqD38obWJCd346SR/SG/OHPCbWXlGtwx8G+141KZkB5wbxr3j/?= =?us-ascii?Q?/mUxVW+S/cgwXX6ujqwAhFA5hxlqD0FAVMY+qBFAA0kPHZ9Ue0+5OB6KIPQD?= =?us-ascii?Q?vECLBa7TmKDjHmekJNyEqW2y1+2cUS+CwM5uHNzH1dZm7fFeuhUWztV4NZkR?= =?us-ascii?Q?5ETynqKSFxp3TFj1q1QQKAvxoy1EWNX7GonpiyOHPyNas19QnMccexG81C/R?= =?us-ascii?Q?A8N6MchvUnzkSR76WDLcN1OpTl6TLQZl94Dp+s8AVYcPUD1s00MTFOQi2WZ2?= =?us-ascii?Q?4BqR4YQT3u6pt9cKFKVAQUCQMZzrVUPxVZTTBLgCuoj4Bwfm4s9dcWLA4mTz?= =?us-ascii?Q?Fp0CJJcxh0zap4gu7bwADvYmm+Iyfh6CTmTrcOOFU2A3Q5SV90U4KY9Bop7m?= =?us-ascii?Q?t8hSQ8Vr57MbmqpOnLkJxxY9pMEMWHaI6b1M?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(36860700013)(376014)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2025 03:14:26.6963 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b39db9b2-9970-42d3-a69d-08ddbd046169 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ5PEPF000001EA.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB5958 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1751858104642116600 Content-Type: text/plain; charset="utf-8" Function cpupool_do_sysctl is designed for doing cpupool related sysctl operations, and shall be wrapped. The following static functions are only called by cpupool_do_sysctl(), then shall be wrapped too: - cpupool_get_next_by_id - cpupool_destroy - cpupool_unassign_cpu_helper - cpupool_unassign_cpu Signed-off-by: Penny Zheng Reviewed-by: Stefano Stabellini Reviewed-by: Juergen Gross --- v1 -> v2: - no need to wrap declaration - add transient #ifdef in sysctl.c for correct compilation --- v2 -> v3 - move #endif up ahead of the blank line --- v3 -> v4: - remove transient "#ifdef CONFIG_SYSCTL" --- xen/common/sched/cpupool.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/xen/common/sched/cpupool.c b/xen/common/sched/cpupool.c index 3d02c7b706..f5459c2779 100644 --- a/xen/common/sched/cpupool.c +++ b/xen/common/sched/cpupool.c @@ -241,10 +241,12 @@ struct cpupool *cpupool_get_by_id(unsigned int poolid) return __cpupool_get_by_id(poolid, true); } =20 +#ifdef CONFIG_SYSCTL static struct cpupool *cpupool_get_next_by_id(unsigned int poolid) { return __cpupool_get_by_id(poolid, false); } +#endif /* CONFIG_SYSCTL */ =20 void cpupool_put(struct cpupool *pool) { @@ -352,6 +354,7 @@ static struct cpupool *cpupool_create(unsigned int pool= id, =20 return ERR_PTR(ret); } +#ifdef CONFIG_SYSCTL /* * destroys the given cpupool * returns 0 on success, 1 else @@ -379,6 +382,7 @@ static int cpupool_destroy(struct cpupool *c) debugtrace_printk("cpupool_destroy(pool=3D%u)\n", c->cpupool_id); return 0; } +#endif /* CONFIG_SYSCTL */ =20 /* * Move domain to another cpupool @@ -568,6 +572,7 @@ static int cpupool_unassign_cpu_start(struct cpupool *c= , unsigned int cpu) return ret; } =20 +#ifdef CONFIG_SYSCTL static long cf_check cpupool_unassign_cpu_helper(void *info) { struct cpupool *c =3D info; @@ -633,6 +638,7 @@ static int cpupool_unassign_cpu(struct cpupool *c, unsi= gned int cpu) } return continue_hypercall_on_cpu(work_cpu, cpupool_unassign_cpu_helper= , c); } +#endif /* CONFIG_SYSCTL */ =20 /* * add a new domain to a cpupool @@ -810,6 +816,7 @@ static void cpupool_cpu_remove_forced(unsigned int cpu) rcu_read_unlock(&sched_res_rculock); } =20 +#ifdef CONFIG_SYSCTL /* * do cpupool related sysctl operations */ @@ -975,6 +982,7 @@ int cpupool_do_sysctl(struct xen_sysctl_cpupool_op *op) =20 return ret; } +#endif /* CONFIG_SYSCTL */ =20 unsigned int cpupool_get_id(const struct domain *d) { --=20 2.34.1 From nobody Thu Oct 30 23:12:08 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1751858110; cv=pass; d=zohomail.com; s=zohoarc; b=YMJl2tzlL4/Cwc+Apvlj8gcGORoq+eQvcavlh5RvHHGRjfm5ZNrzMva4JbxUmeCPxiDJWlUNegLX7WCT48u365FaaAGHLtSxMQYrxp6i6YFnPu4Tw9B+PFW2Gbd0lQVzsHhb0D39QGOUaU/Ssq88d3TDd1+vOjvO/GSQnD1HDPQ= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751858110; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=WvykzEStZK73rMFsbUxdbGQm1JqJFz8VY0tKPFQ221s=; b=aA3tuB0LQHE1eB/CT+JCPl/YH8qr1GSXiQrEAq5ys1wifrmo4muj2HezZqSf3p1efubgSIZw6mMdruror6gzF7+Y7tLFAoo4l0L3cGtyTBE/CEJBjsLOzNVhcSDnjHf/E4k4l/o8DEwNaSqj/hLaXJEMS7whJQNcogcaGJ1i+34= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1751858110282765.4995732865256; Sun, 6 Jul 2025 20:15:10 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1035082.1407345 (Exim 4.92) (envelope-from ) id 1uYcJU-0001Gk-Hv; Mon, 07 Jul 2025 03:14:40 +0000 Received: by outflank-mailman (output) from mailman id 1035082.1407345; Mon, 07 Jul 2025 03:14:40 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uYcJU-0001FX-Co; Mon, 07 Jul 2025 03:14:40 +0000 Received: by outflank-mailman (input) for mailman id 1035082; Mon, 07 Jul 2025 03:14:39 +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 1uYcJT-0007KZ-0q for xen-devel@lists.xenproject.org; Mon, 07 Jul 2025 03:14:39 +0000 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on20621.outbound.protection.outlook.com [2a01:111:f403:2405::621]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 8352951b-5ae0-11f0-a316-13f23c93f187; Mon, 07 Jul 2025 05:14:38 +0200 (CEST) Received: from BYAPR06CA0040.namprd06.prod.outlook.com (2603:10b6:a03:14b::17) by DS0PR12MB7678.namprd12.prod.outlook.com (2603:10b6:8:135::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8857.32; Mon, 7 Jul 2025 03:14:30 +0000 Received: from SJ5PEPF000001EE.namprd05.prod.outlook.com (2603:10b6:a03:14b:cafe::78) by BYAPR06CA0040.outlook.office365.com (2603:10b6:a03:14b::17) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8901.26 via Frontend Transport; Mon, 7 Jul 2025 03:14:30 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by SJ5PEPF000001EE.mail.protection.outlook.com (10.167.242.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8901.20 via Frontend Transport; Mon, 7 Jul 2025 03:14:29 +0000 Received: from penny-System-Product-Name.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Sun, 6 Jul 2025 22:14:26 -0500 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 8352951b-5ae0-11f0-a316-13f23c93f187 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=VWO0E0tU4LgHOUnfAPciAueaR9TyZAELQkAJ/kGhkbevhsCVugWTDSL4eOaY2MneDF1JdMuBlAfQJugdCsKj1Rrg8oP8s/dfWnzYAWmoJhuW0LfD3JYIf66E50GM2KeJydNQCWutysr8uhlTrlNx6FfkifhTL7qrvSawC3aOksbzn7CjPwlMNPRZXUsXXMOyuEXa+XL/QpN+Jt3tiF5KXG/qWeS86zat+BrK4KLn9tiznObOqkUaqE0g5YubynroExDOpfK3C6f+m+3RF3qx21hjE9YcaTyNfVemF6bPVXFU/o/9q7EF+qRwOEZhzqwO81/5O29rTcZPdRXvtzhyWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=WvykzEStZK73rMFsbUxdbGQm1JqJFz8VY0tKPFQ221s=; b=qX6IVQKmj4hZgAFIRy8PpAr7XWx8SLQba7LrLliCw/wEXqIvKk/N2kLD315Kpqa0DaED3KSllZ+O29Is6rf4XWlmCUXh4fnO69FfZDrN5kZa7oqMOkX7XP6UYojrKIy+33r56guMiVryL5SpRmH3k6a19/OCyBMcs63HrVDv9urvWBYhd7ABOP6BXCS6FmDAvyAFN1mgjax6QLVqRTl487A2D5bV9S3v5L1Tn1/UWv39UnmuMXPJNZh/qL/gfk/PqvqJfrjs/6Q/7iC9+YwwMrd1a5D3pGgGwP0o9eQpDBEuXklzriY71VQz1bIj7NniITlqMcW1YM1qBW6av9cAQA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WvykzEStZK73rMFsbUxdbGQm1JqJFz8VY0tKPFQ221s=; b=PZscWKuk7IqxyHh4IDBgjQpFti+N2vpwzcz1amunhAeGgbdwY+Cm5op7FJCYtmce5FOFRUgGSsDQI7wXsjYk2dQBfBFpDLkyjyMR7t3VoUk6ttveksow6g+SLSsgFvp9Deuw8rfS/0vwV4/pZac5AxoZ8kLDfXlo0DMAcwoYTzI= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C From: Penny Zheng To: , CC: , Penny Zheng , Nathan Studer , Stewart Hildebrand , "Dario Faggioli" , Juergen Gross , George Dunlap , "Daniel P. Smith" , Stefano Stabellini Subject: [PATCH 08/11] xen/sysctl: wrap around XEN_SYSCTL_scheduler_op Date: Mon, 7 Jul 2025 11:13:43 +0800 Message-ID: <20250707031346.901567-9-Penny.Zheng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250707031346.901567-1-Penny.Zheng@amd.com> References: <20250707031346.901567-1-Penny.Zheng@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ5PEPF000001EE:EE_|DS0PR12MB7678:EE_ X-MS-Office365-Filtering-Correlation-Id: 4e5a1d2b-3f74-4ecb-5fd2-08ddbd04633c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|1800799024|376014|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?Nbl+Ju2eNlIAbm2wrgeMcxCuhptr4sFo/7+ukgSaixBnu6Oox3TJ+nai8Sds?= =?us-ascii?Q?Kk+MSy86cj/CP5OiRIS2gYUQrVHV4sW7GepUczHfhnQqGovXNXhAQXCG58HP?= =?us-ascii?Q?sO2UY682zp4PkbksIjKvCRoqm8J5e5oU1ygnbJ71YPE2p4Ffjrk2JG33IZHp?= =?us-ascii?Q?ifXjXPLd9Ko/1NMGKY0XkY4U9UZ7p7U7PHThk6EzjZrFbogplHgHQ7PUoTuD?= =?us-ascii?Q?Ar0npAcHbw851u/U3hvE3TFIcKX7EkXsBEjcwiW2lKHeX3n3HytpJWqnaT5w?= =?us-ascii?Q?HdRYqSr2sm7u75f2ouASAbac4JUIxQT08sKgMP8u9IVvEF/8akHWRv+CPteT?= =?us-ascii?Q?D8JkIl+VCR4mEVPZP+aEWA5eYpNBi8vUlvfRHKUGHLntXLHNyNrWpWE5lq0S?= =?us-ascii?Q?L1N1/nPs682kGuijUyxdtMfxW2mRZjzf/AmgHMmDnVKBHsAeswjEJhpWYYoi?= =?us-ascii?Q?+d5hmu9aoLiw7UY7G5cGULFwoYqpmwxSy5FIgN/f07fIOzcNBNQrfHIwtKm6?= =?us-ascii?Q?EY7u7On0P9dOnvAukf9B0kg/2sPWxjAcnfzN+5QzHMEEUW9fs7YXnDa5zdpz?= =?us-ascii?Q?2luoXe0jKYa3/AKEJqLOFnrlTXGaLLUNeDYAOTiV8ETaMUwDgj2y9kbYbDaX?= =?us-ascii?Q?+mVOTofxnGdk6xTeA1rI6KLuCmVugKgngm1IK40qaBwegZUa6oKZXfan+0uv?= =?us-ascii?Q?cQqOn7kfJQGiviBEy1EXDrB5kdOOGkM8mIFHG9o35QAKdFzgmD/3dnIy/l1a?= =?us-ascii?Q?qNcuQBAoTJ+5a4Sp+CKUfzA8zMzfKQllM6igC3FryiQqCWol07Wn/NOOVU6Z?= =?us-ascii?Q?w1F6Lq6bkYIpg9//szbwRqpsFTla4XJZo200zalBu95BoKLOWglhvQZew7dJ?= =?us-ascii?Q?wvd9dkdpCIDIjbCA3l4xEMTPrmJqpoqcFAeeIyupf/H2e/LtqPLDn1/qdM2N?= =?us-ascii?Q?HqZF5nVeGLm1bU5Ew2jNbHLUZMp0Znzua5WhEIQpSqh5hh0PlLQYWHcVbFbU?= =?us-ascii?Q?CyJ+13Lnd+kaQNgNmgY2rQz5QFex6OtPwUnPo7dpHcC9ynyV4W+B0R7YwZE5?= =?us-ascii?Q?+sMoXzyBOB2z2t4Vn7rYOtzVCkgxmB41laVONY0TDwcSzZz7p7n80VBO/4HM?= =?us-ascii?Q?zvKqhlMCILXQGqi4oxxJH2sKSfw1fLgzGggb24l2saEdr86EC5DRZbVEitva?= =?us-ascii?Q?fUf9gpiOJdStUalK5jty8oQnXgDx9l1Yjp0M+yQT9rMwdkDgFdK3T0LfmZJ4?= =?us-ascii?Q?V0IlHUHuPxqs1P4cr1C60k3Fx+tUsoom+GazC+rkzrahXrcMSqp/YGl28+x2?= =?us-ascii?Q?/WavOzEt0ZNgtT1YVJpzFZcj/+5x+vKX3XnIvz9BIOU8dnz8WHJ9mqLXoz/x?= =?us-ascii?Q?H0Z32VpjuSB61ouLjOXvg8xAQX8zaHACAsCYcgIbDcnb2Qy9X3zrzz/32o20?= =?us-ascii?Q?z6tdKQ9drYnrG4ylwleS+tuPxd81L7nYEpkOpJ89tapjT/ScErLJgQp/VEGJ?= =?us-ascii?Q?VRW/skaQrFMWhG5X5N2VLNq82IaQqYxfeW74?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(1800799024)(376014)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2025 03:14:29.7559 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4e5a1d2b-3f74-4ecb-5fd2-08ddbd04633c X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ5PEPF000001EE.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7678 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1751858110891116600 Content-Type: text/plain; charset="utf-8" Function sched_adjust_global is designed for XEN_SYSCTL_scheduler_op, so itself and its calling flow, like .adjust_global, shall all be wrapped. Signed-off-by: Penny Zheng Reviewed-by: Stefano Stabellini Acked-by: Stewart Hildebrand #a653 Reviewed-by: Juergen Gross --- v1 -> v2: - no need to wrap declarations - add transient #ifdef in sysctl.c for correct compilation --- v2 -> v3: - move #endif up ahead of the blank line --- v3 -> v4: - remove transient "#ifdef CONFIG_SYSCTL" --- xen/common/sched/arinc653.c | 6 ++++++ xen/common/sched/core.c | 2 ++ xen/common/sched/credit.c | 4 ++++ xen/common/sched/credit2.c | 4 ++++ xen/common/sched/private.h | 4 ++++ xen/include/xsm/xsm.h | 4 ++++ xen/xsm/dummy.c | 2 ++ xen/xsm/flask/hooks.c | 4 ++++ 8 files changed, 30 insertions(+) diff --git a/xen/common/sched/arinc653.c b/xen/common/sched/arinc653.c index 432ccfe662..3c014c9934 100644 --- a/xen/common/sched/arinc653.c +++ b/xen/common/sched/arinc653.c @@ -220,6 +220,7 @@ static void update_schedule_units(const struct schedule= r *ops) SCHED_PRIV(ops)->schedule[i].unit_id); } =20 +#ifdef CONFIG_SYSCTL /** * This function is called by the adjust_global scheduler hook to put * in place a new ARINC653 schedule. @@ -334,6 +335,7 @@ arinc653_sched_get( =20 return 0; } +#endif /* CONFIG_SYSCTL */ =20 /************************************************************************** * Scheduler callback functions * @@ -653,6 +655,7 @@ a653_switch_sched(struct scheduler *new_ops, unsigned i= nt cpu, return &sr->_lock; } =20 +#ifdef CONFIG_SYSCTL /** * Xen scheduler callback function to perform a global (not domain-specifi= c) * adjustment. It is used by the ARINC 653 scheduler to put in place a new @@ -692,6 +695,7 @@ a653sched_adjust_global(const struct scheduler *ops, =20 return rc; } +#endif /* CONFIG_SYSCTL */ =20 /** * This structure defines our scheduler for Xen. @@ -726,7 +730,9 @@ static const struct scheduler sched_arinc653_def =3D { .switch_sched =3D a653_switch_sched, =20 .adjust =3D NULL, +#ifdef CONFIG_SYSCTL .adjust_global =3D a653sched_adjust_global, +#endif =20 .dump_settings =3D NULL, .dump_cpu_state =3D NULL, diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c index 13fdf57e57..ea95dea65a 100644 --- a/xen/common/sched/core.c +++ b/xen/common/sched/core.c @@ -2112,6 +2112,7 @@ long sched_adjust(struct domain *d, struct xen_domctl= _scheduler_op *op) return ret; } =20 +#ifdef CONFIG_SYSCTL long sched_adjust_global(struct xen_sysctl_scheduler_op *op) { struct cpupool *pool; @@ -2140,6 +2141,7 @@ long sched_adjust_global(struct xen_sysctl_scheduler_= op *op) =20 return rc; } +#endif /* CONFIG_SYSCTL */ =20 static void vcpu_periodic_timer_work_locked(struct vcpu *v) { diff --git a/xen/common/sched/credit.c b/xen/common/sched/credit.c index a6bb321e7d..6dcf6b2c8b 100644 --- a/xen/common/sched/credit.c +++ b/xen/common/sched/credit.c @@ -1256,6 +1256,7 @@ __csched_set_tslice(struct csched_private *prv, unsig= ned int timeslice_ms) prv->credit =3D prv->credits_per_tslice * prv->ncpus; } =20 +#ifdef CONFIG_SYSCTL static int cf_check csched_sys_cntl(const struct scheduler *ops, struct xen_sysctl_scheduler_op *sc) @@ -1298,6 +1299,7 @@ csched_sys_cntl(const struct scheduler *ops, out: return rc; } +#endif /* CONFIG_SYSCTL */ =20 static void *cf_check csched_alloc_domdata(const struct scheduler *ops, struct domain *dom) @@ -2288,7 +2290,9 @@ static const struct scheduler sched_credit_def =3D { =20 .adjust =3D csched_dom_cntl, .adjust_affinity=3D csched_aff_cntl, +#ifdef CONFIG_SYSCTL .adjust_global =3D csched_sys_cntl, +#endif =20 .pick_resource =3D csched_res_pick, .do_schedule =3D csched_schedule, diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c index 0a83f23725..0b3b61df57 100644 --- a/xen/common/sched/credit2.c +++ b/xen/common/sched/credit2.c @@ -3131,6 +3131,7 @@ csched2_aff_cntl(const struct scheduler *ops, struct = sched_unit *unit, __clear_bit(__CSFLAG_pinned, &svc->flags); } =20 +#ifdef CONFIG_SYSCTL static int cf_check csched2_sys_cntl( const struct scheduler *ops, struct xen_sysctl_scheduler_op *sc) { @@ -3162,6 +3163,7 @@ static int cf_check csched2_sys_cntl( =20 return 0; } +#endif /* CONFIG_SYSCTL */ =20 static void *cf_check csched2_alloc_domdata(const struct scheduler *ops, struct domain *dom) @@ -4232,7 +4234,9 @@ static const struct scheduler sched_credit2_def =3D { =20 .adjust =3D csched2_dom_cntl, .adjust_affinity=3D csched2_aff_cntl, +#ifdef CONFIG_SYSCTL .adjust_global =3D csched2_sys_cntl, +#endif =20 .pick_resource =3D csched2_res_pick, .migrate =3D csched2_unit_migrate, diff --git a/xen/common/sched/private.h b/xen/common/sched/private.h index c0e7c96d24..d6884550cd 100644 --- a/xen/common/sched/private.h +++ b/xen/common/sched/private.h @@ -356,8 +356,10 @@ struct scheduler { struct sched_unit *unit, const struct cpumask *hard, const struct cpumask *soft); +#ifdef CONFIG_SYSCTL int (*adjust_global) (const struct scheduler *ops, struct xen_sysctl_scheduler_op *sc); +#endif void (*dump_settings) (const struct scheduler *ops); void (*dump_cpu_state) (const struct scheduler *ops, int cpu); void (*move_timers) (const struct scheduler *ops, @@ -510,11 +512,13 @@ static inline int sched_adjust_dom(const struct sched= uler *s, struct domain *d, return s->adjust ? s->adjust(s, d, op) : 0; } =20 +#ifdef CONFIG_SYSCTL static inline int sched_adjust_cpupool(const struct scheduler *s, struct xen_sysctl_scheduler_op *op) { return s->adjust_global ? s->adjust_global(s, op) : 0; } +#endif =20 static inline void sched_move_timers(const struct scheduler *s, struct sched_resource *sr) diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h index 5ac99904c4..6e1789c314 100644 --- a/xen/include/xsm/xsm.h +++ b/xen/include/xsm/xsm.h @@ -57,7 +57,9 @@ struct xsm_ops { int (*domain_create)(struct domain *d, uint32_t ssidref); int (*getdomaininfo)(struct domain *d); int (*domctl_scheduler_op)(struct domain *d, int op); +#ifdef CONFIG_SYSCTL int (*sysctl_scheduler_op)(int op); +#endif int (*set_target)(struct domain *d, struct domain *e); int (*domctl)(struct domain *d, unsigned int cmd, uint32_t ssidref); int (*sysctl)(int cmd); @@ -244,10 +246,12 @@ static inline int xsm_domctl_scheduler_op( return alternative_call(xsm_ops.domctl_scheduler_op, d, cmd); } =20 +#ifdef CONFIG_SYSCTL static inline int xsm_sysctl_scheduler_op(xsm_default_t def, int cmd) { return alternative_call(xsm_ops.sysctl_scheduler_op, cmd); } +#endif =20 static inline int xsm_set_target( xsm_default_t def, struct domain *d, struct domain *e) diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c index d46413ad8c..8d44f5bfb6 100644 --- a/xen/xsm/dummy.c +++ b/xen/xsm/dummy.c @@ -19,7 +19,9 @@ static const struct xsm_ops __initconst_cf_clobber dummy_= ops =3D { .domain_create =3D xsm_domain_create, .getdomaininfo =3D xsm_getdomaininfo, .domctl_scheduler_op =3D xsm_domctl_scheduler_op, +#ifdef CONFIG_SYSCTL .sysctl_scheduler_op =3D xsm_sysctl_scheduler_op, +#endif .set_target =3D xsm_set_target, .domctl =3D xsm_domctl, #ifdef CONFIG_SYSCTL diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c index 45c12aa662..a7cb33a718 100644 --- a/xen/xsm/flask/hooks.c +++ b/xen/xsm/flask/hooks.c @@ -626,6 +626,7 @@ static int cf_check flask_domctl_scheduler_op(struct do= main *d, int op) } } =20 +#ifdef CONFIG_SYSCTL static int cf_check flask_sysctl_scheduler_op(int op) { switch ( op ) @@ -640,6 +641,7 @@ static int cf_check flask_sysctl_scheduler_op(int op) return avc_unknown_permission("sysctl_scheduler_op", op); } } +#endif /* CONFIG_SYSCTL */ =20 static int cf_check flask_set_target(struct domain *d, struct domain *t) { @@ -1887,7 +1889,9 @@ static const struct xsm_ops __initconst_cf_clobber fl= ask_ops =3D { .domain_create =3D flask_domain_create, .getdomaininfo =3D flask_getdomaininfo, .domctl_scheduler_op =3D flask_domctl_scheduler_op, +#ifdef CONFIG_SYSCTL .sysctl_scheduler_op =3D flask_sysctl_scheduler_op, +#endif .set_target =3D flask_set_target, .domctl =3D flask_domctl, #ifdef CONFIG_SYSCTL --=20 2.34.1 From nobody Thu Oct 30 23:12:08 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1751858097; cv=pass; d=zohomail.com; s=zohoarc; b=Pu7rBwrfXnzJcgudYc7v0kPSiz2uZDrbEqaPSPl+o18EYrr6V0LZ6tzPWzFHA7s028GDZYCp5PiAuCthN1RUsnJRaOwYRDlv/2X+xzT2zxfakoz4TkePGSA+s/9XzNoERKWGqvepcqPkFRaX3q2S2uQGTRrhU07kCdmL+YotFg0= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751858097; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=dFLZ7b6gl3GP+IHNPjkhHrTHCTAFBKAP01UJHvvbNv4=; b=kn9jkNKUMN6s2ff5rhKjVoNILODEoL2ZJQa9pqmGII8INF2hmu62GyDD20mEnfedobVNSMoUynFbNzJwZyaopPrQoeD7RXyRGBw1y590GW/vH7xYX3m77IFIixVUjcmJpk0t8HVmnt0SZvG+ToX/Z6HZjVac8qjg5+7CwSzLzcc= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1751858097584616.785003391386; Sun, 6 Jul 2025 20:14:57 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1035085.1407358 (Exim 4.92) (envelope-from ) id 1uYcJW-0001n6-VS; Mon, 07 Jul 2025 03:14:42 +0000 Received: by outflank-mailman (output) from mailman id 1035085.1407358; Mon, 07 Jul 2025 03:14:42 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uYcJW-0001mt-RL; Mon, 07 Jul 2025 03:14:42 +0000 Received: by outflank-mailman (input) for mailman id 1035085; Mon, 07 Jul 2025 03:14:41 +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 1uYcJV-0007KZ-GA for xen-devel@lists.xenproject.org; Mon, 07 Jul 2025 03:14:41 +0000 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2060e.outbound.protection.outlook.com [2a01:111:f403:2416::60e]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 8477790a-5ae0-11f0-a316-13f23c93f187; Mon, 07 Jul 2025 05:14:40 +0200 (CEST) Received: from BY3PR10CA0006.namprd10.prod.outlook.com (2603:10b6:a03:255::11) by DS0PR12MB7557.namprd12.prod.outlook.com (2603:10b6:8:130::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8880.17; Mon, 7 Jul 2025 03:14:34 +0000 Received: from SJ5PEPF000001ED.namprd05.prod.outlook.com (2603:10b6:a03:255:cafe::b2) by BY3PR10CA0006.outlook.office365.com (2603:10b6:a03:255::11) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8901.26 via Frontend Transport; Mon, 7 Jul 2025 03:14:34 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by SJ5PEPF000001ED.mail.protection.outlook.com (10.167.242.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8901.15 via Frontend Transport; Mon, 7 Jul 2025 03:14:33 +0000 Received: from penny-System-Product-Name.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Sun, 6 Jul 2025 22:14:29 -0500 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 8477790a-5ae0-11f0-a316-13f23c93f187 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=MS9hV+vi0suzY2gAXozYI+LVDqqLkah72vBMVrc+AxVNRibvUn0yygWEDByTgKE26eXJpVFepFXABJAhw8yhhYI2mBs92rAVInr9upTO+KgMcNFLLzkjZlk0yoBdrVK85i7N+dUvx3SJxIvMVuIAY01bC2dG1yAphE7/2LqKammMeL0owXxMIFxDebFm0dKUmcQ9BHiE3bMxO5yQ5cu/MRBf4euhNFoq8w7d6zcdQEWeseU2HiYM+t60dJCGzi0MxWMWo53dw2WjNqD/YT0r/Qs7F1wxXM6BFVKe/MwsPLk6yMO8CoZmU6O9HK0f3ridnYZC24obzik7+eX2ZcOBIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=dFLZ7b6gl3GP+IHNPjkhHrTHCTAFBKAP01UJHvvbNv4=; b=j+UoKIive99mGoGWM+NjEm4GXfUnQDurgoaWiFPuglupayVTk2n5e4Q/KGqG+OG0Fa95ljIUP8RU7xe08Liq3Ljlmt1Urv5cGUZQ8Nv4NNakInx4fAazBD5jQVeLmAlsOmkzt0k0zehIaoQ6sl4j5XpOBxRyQnSGB9o/XnCtj2PYxHfetfP6qYw7wXa8iZOJ8u8pwHFUxEHRDOb6OvB3P6VItkggxZNWK/WDAhC+PAzNUvJ+hg7VJa8Q5oy1cpw6GptfhkzGODR+96TpKhMOfSF1ruL+yfIN6H68A+jdPa6hhv76UY4sttMhb48JFpL+CIFpPsr/+sSbbEcD3w6NAQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dFLZ7b6gl3GP+IHNPjkhHrTHCTAFBKAP01UJHvvbNv4=; b=bKx5juODLbjzUcXBIWDn82E5ktXY0F1ghfRmEQGlZWK/2SMinKAbo3DICC2V9p6N1R8UhQlLwos4QF7pG6Qem1BNZjLzZpXz5bR0E07SaS6IoVmugOy4wALU3/cWlzFokEOLI44MTANK41mK3kpRfrzpymbPTY84V55RmW+JC4E= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C From: Penny Zheng To: CC: , Penny Zheng , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , "Volodymyr Babchuk" , Alistair Francis , Bob Eshleman , "Connor Davis" , Oleksii Kurochko , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , "Stefano Stabellini" , Sergiy Kibrik Subject: [PATCH 09/11] xen/sysctl: wrap around arch-specific arch_do_sysctl Date: Mon, 7 Jul 2025 11:13:44 +0800 Message-ID: <20250707031346.901567-10-Penny.Zheng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250707031346.901567-1-Penny.Zheng@amd.com> References: <20250707031346.901567-1-Penny.Zheng@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ5PEPF000001ED:EE_|DS0PR12MB7557:EE_ X-MS-Office365-Filtering-Correlation-Id: a52ac6f2-5c3b-4ac1-3445-08ddbd0465b0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|82310400026|36860700013|376014|7416014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?BaXfton8BEftg5Mv9SLYJZBYw1FvlgFwvi4apAzbv3Gc7mKwc0WQg0koKP1f?= =?us-ascii?Q?xOhGj3vLPcBrt+WxyYoLczLD6xWmfs0vCoAg/vMct8Jt1JSO9NMolr84PMEy?= =?us-ascii?Q?fkh7ubqlUf7Aq6guEhiuzsxw4XjXR+/HULyY2A5/fs6gQPsZfIblCBFduqaO?= =?us-ascii?Q?jEyixvdGO1rUJ0Uua+45fl0/4T1CR1q4Dw4a5/3OyHxXDdlp8V9huFIgIwZv?= =?us-ascii?Q?xbfPdBOfYIzPQNYL5/VzuU1onlEeNZTvjW941POTfzWCeQ0zJ8dRQHEO00rK?= =?us-ascii?Q?jmrcBb57rczCaTE3pMvqET1u17yyoQocOTgLJkSqCgVCp87N19bJvdAfUUT5?= =?us-ascii?Q?ePMl6rZt1eE4F01+3uD3tBykF11AB56NSt/2+1ukWqsWlgefxJw8fXvsGhr7?= =?us-ascii?Q?DElKjUZXSoeaRPHfuSI96jJuKE+hFA0TYKyK5yXgiLoCi+9hJBQ9uMD0GLQ9?= =?us-ascii?Q?GNt+KKteuqf5LcWWm8hH1yolhAiKqDavjEBtdsBVhtN5Lp8mryYeTbjLwRDC?= =?us-ascii?Q?UxfEqEmSus9Kl/UQpzX2EWi6xykoneZHHcBT68PFGaOPSA/1KNKP+/OcBISS?= =?us-ascii?Q?flFdfjyldBJU+MxcoEwdq25S4rqOvRZvoWxhvYvjp28v6QmLxGEuGeaQsQpL?= =?us-ascii?Q?/jW8i3mmIwDO6xe2z1Y0vIC6h7HubqvGuqUBMCmKXFGTNEuY6M9HI2P9g7Un?= =?us-ascii?Q?v9Z1c8CaqwkE2hSqMm1wkiG2yq6mE38r8nLCqt6eaARAGwW/8xedkKt35EQ5?= =?us-ascii?Q?I2cK/TmxBHu9bcgRz9QS+6U8XFewho7IC9TnXWXgvmDArYkvR9Mce9Adorgk?= =?us-ascii?Q?VY5FQKDRRRxKZlURDFqXcygMJfEeKEcrCdwliF0h5IniZk2AWOs0tnEssQ78?= =?us-ascii?Q?fjtwFswXRI+aR1kfYvg5TGsu12IOSLTqMWoCxE0gGixBv0VOjnPWoqHSserS?= =?us-ascii?Q?wQvFvk/qAqFwu8Ur4fHfqQvm95rr7PYiwoKKgbxJjRdnd4CuIGGOtoGPCkyN?= =?us-ascii?Q?NAEy+Gi7BE1V2DEA/7nOIrFYY0AS18+lWCNny/hgf7lq4nKmpN2J6KqY25mp?= =?us-ascii?Q?4wdOYpYm3sIeQbweOQb+Wtb5sTgMPDVH5sEl29VMNFOOZtkufA6t8/V4n0rP?= =?us-ascii?Q?TamuleR09A/2mfYzxzI2nG/fdPlaSz5Ou7oN8AXV3swb3SqRc8N6K9VedFnp?= =?us-ascii?Q?vYihfzlYZALyagOIUSlLnwjC4RlHXx/OPhtxBPXtBYxVPn3NXriX3coEyxkv?= =?us-ascii?Q?Dvrmtnc90AuZmaUo3jWlw2+LnGtTdoU1KiuvbKwBTvsjhpg1mL87TxV4Twxh?= =?us-ascii?Q?V+wpHLtQ1uryV87glSiXb1Xv8Ti5rKTu7JsTo6wJiku8dJuUl+sPvGnG9BNz?= =?us-ascii?Q?rsX+2zYDQih7oykJKogUkyiPwlE3/m5+uJSe9KNh0rbwU1ADGOGvES/N/gFh?= =?us-ascii?Q?rPefGEtnnO4ckcrIqC5Pl5wIp3XNubiDSUfuiNOHcr2JsdgpWed46Sy7LQVf?= =?us-ascii?Q?ldPt4WMQXI5ISliZ3PSzFpZ33K1BCLLs8J7+?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(82310400026)(36860700013)(376014)(7416014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2025 03:14:33.8705 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a52ac6f2-5c3b-4ac1-3445-08ddbd0465b0 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ5PEPF000001ED.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7557 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1751858098939116600 Content-Type: text/plain; charset="utf-8" Function arch_do_sysctl is to perform arch-specific sysctl op. Some functions, like psr_get_info() for x86, DTB overlay support for arm, are solely available through sysctl op, then they all shall be wrapped with CONFIG_SYSCTL Also, remove all #ifdef CONFIG_SYSCTL-s in arch-specific sysctl.c, as we put the guardian in Makefile for the whole file. Since PV_SHIM_EXCLUSIVE needs sorting in the future, we move obj-$(CONFIG_SYSCTL) +=3D sysctl.o out of PV_SHIM_EXCLUSIVE condition. Signed-off-by: Stefano Stabellini Signed-off-by: Sergiy Kibrik Signed-off-by: Penny Zheng Reviewed-by: Stefano Stabellini Acked-by: Jan Beulich --- v1 -> v2: - use "depends on" for config OVERLAY_DTB - no need to wrap declaration - add transient #ifdef in sysctl.c for correct compilation --- v2 -> v3: - move obj-$(CONFIG_SYSCTL) +=3D sysctl.o out of PV_SHIM_EXCLUSIVE condition - move copyback out of #ifdef - add #else process for default label --- v3 -> v4: - remove transient "#ifdef CONFIG_SYSCTL" - move #ifdef ahead of the comment --- xen/arch/arm/Kconfig | 1 + xen/arch/arm/Makefile | 2 +- xen/arch/arm/sysctl.c | 2 -- xen/arch/riscv/stubs.c | 2 +- xen/arch/x86/Makefile | 2 +- xen/arch/x86/psr.c | 18 ++++++++++++++++++ xen/arch/x86/sysctl.c | 2 -- 7 files changed, 22 insertions(+), 7 deletions(-) diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig index 3f25da3ca5..e076419d5e 100644 --- a/xen/arch/arm/Kconfig +++ b/xen/arch/arm/Kconfig @@ -139,6 +139,7 @@ config HAS_ITS =20 config OVERLAY_DTB bool "DTB overlay support (UNSUPPORTED)" if UNSUPPORTED + depends on SYSCTL help Dynamic addition/removal of Xen device tree nodes using a dtbo. =20 diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile index ab0a0c2be6..f833cdf207 100644 --- a/xen/arch/arm/Makefile +++ b/xen/arch/arm/Makefile @@ -51,7 +51,7 @@ obj-y +=3D setup.o obj-y +=3D shutdown.o obj-y +=3D smp.o obj-y +=3D smpboot.o -obj-y +=3D sysctl.o +obj-$(CONFIG_SYSCTL) +=3D sysctl.o obj-y +=3D time.o obj-y +=3D traps.o obj-y +=3D vcpreg.o diff --git a/xen/arch/arm/sysctl.c b/xen/arch/arm/sysctl.c index 2d350b700a..32cab4feff 100644 --- a/xen/arch/arm/sysctl.c +++ b/xen/arch/arm/sysctl.c @@ -15,7 +15,6 @@ #include #include =20 -#ifdef CONFIG_SYSCTL void arch_do_physinfo(struct xen_sysctl_physinfo *pi) { pi->capabilities |=3D XEN_SYSCTL_PHYSCAP_hvm | XEN_SYSCTL_PHYSCAP_hap; @@ -23,7 +22,6 @@ void arch_do_physinfo(struct xen_sysctl_physinfo *pi) pi->arch_capabilities |=3D MASK_INSR(sve_encode_vl(get_sys_vl_len()), XEN_SYSCTL_PHYSCAP_ARM_SVE_MASK); } -#endif =20 long arch_do_sysctl(struct xen_sysctl *sysctl, XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl) diff --git a/xen/arch/riscv/stubs.c b/xen/arch/riscv/stubs.c index f86a1c17cb..8918cebf35 100644 --- a/xen/arch/riscv/stubs.c +++ b/xen/arch/riscv/stubs.c @@ -302,6 +302,7 @@ unsigned long raw_copy_from_guest(void *to, const void = __user *from, BUG_ON("unimplemented"); } =20 +#ifdef CONFIG_SYSCTL /* sysctl.c */ =20 long arch_do_sysctl(struct xen_sysctl *sysctl, @@ -310,7 +311,6 @@ long arch_do_sysctl(struct xen_sysctl *sysctl, BUG_ON("unimplemented"); } =20 -#ifdef CONFIG_SYSCTL void arch_do_physinfo(struct xen_sysctl_physinfo *pi) { BUG_ON("unimplemented"); diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile index ce724a9daa..96d63219e7 100644 --- a/xen/arch/x86/Makefile +++ b/xen/arch/x86/Makefile @@ -63,6 +63,7 @@ obj-y +=3D smpboot.o obj-y +=3D spec_ctrl.o obj-y +=3D srat.o obj-y +=3D string.o +obj-$(CONFIG_SYSCTL) +=3D sysctl.o obj-y +=3D time.o obj-y +=3D traps-setup.o obj-y +=3D traps.o @@ -78,7 +79,6 @@ ifneq ($(CONFIG_PV_SHIM_EXCLUSIVE),y) obj-y +=3D domctl.o obj-y +=3D platform_hypercall.o obj-$(CONFIG_COMPAT) +=3D x86_64/platform_hypercall.o -obj-y +=3D sysctl.o endif =20 extra-y +=3D asm-macros.i diff --git a/xen/arch/x86/psr.c b/xen/arch/x86/psr.c index 5815a35335..499d320e61 100644 --- a/xen/arch/x86/psr.c +++ b/xen/arch/x86/psr.c @@ -133,9 +133,11 @@ static const struct feat_props { */ enum psr_type alt_type; =20 +#ifdef CONFIG_SYSCTL /* get_feat_info is used to return feature HW info through sysctl. */ bool (*get_feat_info)(const struct feat_node *feat, uint32_t data[], unsigned int array_len); +#endif =20 /* write_msr is used to write out feature MSR register. */ void (*write_msr)(unsigned int cos, uint32_t val, enum psr_type type); @@ -418,6 +420,7 @@ static bool mba_init_feature(const struct cpuid_leaf *r= egs, return true; } =20 +#ifdef CONFIG_SYSCTL static bool cf_check cat_get_feat_info( const struct feat_node *feat, uint32_t data[], unsigned int array_len) { @@ -430,6 +433,7 @@ static bool cf_check cat_get_feat_info( =20 return true; } +#endif /* CONFIG_SYSCTL */ =20 /* L3 CAT props */ static void cf_check l3_cat_write_msr( @@ -442,11 +446,14 @@ static const struct feat_props l3_cat_props =3D { .cos_num =3D 1, .type[0] =3D PSR_TYPE_L3_CBM, .alt_type =3D PSR_TYPE_UNKNOWN, +#ifdef CONFIG_SYSCTL .get_feat_info =3D cat_get_feat_info, +#endif .write_msr =3D l3_cat_write_msr, .sanitize =3D cat_check_cbm, }; =20 +#ifdef CONFIG_SYSCTL /* L3 CDP props */ static bool cf_check l3_cdp_get_feat_info( const struct feat_node *feat, uint32_t data[], uint32_t array_len) @@ -458,6 +465,7 @@ static bool cf_check l3_cdp_get_feat_info( =20 return true; } +#endif /* CONFIG_SYSCTL */ =20 static void cf_check l3_cdp_write_msr( unsigned int cos, uint32_t val, enum psr_type type) @@ -473,7 +481,9 @@ static const struct feat_props l3_cdp_props =3D { .type[0] =3D PSR_TYPE_L3_DATA, .type[1] =3D PSR_TYPE_L3_CODE, .alt_type =3D PSR_TYPE_L3_CBM, +#ifdef CONFIG_SYSCTL .get_feat_info =3D l3_cdp_get_feat_info, +#endif .write_msr =3D l3_cdp_write_msr, .sanitize =3D cat_check_cbm, }; @@ -489,11 +499,14 @@ static const struct feat_props l2_cat_props =3D { .cos_num =3D 1, .type[0] =3D PSR_TYPE_L2_CBM, .alt_type =3D PSR_TYPE_UNKNOWN, +#ifdef CONFIG_SYSCTL .get_feat_info =3D cat_get_feat_info, +#endif .write_msr =3D l2_cat_write_msr, .sanitize =3D cat_check_cbm, }; =20 +#ifdef CONFIG_SYSCTL /* MBA props */ static bool cf_check mba_get_feat_info( const struct feat_node *feat, uint32_t data[], unsigned int array_len) @@ -508,6 +521,7 @@ static bool cf_check mba_get_feat_info( =20 return true; } +#endif /* CONFIG_SYSCTL */ =20 static void cf_check mba_write_msr( unsigned int cos, uint32_t val, enum psr_type type) @@ -545,7 +559,9 @@ static const struct feat_props mba_props =3D { .cos_num =3D 1, .type[0] =3D PSR_TYPE_MBA_THRTL, .alt_type =3D PSR_TYPE_UNKNOWN, +#ifdef CONFIG_SYSCTL .get_feat_info =3D mba_get_feat_info, +#endif .write_msr =3D mba_write_msr, .sanitize =3D mba_sanitize_thrtl, }; @@ -808,6 +824,7 @@ static struct psr_socket_info *get_socket_info(unsigned= int socket) return socket_info + socket; } =20 +#ifdef CONFIG_SYSCTL int psr_get_info(unsigned int socket, enum psr_type type, uint32_t data[], unsigned int array_len) { @@ -839,6 +856,7 @@ int psr_get_info(unsigned int socket, enum psr_type typ= e, =20 return -EINVAL; } +#endif /* CONFIG_SYSCTL */ =20 int psr_get_val(struct domain *d, unsigned int socket, uint32_t *val, enum psr_type type) diff --git a/xen/arch/x86/sysctl.c b/xen/arch/x86/sysctl.c index f64addbe2b..1b04947516 100644 --- a/xen/arch/x86/sysctl.c +++ b/xen/arch/x86/sysctl.c @@ -91,7 +91,6 @@ static long cf_check smt_up_down_helper(void *data) return ret; } =20 -#ifdef CONFIG_SYSCTL void arch_do_physinfo(struct xen_sysctl_physinfo *pi) { memcpy(pi->hw_cap, boot_cpu_data.x86_capability, @@ -105,7 +104,6 @@ void arch_do_physinfo(struct xen_sysctl_physinfo *pi) if ( IS_ENABLED(CONFIG_SHADOW_PAGING) ) pi->capabilities |=3D XEN_SYSCTL_PHYSCAP_shadow; } -#endif /* CONFIG_SYSCTL */ =20 long arch_do_sysctl( struct xen_sysctl *sysctl, XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysc= tl) --=20 2.34.1 From nobody Thu Oct 30 23:12:08 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1751858101; cv=pass; d=zohomail.com; s=zohoarc; b=Xh4MyA7fchM1WngWH9UVO1LUSZEJRDxEDbErlsU0Ol6QYkk0WQWgZRUfFyHmecjnLRTBMluOr/tPFQpZIjxzy9+na3D6vrRqyQpgzDiOLnqgnaUcs+TDAWu8jB2VdcJ924Ao1tC1GXL84ZJByaUZS6MGvq2VsGQkRKJABZqtAGo= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751858101; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=qJ0yWQQ3+ezfc84j0CJ2nrRzdn7Cpfu7Pu0S/BuaQIE=; b=LhV43G3+K3DQo0tBPLXXqognjV/GuHKT3Q0dB4pi9nk50QCElVfrCM+j/SYAPau86GXTDwetAKjSMVanlwkg0Xmc2fbJwNyoAkDZOcmNHfbT7SPK/heV5vcXnsoq2Q3ZLwoZrMgtOwO696q5BInrfoNW0mOTRLUCDz/uzHax63Y= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1751858101560130.40058431202806; Sun, 6 Jul 2025 20:15:01 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1035086.1407365 (Exim 4.92) (envelope-from ) id 1uYcJX-0001uM-M9; Mon, 07 Jul 2025 03:14:43 +0000 Received: by outflank-mailman (output) from mailman id 1035086.1407365; Mon, 07 Jul 2025 03:14:43 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uYcJX-0001te-Dn; Mon, 07 Jul 2025 03:14:43 +0000 Received: by outflank-mailman (input) for mailman id 1035086; Mon, 07 Jul 2025 03:14:42 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uYcJW-0007mT-Lg for xen-devel@lists.xenproject.org; Mon, 07 Jul 2025 03:14:42 +0000 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on20624.outbound.protection.outlook.com [2a01:111:f403:2417::624]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 851f2a38-5ae0-11f0-b894-0df219b8e170; Mon, 07 Jul 2025 05:14:41 +0200 (CEST) Received: from BY5PR03CA0016.namprd03.prod.outlook.com (2603:10b6:a03:1e0::26) by CH2PR12MB4311.namprd12.prod.outlook.com (2603:10b6:610:a8::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8880.30; Mon, 7 Jul 2025 03:14:38 +0000 Received: from SJ5PEPF000001E8.namprd05.prod.outlook.com (2603:10b6:a03:1e0:cafe::15) by BY5PR03CA0016.outlook.office365.com (2603:10b6:a03:1e0::26) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8901.26 via Frontend Transport; Mon, 7 Jul 2025 03:14:37 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by SJ5PEPF000001E8.mail.protection.outlook.com (10.167.242.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8901.15 via Frontend Transport; Mon, 7 Jul 2025 03:14:36 +0000 Received: from penny-System-Product-Name.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Sun, 6 Jul 2025 22:14:33 -0500 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 851f2a38-5ae0-11f0-b894-0df219b8e170 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=G9sh/t4tziq4DB/Ko8P2Dbht7DdhXZJ+0qNmmhO1UGd9e4C9W4bu4i7uFRnk6X9djh4fNufcKvBozEIsr3b3yi5NgeRs7qskp2ECr24puKtFVyKHXeB61IzENkm7KjU/3NRxtD0/tqo1eZvvYlxQa5JgYYOdgKssrRtyIDD+y6DPn2tcxaaPpqIa6rBmqDSfMx+VPX/yiLxi4EEatNUqC3GaCnkRokMhc2XBpmcvtiJi5e6pLG3T64+EEKbqy3WG9xraKpjbO1lvvbn5lcyg8ue8mVfQZ6nw37XDPoTk5zNlB4U0OipjrytFBzuSSnptMcqT1UQnckJhdzwjidXJnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=qJ0yWQQ3+ezfc84j0CJ2nrRzdn7Cpfu7Pu0S/BuaQIE=; b=FFa/DUGkluWVgzSOt8NvVeKgwaGbIUCDQ1JS77cTNYn8BRoCfhK2or69FQPaPniFOp/4+VGZjeUpreKJFyGyTX3kaUw5UUZBaenyBK1GfN35HDq0jE4Pkl48epC1zOzt67VoXMAVtFBKKoT0MKT56z/2V9TSsc6l1siai5olNXc3ItSXBCh8E9ZAdxLGx+eBkj/BniveQPs6vz9AXqc8I79a9KxZvXrExYKLzS6pYn+3igwwJf5HpCZIYGJ50e0LvONEl9npQwl0Q19cAlWJmeYMOzm1q0udj471l9tY/3LC0v9h++ZIY1xzz7GbHIlmu9aevFt25gqYijtW02ZXrw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qJ0yWQQ3+ezfc84j0CJ2nrRzdn7Cpfu7Pu0S/BuaQIE=; b=Jh2XC/3tSeIKB0AlNPfV7vFHa4pbrNj0ccOT1HEPVQq7xbm3sEQ4mpRk1QEGUX0dlcBDRyDVKTvu6ySXgn16Xq+LniRDlWVUdZVVkp228mzwi+HHOuIUwS/qAKPbr8nFvYX0X5SR5oyiTRENQJ9xsuZGU88blC2ypIYeTxroQ4Y= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C From: Penny Zheng To: CC: , Penny Zheng , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Anthony PERARD , Michal Orzel , "Julien Grall" , Stefano Stabellini Subject: [PATCH 10/11] xen/x86: remove "depends on !PV_SHIM_EXCLUSIVE" Date: Mon, 7 Jul 2025 11:13:45 +0800 Message-ID: <20250707031346.901567-11-Penny.Zheng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250707031346.901567-1-Penny.Zheng@amd.com> References: <20250707031346.901567-1-Penny.Zheng@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ5PEPF000001E8:EE_|CH2PR12MB4311:EE_ X-MS-Office365-Filtering-Correlation-Id: e5b9dbbf-1c35-4cbc-28cf-08ddbd04675a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|82310400026|376014|36860700013; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?jXLQ7e4oqagfkGBf3fwPUhk5Pa9KDV2oOo0aLonWpSGw/44DqgI/AiBTqJIw?= =?us-ascii?Q?EfHPHaW6dwD1a7kZQ2AzsZYowapIh5FWVXX0n+8rNsKNN70G8BCW1lqfJwOB?= =?us-ascii?Q?FPZVqX2yYd6MAJ1Mxp7bKt+ShndCO5X7rtg16Q8NFU2Fq/RlETukvFuKinHo?= =?us-ascii?Q?mpM1Qzkz7zwdevpNoFCWsE5Lwclj+GraQHxGw8Jzojpj1CAEfGkxhkFNCpBT?= =?us-ascii?Q?CgcvKxkp6YRraCMzpVEgC194umWDK208bEki3xDVzePNEeX1S5dB6XpV3QVZ?= =?us-ascii?Q?aV1iVSuQ0McInI4UcxYYBUlmSWUTHHgg1RdrHjWx2JcVoFcmy3amN3r7Xtml?= =?us-ascii?Q?p2tmJ7VpLdujdh9oEoqNKcZQV78cy3Etf5yFdVNR8AVgV4SFKjmeZLpSkWES?= =?us-ascii?Q?y59UnOmzRAY8Pghqn1GlSBIWEIAXuYXvJ+lZtWokSlP9kDlTL6n7jwqmzjpd?= =?us-ascii?Q?I+lDPXgNgbxZcAwz8nyT0QsGulLZ2NkuV+mDOcqJiYZFDzRdOpyhpZPzOZ2a?= =?us-ascii?Q?UEA429M0xjqo1iyOmiBaIdVqXlGZ8ZJ6VJujHhZQLMhxQGOABvjekBNwbS5D?= =?us-ascii?Q?Af8Iot1BniIH+o/ufA9cBhL8D5zK29VoUD2A3EHERZjuEa4YhAhqVcCmwkib?= =?us-ascii?Q?K/0i/TBRYjx9RhcxNDzPRNtnfJjsLhzuygyFXflkdeVaYwHifbid384IzOrL?= =?us-ascii?Q?CgnbXQR3mXq8zZqc1iC/k4k1KDHpUgeR+35Xh9H56inSc/o48nLwP6szM4r9?= =?us-ascii?Q?irzE84E3lghnpLHTTi8/AQYESa2bVPmaDZFsiYOPZ7stumYlV0Zyk/Vys4Nv?= =?us-ascii?Q?lQFsT21R1UQ6HBEFy+M2jjeJN9VEririM4pAbfELwLP/0j/UAnHQv5pSMsmA?= =?us-ascii?Q?wYmLs4syIpOHHuFkR9oPZRcpgwhY1kNfYsxx5qnl6yWoKeKAtGenXvlzwMod?= =?us-ascii?Q?NpDNNZOiy99IEsHx0bmmBXK5Xx6hYpewWvagfJ89cCEaVxooL5jillgOmBXM?= =?us-ascii?Q?2rz4UNvIpvz0kh7c4It87jM2l5Gfx4KN9uhsIe5QFg3pMZLl3KaVKDzgil/0?= =?us-ascii?Q?r6PEhQZ1Go7gH2a8rRr9sDBJfCMS6ceLaYuui49DudYgaI3saQrhOmLPFOT1?= =?us-ascii?Q?D9GIPkvtU9kY6S7uqBWYjZ58ZoSCtBdy6lQ/NwrBugaAQ013HrchnVN9BIZK?= =?us-ascii?Q?VdrmrJ4nxrIZC2rOJwWDcRJ7RXxwRr2TTpGfoHWuHH8V5GZCDEdEwuWDejEA?= =?us-ascii?Q?nyhWt813sqoXrzQv284Lt0FgyU/zU9/zQ09pGJHawb+7M0QcH6B3EfQ4E9kp?= =?us-ascii?Q?7X+kgOoS1yxeD6j9nuju8shikiFRX67kiXeyP5+xAQIKj564ELzD+N31BL/m?= =?us-ascii?Q?UGRi1bKMXFQyfGWukVrqRAVZ8eZqCb3kMIwFfd4YvtHtLSRJhCwrHxc8U8Za?= =?us-ascii?Q?DqGf3sFBXgLxZPGi6NuVxmlgyAprn3HROEgmp7yPywyf89qIjRUp0/tlA2Ll?= =?us-ascii?Q?jKymu5WWVtaphHe5sj9pTx5nQ9b1DXx2Fiqz?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(82310400026)(376014)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2025 03:14:36.6606 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e5b9dbbf-1c35-4cbc-28cf-08ddbd04675a X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ5PEPF000001E8.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4311 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1751858102633116600 Content-Type: text/plain; charset="utf-8" Remove all "depends on !PV_SHIM_EXCLUSIVE" (also the functionally equivalent "if !...") in Kconfig file, since negative dependancy will badly affect allyesconfig. Although "if !PV_SHIM_EXCLUSIVE" for CONFIG_VGA is not truly a dependency, setting PV_SHIM_EXCLUSIVE y still makes it unconfigurab= le. So we remove it here too Add "#CONFIG_xxx is not set" for above options in presets for x86 PV shim, = as the explicit declaration is to ephasize setting for the shim is different from the general default. Signed-off-by: Penny Zheng Reviewed-by: Stefano Stabellini --- This commit shall be commited together with the next one, which is also the last commit. --- v2 -> v3: - remove comment for PV_SHIM_EXCLUSIVE --- v3 -> v4: - explicitly state "CONFIG_xxx is not set" in "pvshim_defconfig" - Add "default y" for SHADOW_PAGING and TBOOT - refactor commit message --- v4 -> v5: - For not breaking allyesconfig, changes to defaults are actually not neede= d. So remove them all - Leave one blank lines --- v5 -> v6 - add description for change: removing "if !PV_SHIM_EXCLUSIVE" for CONFIG_V= GA --- xen/arch/x86/Kconfig | 4 ---- xen/arch/x86/hvm/Kconfig | 1 - xen/drivers/video/Kconfig | 2 +- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig index 752d5141bb..b45f17a16e 100644 --- a/xen/arch/x86/Kconfig +++ b/xen/arch/x86/Kconfig @@ -289,8 +289,6 @@ config PV_SHIM_EXCLUSIVE =20 If unsure, say N. =20 -if !PV_SHIM_EXCLUSIVE - config HYPERV_GUEST bool "Hyper-V Guest" select GUEST @@ -299,8 +297,6 @@ config HYPERV_GUEST =20 If unsure, say N. =20 -endif - config REQUIRE_NX bool "Require NX (No eXecute) support" help diff --git a/xen/arch/x86/hvm/Kconfig b/xen/arch/x86/hvm/Kconfig index 2def0f98e2..b903764bda 100644 --- a/xen/arch/x86/hvm/Kconfig +++ b/xen/arch/x86/hvm/Kconfig @@ -1,6 +1,5 @@ menuconfig HVM bool "HVM support" - depends on !PV_SHIM_EXCLUSIVE default !PV_SHIM select COMPAT select IOREQ_SERVER diff --git a/xen/drivers/video/Kconfig b/xen/drivers/video/Kconfig index 245030beea..0a51e87eb2 100644 --- a/xen/drivers/video/Kconfig +++ b/xen/drivers/video/Kconfig @@ -3,7 +3,7 @@ config VIDEO bool =20 config VGA - bool "VGA support" if !PV_SHIM_EXCLUSIVE + bool "VGA support" select VIDEO depends on X86 default y if !PV_SHIM_EXCLUSIVE --=20 2.34.1 From nobody Thu Oct 30 23:12:08 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1751858464; cv=pass; d=zohomail.com; s=zohoarc; b=AARRXu9Whsze7qvPQbLysabz1RJ1HtGMMEsXm9sAynSLAjKzwmQp1j7gwnaPzclSCI1SNmZnDAnEsOCg07uKR4Sbf1cU86djy+QxC759L/LmmCmm/Ul+OSpdRWecn5iH2ALGCeOwVZppOntGqngN5wNiwhIB2nm/N7V8ibBnyQo= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751858464; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=T1LpiZC0rlbfXrVfLcubSIpVFQgeVU79WtlQi0mk+O4=; b=JQCNkMzhNzPMiBEsf/J5AZ2R4Uu24JTlmRIDQ12LWtzNRjfgY5OJsfh4CK2CYUv9MP7bEpfTP22U37CWohLKMmWWu2wmmhCdChN2nds/q9ndkuGXDImxzk4ZTGaaV/kJCYroxi74lKbjw/aKNKyeIdFARUJl0QmpkqgSAOVnvhA= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1751858464087572.5799493787476; Sun, 6 Jul 2025 20:21:04 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1035118.1407380 (Exim 4.92) (envelope-from ) id 1uYcPP-0005pD-BE; Mon, 07 Jul 2025 03:20:47 +0000 Received: by outflank-mailman (output) from mailman id 1035118.1407380; Mon, 07 Jul 2025 03:20:47 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uYcPP-0005p6-6w; Mon, 07 Jul 2025 03:20:47 +0000 Received: by outflank-mailman (input) for mailman id 1035118; Mon, 07 Jul 2025 03:20:45 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uYcJd-0007mT-Jw for xen-devel@lists.xenproject.org; Mon, 07 Jul 2025 03:14:49 +0000 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on20631.outbound.protection.outlook.com [2a01:111:f403:2408::631]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 88f3b0ed-5ae0-11f0-b894-0df219b8e170; Mon, 07 Jul 2025 05:14:47 +0200 (CEST) Received: from BY3PR10CA0004.namprd10.prod.outlook.com (2603:10b6:a03:255::9) by DS0PR12MB7608.namprd12.prod.outlook.com (2603:10b6:8:13b::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8901.23; Mon, 7 Jul 2025 03:14:40 +0000 Received: from SJ5PEPF000001ED.namprd05.prod.outlook.com (2603:10b6:a03:255:cafe::8) by BY3PR10CA0004.outlook.office365.com (2603:10b6:a03:255::9) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8901.26 via Frontend Transport; Mon, 7 Jul 2025 03:14:40 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by SJ5PEPF000001ED.mail.protection.outlook.com (10.167.242.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8901.15 via Frontend Transport; Mon, 7 Jul 2025 03:14:40 +0000 Received: from penny-System-Product-Name.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Sun, 6 Jul 2025 22:14:36 -0500 X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 88f3b0ed-5ae0-11f0-b894-0df219b8e170 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=dEiGm2JmNyV2Dk56df/8Ee7a+rs7bv2N6X/DfaUTEX4YT5JKPh9nijVcRa1q3B/hlOaqt9vodb+UlZHwEtHTS+pIZ3VCbYyk3J1kv47Oqs3cpeUlB3/d1OxwCRKy481b7vsPdam2exptbRQ/x0Vgp+f5p9dugmKfYDSNCAtZy9tXzTj9usfsyVKdI1OCnTYFCzvG/u3xO6EZA2XIM5/9WcVAwH9eMwVsvjDkHo9P2zw31al0vP9dj2q7eUcYpRyEUcx4mlrnwAXuSiCngs6eFet97Mrzpd5Sw+k8i70Iyjm9laFTZs0Gpb8oHUDYoFKkMH5H9PenNtsXCVgEF0JTQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=T1LpiZC0rlbfXrVfLcubSIpVFQgeVU79WtlQi0mk+O4=; b=s+BzYbOgi8o0O9OHX+0C9JJm5j142F9wfUHOh1nuA4WFnDev8u5tjvURLnHX6OwBsyV0M8puSQhb6UibRRpR2DWs7+vRM7C0S5o1fvrtS7UQUl+SG2O6ghOCD6MUIfGLLK/tJX6u+B6EFdTxl6doY2idh39kBadnw8jFrVeD06NpwjQdKNJWo6Avq2zIEtf2aI0D0no3KlhxVbwLzLB93tL/SxWfbZt1W8rAqC4vHTBgF/qqEHG9a/x65gZCMBCKCYcW7MpA6XayhZM3woosp2ABDeo71rkQk4BZa8s9bTtwIpqCaxzjkw9MCZbXbX3bVePnVUMpmLHX6d++/fVsvw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=T1LpiZC0rlbfXrVfLcubSIpVFQgeVU79WtlQi0mk+O4=; b=aY4Dq0Q+uRqYrenAHPHeygBJKX60yjXYzFzBIetm2pGPVorK5pq29ZRe/TXomZp+llHKBGuNJWSJ3tBclnGrnFm7znVzDRYmj9idaaffe6inoaOuHeAt0DllWyJYU4uUKBjB5W8lw8UJFEsoFoGE4ag2WA45gJhygmt8O0SGWaU= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C From: Penny Zheng To: CC: , Stefano Stabellini , "Jan Beulich" , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Anthony PERARD , Michal Orzel , "Julien Grall" , Stefano Stabellini , Sergiy Kibrik , Penny Zheng Subject: [PATCH 11/11] xen/sysctl: wrap around sysctl hypercall Date: Mon, 7 Jul 2025 11:13:46 +0800 Message-ID: <20250707031346.901567-12-Penny.Zheng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250707031346.901567-1-Penny.Zheng@amd.com> References: <20250707031346.901567-1-Penny.Zheng@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ5PEPF000001ED:EE_|DS0PR12MB7608:EE_ X-MS-Office365-Filtering-Correlation-Id: 3d930276-5280-49ca-f76d-08ddbd0469bd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|82310400026|36860700013|1800799024; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?wA7vOce+YzLPANF//O1dgjHRE/3mnkatDWpQRx3UroKt9ND82kEyZoIy00iF?= =?us-ascii?Q?nyK70b0lzPw/L/DQ5h6jcb+6TrTcOMK+/vn5LCsdCmhh1Y2zmcy7eenZ235F?= =?us-ascii?Q?dm343p83wfmJYz1U2GP0HW0i1pAhEpWHOKk/k9CC5CkE1sBrBGIPULgFp4UU?= =?us-ascii?Q?JJZmhpk4mb86mHpgIJqU2mYTf65DZaOCupygdoXHitgM232+KAGpA74C6gDq?= =?us-ascii?Q?KlbKIIbKjFq052XMcNpB1OOmcHGuVqw0h7esQBh/5dkjvEB0W23sDRl8BBtt?= =?us-ascii?Q?19FORxWGdX01X3HDEg9mR20vAHibEW7NhJ2t2qVIXf/z5eq5AZQHp8+EoI13?= =?us-ascii?Q?IEypDMBF53rBpPmUXrKeP9FW2v0/YEJ8PE+PxjhFWCzO7lQkknlyIOxf1189?= =?us-ascii?Q?HEDuPbfHwLPJirhSc/FTFdV996UyzX65fYnwgW1CisLJJKK7oEIgC7mzYfVa?= =?us-ascii?Q?7C+JBAL9KUPVjlixSfLNzfFNeKKO5YohgMyf//EMUwwvfD4OJMEMq1WEe60M?= =?us-ascii?Q?1ZPmYokmSw8rVIGCrB8KoJDcmDkF6ugRLSWlbB5FKHX2r0e5jYofR3jlQILM?= =?us-ascii?Q?zy0hojg+AbUeS5ClwYWkiHED7j2buzzaUblGz7l/2K9cTvioJ/f4FK8zzxr5?= =?us-ascii?Q?qktqZoRqLiSMrk9ftRP/22OfrVh47scRzVhzqgj8UR7uDRp4s6tEqa9r6I+/?= =?us-ascii?Q?5ybuTvPjpSrPUt5kU3q8CgmDWHjw/NpRD2GPrTupUuQVCcsWQZaao0bE2iGc?= =?us-ascii?Q?rSnyZnqdzQhLGzFASDROGnI0FqjMTbSh4kZOqdLGzls+db2xDVEGVoSkfrFo?= =?us-ascii?Q?EfNrrxqB1VaZFwslOzlZ9O4OOhjuAmRGLL6raZ6WaRfAs46saVlG8MRK7PWn?= =?us-ascii?Q?zAedVDIiz9Kg3WUCHZHPhEflREbCqjOL5Mb7+NGAOoyaT5/DmTJZGiS0X1pz?= =?us-ascii?Q?qWSOZLIygRFFX/TLxcsbc7tWJ/SBAULstakJje93E+JkWAl6YgXP52cfBt+F?= =?us-ascii?Q?tgRT6eGlc6Num7lg1bS+cICdJkFujqL8ySsn0TG+aZjQjtXJRtJc6jPjJmGy?= =?us-ascii?Q?u4ZAswNYxUIq4FNFV8jxofF9OgjGbD2dscGnQSyngJrqfJrkMUGhxBomk7Kz?= =?us-ascii?Q?zpD6iF5uqtqae5VSf86rcDzsEcWheVB/PU4kqPmhJpgQ45L/6PpFkayuY2Yz?= =?us-ascii?Q?fsAgHmz81iBbpJVb8Q5FIrlWFb2vLriCaHdJXLWi/86RznhitwTeDOMDBS+2?= =?us-ascii?Q?KVFptfw1RFUdZLm8LDSxra4LV5bCqd4tiro/gKLAVFUPFxhWsNKp9EDTAmK/?= =?us-ascii?Q?8hcxLOf7gw2UVV6Yk2LTahu+TPvzP3jrtvv3pwyOBQrpGoAeKznDK0D8nP24?= =?us-ascii?Q?GmY+SzzASlX/B2jXD/fHayrPxgGCIkY0zlyoeKrBGdOArPddeUrtGKfWx2zr?= =?us-ascii?Q?lR+odHbR0dP6BkrdSwW/gl+L2vi505t7gBUuItayu03JIicrU3WW4Rci5KzQ?= =?us-ascii?Q?HWcbWuO1e6+xFY5Kk7YwqkbVLNAcRKd7cMDt?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(82310400026)(36860700013)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2025 03:14:40.6718 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3d930276-5280-49ca-f76d-08ddbd0469bd X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ5PEPF000001ED.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7608 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1751858464518116600 Content-Type: text/plain; charset="utf-8" From: Stefano Stabellini Wrap sysctl hypercall def and sysctl.o with CONFIG_SYSCTL, and since PV_SHIM_EXCLUSIVE needs sorting in the future, we move them out of PV_SHIM_EXCLUSIVE condition at the same time. We need to make SYSCTL with prompt back, add help info and set default value as y. We shall at least provide "# CONFIG_SYSCTL is not set" in preset configs for PV shim on x86. Signed-off-by: Stefano Stabellini Signed-off-by: Sergiy Kibrik Signed-off-by: Penny Zheng Reviewed-by: Stefano Stabellini --- v1 -> v2: - remove all transient "#ifdef CONFIG_SYSCTL"-s in sysctl.c --- v2 -> v3: - move out of CONFIG_PV_SHIM_EXCLUSIVE condition --- v3 -> v4: - make SYSCTL with prompt - state unsetting SYSCTL in pvshim_defconfig --- v4 -> v5: - adapt to the new changes in commit "xen: introduce CONFIG_SYSCTL" - expand help info also for PV shim - refactor commit message --- xen/arch/x86/configs/pvshim_defconfig | 1 + xen/common/Kconfig | 6 +++++- xen/common/Makefile | 2 +- xen/include/hypercall-defs.c | 8 ++++++-- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/configs/pvshim_defconfig b/xen/arch/x86/configs/p= vshim_defconfig index 9dc91c33e3..aab5940e62 100644 --- a/xen/arch/x86/configs/pvshim_defconfig +++ b/xen/arch/x86/configs/pvshim_defconfig @@ -28,3 +28,4 @@ CONFIG_EXPERT=3Dy # CONFIG_GDBSX is not set # CONFIG_PM_OP is not set # CONFIG_PM_STATS is not set +# CONFIG_SYSCTL is not set diff --git a/xen/common/Kconfig b/xen/common/Kconfig index 65f07289dd..64865112a1 100644 --- a/xen/common/Kconfig +++ b/xen/common/Kconfig @@ -616,7 +616,11 @@ menu "Supported hypercall interfaces" visible if EXPERT =20 config SYSCTL - def_bool y + bool "Enable sysctl hypercall" + default y + help + This option shall only be disabled on some dom0less systems, or + PV shim on x86, to reduce Xen footprint. =20 endmenu =20 diff --git a/xen/common/Makefile b/xen/common/Makefile index 98f0873056..15ab048244 100644 --- a/xen/common/Makefile +++ b/xen/common/Makefile @@ -49,6 +49,7 @@ obj-y +=3D spinlock.o obj-$(CONFIG_STACK_PROTECTOR) +=3D stack-protector.o obj-y +=3D stop_machine.o obj-y +=3D symbols.o +obj-$(CONFIG_SYSCTL) +=3D sysctl.o obj-y +=3D tasklet.o obj-y +=3D time.o obj-y +=3D timer.o @@ -70,7 +71,6 @@ obj-$(CONFIG_COMPAT) +=3D $(addprefix compat/,domain.o me= mory.o multicall.o xlat.o ifneq ($(CONFIG_PV_SHIM_EXCLUSIVE),y) obj-y +=3D domctl.o obj-$(CONFIG_VM_EVENT) +=3D monitor.o -obj-y +=3D sysctl.o endif =20 extra-y :=3D symbols-dummy.o diff --git a/xen/include/hypercall-defs.c b/xen/include/hypercall-defs.c index 7720a29ade..c1081d87a2 100644 --- a/xen/include/hypercall-defs.c +++ b/xen/include/hypercall-defs.c @@ -194,8 +194,10 @@ kexec_op(unsigned long op, void *uarg) #ifdef CONFIG_IOREQ_SERVER dm_op(domid_t domid, unsigned int nr_bufs, xen_dm_op_buf_t *bufs) #endif -#ifndef CONFIG_PV_SHIM_EXCLUSIVE +#ifdef CONFIG_SYSCTL sysctl(xen_sysctl_t *u_sysctl) +#endif +#ifndef CONFIG_PV_SHIM_EXCLUSIVE domctl(xen_domctl_t *u_domctl) paging_domctl_cont(xen_domctl_t *u_domctl) platform_op(xen_platform_op_t *u_xenpf_op) @@ -273,8 +275,10 @@ physdev_op compat do h= vm hvm do_arm #ifdef CONFIG_HVM hvm_op do do do do do #endif -#ifndef CONFIG_PV_SHIM_EXCLUSIVE +#ifdef CONFIG_SYSCTL sysctl do do do do do +#endif +#ifndef CONFIG_PV_SHIM_EXCLUSIVE domctl do do do do do #endif #ifdef CONFIG_KEXEC --=20 2.34.1