From nobody Thu Oct 30 22:53:23 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=1752208373; cv=pass; d=zohomail.com; s=zohoarc; b=dzYAwYxGMO6XZqTXDd9+sOxCIlvPS9BMo7Pc2D1KiOk2P0h4q9lr4M+A8Xvjc0pSAc4PMvNXSgsbdTGn5s4VjkqXeTGOHiB6xFlhJP7dHltOSdRBD78pz0lOcQt4WueEEXXC4yIR9iZbpSQWeXDaFIO5bqd0D+dvDCmLCAoXSig= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752208373; 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=lKqG6NssgmUmOi7fZJgdhY3p/fKYdmsdg3W8WW/g+wwzUDnXUKjLP6QHJBszgcyRbObzpNWXby2xJraq4xxfpyY8DL7hCdajArthvZp5qBsSz6xZzov0CMJRwosuQZWtmhQEClvMDIsBnMVchQCj1ZoD6WNRmwJXtWaAUVraUcU= 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 1752208373212819.5148532739083; Thu, 10 Jul 2025 21:32:53 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1040355.1411796 (Exim 4.92) (envelope-from ) id 1ua5R3-0003cR-DM; Fri, 11 Jul 2025 04:32:33 +0000 Received: by outflank-mailman (output) from mailman id 1040355.1411796; Fri, 11 Jul 2025 04:32:33 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ua5R3-0003cK-Ao; Fri, 11 Jul 2025 04:32:33 +0000 Received: by outflank-mailman (input) for mailman id 1040355; Fri, 11 Jul 2025 04:32:31 +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 1ua5R1-0003OX-7s for xen-devel@lists.xenproject.org; Fri, 11 Jul 2025 04:32:31 +0000 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on20601.outbound.protection.outlook.com [2a01:111:f403:2417::601]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 0d1e58f6-5e10-11f0-a318-13f23c93f187; Fri, 11 Jul 2025 06:32:29 +0200 (CEST) Received: from BN9PR03CA0912.namprd03.prod.outlook.com (2603:10b6:408:107::17) by DS2PR12MB9687.namprd12.prod.outlook.com (2603:10b6:8:27b::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8901.26; Fri, 11 Jul 2025 04:32:23 +0000 Received: from BN3PEPF0000B070.namprd21.prod.outlook.com (2603:10b6:408:107:cafe::6) by BN9PR03CA0912.outlook.office365.com (2603:10b6:408:107::17) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8922.22 via Frontend Transport; Fri, 11 Jul 2025 04:32:23 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by BN3PEPF0000B070.mail.protection.outlook.com (10.167.243.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8922.1 via Frontend Transport; Fri, 11 Jul 2025 04:32: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; Thu, 10 Jul 2025 23:32:20 -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: 0d1e58f6-5e10-11f0-a318-13f23c93f187 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TFyZHdxQcUMnR3vF99nnomGRb08ansTo9562jZSmUAQL6fwcxzomi274Ul+j2vaJQ8T8jN7lNHFAFl67/g9KrEAPE5EvLuQ6DNuGsZ+cTbMNbRAcsITKYH9w21M7w9QjmktCoDcpvsWPWTc/mTNo0pAa1CG9+B2WuBGoT9HwiShhQbgmqadScqZidaSnBEAnoWT5yB7mxtZjxin8tOPnGKmgg94bk4JPqy/7/K0CmR+c9uSUkTnkBZSRoiWm2kfK9w1z9Ej9fdTo4K8++zaQOkih4e1nF9M8vQ0oag6MOin/G3dCxWW9+m6S2OF5dgmY1m8MzWvOX+MFD4mRGCsiww== 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=gJtD7Vu7+Vc5hTCIAYnIhg6BWO4Tx8AxlhCAMkb1GCkNxVgF+758QvOOpLUhdPwxjKnvGgwblhtaXhVrBadGmxzNmhTWfrRfQJZf/683swzkdZpHuzYN4lMaQ3A1YHygnacORPS75YnuL1mxmmJV6PuepuOIPg+/Q11pfiAutgTbwMRDu6bCQWIseRRwIjB7qhCr/9xm/pCJYxmXiKd+9TzfqO4IDrvxG8LOYtMvJuru3FcI72exPMda3VYePnbKNZXaf1N6DODoesTBWSOu9SQPyFL8mhdhTiQCg2qz+xrYqnsLqIb7SS9oO41oKvDlAPYqqR74zUfu1Lre9++ysA== 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=InhmV0mTw+LMoY0Q9fZ1RtvM2X1KhqPzv6M7pFGH7r3PRsb9a4HOh6o3f7sMbEDxRmyuN9yxlKHw3OKAGEUVP/jkaGmptWtHXJiwVW/27Myzf/ES124Da8OeFTZxhjjrTBsoVmcy8se6YmK/JEzqmEbVN29OaT9OfdEHJTCBKt0= 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 v8 1/7] xen/xsm: wrap around xsm_sysctl with CONFIG_SYSCTL Date: Fri, 11 Jul 2025 12:31:52 +0800 Message-ID: <20250711043158.2566880-2-Penny.Zheng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250711043158.2566880-1-Penny.Zheng@amd.com> References: <20250711043158.2566880-1-Penny.Zheng@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN3PEPF0000B070:EE_|DS2PR12MB9687:EE_ X-MS-Office365-Filtering-Correlation-Id: 2183c9fe-05a1-44c8-794f-08ddc033ee3d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?HuFiuoEdk6wAaYqhLNlmsdK8Eq0m6c1VWAxp7ZIkNioAa1zvjzy/yjRyTlNm?= =?us-ascii?Q?cOaYAEqRKhvdXjE0m4dMa9M6dzO0LkIN7U+dtK960+b+32tCLCpaeMpDNHKA?= =?us-ascii?Q?BsdAI32w5uzh89fV2YIivyej6U4Vf4UoIA3kN/9XUd1W4/sFH7MqXR3vpTMF?= =?us-ascii?Q?n0Be6YG3h66pX3ENW8xUo1TocbRyT0xZXVXoNaotcQcLCwB5upLHl9LtBTF/?= =?us-ascii?Q?xBiGfMF1o2U1NlHz9CZ4den4DPGR8Ehx/JeVZvXY7h0L8TEGYQgIppXx2vpW?= =?us-ascii?Q?lTdxb/Hz7YxO0iTCrY4vvt0DEa45yo1gXUJgmckgdxIUUpWi0Q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PJGEFwD+1u66dnb+74m1oPS3OLTqpwy4I?= =?us-ascii?Q?pI+iKbTRKqDGN753+8qL+4VwETy48dQ45le4e9Q3rDpWNmnxx7NPUpkqJst7?= =?us-ascii?Q?HuxQPFoTNFlYu7+3W2LF6L9T7Z87B12k2g83dxmxtPXs1n+KZNrk7n60e0fR?= =?us-ascii?Q?LNtUuYVY7BaCjW8dXiNx2nbUtQD1z5u0i+y9ViMxLjoMkeg+wDfqIYhQvoe9?= =?us-ascii?Q?brS3Q4DbL16r5DCFbLOmJ7GTfM0mjz1W8NEfcF91GvQMTfYvLJD9+DAikHAN?= =?us-ascii?Q?XFXqsv/sa96xP0UMEZw1mkx/0ecW89UxH8EM?= 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)(376014)(36860700013)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2025 04:32:22.8917 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2183c9fe-05a1-44c8-794f-08ddc033ee3d 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: BN3PEPF0000B070.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS2PR12MB9687 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1752208374147116600 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 Acked-by: Daniel P. Smith --- 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 22:53:23 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=1752208373; cv=pass; d=zohomail.com; s=zohoarc; b=BD11BT7B7764RgblP5UiONgnoeHuiPzwrA9DpXYUFfT6hdUgXqfDCAKuho6EYS//prF1/xmtCPsvkWcQNf2MmfAkRaQ7E1xGiXjRnJavRj09T1hxrwy3Mk5jXT80mf6/7VZyMBWg/zTqif5dHvOtheSglTJO0lMn8MB6UpZN6CM= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752208373; 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=abgkQowMvCRNzmd4xUppE0j0myI5U13OYqFEcP4x1jWovAptPmp00sja65yGmLMVd+nzoFDyTY3AiOI2fs5LhEYfKSO9z9LChMcwNDy+gmRF0X8587QaEifG5SBz6tcU8MDYWYvOpEBXMjYn5aEuFDi4APxwiHc27hedpuRJVVE= 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 1752208373445217.6601180232525; Thu, 10 Jul 2025 21:32:53 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1040356.1411804 (Exim 4.92) (envelope-from ) id 1ua5R3-0003iK-RO; Fri, 11 Jul 2025 04:32:33 +0000 Received: by outflank-mailman (output) from mailman id 1040356.1411804; Fri, 11 Jul 2025 04:32:33 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ua5R3-0003gT-LQ; Fri, 11 Jul 2025 04:32:33 +0000 Received: by outflank-mailman (input) for mailman id 1040356; Fri, 11 Jul 2025 04:32:32 +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 1ua5R2-0003OR-P6 for xen-devel@lists.xenproject.org; Fri, 11 Jul 2025 04:32:32 +0000 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on20616.outbound.protection.outlook.com [2a01:111:f403:2412::616]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 0dea3c97-5e10-11f0-b894-0df219b8e170; Fri, 11 Jul 2025 06:32:31 +0200 (CEST) Received: from BN9PR03CA0920.namprd03.prod.outlook.com (2603:10b6:408:107::25) by SA1PR12MB8744.namprd12.prod.outlook.com (2603:10b6:806:38c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8880.23; Fri, 11 Jul 2025 04:32:26 +0000 Received: from BN3PEPF0000B070.namprd21.prod.outlook.com (2603:10b6:408:107:cafe::ef) by BN9PR03CA0920.outlook.office365.com (2603:10b6:408:107::25) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8922.23 via Frontend Transport; Fri, 11 Jul 2025 04:32:26 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by BN3PEPF0000B070.mail.protection.outlook.com (10.167.243.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8922.1 via Frontend Transport; Fri, 11 Jul 2025 04:32: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; Thu, 10 Jul 2025 23:32:22 -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: 0dea3c97-5e10-11f0-b894-0df219b8e170 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=YhibGtaxG+6B0FOKQFPGXDYUDy1zFRLoOkiWv+5wANyv1lUaygk9reKPPX4Rm4o9lEXWMgVsofOiHu7vJHqXMZb8E1alKuRpdR5sF/nK35ZvQgXKFtXcqTNDqmSkZt0UP+hAj9OQUc8OYSImEPela/TIgasgY0n4iBIGkkRRnahAhOij2wn8e+AFtyCEYkEkKOEoOA4L1a8FofJbmqP+nBVssHovNbyZ8NNIxoDwUaksdB01iFVB6c9kuhklbMLxRs1ErDQtOvw+L2ooSRDP+rVBET7ystwLxW0vOYNAlkYGNZabumQyNr9OX6yCfHgJ/JWH6UB76pRonn2hBhA+Mw== 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=oK8kI1/daT1rSjYmPjNSc3z/iVJenqMye6PHn+qzgmlsJJiN0JlpZR0pD3ZCux+C+3t5PxGCq+Xa5B4noJKjgKSV17G7Iz73/uPsGUSIimFaaikTOhBsqAnyS6LCFwRFr2sCAOilsHs5yPDv/T9GAzchAZazuq8tHYH1vKQmo8j7OOZe/JqrVB6+MpODOtByzFv2s0s8SqxOjcy1RzcBEfXdBGwWK3cMpZ3Oz5iwjOxa1F5aoTVt6reVLkoHC5VFnTadrVEv0wKeSrWzK9EgaCaK1/cWhnm13erubgz8qcQI0Ywcr783k9nv2wwNtxQgPx54nW68GdnsXFeekcSQhg== 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=42aFn1iB/4MAjHzaT+52Z6FvQSbBSji1b9O+CaT/kIVQG/n5ruWVQz6uE4VkvTGUlHj8GLbUkiZOq/ORAfya9xnBTT7o4KLTAowtbM5+SlwGbIdN9i68gO91PCM6YrrktgD0ltg2vudT/KwNfntlaWbhp+Bgg2QubM3Cg5xRl5s= 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 v8 2/7] xen/sysctl: wrap around XEN_SYSCTL_readconsole Date: Fri, 11 Jul 2025 12:31:53 +0800 Message-ID: <20250711043158.2566880-3-Penny.Zheng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250711043158.2566880-1-Penny.Zheng@amd.com> References: <20250711043158.2566880-1-Penny.Zheng@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN3PEPF0000B070:EE_|SA1PR12MB8744:EE_ X-MS-Office365-Filtering-Correlation-Id: 0f08753b-5dd1-4921-9241-08ddc033f040 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|36860700013|1800799024|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?MYLMHZKuzEgSzZyk0I5i/gNfbvw6n7MkfMDZ9iRbfMAU/6uK+mVZeIN9JAPj?= =?us-ascii?Q?T2JWxAB8BPrfWvPbBSILx7CFFGtmi6FxpQrkl7Qw59XOQHBYsKUHMEXqVdl6?= =?us-ascii?Q?NTK14mip0DI+KzeDT3i4cx2VEmml3kNYit1I+/uDXEeG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JFeSA569qw1swOtRBHC/L/uS5cFSGywSURwp?= =?us-ascii?Q?hk1wucBpBX3e9svg79BT9ZynVvGQjZn9OvVlDIgYWUej4+lG1ouAjtl2A+iw?= =?us-ascii?Q?jqFYKzzsGg0yRKMY/7Zfw8X4AdHHAoTLQGvGk+NLAQhKDhqZ7QIgjauthfV5?= =?us-ascii?Q?0eoXLYL8Rg69XSInQXU54X/Or71rkN3TVNMnsfK+T9mUThUDT3+eMF2k6wSw?= =?us-ascii?Q?GmwIeuFQRpRagM1pYtsFKHgI+rPtk8t6cq0ClCz4MuNIXaBIQK6T7d3cEfti?= =?us-ascii?Q?iT+CCN5sCRI1sjd7CoVPFAg2hieG97uvsoWBgnNAUs4GvIe7cdyINegKDXA0?= =?us-ascii?Q?cIVHK/Pn3ixig0iz2GZ59xhLxSpX6J8lsB7PpszPI8l1B+uuVr0I4V43n7m/?= =?us-ascii?Q?xx/HlZfYbkAJjdsg+0eDWBQIs6tC1DJw/jUz2rQ8C0R3hTxO6p3yzYNhL3t1?= =?us-ascii?Q?oQeeGh2F4NwFXHm/Y2ZsFyRjpnmJADS172uN?= 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)(1800799024)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2025 04:32:26.2685 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0f08753b-5dd1-4921-9241-08ddc033f040 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: BN3PEPF0000B070.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB8744 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1752208374099116600 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 Acked-by: Daniel P. Smith --- 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 22:53:23 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=1752208369; cv=pass; d=zohomail.com; s=zohoarc; b=eLf+Ei7vPESNl4iJOLb0RwoplC7kuOEJ2jLKx5SJwor7TpBv3hzHreBj18YpkUG2DnQpSpSeWioZcTwBeqjCS463IZtqa20VZQwTwoVs3uLROh7JGq0/xUd/3ibbB416k+7d9lst71G+qycJBworJjjWCUcZ286p7dH9Nd4N6YQ= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752208369; 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=PjH3zk9YVGyXEUuq3fkmY3S+PJ9CS/piUTPmR5yPvm1+dDA2AA00r4WhGRj4fr6+ft9jGvxjSwahENWm1/+0mR/nR7+6ZvFF+g48gRSL2stigSEqi21F4q4zAjz3apJO0BMpgF/RM9Cel8q6X/L1SFg71q06JjNr1xRhGc+rEZ8= 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 1752208369931624.1485153443632; Thu, 10 Jul 2025 21:32:49 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1040357.1411817 (Exim 4.92) (envelope-from ) id 1ua5R5-00045K-Vn; Fri, 11 Jul 2025 04:32:35 +0000 Received: by outflank-mailman (output) from mailman id 1040357.1411817; Fri, 11 Jul 2025 04:32:35 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ua5R5-00045D-Rz; Fri, 11 Jul 2025 04:32:35 +0000 Received: by outflank-mailman (input) for mailman id 1040357; Fri, 11 Jul 2025 04:32:34 +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 1ua5R4-0003OR-JR for xen-devel@lists.xenproject.org; Fri, 11 Jul 2025 04:32:34 +0000 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2060c.outbound.protection.outlook.com [2a01:111:f403:2416::60c]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 0f053cab-5e10-11f0-b894-0df219b8e170; Fri, 11 Jul 2025 06:32:33 +0200 (CEST) Received: from BN9PR03CA0926.namprd03.prod.outlook.com (2603:10b6:408:107::31) by SA5PPFA403A61D8.namprd12.prod.outlook.com (2603:10b6:80f:fc04::8da) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8678.27; Fri, 11 Jul 2025 04:32:28 +0000 Received: from BN3PEPF0000B070.namprd21.prod.outlook.com (2603:10b6:408:107:cafe::46) by BN9PR03CA0926.outlook.office365.com (2603:10b6:408:107::31) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8922.23 via Frontend Transport; Fri, 11 Jul 2025 04:32:28 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by BN3PEPF0000B070.mail.protection.outlook.com (10.167.243.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8922.1 via Frontend Transport; Fri, 11 Jul 2025 04:32:28 +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; Thu, 10 Jul 2025 23:32:25 -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: 0f053cab-5e10-11f0-b894-0df219b8e170 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=D8rlI3oBziBbSZyElOi47xaXPwW6JnrIVZ0A3Ckjk2k5DhOqE7ikFbqII2+fx06szMG7oYzZuM+Kp3oRDJzKGn20BlLO7haC3b3aq5j/q73xoii/MN/eio8gaKPHv7mQKPEKNVrAJcGaCSZxMKeel1DzyW3C9hCNmrSbs710j0Xnr0n4169WRO2zHUJtZF4Zwvk9zw/b5LYXaaXpm0SafHewmrsxaj1NFe0SRZK4UEZEK8/HvUZytnacZbhtADbvy5UC4YQIymVBcm7+toGHyL5nPrfE+Vfwf9F/2OMNKCsNERMxuGvBXzQXXt9cIxVU4q1v3hutYtcyhRByePvp/w== 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=R412QSeBkTgi0mly+qO+Kji0VSpnMMRn1SgJ/D6DNqeaqFFtjtAswltF8P6EPH0GtRbk1vO7K0uA7Jq71n8KQaoSM6ZlJ4Py8q2QQRXbw/JZqXg8nDiRhyALbaf4DfhfF9od60NvC3eQv1DFIao6EsjPUBCyD3fQUNhEsiBq6QgYOOAAMr/94LV4GdDTkvx8/yOEGmksTnlNDng1FDR7k2t4AN5O0zCGSF4y14mV9/cmHUDidv5F2G6tF1p/l5PGwkarlm211Gh3vDewJlkjszImes4c+xlXZu67mRqD1ew+mBNBlzMEDIa/9gI9L4ROnha80dpHHuLtpjrXdIMEUw== 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=ztdk6/yohgfPKVHht7Guo9WdrJLVcKBFc0DQ/4j7m2szRennWH6Ru9BiSIiOtBC2Px/sWqV337KJLzdBU9PFRh/wSdzsMAY8opW/sGHY6j7p2vOYKq8mmEPeUTZUQy/9kZSRaw12EBYzMAExghx85/j5oudBmaBEAp55kfSNaI4= 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 v8 3/7] xen/sysctl: wrap around XEN_SYSCTL_page_offline_op Date: Fri, 11 Jul 2025 12:31:54 +0800 Message-ID: <20250711043158.2566880-4-Penny.Zheng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250711043158.2566880-1-Penny.Zheng@amd.com> References: <20250711043158.2566880-1-Penny.Zheng@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN3PEPF0000B070:EE_|SA5PPFA403A61D8:EE_ X-MS-Office365-Filtering-Correlation-Id: 4604e2c4-87c1-44a8-29c3-08ddc033f170 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|82310400026|36860700013|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?u+tvH7BT2RVAkgIo/Et6Gdvt89GEisJXtYL0mztBwDUedmW8ff0sWqLypozB?= =?us-ascii?Q?79TNI+LGNmIAazTmRZzmDwHtbwkZTuq3UIDsdJN+hOuSG5csQUdhd+quUfdV?= =?us-ascii?Q?bKITOMeR7VPuQvIPkb15aSpNB4nZfOmQy76C4HeOmEQfS0LO2EwYJBopRYZL?= =?us-ascii?Q?rGlPSfacLF5eD8+hkeBU4vSOwjsJjow7N5zm8nQtmeTV6hCq9kxQy/mZWkGN?= =?us-ascii?Q?Hrb2mCdChLdMXRbluhvKpQugGz2h6FX1FzjtGwJmuDBb0cDUs2jubbYUKCb7?= =?us-ascii?Q?wyE0hRf3krhQZGhstmB8hoD0NrZBlGKSaYwuLhclI1WzxvOMxIOPnuW4RlpM?= =?us-ascii?Q?rV11lQVzBlQKgO4ATjEMVG9ifRnAC5WyJ2Dj5GyHJaZPv1hlaE54MsRR+Jj7?= =?us-ascii?Q?R0B0WqXArGlLSOiFUL+Lq/CJpbYuvZw1xDfa988/uLdTCqBEPtHpz2gCOrSU?= =?us-ascii?Q?rCVJelnkWHjtQFaQsgvFE4aa4dWQjIL4wpnan4ilDy0YQeG4cFNEli52RE3A?= =?us-ascii?Q?HymXqz3HISbkpPHT8ew5dpjE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-ascii?Q?r/AU61//FpjK4iWDkayFu4U7bLs1ExnprJwYqOcGe1Hnu+ppa1tgbO6dBKAY?= =?us-ascii?Q?eCfqpinYmbHoXVRjog6nXhQT8R8V78xLi2BH?= 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);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2025 04:32:28.2573 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4604e2c4-87c1-44a8-29c3-08ddc033f170 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: BN3PEPF0000B070.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA5PPFA403A61D8 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1752208372358116600 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 Acked-by: Daniel P. Smith --- 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 22:53:23 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=1752208383; cv=pass; d=zohomail.com; s=zohoarc; b=Ab08iqNq4ZJOD3oCkJNsVbeEQqMTb/3ejZpOWPul2Ct3fHaloeywQHYTtwZzC6hhXwGGInJF26OgPAU25kNaQHSQxqnrH9ASPfwkmv4KUvdaCLXTZ8PQann4nq610UqrLUAKz4rsA3isiQn7SpTZvjin6ecRvCIMjupi/d9R1Ac= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752208383; 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=ioaUOREOUDHYxQK7j0fG1byAQi7FdqCENCowaQuQVEiM8IRelQjfA398WaOjIDOmkFh+KgEl/xmmpdA6JNtZek4b7HDrWsuYr9zGP1uPIVGZMt1crK4YYNUVxaYKnqgQ2oh1RM6LSpT88V0X/8d2tpdKvtdywjQjGEy3aAy7TYQ= 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 1752208383031368.27074399831474; Thu, 10 Jul 2025 21:33:03 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1040360.1411826 (Exim 4.92) (envelope-from ) id 1ua5RB-0004RP-79; Fri, 11 Jul 2025 04:32:41 +0000 Received: by outflank-mailman (output) from mailman id 1040360.1411826; Fri, 11 Jul 2025 04:32:41 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ua5RB-0004RB-44; Fri, 11 Jul 2025 04:32:41 +0000 Received: by outflank-mailman (input) for mailman id 1040360; Fri, 11 Jul 2025 04:32:40 +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 1ua5R9-0003OX-UU for xen-devel@lists.xenproject.org; Fri, 11 Jul 2025 04:32:40 +0000 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on20605.outbound.protection.outlook.com [2a01:111:f403:2417::605]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 12c5d654-5e10-11f0-a318-13f23c93f187; Fri, 11 Jul 2025 06:32:38 +0200 (CEST) Received: from BN9PR03CA0521.namprd03.prod.outlook.com (2603:10b6:408:131::16) by MN0PR12MB5811.namprd12.prod.outlook.com (2603:10b6:208:377::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8922.25; Fri, 11 Jul 2025 04:32:32 +0000 Received: from BN3PEPF0000B06B.namprd21.prod.outlook.com (2603:10b6:408:131:cafe::e5) by BN9PR03CA0521.outlook.office365.com (2603:10b6:408:131::16) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8922.22 via Frontend Transport; Fri, 11 Jul 2025 04:32:31 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by BN3PEPF0000B06B.mail.protection.outlook.com (10.167.243.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8943.1 via Frontend Transport; Fri, 11 Jul 2025 04:32:31 +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; Thu, 10 Jul 2025 23:32:28 -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: 12c5d654-5e10-11f0-a318-13f23c93f187 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=pRo05I/CEfaEToqvwjnGzJ968o/Rs9xu4jJdKxVLu889y9YufTpLd8TqKzDhxtnnxx3zu+7r6zsYlD/ZlniKSf6bJYD4UXi0I9sF4AdeAPsrqxt2tgzQRj8kR+cmoNlTYOcUeujA+UiuPr8FUx5aSMSwjRRg9NxG2zMLiU7vL31TRcthHHwpcl5wJH7UHmgllSEuuTZzKnUpEjdJwVdnIo6Sm/XAxr/35qTi0youkl+WSRvhXfUHFbejbVAjG7zEUPQyoDr89sMx4RR/B564gqRg7SdwO6YyHRF9pzxdd+MK4WkHCLzlUUVukM7ndgIdN4kTimYi55dCeWusyaJdtw== 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=OhQmM475vJBxeqOCT/l0lpPV25QyXwQHYpNAlFfyat8A4vNgRc+OaVygypsd3pHP1PXgpebBIpjyXlD//Jr9pOxijE4R0B1WRxDO8HyfaVAqPjj5Ex4jX23WYsFVmuglVlnvSn1AwvciD0QKbfiZSIO7GlBUMlW7APrEXJjBb961u1O8PTjjqcuAAbFp9BsfDndoTFHL1M+1+3wUX0i782M2SvtCFgu/0zwfCtnoWOjqdU1B8JDUE2ScNHpbXM8Id25JlUWuxiK/10H0gySDf524VNGZeqPe9c/FwEI0ycjKuTIDtkINT4pJCHLHcF25QMfulXYQeORMlror0n/yFw== 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=xEcRBZSgLR6PP/FRqTYLP7EcAZk/WuB/1/o4I4yyMIt32v+/j9mQoU8c7CwKRPfXg/oxamOD3zojGKs3Saj77fK9kSvjbw21kKqhsidMvqESuMryIpaRLIy99UmjxzzGv8PZ1xI2DGquc51VrGgFc3Zq4BwuFIStY91KXymcNE0= 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 v8 4/7] xen/sysctl: wrap around XEN_SYSCTL_scheduler_op Date: Fri, 11 Jul 2025 12:31:55 +0800 Message-ID: <20250711043158.2566880-5-Penny.Zheng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250711043158.2566880-1-Penny.Zheng@amd.com> References: <20250711043158.2566880-1-Penny.Zheng@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN3PEPF0000B06B:EE_|MN0PR12MB5811:EE_ X-MS-Office365-Filtering-Correlation-Id: ace85ff3-f72e-4ae1-5d70-08ddc033f38a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|82310400026|1800799024|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?u9w+UdG9Im0g4IO3YxLbMurZIIxZAr+/shZLDQYy1QlOP4q4cnjfhmLqAPW0?= =?us-ascii?Q?1lcYKEUA9Th1k4H7jJrFUrwsfp/WVozIy7sZ+zzbJNAebCGXu0s6bgnqOfi1?= =?us-ascii?Q?mqR42MCJwpkIr6VCGHqqE1To2VYOyqigCLXvgBTvb6M+TphTzenVRQgtE2wD?= =?us-ascii?Q?cPcRSpw+RLAhy8UZmlZI43t8Uhj8rVwQzmFzE/AzKfEE10sJUFxnzVWs++qm?= =?us-ascii?Q?UjF1UOyV5LTVTsmRzTipAWUiQUQu3bWAb+JabncGEgDskgBmFfRDJ2qZSHkp?= =?us-ascii?Q?r4KB+CmUAeotfgd2OIiQlYR8WQFjVoIRxXznE2fkugD8mwLEryx6rkyPfmA+?= =?us-ascii?Q?98WokJssKjMlaw36T4vUwbYv/sd4JiAwmhHrVb5sbRYZK9niTR+jIvEpjzzI?= =?us-ascii?Q?9VynmbInIIygYBPtX6nXSnOO/TTCITKZCmQ8Oihn6yW7rT4R4uyjsuyGdNEk?= =?us-ascii?Q?y+z5uVYKXKun9e0GjmMPHlfyXwrlJa7L61vg+Y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pZnw/0FZT3EM1JKdgwLGpGczzug9Ph4vGarSR4ECUS/P10Ggh5J?= =?us-ascii?Q?DAG55H2RVtasEzPcLdjkcjG7O6ElONRLynlqe0+lXheqDXyhP9jxLQeOJGrA?= =?us-ascii?Q?YeiZltbGwq5oanflTr4P+LJB7CEF6EMMGkG+?= 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)(82310400026)(1800799024)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2025 04:32:31.7846 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ace85ff3-f72e-4ae1-5d70-08ddc033f38a 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: BN3PEPF0000B06B.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB5811 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1752208384573116600 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 Acked-by: Daniel P. Smith --- 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 22:53:23 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=1752208378; cv=pass; d=zohomail.com; s=zohoarc; b=hXFA70FWsRWQGPeUigiKSguunefZRWyS/DLAA3N4G9fN/0V6HGb3YaiXzQ9iEGG78JN9MgyFntgjDSQf3YBwLLcQ5vNQPwR4SosQlfF+LWTRqsDKzPROKs/XOhH/BXt1TDPw0tE/xwy9W1q3KP7zOHUv9UJDcmVxZBEurkIbD/Y= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752208378; 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=Voja366GRLkArm/oRSmSEQseZs/w0GurTI1ozWXLQ+vmfuIKRSZ7nlvIJFj9Pw8GW6NB9zUTQc/KfFcJZBpSdON1BP6fDudRLvKppW/BVw91N5cuU7U+jbOBM/R41zLaRAgBAtIKQ49DfuQ5TtOHKE7i/AL4NzRIquC/Ipcr1qs= 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 17522083788911023.1750076063865; Thu, 10 Jul 2025 21:32:58 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1040361.1411837 (Exim 4.92) (envelope-from ) id 1ua5RC-0004iF-Mt; Fri, 11 Jul 2025 04:32:42 +0000 Received: by outflank-mailman (output) from mailman id 1040361.1411837; Fri, 11 Jul 2025 04:32: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 1ua5RC-0004hy-J0; Fri, 11 Jul 2025 04:32:42 +0000 Received: by outflank-mailman (input) for mailman id 1040361; Fri, 11 Jul 2025 04:32: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 1ua5RC-0003OR-2H for xen-devel@lists.xenproject.org; Fri, 11 Jul 2025 04:32:42 +0000 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2061f.outbound.protection.outlook.com [2a01:111:f403:2412::61f]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 137f53db-5e10-11f0-b894-0df219b8e170; Fri, 11 Jul 2025 06:32:40 +0200 (CEST) Received: from BN8PR16CA0033.namprd16.prod.outlook.com (2603:10b6:408:4c::46) by CY1PR12MB9625.namprd12.prod.outlook.com (2603:10b6:930:106::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8880.21; Fri, 11 Jul 2025 04:32:35 +0000 Received: from BN3PEPF0000B06C.namprd21.prod.outlook.com (2603:10b6:408:4c:cafe::ae) by BN8PR16CA0033.outlook.office365.com (2603:10b6:408:4c::46) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8922.22 via Frontend Transport; Fri, 11 Jul 2025 04:32:35 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by BN3PEPF0000B06C.mail.protection.outlook.com (10.167.243.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8943.1 via Frontend Transport; Fri, 11 Jul 2025 04:32:35 +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; Thu, 10 Jul 2025 23:32:31 -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: 137f53db-5e10-11f0-b894-0df219b8e170 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=IrZDh2uexMmCUBlGxR7jIxR6B+UKmxlnmIL7/O0/Gt80skWupebMEAPcPyAnE2raGoan38jahvLxYk9E0OP53nn7ypCgqMg6tpoWdJmEbqfTL7UWg3HHM8pED3XAcI4Qsl9ev5eb6pxOauFHVIGTHCD20BKrdMtVBoQCZMvq6ogntj5uERv0aKj8BCI8JgvqqeH1NHvHHqikj8ZIvaV9IXxXebKSeq1jTCe8arIN64fCNeo1stXMaZ3X7h7omG7KEU32k0ILTxogs/GbSFMo2xuuso/7uFJ8trHnZSRZ+z/cxZwvewcfIgEasvMRmbZZAyuP4a6vff1mzzZm4ReUBA== 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=MF464yP40zmw02bLdP1l7rUmlNy5inAsnvQZCd1yuwn22QIGipyRcYORTmyYpjWhJMtm+8jehCSoFliQ4XPIy2NaaN+LM10UVhZjhzvezQhVncaE+Y/k8hWOuncMemM3kPd6iG1z1oFB9Ebf53ATf44PW7QaEiNCojeJa4EJLzArLfCiHnkZSjceFby4bAz9jqdHLJ1UAZZQ/O5uH6VvLyx4Tjp/NkeQu/CQY7QTpf4xyGGqlClc+46GkUECpP6VnrIEoZy9b63FefRUv9TPA0e/Q8LvgSUU9KOgwIQOvrAVzNDj/gN1kMYO3qJbWIXDEFAYmbiB2FNFUmAY2Lmu/Q== 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=oOBaO9Gj6Iuhakr7ssOrU0O7ZlJJ0Aax5VTfYnifqYkU3F5C5W41p2pL3eHtoS+0Jl3MbqDq+sZMFRQnoPWmc716HWOo3+pL3BvPHr0jPiSCHyldl1XRKM/k5R53s98pFCGEF0hWoSP9+v/EibYWxzdcB0krLqPq+EpnJ2A2CT4= 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 v8 5/7] xen/sysctl: wrap around arch-specific arch_do_sysctl Date: Fri, 11 Jul 2025 12:31:56 +0800 Message-ID: <20250711043158.2566880-6-Penny.Zheng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250711043158.2566880-1-Penny.Zheng@amd.com> References: <20250711043158.2566880-1-Penny.Zheng@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN3PEPF0000B06C:EE_|CY1PR12MB9625:EE_ X-MS-Office365-Filtering-Correlation-Id: e48a1e5a-4b66-4a36-bb17-08ddc033f584 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?/BXlwpzlH7BAcp77sUwMzjmJ/9KFFsgVSH0TzftKfFGxeKLcNk4OuoiRyqmH?= =?us-ascii?Q?Rk8BDPUgFHDXCKlPfmMgx7wsFqj4g9150ATOtvKeb4Wo3yiole+AW7OLwOSN?= =?us-ascii?Q?BsIdcE4dqB3KPpkXPQV1zdyK/aI1EhigXIfRwlVgAeZBU+71OakxDvBAUT6j?= =?us-ascii?Q?ze0HYBhLMGxYLydA7zhxL0NcD5YYNq3XzNjVEcHn2Kf87NYaiksWaMY0BN+D?= =?us-ascii?Q?TD/EUXGat6FLUMKxBSkVR0ZTqOeyINgx55tZHGcdl5NWQcjmIeMXxrhaq+u7?= =?us-ascii?Q?BOZnxz/HhNAlO/lvgP3RvFhbJ+RwpYqboiJ0mkOk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TTXphIM+vU4yzdu1lYOR6oj+7mYYPd4xvYsp+Q2vbrksx?= =?us-ascii?Q?jLlFnIJlXmz+m+l9x3ynjuFuBYkty+kWMU2LrCsU92UzwPKL/KnajEFFzyNe?= =?us-ascii?Q?8inDv5J55f7iT+E4wd6X7N+Fpc3W5BnIg7m3NBTA41lXtpF1l97osd6VZJOB?= =?us-ascii?Q?1NcenkLD9b3TV84EudboXHRo1LA8nsiHdZMs9OQcFeaSU7geCkZu1Pq7cMpQ?= =?us-ascii?Q?98dKt/e5B7b4eNdfQ46ZyjsQVFo3B6xluuep7Ez8BRw9lNw1jny3Zd+ixSMl?= =?us-ascii?Q?YBH3VVOAHkmN94Dv7ah4w57CGMf7XFUDJ6+4?= 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: 11 Jul 2025 04:32:35.1038 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e48a1e5a-4b66-4a36-bb17-08ddc033f584 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: BN3PEPF0000B06C.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR12MB9625 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1752208381260116600 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 22:53:23 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=1752208387; cv=pass; d=zohomail.com; s=zohoarc; b=IVGI28t7EOCU0Jw1aJDw/DL1RZSIXsMdKT8F1UY5IAkYkf+OSp/ewdX7+wIixLUEnn9W9UDlRkJYj5Xfi7VW8rCNL+YanSHKRP3LiYeD58i3TVxGpeOqtvzmIVHxy1zAeYSNH4n2BnuLOFxe24OF4YaIOtovOQyakyy4MyPJEUM= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752208387; 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=YxLjdkHa3RaEXWbirz1dDiVlE8yRGnu25xYevR+WJ70=; b=NYqfmXk+ML83AAuFLNuHW3a/HCcEGy3z//SF0D1DdV6YcDSsnOAuJO7X2HdvRmEow6hUp65/6Zh//d4g8p/xUwUpK6nho8JYfbo7DaRaKDwuS1QGFlpiWkisEnU6LG5e7gCLolzNL02liNLcscdwDNRvl7Uc1JnnA7kG1tSEweY= 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 1752208387810282.13635442981524; Thu, 10 Jul 2025 21:33:07 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1040365.1411847 (Exim 4.92) (envelope-from ) id 1ua5RJ-0005NI-UX; Fri, 11 Jul 2025 04:32:49 +0000 Received: by outflank-mailman (output) from mailman id 1040365.1411847; Fri, 11 Jul 2025 04:32:49 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ua5RJ-0005N8-QX; Fri, 11 Jul 2025 04:32:49 +0000 Received: by outflank-mailman (input) for mailman id 1040365; Fri, 11 Jul 2025 04:32:48 +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 1ua5RI-0003OR-Bd for xen-devel@lists.xenproject.org; Fri, 11 Jul 2025 04:32:48 +0000 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on20618.outbound.protection.outlook.com [2a01:111:f403:2416::618]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 1753fed2-5e10-11f0-b894-0df219b8e170; Fri, 11 Jul 2025 06:32:46 +0200 (CEST) Received: from BN8PR16CA0028.namprd16.prod.outlook.com (2603:10b6:408:4c::41) by PH0PR12MB7888.namprd12.prod.outlook.com (2603:10b6:510:28b::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8901.25; Fri, 11 Jul 2025 04:32:38 +0000 Received: from BN3PEPF0000B06C.namprd21.prod.outlook.com (2603:10b6:408:4c:cafe::17) by BN8PR16CA0028.outlook.office365.com (2603:10b6:408:4c::41) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8922.23 via Frontend Transport; Fri, 11 Jul 2025 04:32:38 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by BN3PEPF0000B06C.mail.protection.outlook.com (10.167.243.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8943.1 via Frontend Transport; Fri, 11 Jul 2025 04:32:38 +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; Thu, 10 Jul 2025 23:32:35 -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: 1753fed2-5e10-11f0-b894-0df219b8e170 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=SLtx+s3xOM+re0QZkNgI4Wxyvwzua0fs3vUf1eDWzqbBdC1Wqlqw6HaxXgnSP1rtZkEv7+WJkx3uNAwimymbYNnY1Vo0Fml1yGs3nQ1FiwgeqqKQhDXR0yPNksVAMYaon0dyAJQQrtU1WEB4aFof3qQWROcZhYNtsWzVLN/VXLZzsguz65hcEB8N/rT0JFyqnpbC/46rifcGlm2v8rPQsYsizuKC1Af8O5KKo6BQ7MvP8/p4/7DQR6MWnAODbGxCOKfG6yJb4LnLETfPevF9bq3UAqI812enbXlse+yqiXPIIKAB71WeWPigQYGskPmMu0XCPjD7gH+mINlo+Lc+dA== 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=YxLjdkHa3RaEXWbirz1dDiVlE8yRGnu25xYevR+WJ70=; b=cjkUkd25DUf+1F01v4DKwH4W1W8Ospvj0gfXvvm5HsbynGKxb+g5cQ7Vn2uqOaZ4VAmozAoUI8tJwhe9ZE40Q/fdkjUeg7Qm9OyjiPm5V9zB5RzJIzzgk6MigNPnCQvUkjUMDj8MogSXtntDnIt6L3YbuIxeh/jAtscxedLJfNMDfHpsrw8J9t5xP8A4g0ES8/VJwly9mX0HckMv/fOSW4fCHld9ZTqE9Wn7MnCyPw9cIUBK5HmjRL1Jm0uXb+8GjhQ793gmD/RBgTS9jU/yjCzlAEGufQTgSrAq5xKSWLoM7CJwBF1WsE7Xq8luku2cRqzemD3x8a62XgXsNk/rhQ== 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=YxLjdkHa3RaEXWbirz1dDiVlE8yRGnu25xYevR+WJ70=; b=kO+ZnjAURTiAOVGpB2SWQy4R0q4gJVVaUV/l1ZLIMRfAYUQ+e/AW4FfrY+x9hkXsGutfgNA0utAJrrFxO4KKIKiYvATyJIZtK6STbYCnJUSAQV6z9IE8qU4esqDdZ6zOHarC7utsQ+oHNfURgorxl+s7ayKIC/SvUHWamStWDHg= 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 v8 6/7] xen/x86: remove "depends on !PV_SHIM_EXCLUSIVE" Date: Fri, 11 Jul 2025 12:31:57 +0800 Message-ID: <20250711043158.2566880-7-Penny.Zheng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250711043158.2566880-1-Penny.Zheng@amd.com> References: <20250711043158.2566880-1-Penny.Zheng@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN3PEPF0000B06C:EE_|PH0PR12MB7888:EE_ X-MS-Office365-Filtering-Correlation-Id: 5a09c855-698d-4f80-6400-08ddc033f776 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|36860700013|1800799024|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?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6J05LZAS8vXDBP6cUHq43+sb?= =?us-ascii?Q?1X3YVv1dR9wmYZFnOYwh6S4HE8VbSAJEVyG93D8/oCN9wsf6JnrOTat4B2vK?= =?us-ascii?Q?+6s94sFsWJSkEbgV1ZBLzDvR0oPBErvxxUdw8wDmMK3g+5ShvWO7mOi1FZA/?= =?us-ascii?Q?5mWLsOhY2AlLRurnP0LyP2muQQZACChlp1LV/hXeGNmq12FBJuTx/HtwTKPN?= =?us-ascii?Q?x3c2QEYpqCE18vReS9zTDgUnFEub5OLcd3+FmlOtQtnRoJnMrxP9BtkLfW5d?= =?us-ascii?Q?ILD7Lraqo//4FmPwn1LKkk+c47LZer45/KIhXkg5tGboFxFkJ2S0olFR+Lb1?= =?us-ascii?Q?ckUUzwR3N8E0yvdAeRuiQ53ZTcpDaDARQrKkzETohhhMeyxM0qmt6Fs+pMFg?= =?us-ascii?Q?+RZ+EK0qMfHnNWXVTor6ZSb5hq72tqu7XD0mmRH5aUsR723ceRtDazjZXjL8?= =?us-ascii?Q?7pYmiLvRxDjCVomnV7yr5wu/1odomqarFBeG6uT+zmD7j9FRo7dCN+YEFkXX?= =?us-ascii?Q?0pxJQuCJlfUx7bybUIYG31qb5kHeWEJq87awqEoAItJ+cuJ5tds+ic0jO3Nu?= =?us-ascii?Q?dLkrJ+btbWr9pK+Fw16aUAnvdmviE9wzSHpOagmxV3TcM1VKKRu08hnnL/+L?= =?us-ascii?Q?dbhnmZAyVFJD6pNnzxVWX2soOPyCPu31i1XM?= 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)(1800799024)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2025 04:32:38.3641 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5a09c855-698d-4f80-6400-08ddc033f776 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: BN3PEPF0000B06C.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB7888 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1752208388241116600 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 9ec0fb0bed..a45ce106e2 100644 --- a/xen/arch/x86/Kconfig +++ b/xen/arch/x86/Kconfig @@ -303,8 +303,6 @@ config PV_SHIM_EXCLUSIVE =20 If unsure, say N. =20 -if !PV_SHIM_EXCLUSIVE - config HYPERV_GUEST bool "Hyper-V Guest" select GUEST @@ -313,8 +311,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 22:53:23 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=1752208385; cv=pass; d=zohomail.com; s=zohoarc; b=KVnXWdoI+jUKeADc+rRsRfgAMfVHqRWP9oJ4dDa6DtsgCq7GuIPa5WxU6TL/jBF+6SBRdE6wucXcpe7Se/8PMUQBxk8fBX00flLzshSnXBJ+JRtxO9aMWN1z+tPQk06qHIYT1wakTMS2qQuEpgtQdU1G5UEX0GjnVI0ZbMn/+QM= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1752208385; 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=dsdbWxBv56FOkGsY2m7yzhlzougzMSVRZxtAOx2nCOI=; b=SmXd+WTwjc5YTSSzLXoxz/Qs2Pwm7pYIx/IbPWjatzAqsnQULXY2VNlFFiLFosvF+D31oqiAt4ojnvYOeBa9ADFAnEsF98/rrwEOYE4Fyv3wHLwtXHDhkKXxhY0OB2B03a3yUN2/cLVEskejYC8FYNpQRKa6Ehc61AQBmvxRRXw= 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 1752208385213844.4346775674795; Thu, 10 Jul 2025 21:33:05 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1040366.1411857 (Exim 4.92) (envelope-from ) id 1ua5RL-0005gy-Bc; Fri, 11 Jul 2025 04:32:51 +0000 Received: by outflank-mailman (output) from mailman id 1040366.1411857; Fri, 11 Jul 2025 04:32:51 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ua5RL-0005gR-6g; Fri, 11 Jul 2025 04:32:51 +0000 Received: by outflank-mailman (input) for mailman id 1040366; Fri, 11 Jul 2025 04:32:49 +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 1ua5RJ-0003OR-Bx for xen-devel@lists.xenproject.org; Fri, 11 Jul 2025 04:32:49 +0000 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2061c.outbound.protection.outlook.com [2a01:111:f403:2415::61c]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 17d4f4d3-5e10-11f0-b894-0df219b8e170; Fri, 11 Jul 2025 06:32:47 +0200 (CEST) Received: from BN9PR03CA0528.namprd03.prod.outlook.com (2603:10b6:408:131::23) by CYXPR12MB9338.namprd12.prod.outlook.com (2603:10b6:930:e5::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8901.26; Fri, 11 Jul 2025 04:32:42 +0000 Received: from BN3PEPF0000B06B.namprd21.prod.outlook.com (2603:10b6:408:131:cafe::1d) by BN9PR03CA0528.outlook.office365.com (2603:10b6:408:131::23) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8922.22 via Frontend Transport; Fri, 11 Jul 2025 04:32:42 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by BN3PEPF0000B06B.mail.protection.outlook.com (10.167.243.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8943.1 via Frontend Transport; Fri, 11 Jul 2025 04:32:42 +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; Thu, 10 Jul 2025 23:32:37 -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: 17d4f4d3-5e10-11f0-b894-0df219b8e170 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ccAyG2vqifkpVnkud0i58E42skBBBAyD8cnFaTfdbUMR7sB3WORCPl60yBgsQYfsKwMIU+ZmBOsewm+WCzEsxhrzzIZEIKVXYUALWimEGKwwsrbdqu7A0vmRTlA+8HRoX3ichiz/LFi5NvNjNiE/+Ww1i9egtTp85EuL2nfnArsyUetq84fwjW7T5dlgTNJrjuuh3DOsQ8DmVAWJefL96NKjyfhT4bYBGOrptBtI76bRNDQiQh2L5gpSzoKTxzwDt4PY3C78DqBXoF3uevi16vdtZ5v9wKZ2Mo6Ui/Sz/7614jmdo6NpQ3we6qxXx7IaQPayUCByqKRuZSrKqxH/dw== 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=dsdbWxBv56FOkGsY2m7yzhlzougzMSVRZxtAOx2nCOI=; b=E4uwIGMnVq0xKS/SlPkoTyFLsjdJ/N/3ADB3QDlEGGAx3JJyE7lhPS/bHRn68l0d4BgY4zWDWjDncQrVI998tyOso3khlOZ4d7oCj5kQ+rDFnSxb/Jsgq1j0qW1ilBKwoMxpPxtZXZWK43aBf0U8QmFFfUQmVf6DgB6Kkhu9iklObQCFnM97RTmQ80DbRAmaLdGXnnUPHV/X4l7kdSfriaY3y8fICcnLg8AYQbG27ZhPGBFrej+PaetwH8zM5oaZZBc4R1MBS0lcknkpVb6ByU0C/lALH+PKd+5L7f6yzVd1/0b1NxAYN1UF539eL4QAes+dAWmQDXftcFubewAGhg== 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=dsdbWxBv56FOkGsY2m7yzhlzougzMSVRZxtAOx2nCOI=; b=C6RmFLX+7lBpxC/X6tMayYUSYDLtD02QqQycRHrgGZ3A8FVJDpgeRSQgfmokCEbn6MhGYv4/WBcnL7h/UPrLCrhVMxLM1wCQo316hAhI+FSXH1X/fuEOhQ9VI5Iq8PQWKJ4fmJkRNYPlGRSJk++o/TJ5oYhSTGsU6JEC7ZfGlng= 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 v8 7/7] xen/sysctl: wrap around sysctl hypercall Date: Fri, 11 Jul 2025 12:31:58 +0800 Message-ID: <20250711043158.2566880-8-Penny.Zheng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250711043158.2566880-1-Penny.Zheng@amd.com> References: <20250711043158.2566880-1-Penny.Zheng@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN3PEPF0000B06B:EE_|CYXPR12MB9338:EE_ X-MS-Office365-Filtering-Correlation-Id: c31302cc-671d-4799-b135-08ddc033f9ab 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?OidPS+Z+hYNDtSKer5V7x4LrJd4RQ5ZRdTfzDDxI1JyWp91WhtdR5IMJI2dN?= =?us-ascii?Q?oItTJhYY91Nv0EYTL3mutHICgOviCQDDdWX3b2ZI31fYz9yi/IkA3c83Eq6o?= =?us-ascii?Q?EzwAeA2veUDR2Mbs13wd0lvqPN1qOqLxbEiTzILdhRHGz7DcC67qkPDp74Aj?= =?us-ascii?Q?9oq+Go5idqgthSvgs5R7+n+56AugIsqPy/Ta7FSIPAU5vZiz4RZsjlYcF5Rj?= =?us-ascii?Q?CqWQaxJj51ypv5yK6xaPLcxpT5MiluEl19njB7luIYyGSFW5AtmGNuyqGmKS?= =?us-ascii?Q?yNIbgIzz4KlUTwKAB6K1WkNMfTNHPdU9wgiHFr7eCL/ildr5PECCscB9LWBZ?= =?us-ascii?Q?Tv3mObohMSsRNXZtetP/BvhtBWRZl9GAR/oqnwyeWe0wKA5g1sthL/XBw3zQ?= =?us-ascii?Q?OZcP+TH+WMPZDzqKrk9Xa3j4L5BvRzCpwE2DANkZOtOLX1be42sF1xQQsE2O?= =?us-ascii?Q?Uf7Egc19vR1Tqcsn55Vjw1x5SFENY0FoN3fvhunUqbTFodwHYYXwyqPQVw3M?= =?us-ascii?Q?IFErePphkSZYKCCfsusmLdNfNPZTmhnYaeuftxz4Sj07hkDlXAkWCpwKPXZ9?= =?us-ascii?Q?5bVrhzatO7HJzHubGa/7s0bAgxV+JErom7gy/61vqo/DXt5SavhHNqGYCTqB?= =?us-ascii?Q?Sgl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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: 11 Jul 2025 04:32:42.0659 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c31302cc-671d-4799-b135-08ddc033f9ab 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: BN3PEPF0000B06B.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYXPR12MB9338 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1752208386267116600 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. With that, all dependent option get covered and could be deleted. Signed-off-by: Stefano Stabellini Signed-off-by: Sergiy Kibrik Signed-off-by: Penny Zheng Reviewed-by: Stefano Stabellini Reviewed-by: Jan Beulich --- 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 --- v7 -> v8 - remove TRACEBUFFER, PM_OP, PM_STATS, LIVEPATCH entry in pvshim_defconfig --- xen/arch/x86/configs/pvshim_defconfig | 5 +---- xen/common/Kconfig | 6 +++++- xen/common/Makefile | 2 +- xen/include/hypercall-defs.c | 8 ++++++-- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/xen/arch/x86/configs/pvshim_defconfig b/xen/arch/x86/configs/p= vshim_defconfig index 9dc91c33e3..c58c29adb0 100644 --- a/xen/arch/x86/configs/pvshim_defconfig +++ b/xen/arch/x86/configs/pvshim_defconfig @@ -19,12 +19,9 @@ CONFIG_EXPERT=3Dy # CONFIG_SCHED_CREDIT2 is not set # CONFIG_SCHED_RTDS is not set # CONFIG_SCHED_ARINC653 is not set -# CONFIG_LIVEPATCH is not set # CONFIG_SUPPRESS_DUPLICATE_SYMBOL_WARNINGS is not set -# CONFIG_TRACEBUFFER is not set # CONFIG_AMD_IOMMU is not set # CONFIG_INTEL_IOMMU is not set # CONFIG_DEBUG is not set # 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