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

[PATCH v3 3/5] xen/include: customize headers for host builds


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: dmukhin@xxxxxxxx
  • Date: Thu, 12 Feb 2026 18:49:50 -0800
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 205.220.161.53) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=ford.com; dkim=pass (signature was verified) header.d=saarlouis.ford.com; dkim=pass (signature was verified) header.d=ford.com; 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=fOUWfQtEpLW+O91WgiS4xNRvSlc7HEqZhzWoRw/fWwE=; b=zGTR7S5Ai+5/n+4DbAZ+G9OU9YJOU18V5hTEni71OSDZ5YWljgb4DSb1KW+GrUt6zqfOAMApURUlxoaATDb/ZWTz6kyzBbw5qR1d+Sy/iIGJ31bRRUlY9TA6S+2jcRy7dBbzzTmiP7LjCL5zDfRripEIuaLXjOkn8rZiWkXpxY+IRwhxMlaem+isc/QJTXIK/jNz0xPTNO6La71Bk23Em4slSEPJBJZcHvE999+1/bJZymFvJpEDuIQoBJcO4P+HlT+7woaY7Q8v8IV7JMzGSewOiJGTerGxyNckCcyhonTmSXmQvMR99YwyXok2+WlUyyuLs7xk7a79ocu3whTHNA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=izXyZAdZn1WdnlEF+bzS5u7XHRjA82wU7QkbvSCnDw8Lsrh0dARt/0SUZB2Kyhf2RqsBx4ResF1ZISK125yw5VayaArzw7kFPQyOTqKKvOhqKA9sKPE8d843Q2UcbsFWQN8Klu37rdrhIG5+S1Ru1QHPWTnSXGoaKZGy7gBYgkMCh2Az5PzGGzGaQIQFTQyK5Zx8ly4CQL5kW4K5tef0iGPLzcr6pCU0Y7vT5LwByjR9imcfDHJG9UKLA4QuBjK9VWOY75Sypw4iEEwcyQcpO0JWybR3eIzs8Q3lb/3pXZOZXfhjUs6y2IvVWV6VZHAmATnT1Zka/tkSqcL7mYRMZA==
  • Cc: andrew.cooper3@xxxxxxxxxx, anthony.perard@xxxxxxxxxx, jbeulich@xxxxxxxx, julien@xxxxxxx, michal.orzel@xxxxxxx, roger.pau@xxxxxxxxxx, sstabellini@xxxxxxxxxx, dmukhin@xxxxxxxx
  • Delivery-date: Fri, 13 Feb 2026 02:50:31 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Pser-m365-app: SER-APP

From: Denis Mukhin <dmukhin@xxxxxxxx> 

Update hypervisor headers to allow vpci.c to compile in a host build
environment, as required for the vPCI unit test.

Signed-off-by: Denis Mukhin <dmukhin@xxxxxxxx>
---
Changes since v2:
- new patch
---
 xen/include/xen/irq.h      | 2 ++
 xen/include/xen/list.h     | 2 ++
 xen/include/xen/numa.h     | 2 ++
 xen/include/xen/pci.h      | 2 ++
 xen/include/xen/pfn.h      | 2 ++
 xen/include/xen/spinlock.h | 2 ++
 xen/include/xen/types.h    | 4 ++++
 7 files changed, 16 insertions(+)

diff --git a/xen/include/xen/irq.h b/xen/include/xen/irq.h
index 6071b00f621e..f7fa1d0fa29b 100644
--- a/xen/include/xen/irq.h
+++ b/xen/include/xen/irq.h
@@ -1,5 +1,6 @@
 #ifndef __XEN_IRQ_H__
 #define __XEN_IRQ_H__
+#ifdef __XEN__
 
 #include <xen/cpumask.h>
 #include <xen/rcupdate.h>
@@ -208,4 +209,5 @@ unsigned int arch_hwdom_irqs(const struct domain *d);
 void arch_evtchn_bind_pirq(struct domain *d, int pirq);
 #endif
 
+#endif /* __XEN__ */
 #endif /* __XEN_IRQ_H__ */
diff --git a/xen/include/xen/list.h b/xen/include/xen/list.h
index 98d8482daba1..06d2fa3aed15 100644
--- a/xen/include/xen/list.h
+++ b/xen/include/xen/list.h
@@ -7,8 +7,10 @@
 #ifndef __XEN_LIST_H__
 #define __XEN_LIST_H__
 
+#ifdef __XEN__
 #include <xen/bug.h>
 #include <asm/system.h>
