Skip to content

Commit 28c11b0

Browse files
jgross1KAGA-KOKO
authored andcommitted
x86/xen: Move pv irq related functions under CONFIG_XEN_PV umbrella
All functions in arch/x86/xen/irq.c and arch/x86/xen/xen-asm*.S are specific to PV guests. Include them in the kernel with CONFIG_XEN_PV only. Make the PV specific code in arch/x86/entry/entry_*.S dependent on CONFIG_XEN_PV instead of CONFIG_XEN. The HVM specific code should depend on CONFIG_XEN_PVHVM. While at it reformat the Makefile to make it more readable. Signed-off-by: Juergen Gross <jgross@suse.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com> Acked-by: Thomas Gleixner <tglx@linutronix.de> Cc: xen-devel@lists.xenproject.org Cc: virtualization@lists.linux-foundation.org Cc: akataria@vmware.com Cc: rusty@rustcorp.com.au Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/20180828074026.820-2-jgross@suse.com
1 parent 60c1f89 commit 28c11b0

File tree

4 files changed

+43
-16
lines changed

4 files changed

+43
-16
lines changed

arch/x86/entry/entry_32.S

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,7 @@ GLOBAL(__begin_SYSENTER_singlestep_region)
782782
* will ignore all of the single-step traps generated in this range.
783783
*/
784784

785-
#ifdef CONFIG_XEN
785+
#ifdef CONFIG_XEN_PV
786786
/*
787787
* Xen doesn't set %esp to be precisely what the normal SYSENTER
788788
* entry point expects, so fix it up before using the normal path.
@@ -1240,7 +1240,7 @@ ENTRY(spurious_interrupt_bug)
12401240
jmp common_exception
12411241
END(spurious_interrupt_bug)
12421242

1243-
#ifdef CONFIG_XEN
1243+
#ifdef CONFIG_XEN_PV
12441244
ENTRY(xen_hypervisor_callback)
12451245
pushl $-1 /* orig_ax = -1 => not a system call */
12461246
SAVE_ALL
@@ -1321,11 +1321,13 @@ ENTRY(xen_failsafe_callback)
13211321
_ASM_EXTABLE(3b, 8b)
13221322
_ASM_EXTABLE(4b, 9b)
13231323
ENDPROC(xen_failsafe_callback)
1324+
#endif /* CONFIG_XEN_PV */
13241325

1326+
#ifdef CONFIG_XEN_PVHVM
13251327
BUILD_INTERRUPT3(xen_hvm_callback_vector, HYPERVISOR_CALLBACK_VECTOR,
13261328
xen_evtchn_do_upcall)
1329+
#endif
13271330

1328-
#endif /* CONFIG_XEN */
13291331

13301332
#if IS_ENABLED(CONFIG_HYPERV)
13311333

arch/x86/entry/entry_64.S

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,7 +1050,7 @@ ENTRY(do_softirq_own_stack)
10501050
ret
10511051
ENDPROC(do_softirq_own_stack)
10521052

1053-
#ifdef CONFIG_XEN
1053+
#ifdef CONFIG_XEN_PV
10541054
idtentry hypervisor_callback xen_do_hypervisor_callback has_error_code=0
10551055

10561056
/*
@@ -1130,11 +1130,13 @@ ENTRY(xen_failsafe_callback)
11301130
ENCODE_FRAME_POINTER
11311131
jmp error_exit
11321132
END(xen_failsafe_callback)
1133+
#endif /* CONFIG_XEN_PV */
11331134

1135+
#ifdef CONFIG_XEN_PVHVM
11341136
apicinterrupt3 HYPERVISOR_CALLBACK_VECTOR \
11351137
xen_hvm_callback_vector xen_evtchn_do_upcall
1138+
#endif
11361139

1137-
#endif /* CONFIG_XEN */
11381140

11391141
#if IS_ENABLED(CONFIG_HYPERV)
11401142
apicinterrupt3 HYPERVISOR_CALLBACK_VECTOR \
@@ -1151,7 +1153,7 @@ idtentry debug do_debug has_error_code=0 paranoid=1 shift_ist=DEBUG_STACK
11511153
idtentry int3 do_int3 has_error_code=0
11521154
idtentry stack_segment do_stack_segment has_error_code=1
11531155

