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

[PATCH v3] xen: ifdef inclusion of <asm/grant_table.h> in <xen/grant_table.h>



Ifdef-ing inclusion of <asm/grant_table.h> allows to avoid
generation of empty <asm/grant_table.h> for cases when
CONFIG_GRANT_TABLE is not enabled.

The following changes were done for Arm:
<asm/grant_table.h> should be included directly because it contains
gnttab_dom0_frames() macros which is unique for Arm and is used in
arch/arm/domain_build.c.
<asm/grant_table.h> is #ifdef-ed with CONFIG_GRANT_TABLE in
<xen/grant_table.h> so in case of !CONFIG_GRANT_TABLE gnttab_dom0_frames
won't be available for use in arch/arm/domain_build.c.

Suggested-by: Jan Beulich <jbeulich@xxxxxxxx>
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
---
This patch was part of patch series:
https://lore.kernel.org/xen-devel/cover.1699633310.git.oleksii.kurochko@xxxxxxxxx/

The patch series hasn't been reviewed all yet so send this path
separately.
---
 xen/arch/arm/domain_build.c   | 10 ++++++++++
 xen/include/xen/grant_table.h |  3 +++
 2 files changed, 13 insertions(+)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 49792dd590..54620199d2 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -33,6 +33,16 @@
 
 #include <xen/irq.h>
 #include <xen/grant_table.h>
+/*
+ * <asm/grant_table.h> should be included directly because it contains
+ * gnttab_dom0_frames() macros which is unique for Arm and is used in
+ * this file.
+ *
+ * <asm/grant_table.h> is #ifdef-ed with CONFIG_GRANT_TABLE in
+ * <xen/grant_table.h> so in case of !CONFIG_GRANT_TABLE gnttab_dom0_frames
+ * won't be available for use in this file.
+ */
+#include <asm/grant_table.h>
 #include <xen/serial.h>
 
 #define STATIC_EVTCHN_NODE_SIZE_CELLS 2
diff --git a/xen/include/xen/grant_table.h b/xen/include/xen/grant_table.h
index 85fe6b7b5e..50edfecfb6 100644
--- a/xen/include/xen/grant_table.h
+++ b/xen/include/xen/grant_table.h
@@ -26,7 +26,10 @@
 #include <xen/mm-frame.h>
 #include <xen/rwlock.h>
 #include <public/grant_table.h>
+
+#ifdef CONFIG_GRANT_TABLE
 #include <asm/grant_table.h>
+#endif
 
 struct grant_table;
 
-- 
2.41.0




 


Rackspace

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