From nobody Fri Oct 31 04:02:45 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=1751622071; cv=pass; d=zohomail.com; s=zohoarc; b=Wo8II6kpjHpXfuiHpfzY49LRxdvL8D/ozM3tpIgqmQzCZndhNpH6y45T7GrvhveV0gjBNEDp+SBrLKiE9L5+K7VhjDIZpNRivbS5nFtW8yi/DqFnnkXSC09aluV9SqpxKiWN/NTw6TfME/oxdtyNOua1GuCFEUKP9MJ9dAH3Z6Y= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751622071; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=T1LpiZC0rlbfXrVfLcubSIpVFQgeVU79WtlQi0mk+O4=; b=SGPL0h1X4aUqyPBFgNo27/tvku/5zawP/kaGqMqycMZHLsOr5UP6ZYwREwtTXuYo6uhvmsgfGoXdgzZtoO5M3mQaz7T0y0xXI3P/PTCuPwaHzBpOdfG1POGx6Qhbcb3jZ+OcUPz2ROfw/TArs3rhZLAIKT+ux1P02zAJuXLHxq4= 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 1751622071931924.455143094007; Fri, 4 Jul 2025 02:41:11 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1033150.1406616 (Exim 4.92) (envelope-from ) id 1uXcuZ-0006QT-8J; Fri, 04 Jul 2025 09:40:51 +0000 Received: by outflank-mailman (output) from mailman id 1033150.1406616; Fri, 04 Jul 2025 09:40: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 1uXcuZ-0006QM-3s; Fri, 04 Jul 2025 09:40:51 +0000 Received: by outflank-mailman (input) for mailman id 1033150; Fri, 04 Jul 2025 09:40:49 +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 1uXclG-0006x0-9a for xen-devel@lists.xenproject.org; Fri, 04 Jul 2025 09:31:14 +0000 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on20621.outbound.protection.outlook.com [2a01:111:f403:2009::621]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 9fddd7d3-58b9-11f0-a315-13f23c93f187; Fri, 04 Jul 2025 11:31:12 +0200 (CEST) Received: from MW4PR02CA0006.namprd02.prod.outlook.com (2603:10b6:303:16d::12) by CH3PR12MB9341.namprd12.prod.outlook.com (2603:10b6:610:1cd::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8901.22; Fri, 4 Jul 2025 09:31:07 +0000 Received: from SJ1PEPF000023D0.namprd02.prod.outlook.com (2603:10b6:303:16d:cafe::e9) by MW4PR02CA0006.outlook.office365.com (2603:10b6:303:16d::12) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8901.21 via Frontend Transport; Fri, 4 Jul 2025 09:31:07 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by SJ1PEPF000023D0.mail.protection.outlook.com (10.167.244.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8901.15 via Frontend Transport; Fri, 4 Jul 2025 09:31:07 +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; Fri, 4 Jul 2025 04:30:59 -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: 9fddd7d3-58b9-11f0-a315-13f23c93f187 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ykCvh/3iZtTVKStB2YYeiTcK9s+XhW2pjLVNGbVtIebsf/h7pym8kNTrPViBu5/Gp/s+4QWaG3Ky2rUqdRomURiqibZ7AxCEJg5DG6ns0oOau1Yfgy5aRhAro6Gwg61CxqpiUaCC+Z+6A8o3kWqf35Cz6W33It2iLMxjR0MfuXCY4ZsK3ZRT8iJk9cERJSn2W7xcJw5R7pq382TV484HrEXVDDz7xeI5wMLFGTW1GsskXNE6jxTDsMWqYzHCDd6eT1yF6js6B2VPno5AuQLWMFMx7Pl+rurIfbPXq6xL/ZxOUtLgMc+iuwbFkdRgCM0tSfnpZMs1dpxqk/jd705Qhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=T1LpiZC0rlbfXrVfLcubSIpVFQgeVU79WtlQi0mk+O4=; b=xkzyNLbM8NPBHWz4+pyijPW8PLJOMJhdvc7plhY+LAgTOpdu41N5o7us45XmW639etlyt4gcYENbjFOZmXbM9vOhSJ8peF0GNQeg/eB1dhS+fuf62i1QeOmDBzAFYH6JDdX4Hr2iToQ5r4x11+QoKSg8DY0jAy/QbY4rvAq1mZsCJ/kE71yyQpQGJhKGRtWc8w0xLDSmgg893rJbDBy7rexewdV2Wa1x0xbC2bQIpPBq1dNeiny0jBj+YtT4ex3KSjZcdrZ4QlGJoDfA+zxJVXweLy6tyCUivNJ9shemBkV6cSh82crYVX24Kbyz5r4u7yTSGBzdykr7G5fE/K1mEQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=T1LpiZC0rlbfXrVfLcubSIpVFQgeVU79WtlQi0mk+O4=; b=1P2hdc9VHryUgyw1z0JtpkKhyQOUNsiwsEcsJ3R7T9gK0DeVxMGBqFc42BpS/oC5lruR5wYF/kaffOWQ/Yn4Dxv80tqcAN6JCHxOtSYkOHwumbNeXkG6Q3Xv3GodLGDZ2cQmm6Cx1MJZS9Az7fM/PDSIBvQiXOfMyWLsqXkrmZQ= 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 v6 18/18] xen/sysctl: wrap around sysctl hypercall Date: Fri, 4 Jul 2025 17:29:52 +0800 Message-ID: <20250704092952.822578-19-Penny.Zheng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250704092952.822578-1-Penny.Zheng@amd.com> References: <20250704092952.822578-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: SJ1PEPF000023D0:EE_|CH3PR12MB9341:EE_ X-MS-Office365-Filtering-Correlation-Id: 0c5e7a09-0eb6-4be8-4e1c-08ddbadd810e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|376014|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?RJxuKO1DVoXxHSIInJFoPqKwpgIFuvpYVAxulCnk/62Wc2JU9gi6jDTBNlXI?= =?us-ascii?Q?nfISalsRCcZr2XRg5jnaV48XQ+3vS9tj6PnxTvUnMJbidB2+Xkm17yzoYLUp?= =?us-ascii?Q?8btVI3nkuumaiu2Q/9Yk1fzdMI/WiguYRwPTe4y4gp0FPmqxUZYqOlMtKhHy?= =?us-ascii?Q?lotO1ghWy4u5oIxBJdLrX/M6hzaM5Ho0QwirI94uXh5rhEHIsxFK9T+gdyQY?= =?us-ascii?Q?V0u8bmbOokv5qtTfjmkJOl08+9rbA2Fnb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D?= =?us-ascii?Q?4fY1lQ0ZijWQEu74r+uIO039C4gnDFEc4C7eYmdVrnErGu5G6ngsx9R0BDua?= =?us-ascii?Q?iq4DywYL2HMRZuVCrUxImeNBGkpHIdRCHmFJxd+VsU5pwGzKVrGUS4zulSys?= =?us-ascii?Q?/J8KdA6soo63JHFPocV8pcuIi9+vApH9t3BaCTyxLpkTD44w/EMDIFtdzNbR?= =?us-ascii?Q?PnevJI9di/0h3MeAcp/6VMVbWa9dKRiMxaSPsxrfbFrY7tEwHMItWt6NIliC?= =?us-ascii?Q?xwURieJdxdHTZ8wIK5qUcH7WS7B/VLvDPx7I3BLI43CLdP/KGWNBCNS6p/i+?= =?us-ascii?Q?B/bF21edrH8T2XN8TRP9gxAc5jYE5qtGqA6B+fmrwVQkuoUU0Gs5kyWMfj3I?= =?us-ascii?Q?oTsSlEM+hieCFCfdXtghol4DGQMv8UHiNGUK?= 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)(376014)(1800799024)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2025 09:31:07.0859 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0c5e7a09-0eb6-4be8-4e1c-08ddbadd810e 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: SJ1PEPF000023D0.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB9341 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1751622072887116600 Content-Type: text/plain; charset="utf-8" From: Stefano Stabellini Wrap sysctl hypercall def and sysctl.o with CONFIG_SYSCTL, and since PV_SHIM_EXCLUSIVE needs sorting in the future, we move them out of PV_SHIM_EXCLUSIVE condition at the same time. We need to make SYSCTL with prompt back, add help info and set default value as y. We shall at least provide "# CONFIG_SYSCTL is not set" in preset configs for PV shim on x86. Signed-off-by: Stefano Stabellini Signed-off-by: Sergiy Kibrik Signed-off-by: Penny Zheng Reviewed-by: Stefano Stabellini --- v1 -> v2: - remove all transient "#ifdef CONFIG_SYSCTL"-s in sysctl.c --- v2 -> v3: - move out of CONFIG_PV_SHIM_EXCLUSIVE condition --- v3 -> v4: - make SYSCTL with prompt - state unsetting SYSCTL in pvshim_defconfig --- v4 -> v5: - adapt to the new changes in commit "xen: introduce CONFIG_SYSCTL" - expand help info also for PV shim - refactor commit message --- xen/arch/x86/configs/pvshim_defconfig | 1 + xen/common/Kconfig | 6 +++++- xen/common/Makefile | 2 +- xen/include/hypercall-defs.c | 8 ++++++-- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/configs/pvshim_defconfig b/xen/arch/x86/configs/p= vshim_defconfig index 9dc91c33e3..aab5940e62 100644 --- a/xen/arch/x86/configs/pvshim_defconfig +++ b/xen/arch/x86/configs/pvshim_defconfig @@ -28,3 +28,4 @@ CONFIG_EXPERT=3Dy # CONFIG_GDBSX is not set # CONFIG_PM_OP is not set # CONFIG_PM_STATS is not set +# CONFIG_SYSCTL is not set diff --git a/xen/common/Kconfig b/xen/common/Kconfig index 65f07289dd..64865112a1 100644 --- a/xen/common/Kconfig +++ b/xen/common/Kconfig @@ -616,7 +616,11 @@ menu "Supported hypercall interfaces" visible if EXPERT =20 config SYSCTL - def_bool y + bool "Enable sysctl hypercall" + default y + help + This option shall only be disabled on some dom0less systems, or + PV shim on x86, to reduce Xen footprint. =20 endmenu =20 diff --git a/xen/common/Makefile b/xen/common/Makefile index 98f0873056..15ab048244 100644 --- a/xen/common/Makefile +++ b/xen/common/Makefile @@ -49,6 +49,7 @@ obj-y +=3D spinlock.o obj-$(CONFIG_STACK_PROTECTOR) +=3D stack-protector.o obj-y +=3D stop_machine.o obj-y +=3D symbols.o +obj-$(CONFIG_SYSCTL) +=3D sysctl.o obj-y +=3D tasklet.o obj-y +=3D time.o obj-y +=3D timer.o @@ -70,7 +71,6 @@ obj-$(CONFIG_COMPAT) +=3D $(addprefix compat/,domain.o me= mory.o multicall.o xlat.o ifneq ($(CONFIG_PV_SHIM_EXCLUSIVE),y) obj-y +=3D domctl.o obj-$(CONFIG_VM_EVENT) +=3D monitor.o -obj-y +=3D sysctl.o endif =20 extra-y :=3D symbols-dummy.o diff --git a/xen/include/hypercall-defs.c b/xen/include/hypercall-defs.c index 7720a29ade..c1081d87a2 100644 --- a/xen/include/hypercall-defs.c +++ b/xen/include/hypercall-defs.c @@ -194,8 +194,10 @@ kexec_op(unsigned long op, void *uarg) #ifdef CONFIG_IOREQ_SERVER dm_op(domid_t domid, unsigned int nr_bufs, xen_dm_op_buf_t *bufs) #endif -#ifndef CONFIG_PV_SHIM_EXCLUSIVE +#ifdef CONFIG_SYSCTL sysctl(xen_sysctl_t *u_sysctl) +#endif +#ifndef CONFIG_PV_SHIM_EXCLUSIVE domctl(xen_domctl_t *u_domctl) paging_domctl_cont(xen_domctl_t *u_domctl) platform_op(xen_platform_op_t *u_xenpf_op) @@ -273,8 +275,10 @@ physdev_op compat do h= vm hvm do_arm #ifdef CONFIG_HVM hvm_op do do do do do #endif -#ifndef CONFIG_PV_SHIM_EXCLUSIVE +#ifdef CONFIG_SYSCTL sysctl do do do do do +#endif +#ifndef CONFIG_PV_SHIM_EXCLUSIVE domctl do do do do do #endif #ifdef CONFIG_KEXEC --=20 2.34.1