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

[PATCH] xen: Put wait.c behind CONFIG_WAIT


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jason Andryuk <jason.andryuk@xxxxxxx>
  • Date: Wed, 11 Feb 2026 12:01:18 -0500
  • 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)
  • 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=/aCm1TpIJjYd0leIOhN0/WRlXUcOWnbPdDL9kCWTj40=; b=cZHEb2krm2hzqFI0+uo6kCoJk3zSSe6vJe73l9+KGJYwPgweJkqeP0VuoNEpnKDPAQCprKbpkFdAG5EIu4n7i1qqgdJD0Dys/AFhEajRO1O3ZQ3Z9v5fGA8PzP2WhdWGtHkEog1U+cTEWLiFY2VlxjyGQasSkbkWPcQclvMS4ZjFoyc7Lb5lBIKVg+EEu87QHdWieQ7hvShDNgpOdm0eO9GbAbQ/hXTirt34zNscAYwARk/DnNDFFM8NDOkI3dCgaGUAiSvwbfL5fKUM/VkI2wnKFpM0LeQlhDCSux+QZfNWUWC+AicbxVdCEAhHBpi/jw5XMhXK5MyAi1a1ScVqXQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=o1StyCJfOu1e6q5hgWQ+UIbPayiZ3Xo5piyGi3t11iBi0ZDbGCwgB3izoW0HWr5uoRj0l7hjcA+tUCaqdY3naEkIc33IOylA7c6N44oPBKVV9GDubV+vKFlFpMpsHiyxECKAVmUUzlmKRwC3LsCpF5hOf07kuhIe3+Udnk7RyUeUkdbp4Mjroqp+1lWqCUfMTaD5SaTcxanqtLNqbsNxU6inNAw++7bI37L28qIvntgZfZIaec3/w9FBtoQi/mIxP7AWApHY2q98P5VpFSIYSssNQcczFqVSCnxp+he/2DTD85iR+9b4zVfwjZKQ76ZorBEOfCZV9yICMq0zSRnExg==
  • Cc: Jason Andryuk <jason.andryuk@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, 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>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • Delivery-date: Wed, 11 Feb 2026 17:02:25 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

wait.c is only used by vm_event.c.  Make CONFIG_VM_EVENT select
CONFIG_WAIT, and use CONFIG_WAIT to control building it.

Provide stubs of functions called from common code.  entry.S needs an
ifdef to hide the symbol from the assembly.

Also conditionalize .waitqueue_vcpu in struct vcpu to save space.

Signed-off-by: Jason Andryuk <jason.andryuk@xxxxxxx>
---
 xen/arch/x86/x86_64/entry.S |  2 ++
 xen/common/Kconfig          |  4 ++++
 xen/common/Makefile         |  2 +-
 xen/include/xen/sched.h     |  2 ++
 xen/include/xen/wait.h      | 11 +++++++++--
 5 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index ca446c6ff0..adb570c07e 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -664,7 +664,9 @@ FUNC(continue_pv_domain)
         ALTERNATIVE "", "mov $2, %eax; incsspd %eax", X86_FEATURE_XEN_SHSTK
 #endif
 
+#ifdef CONFIG_WAIT
         call  check_wakeup_from_wait
+#endif
 ret_from_intr:
         GET_CURRENT(bx)
         testb $3, UREGS_cs(%rsp)
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index d7e79e752a..ab3f24cb4f 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -173,10 +173,14 @@ config HAS_VMAP
 config LIBFDT
        bool
 
+config WAIT
+       bool
+
 config VM_EVENT
        bool "Memory Access and VM events"
        depends on HVM
        default X86
+       select WAIT
        help
 
          Framework to configure memory access types for guests and receive
diff --git a/xen/common/Makefile b/xen/common/Makefile
index 4fc0c15088..ef2c5ddd4e 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -61,7 +61,7 @@ obj-y += virtual_region.o
 obj-$(CONFIG_VM_EVENT) += vm_event.o
 obj-$(CONFIG_HAS_VMAP) += vmap.o
 obj-y += vsprintf.o
-obj-y += wait.o
+obj-$(CONFIG_WAIT) += wait.o
 obj-bin-y += warning.init.o
 obj-y += xmalloc_tlsf.o
 
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 1268632344..f232f2731e 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -293,7 +293,9 @@ struct vcpu
     /* Multicall information. */
     struct mc_state  mc_state;
 
+#ifdef CONFIG_WAIT
     struct waitqueue_vcpu *waitqueue_vcpu;
+#endif
 
     struct evtchn_fifo_vcpu *evtchn_fifo;
 
diff --git a/xen/include/xen/wait.h b/xen/include/xen/wait.h
index 1c68bc564b..d7d83adef1 100644
--- a/xen/include/xen/wait.h
+++ b/xen/include/xen/wait.h
@@ -49,11 +49,18 @@ do {                                            \
 } while (0)
 
 /* Private functions. */
-int init_waitqueue_vcpu(struct vcpu *v);
-void destroy_waitqueue_vcpu(struct vcpu *v);
 void prepare_to_wait(struct waitqueue_head *wq);
 void wait(void);
 void finish_wait(struct waitqueue_head *wq);
+
+#ifdef CONFIG_WAIT
+int init_waitqueue_vcpu(struct vcpu *v);
+void destroy_waitqueue_vcpu(struct vcpu *v);
 void check_wakeup_from_wait(void);
+#else
+static inline int init_waitqueue_vcpu(struct vcpu *v) { return 0; }
+static inline void destroy_waitqueue_vcpu(struct vcpu *v) {}
+static inline void check_wakeup_from_wait(void) {}
+#endif
 
 #endif /* __XEN_WAIT_H__ */
-- 
2.53.0




 


Rackspace

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