1154-
#ifdef CONFIG_XEN
1156+
#ifdef CONFIG_XEN_PV
11551157
idtentry xennmi do_nmi has_error_code=0
11561158
idtentry xendebug do_debug has_error_code=0
11571159
idtentry xenint3 do_int3 has_error_code=0

arch/x86/xen/Makefile

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,46 @@ endif
1212
# Make sure early boot has no stackprotector
1313
nostackp := $(call cc-option, -fno-stack-protector)
1414
CFLAGS_enlighten_pv.o := $(nostackp)
15-
CFLAGS_mmu_pv.o := $(nostackp)
15+
CFLAGS_mmu_pv.o := $(nostackp)
1616

17-
obj-y := enlighten.o multicalls.o mmu.o irq.o \
18-
time.o xen-asm.o xen-asm_$(BITS).o \
19-
grant-table.o suspend.o platform-pci-unplug.o
17+
obj-y += enlighten.o
18+
obj-y += multicalls.o
19+
obj-y += mmu.o
20+
obj-y += time.o
21+
obj-y += grant-table.o
22+
obj-y += suspend.o
23+
obj-y += platform-pci-unplug.o
2024

21-
obj-$(CONFIG_XEN_PVHVM) += enlighten_hvm.o mmu_hvm.o suspend_hvm.o
22-
obj-$(CONFIG_XEN_PV) += setup.o apic.o pmu.o suspend_pv.o \
23-
p2m.o enlighten_pv.o mmu_pv.o
24-
obj-$(CONFIG_XEN_PVH) += enlighten_pvh.o
25+
obj-$(CONFIG_XEN_PVHVM) += enlighten_hvm.o
26+
obj-$(CONFIG_XEN_PVHVM) += mmu_hvm.o
27+
obj-$(CONFIG_XEN_PVHVM) += suspend_hvm.o
2528

26-
obj-$(CONFIG_EVENT_TRACING) += trace.o
29+
obj-$(CONFIG_XEN_PV) += setup.o
30+
obj-$(CONFIG_XEN_PV) += apic.o
31+
obj-$(CONFIG_XEN_PV) += pmu.o
32+
obj-$(CONFIG_XEN_PV) += suspend_pv.o
33+
obj-$(CONFIG_XEN_PV) += p2m.o
34+
obj-$(CONFIG_XEN_PV) += enlighten_pv.o
35+
obj-$(CONFIG_XEN_PV) += mmu_pv.o
36+
obj-$(CONFIG_XEN_PV) += irq.o
37+
obj-$(CONFIG_XEN_PV) += xen-asm.o
38+
obj-$(CONFIG_XEN_PV) += xen-asm_$(BITS).o
39+
40+
obj-$(CONFIG_XEN_PVH) += enlighten_pvh.o
41+
obj-$(CONFIG_XEN_PVH) += xen-pvh.o
42+
43+
obj-$(CONFIG_EVENT_TRACING) += trace.o
2744

2845
obj-$(CONFIG_SMP) += smp.o
2946
obj-$(CONFIG_XEN_PV_SMP) += smp_pv.o
3047
obj-$(CONFIG_XEN_PVHVM_SMP) += smp_hvm.o
48+
3149
obj-$(CONFIG_PARAVIRT_SPINLOCKS)+= spinlock.o
50+
3251
obj-$(CONFIG_XEN_DEBUG_FS) += debugfs.o
52+
3353
obj-$(CONFIG_XEN_DOM0) += vga.o
54+
3455
obj-$(CONFIG_SWIOTLB_XEN) += pci-swiotlb-xen.o
56+
3557
obj-$(CONFIG_XEN_EFI) += efi.o
36-
obj-$(CONFIG_XEN_PVH) += xen-pvh.o

include/xen/events.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,13 @@ unsigned irq_from_evtchn(unsigned int evtchn);
8989
int irq_from_virq(unsigned int cpu, unsigned int virq);
9090
unsigned int evtchn_from_irq(unsigned irq);
9191

92+
#ifdef CONFIG_XEN_PVHVM
9293
/* Xen HVM evtchn vector callback */
9394
void xen_hvm_callback_vector(void);
9495
#ifdef CONFIG_TRACING
9596
#define trace_xen_hvm_callback_vector xen_hvm_callback_vector
9697
#endif
98+
#endif
9799
int xen_set_callback_via(uint64_t via);
98100
void xen_evtchn_do_upcall(struct pt_regs *regs);
99101
void xen_hvm_evtchn_do_upcall(void);

0 commit comments

Comments
 (0)