* [PATCH] x86/pv: Prune include lists
@ 2020-05-05 11:42 Andrew Cooper
2020-05-05 13:51 ` Jan Beulich
0 siblings, 1 reply; 2+ messages in thread
From: Andrew Cooper @ 2020-05-05 11:42 UTC (permalink / raw)
To: Xen-devel; +Cc: Andrew Cooper, Wei Liu, Jan Beulich, Roger Pau Monné
Several of these in particular haven't been pruned since the logic was all
part of arch/x86/traps.c
Some adjustments to header files are required to avoid compile errors:
* emulate.h needs xen/sched.h because gdt_ldt_desc_ptr() uses v->vcpu_id.
* mmconfig.h needs to forward declare acpi_table_header.
* shadow.h and trace.h need to have uint*_t in scope before including the Xen
public headers. For shadow.h, reorder the includes. For trace.h, include
types.h
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Wei Liu <wl@xen.org>
CC: Roger Pau Monné <roger.pau@citrix.com>
---
xen/arch/x86/pv/callback.c | 5 -----
xen/arch/x86/pv/emul-gate-op.c | 19 -------------------
xen/arch/x86/pv/emul-inv-op.c | 18 ------------------
xen/arch/x86/pv/emul-priv-op.c | 9 +--------
xen/arch/x86/pv/emulate.h | 2 ++
xen/arch/x86/pv/ro-page-fault.c | 8 --------
xen/arch/x86/pv/shim.c | 3 ---
xen/arch/x86/x86_64/mmconfig.h | 1 +
xen/include/asm-x86/shadow.h | 3 ++-
xen/include/xen/trace.h | 1 +
10 files changed, 7 insertions(+), 62 deletions(-)
diff --git a/xen/arch/x86/pv/callback.c b/xen/arch/x86/pv/callback.c
index 106c16ed01..97242cd3d4 100644
--- a/xen/arch/x86/pv/callback.c
+++ b/xen/arch/x86/pv/callback.c
@@ -19,15 +19,10 @@
#include <xen/event.h>
#include <xen/hypercall.h>
#include <xen/guest_access.h>
-#include <xen/lib.h>
-#include <xen/sched.h>
#include <compat/callback.h>
#include <compat/nmi.h>
-#include <asm/current.h>
-#include <asm/nmi.h>
#include <asm/shared.h>
-#include <asm/traps.h>
#include <public/callback.h>
diff --git a/xen/arch/x86/pv/emul-gate-op.c b/xen/arch/x86/pv/emul-gate-op.c
index 3c7f6d70bc..61e65ce521 100644
--- a/xen/arch/x86/pv/emul-gate-op.c
+++ b/xen/arch/x86/pv/emul-gate-op.c
@@ -20,25 +20,6 @@
*/
#include <xen/err.h>
-#include <xen/errno.h>
-#include <xen/event.h>
-#include <xen/guest_access.h>
-#include <xen/iocap.h>
-#include <xen/spinlock.h>
-#include <xen/trace.h>
-
-#include <asm/apic.h>
-#include <asm/debugreg.h>
-#include <asm/hpet.h>
-#include <asm/hypercall.h>
-#include <asm/mc146818rtc.h>
-#include <asm/p2m.h>
-#include <asm/pv/traps.h>
-#include <asm/shared.h>
-#include <asm/traps.h>
-#include <asm/x86_emulate.h>
-
-#include <xsm/xsm.h>
#include "emulate.h"
diff --git a/xen/arch/x86/pv/emul-inv-op.c b/xen/arch/x86/pv/emul-inv-op.c
index 91d05790c2..59e3edc8c4 100644
--- a/xen/arch/x86/pv/emul-inv-op.c
+++ b/xen/arch/x86/pv/emul-inv-op.c
@@ -19,26 +19,8 @@
* along with this program; If not, see <http://www.gnu.org/licenses/>.
*/
-#include <xen/errno.h>
-#include <xen/event.h>
-#include <xen/guest_access.h>
-#include <xen/iocap.h>
-#include <xen/spinlock.h>
#include <xen/trace.h>
-#include <asm/apic.h>
-#include <asm/debugreg.h>
-#include <asm/hpet.h>
-#include <asm/hypercall.h>
-#include <asm/mc146818rtc.h>
-#include <asm/p2m.h>
-#include <asm/pv/traps.h>
-#include <asm/shared.h>
-#include <asm/traps.h>
-#include <asm/x86_emulate.h>
-
-#include <xsm/xsm.h>
-
#include "emulate.h"
static int emulate_forced_invalid_op(struct cpu_user_regs *regs)
diff --git a/xen/arch/x86/pv/emul-priv-op.c b/xen/arch/x86/pv/emul-priv-op.c
index e24b84f46a..3b705299cf 100644
--- a/xen/arch/x86/pv/emul-priv-op.c
+++ b/xen/arch/x86/pv/emul-priv-op.c
@@ -19,25 +19,18 @@
* along with this program; If not, see <http://www.gnu.org/licenses/>.
*/
-#include <xen/errno.h>
+#include <xen/domain_page.h>
#include <xen/event.h>
#include <xen/guest_access.h>
#include <xen/iocap.h>
-#include <xen/spinlock.h>
-#include <xen/trace.h>
#include <asm/amd.h>
-#include <asm/apic.h>
#include <asm/debugreg.h>
#include <asm/hpet.h>
#include <asm/hypercall.h>
#include <asm/mc146818rtc.h>
-#include <asm/p2m.h>
#include <asm/pv/domain.h>
-#include <asm/pv/traps.h>
#include <asm/shared.h>
-#include <asm/traps.h>
-#include <asm/x86_emulate.h>
#include <xsm/xsm.h>
diff --git a/xen/arch/x86/pv/emulate.h b/xen/arch/x86/pv/emulate.h
index fd2aa0a484..4b845b08e3 100644
--- a/xen/arch/x86/pv/emulate.h
+++ b/xen/arch/x86/pv/emulate.h
@@ -1,6 +1,8 @@
#ifndef __PV_EMULATE_H__
#define __PV_EMULATE_H__
+#include <xen/sched.h>
+
#include <asm/processor.h>
#include <asm/x86_emulate.h>
diff --git a/xen/arch/x86/pv/ro-page-fault.c b/xen/arch/x86/pv/ro-page-fault.c
index a920fb5e15..0eedb70002 100644
--- a/xen/arch/x86/pv/ro-page-fault.c
+++ b/xen/arch/x86/pv/ro-page-fault.c
@@ -20,15 +20,7 @@
* along with this program; If not, see <http://www.gnu.org/licenses/>.
*/
-#include <xen/guest_access.h>
-#include <xen/rangeset.h>
-#include <xen/sched.h>
#include <xen/trace.h>
-
-#include <asm/domain.h>
-#include <asm/mm.h>
-#include <asm/pci.h>
-#include <asm/pv/mm.h>
#include <asm/shadow.h>
#include "emulate.h"
diff --git a/xen/arch/x86/pv/shim.c b/xen/arch/x86/pv/shim.c
index 31264582cc..3a0525c209 100644
--- a/xen/arch/x86/pv/shim.c
+++ b/xen/arch/x86/pv/shim.c
@@ -25,14 +25,11 @@
#include <xen/iocap.h>
#include <xen/param.h>
#include <xen/shutdown.h>
-#include <xen/types.h>
#include <xen/consoled.h>
#include <xen/pv_console.h>
-#include <asm/apic.h>
#include <asm/dom0_build.h>
#include <asm/guest.h>
-#include <asm/pv/mm.h>
#include <public/arch-x86/cpuid.h>
#include <public/hvm/params.h>
diff --git a/xen/arch/x86/x86_64/mmconfig.h b/xen/arch/x86/x86_64/mmconfig.h
index 2e836848ad..4d3b9fcbdd 100644
--- a/xen/arch/x86/x86_64/mmconfig.h
+++ b/xen/arch/x86/x86_64/mmconfig.h
@@ -75,6 +75,7 @@ static inline void mmio_config_writel(void __iomem *pos, u32 val)
}
/* function prototypes */
+struct acpi_table_header;
int acpi_parse_mcfg(struct acpi_table_header *header);
int pci_mmcfg_reserved(uint64_t address, unsigned int segment,
unsigned int start_bus, unsigned int end_bus,
diff --git a/xen/include/asm-x86/shadow.h b/xen/include/asm-x86/shadow.h
index 907c71f497..8335862c87 100644
--- a/xen/include/asm-x86/shadow.h
+++ b/xen/include/asm-x86/shadow.h
@@ -22,7 +22,6 @@
#ifndef _XEN_SHADOW_H
#define _XEN_SHADOW_H
-#include <public/domctl.h>
#include <xen/sched.h>
#include <xen/perfc.h>
#include <xen/domain_page.h>
@@ -31,6 +30,8 @@
#include <asm/p2m.h>
#include <asm/spec_ctrl.h>
+#include <public/domctl.h>
+
/*****************************************************************************
* Macros to tell which shadow paging mode a domain is in*/
diff --git a/xen/include/xen/trace.h b/xen/include/xen/trace.h
index af925bcfcc..3cbb542af8 100644
--- a/xen/include/xen/trace.h
+++ b/xen/include/xen/trace.h
@@ -28,6 +28,7 @@ extern int tb_init_done;
#define tb_init_done false
#endif
+#include <xen/types.h>
#include <public/sysctl.h>
#include <public/trace.h>
#include <asm/trace.h>
--
2.11.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] x86/pv: Prune include lists
2020-05-05 11:42 [PATCH] x86/pv: Prune include lists Andrew Cooper
@ 2020-05-05 13:51 ` Jan Beulich
0 siblings, 0 replies; 2+ messages in thread
From: Jan Beulich @ 2020-05-05 13:51 UTC (permalink / raw)
To: Andrew Cooper; +Cc: Xen-devel, Wei Liu, Roger Pau Monné
On 05.05.2020 13:42, Andrew Cooper wrote:
> Several of these in particular haven't been pruned since the logic was all
> part of arch/x86/traps.c
>
> Some adjustments to header files are required to avoid compile errors:
> * emulate.h needs xen/sched.h because gdt_ldt_desc_ptr() uses v->vcpu_id.
> * mmconfig.h needs to forward declare acpi_table_header.
> * shadow.h and trace.h need to have uint*_t in scope before including the Xen
> public headers. For shadow.h, reorder the includes. For trace.h, include
> types.h
>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-05-05 13:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-05 11:42 [PATCH] x86/pv: Prune include lists Andrew Cooper
2020-05-05 13:51 ` Jan Beulich
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.