[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] xen/x86: move domctl.o out of PV_SHIM_EXCLUSIVE


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Stefano Stabellini <stefano.stabellini@xxxxxxx>
  • Date: Tue, 26 Aug 2025 19:09:09 -0700
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.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)
  • 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=1QvF+xLsQctW7G4unTn7CijyPOESIHg/9PWEXSCRLDk=; b=C9/1+2j5R7hZVWfP8Wkj+yGZ3zlFThYOMxrCCvyIsIsVdFmy+tFFdKdXXJBuKnEZu+gckE6BQxJ8RFSs7z4KK819pcNiHnYXOJSJDD3odR9FA3fujgpHfv2vfjcfHFR+T5+2wLygevn5uqRqO84aFEETRc89aZ7I2KyJRH2pmQnnH1zmjFeGQX2Ebd8bzm2w+UTsuAA+nOy4pQ1/on6LFcro5GiyWK9EHwpp6Cqr0djWOeLqS0OXUAfOXcN5M5j/XRR4kIgqp/xlSHffRImdGavqYFX9qJJzhEWt/Cv+oj79zomiKRTAhJrd7uvw1TfGqsUwkMNzpTnWrAesMHuwEw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Wc/msUYe2PP21P2QfWvgcTDdrTsuXtpKph7B7XJO9PE4rH+bLTGonU97Z3IeJEpr2rhUs6JVt8+XcXfLS/2gmXhMeHfEheJKUJzgRIq69KF+2nQV88yxWF/KDylb8KhFY1DOcRgsFkSDhBdqOTyEg2wLx0yE+Y8wbUNifaL0mbVHPi6PKm+R/ttBdbyRCFCckxA0P8M/SVtoV9K6j19dILOKqru01Xm2ld9F1S28cjo8GsapE7uUD+mHVlQrYYZ0P4CXo19jg6HADfiANQODff6B+YD1CRFEv1nVS7WaC+O0uEjaydz0DcQ6R3xq+IrW0I2VgbbpGbPdzBdFGdK+YA==
  • Cc: <jbeulich@xxxxxxxx>, Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>, <ray.huang@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, "Julien Grall" <julien@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Penny Zheng <Penny.Zheng@xxxxxxx>
  • Delivery-date: Wed, 27 Aug 2025 02:09:20 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Tue, 26 Aug 2025, Stefano Stabellini wrote:
> Hi all,
> 
> So I ran a test and the appended change, which is based on [1] and
> renaming CONFIG_DOMCTL to CONFIG_SYSCTL, is sufficient to resolve the
> build issue.
> 
> For 4.21, I suggest we go with two patches:
> 1) global rename of CONFIG_SYSCTL to CONFIG_MGMT_HYPERCALLS
> 2) stub domctl_lock_acquire/release based on CONFIG_MGMT_HYPERCALLS
> 
> Jan, are you OK with this?

The other patch doesn't work in the regular case but this patch does. I
ran it through 60+ randconfigs and so far so good. The strategy is still
the same I suggested above for 4.21: global rename, plus one more patch
(this one).


diff --git a/xen/common/Makefile b/xen/common/Makefile
index c316957fcb..352f004a2c 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -50,7 +50,6 @@ obj-y += spinlock.o
 obj-$(CONFIG_STACK_PROTECTOR) += stack-protector.o
 obj-y += stop_machine.o
 obj-y += symbols.o
-obj-$(CONFIG_SYSCTL) += sysctl.o
 obj-y += tasklet.o
 obj-y += time.o
 obj-y += timer.o
@@ -70,7 +69,10 @@ obj-bin-$(CONFIG_X86) += $(foreach n,decompress bunzip2 unxz 
unlzma lzo unlzo un
 obj-$(CONFIG_COMPAT) += $(addprefix compat/,domain.o memory.o multicall.o 
xlat.o)
 
 ifneq ($(CONFIG_PV_SHIM_EXCLUSIVE),y)
+ifeq ($(CONFIG_SYSCTL),y)
 obj-y += domctl.o
+obj-y += sysctl.o
+endif
 endif
 
 extra-y := symbols-dummy.o
diff --git a/xen/include/hypercall-defs.c b/xen/include/hypercall-defs.c
index 8370b4b289..18ab294f94 100644
--- a/xen/include/hypercall-defs.c
+++ b/xen/include/hypercall-defs.c
@@ -194,14 +194,16 @@ 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
-#ifdef CONFIG_SYSCTL
+#if !defined(CONFIG_PV_SHIM_EXCLUSIVE) && defined(CONFIG_SYSCTL)
 sysctl(xen_sysctl_t *u_sysctl)
 #endif
 #if defined(CONFIG_X86) && defined(CONFIG_PAGING)
 paging_domctl_cont(xen_domctl_t *u_domctl)
 #endif
 #ifndef CONFIG_PV_SHIM_EXCLUSIVE
+#ifdef CONFIG_SYSCTL
 domctl(xen_domctl_t *u_domctl)
+#endif
 platform_op(xen_platform_op_t *u_xenpf_op)
 #endif
 #ifdef CONFIG_HVM
@@ -277,10 +279,8 @@ physdev_op                         compat   do       hvm   
   hvm      do_arm
 #ifdef CONFIG_HVM
 hvm_op                             do       do       do       do       do
 #endif
-#ifdef CONFIG_SYSCTL
+#if !defined(CONFIG_PV_SHIM_EXCLUSIVE) && defined(CONFIG_SYSCTL)
 sysctl                             do       do       do       do       do
-#endif
-#ifndef CONFIG_PV_SHIM_EXCLUSIVE
 domctl                             do       do       do       do       do
 #endif
 #ifdef CONFIG_KEXEC
diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h
index e10baf2615..cb80e49de1 100644
--- a/xen/include/xen/domain.h
+++ b/xen/include/xen/domain.h
@@ -148,8 +148,17 @@ void arch_dump_domain_info(struct domain *d);
 
 int arch_vcpu_reset(struct vcpu *v);
 
+#if !defined(CONFIG_PV_SHIM_EXCLUSIVE) && defined(CONFIG_SYSCTL)
 bool domctl_lock_acquire(void);
 void domctl_lock_release(void);
+#else
+static inline bool domctl_lock_acquire(void)
+{
+    return false;
+}
+
+static inline void domctl_lock_release(void) {}
+#endif /* CONFIG_DOMCTL */
 
 /*
  * Continue the current hypercall via func(data) on specified cpu.
@@ -182,7 +191,7 @@ struct vnuma_info {
     struct xen_vmemrange *vmemrange;
 };
 
-#ifndef CONFIG_PV_SHIM_EXCLUSIVE
+#if !defined(CONFIG_PV_SHIM_EXCLUSIVE) && defined(CONFIG_SYSCTL)
 void vnuma_destroy(struct vnuma_info *vnuma);
 #else
 static inline void vnuma_destroy(struct vnuma_info *vnuma) { ASSERT(!vnuma); }



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.