+#endif
 
 /*
  * These are non-NULL pointers that will result in faults under normal
diff --git a/xen/include/xen/numa.h b/xen/include/xen/numa.h
index f6c1f27ca105..80d60fd49178 100644
--- a/xen/include/xen/numa.h
+++ b/xen/include/xen/numa.h
@@ -1,5 +1,6 @@
 #ifndef _XEN_NUMA_H
 #define _XEN_NUMA_H
+#ifdef __XEN__
 
 #include <xen/mm-frame.h>
 
@@ -152,4 +153,5 @@ static inline nodeid_t mfn_to_nid(mfn_t mfn)
 
 #define page_to_nid(pg) mfn_to_nid(page_to_mfn(pg))
 
+#endif /* __XEN__ */
 #endif /* _XEN_NUMA_H */
diff --git a/xen/include/xen/pci.h b/xen/include/xen/pci.h
index afb6bbf50d05..f52dc7875e16 100644
--- a/xen/include/xen/pci.h
+++ b/xen/include/xen/pci.h
@@ -14,7 +14,9 @@
 #include <xen/numa.h>
 #include <xen/pci_regs.h>
 #include <xen/pfn.h>
+#ifdef __XEN__
 #include <asm/device.h>
+#endif
 
 /*
  * The PCI interface treats multi-function devices as independent
diff --git a/xen/include/xen/pfn.h b/xen/include/xen/pfn.h
index 1ca9b095e0df..98ff669d7def 100644
--- a/xen/include/xen/pfn.h
+++ b/xen/include/xen/pfn.h
@@ -1,7 +1,9 @@
 #ifndef __XEN_PFN_H__
 #define __XEN_PFN_H__
 
+#ifdef __XEN__
 #include <xen/page-size.h>
+#endif
 
 #define PFN_DOWN(x)   ((x) >> PAGE_SHIFT)
 #define PFN_UP(x)     (((x) + PAGE_SIZE-1) >> PAGE_SHIFT)
diff --git a/xen/include/xen/spinlock.h b/xen/include/xen/spinlock.h
index ca9d8c7ec0a1..ad5094c4eb92 100644
--- a/xen/include/xen/spinlock.h
+++ b/xen/include/xen/spinlock.h
@@ -1,5 +1,6 @@
 #ifndef __SPINLOCK_H__
 #define __SPINLOCK_H__
+#ifdef __XEN__
 
 #include <xen/nospec.h>
 #include <xen/time.h>
@@ -360,4 +361,5 @@ static always_inline void nrspin_lock_irq(rspinlock_t *l)
 #define nrspin_unlock_irqrestore(l, f) _nrspin_unlock_irqrestore(l, f)
 #define nrspin_unlock_irq(l)           _nrspin_unlock_irq(l)
 
+#endif /* __XEN__ */
 #endif /* __SPINLOCK_H__ */
diff --git a/xen/include/xen/types.h b/xen/include/xen/types.h
index 73ddccbbd5dc..e5d702b48ac0 100644
--- a/xen/include/xen/types.h
+++ b/xen/include/xen/types.h
@@ -4,6 +4,7 @@
 #include <xen/stdbool.h>
 #include <xen/stdint.h>
 
+#ifdef __XEN__
 /* Linux inherited types which are being phased out */
 typedef uint8_t u8;
 typedef uint16_t u16;
@@ -15,6 +16,7 @@ typedef uint64_t u64;
 typedef __SIZE_TYPE__ size_t;
 
 typedef signed long ssize_t;
+#endif /* __XEN__ */
 
 typedef __PTRDIFF_TYPE__ ptrdiff_t;
 typedef __UINTPTR_TYPE__ uintptr_t;
@@ -33,6 +35,7 @@ typedef __UINTPTR_TYPE__ uintptr_t;
 #define NULL ((void*)0)
 #endif
 
+#ifdef __XEN__
 #define INT8_MIN        (-127-1)
 #define INT16_MIN       (-32767-1)
 #define INT32_MIN       (-2147483647-1)
@@ -52,6 +55,7 @@ typedef __UINTPTR_TYPE__ uintptr_t;
 #define LONG_MAX        ((long)(~0UL>>1))
 #define LONG_MIN        (-LONG_MAX - 1)
 #define ULONG_MAX       (~0UL)
+#endif /* __XEN__ */
 
 typedef uint16_t __le16;
 typedef uint16_t __be16;
-- 
2.52.0




 


Rackspace

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