From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: "Juergen Gross" <jgross@suse.com>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Julien Grall" <julien@xen.org>,
"Bertrand Marquis" <bertrand.marquis@arm.com>,
"Volodymyr Babchuk" <Volodymyr_Babchuk@epam.com>,
"Andrew Cooper" <andrew.cooper3@citrix.com>,
"George Dunlap" <george.dunlap@citrix.com>,
"Jan Beulich" <jbeulich@suse.com>, "Wei Liu" <wl@xen.org>,
"Roger Pau Monné" <roger.pau@citrix.com>
Subject: [PATCH v4 05/11] xen: don't include asm/hypercall.h from C sources
Date: Thu, 10 Mar 2022 08:34:14 +0100 [thread overview]
Message-ID: <20220310073420.15622-6-jgross@suse.com> (raw)
In-Reply-To: <20220310073420.15622-1-jgross@suse.com>
Instead of including asm/hypercall.h always use xen/hypercall.h.
Additionally include xen/hypercall.h from all sources containing a
hypercall handler.
This prepares for generating the handlers' prototypes at build time.
Add a guard in asm/hypercall.h to catch direct inclusion.
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
V2:
- remove platform_op hunk (Jan Beulich)
- remove including of xen/hypervisor.h from arch/x86/x86_64/mm.c
(Jan Beulich)
- fix include order in common/compat/grant_table.c (Jan Beulich)
---
xen/arch/arm/hvm.c | 3 +--
xen/arch/arm/include/asm/hypercall.h | 4 ++++
xen/arch/arm/platform_hypercall.c | 1 +
xen/arch/x86/cpu/vpmu.c | 1 +
xen/arch/x86/include/asm/hypercall.h | 4 ++++
xen/arch/x86/mm.c | 1 -
xen/arch/x86/platform_hypercall.c | 1 +
xen/arch/x86/pv/iret.c | 1 +
xen/arch/x86/traps.c | 2 +-
xen/arch/x86/x86_64/compat/mm.c | 1 +
xen/arch/x86/x86_64/mm.c | 2 --
xen/arch/x86/x86_64/platform_hypercall.c | 1 -
xen/common/compat/grant_table.c | 1 +
xen/common/event_channel.c | 1 +
xen/common/grant_table.c | 1 +
xen/common/multicall.c | 1 +
16 files changed, 19 insertions(+), 7 deletions(-)
diff --git a/xen/arch/arm/hvm.c b/xen/arch/arm/hvm.c
index 8951b34086..fc1a52767d 100644
--- a/xen/arch/arm/hvm.c
+++ b/xen/arch/arm/hvm.c
@@ -20,6 +20,7 @@
#include <xen/lib.h>
#include <xen/errno.h>
#include <xen/guest_access.h>
+#include <xen/hypercall.h>
#include <xen/sched.h>
#include <xen/monitor.h>
@@ -29,8 +30,6 @@
#include <public/hvm/params.h>
#include <public/hvm/hvm_op.h>
-#include <asm/hypercall.h>
-
static int hvm_allow_set_param(const struct domain *d, unsigned int param)
{
switch ( param )
diff --git a/xen/arch/arm/include/asm/hypercall.h b/xen/arch/arm/include/asm/hypercall.h
index fac4d60f17..8182895358 100644
--- a/xen/arch/arm/include/asm/hypercall.h
+++ b/xen/arch/arm/include/asm/hypercall.h
@@ -1,3 +1,7 @@
+#ifndef __XEN_HYPERCALL_H__
+#error "asm/hypercall.h should not be included directly - include xen/hypercall.h instead"
+#endif
+
#ifndef __ASM_ARM_HYPERCALL_H__
#define __ASM_ARM_HYPERCALL_H__
diff --git a/xen/arch/arm/platform_hypercall.c b/xen/arch/arm/platform_hypercall.c
index 8efac7ee60..403cc84324 100644
--- a/xen/arch/arm/platform_hypercall.c
+++ b/xen/arch/arm/platform_hypercall.c
@@ -9,6 +9,7 @@
#include <xen/types.h>
#include <xen/sched.h>
#include <xen/guest_access.h>
+#include <xen/hypercall.h>
#include <xen/spinlock.h>
#include <public/platform.h>
#include <xsm/xsm.h>
diff --git a/xen/arch/x86/cpu/vpmu.c b/xen/arch/x86/cpu/vpmu.c
index 4fedc7c570..51d171615f 100644
--- a/xen/arch/x86/cpu/vpmu.c
+++ b/xen/arch/x86/cpu/vpmu.c
@@ -22,6 +22,7 @@
#include <xen/param.h>
#include <xen/event.h>
#include <xen/guest_access.h>
+#include <xen/hypercall.h>
#include <xen/sched.h>
#include <asm/regs.h>
#include <asm/types.h>
diff --git a/xen/arch/x86/include/asm/hypercall.h b/xen/arch/x86/include/asm/hypercall.h
index 49973820af..81ca25f7b3 100644
--- a/xen/arch/x86/include/asm/hypercall.h
+++ b/xen/arch/x86/include/asm/hypercall.h
@@ -2,6 +2,10 @@
* asm-x86/hypercall.h
*/
+#ifndef __XEN_HYPERCALL_H__
+#error "asm/hypercall.h should not be included directly - include xen/hypercall.h instead"
+#endif
+
#ifndef __ASM_X86_HYPERCALL_H__
#define __ASM_X86_HYPERCALL_H__
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 2befd0c191..6cc73187ac 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -129,7 +129,6 @@
#include <asm/ldt.h>
#include <asm/x86_emulate.h>
#include <asm/e820.h>
-#include <asm/hypercall.h>
#include <asm/shared.h>
#include <asm/mem_sharing.h>
#include <public/memory.h>
diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index b91ccff589..eeb4f7a20e 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -17,6 +17,7 @@
#include <xen/console.h>
#include <xen/iocap.h>
#include <xen/guest_access.h>
+#include <xen/hypercall.h>
#include <xen/acpi.h>
#include <xen/efi.h>
#include <xen/cpu.h>
diff --git a/xen/arch/x86/pv/iret.c b/xen/arch/x86/pv/iret.c
index 55eb6a63bd..58de9f7922 100644
--- a/xen/arch/x86/pv/iret.c
+++ b/xen/arch/x86/pv/iret.c
@@ -18,6 +18,7 @@
*/
#include <xen/guest_access.h>
+#include <xen/hypercall.h>
#include <xen/lib.h>
#include <xen/sched.h>
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index a2278d9499..3ad954991b 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -29,6 +29,7 @@
#include <xen/lib.h>
#include <xen/err.h>
#include <xen/errno.h>
+#include <xen/hypercall.h>
#include <xen/mm.h>
#include <xen/param.h>
#include <xen/console.h>
@@ -70,7 +71,6 @@
#include <asm/x86_emulate.h>
#include <asm/traps.h>
#include <asm/hvm/vpt.h>
-#include <asm/hypercall.h>
#include <asm/mce.h>
#include <asm/apic.h>
#include <asm/mc146818rtc.h>
diff --git a/xen/arch/x86/x86_64/compat/mm.c b/xen/arch/x86/x86_64/compat/mm.c
index b3da8fafbb..70b08a832a 100644
--- a/xen/arch/x86/x86_64/compat/mm.c
+++ b/xen/arch/x86/x86_64/compat/mm.c
@@ -1,4 +1,5 @@
#include <xen/event.h>
+#include <xen/hypercall.h>
#include <xen/mem_access.h>
#include <xen/multicall.h>
#include <compat/memory.h>
diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
index 4f225da81e..3510a5affe 100644
--- a/xen/arch/x86/x86_64/mm.c
+++ b/xen/arch/x86/x86_64/mm.c
@@ -25,14 +25,12 @@ EMIT_FILE;
#include <xen/numa.h>
#include <xen/nodemask.h>
#include <xen/guest_access.h>
-#include <xen/hypercall.h>
#include <xen/mem_access.h>
#include <asm/current.h>
#include <asm/asm_defns.h>
#include <asm/page.h>
#include <asm/flushtlb.h>
#include <asm/fixmap.h>
-#include <asm/hypercall.h>
#include <asm/msr.h>
#include <asm/pv/domain.h>
#include <asm/setup.h>
diff --git a/xen/arch/x86/x86_64/platform_hypercall.c b/xen/arch/x86/x86_64/platform_hypercall.c
index 2c21a3fd05..f84252bac6 100644
--- a/xen/arch/x86/x86_64/platform_hypercall.c
+++ b/xen/arch/x86/x86_64/platform_hypercall.c
@@ -7,7 +7,6 @@ EMIT_FILE;
#include <xen/hypercall.h>
#include <xen/lib.h>
#include <compat/platform.h>
-#include <xen/hypercall.h>
#define xen_platform_op compat_platform_op
#define xen_platform_op_t compat_platform_op_t
diff --git a/xen/common/compat/grant_table.c b/xen/common/compat/grant_table.c
index c6199e8918..d5787e3719 100644
--- a/xen/common/compat/grant_table.c
+++ b/xen/common/compat/grant_table.c
@@ -3,6 +3,7 @@
*
*/
+#include <xen/hypercall.h>
#include <compat/grant_table.h>
#define xen_grant_entry_v1 grant_entry_v1
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index ffb042a241..0a82eb3ac2 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -24,6 +24,7 @@
#include <xen/iocap.h>
#include <xen/compat.h>
#include <xen/guest_access.h>
+#include <xen/hypercall.h>
#include <xen/keyhandler.h>
#include <asm/current.h>
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 1e0762b064..febbe12eab 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -33,6 +33,7 @@
#include <xen/trace.h>
#include <xen/grant_table.h>
#include <xen/guest_access.h>
+#include <xen/hypercall.h>
#include <xen/domain_page.h>
#include <xen/iommu.h>
#include <xen/paging.h>
diff --git a/xen/common/multicall.c b/xen/common/multicall.c
index e48f46dbe0..9db49092b4 100644
--- a/xen/common/multicall.c
+++ b/xen/common/multicall.c
@@ -9,6 +9,7 @@
#include <xen/event.h>
#include <xen/multicall.h>
#include <xen/guest_access.h>
+#include <xen/hypercall.h>
#include <xen/perfc.h>
#include <xen/trace.h>
#include <asm/current.h>
--
2.34.1
next prev parent reply other threads:[~2022-03-10 7:34 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-10 7:34 [PATCH v4 00/11] xen: drop hypercall function tables Juergen Gross
2022-03-10 7:34 ` [PATCH v4 01/11] xen/arm: rename do_phydev_op() to do_arm_physdev_op() Juergen Gross
2022-03-22 20:09 ` Julien Grall
2022-03-10 7:34 ` [PATCH v4 02/11] xen: move do_vcpu_op() to arch specific code Juergen Gross
2022-03-22 20:13 ` Julien Grall
2022-03-10 7:34 ` [PATCH v4 03/11] xen: switch non style compliant hypercall handler parameter types Juergen Gross
2022-03-10 7:34 ` [PATCH v4 04/11] xen: harmonize return types of hypercall handlers Juergen Gross
2022-03-10 7:34 ` Juergen Gross [this message]
2022-03-22 20:15 ` [PATCH v4 05/11] xen: don't include asm/hypercall.h from C sources Julien Grall
2022-03-10 7:34 ` [PATCH v4 06/11] xen: include compat/platform.h from hypercall.h Juergen Gross
2022-03-10 7:34 ` [PATCH v4 07/11] xen: generate hypercall interface related code Juergen Gross
2022-03-22 15:31 ` Anthony PERARD
2022-03-22 15:51 ` Juergen Gross
2022-03-22 20:25 ` Julien Grall
2022-03-10 7:34 ` [PATCH v4 08/11] xen: use generated prototypes for hypercall handlers Juergen Gross
2022-03-22 20:26 ` Julien Grall
2022-03-10 7:34 ` [PATCH v4 09/11] xen/x86: call hypercall handlers via generated macro Juergen Gross
2022-03-10 7:34 ` [PATCH v4 10/11] xen/arm: " Juergen Gross
2022-03-23 9:40 ` Julien Grall
2022-03-24 6:58 ` Juergen Gross
2022-03-10 7:34 ` [PATCH v4 11/11] xen/x86: remove cf_check attribute from hypercall handlers Juergen Gross
2022-03-14 17:25 ` Daniel P. Smith
2022-03-17 16:47 ` Jan Beulich
2022-03-17 16:52 ` Juergen Gross
2022-03-17 16:53 ` Jan Beulich
2022-03-22 15:06 ` Teo Couprie Diaz
2022-03-21 7:15 ` [PATCH v4.1 02/11] xen: move do_vcpu_op() to arch specific code Juergen Gross
2022-03-21 7:15 ` [PATCH v4.1 11/11] xen/x86: remove cf_check attribute from hypercall handlers Juergen Gross
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220310073420.15622-6-jgross@suse.com \
--to=jgross@suse.com \
--cc=Volodymyr_Babchuk@epam.com \
--cc=andrew.cooper3@citrix.com \
--cc=bertrand.marquis@arm.com \
--cc=george.dunlap@citrix.com \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=wl@xen.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.