Skip to content

Commit a13f2ef

Browse files
committed
x86/xen: remove 32-bit Xen PV guest support
Xen is requiring 64-bit machines today and since Xen 4.14 it can be built without 32-bit PV guest support. There is no need to carry the burden of 32-bit PV guest support in the kernel any longer, as new guests can be either HVM or PVH, or they can use a 64 bit kernel. Remove the 32-bit Xen PV support from the kernel. Signed-off-by: Juergen Gross <[email protected]> Reviewed-by: Boris Ostrovsky <[email protected]> Signed-off-by: Juergen Gross <[email protected]>
1 parent d7b461c commit a13f2ef

File tree

18 files changed

+50
-840
lines changed

18 files changed

+50
-840
lines changed

arch/x86/entry/entry_32.S

Lines changed: 2 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -449,8 +449,6 @@
449449

450450
.macro SWITCH_TO_KERNEL_STACK
451451

452-
ALTERNATIVE "", "jmp .Lend_\@", X86_FEATURE_XENPV
453-
454452
BUG_IF_WRONG_CR3
455453

456454
SWITCH_TO_KERNEL_CR3 scratch_reg=%eax
@@ -599,8 +597,6 @@
599597
*/
600598
.macro SWITCH_TO_ENTRY_STACK
601599

602-
ALTERNATIVE "", "jmp .Lend_\@", X86_FEATURE_XENPV
603-
604600
/* Bytes to copy */
605601
movl $PTREGS_SIZE, %ecx
606602

@@ -872,17 +868,6 @@ SYM_ENTRY(__begin_SYSENTER_singlestep_region, SYM_L_GLOBAL, SYM_A_NONE)
872868
* will ignore all of the single-step traps generated in this range.
873869
*/
874870

875-
#ifdef CONFIG_XEN_PV
876-
/*
877-
* Xen doesn't set %esp to be precisely what the normal SYSENTER
878-
* entry point expects, so fix it up before using the normal path.
879-
*/
880-
SYM_CODE_START(xen_sysenter_target)
881-
addl $5*4, %esp /* remove xen-provided frame */
882-
jmp .Lsysenter_past_esp
883-
SYM_CODE_END(xen_sysenter_target)
884-
#endif
885-
886871
/*
887872
* 32-bit SYSENTER entry.
888873
*
@@ -965,9 +950,8 @@ SYM_FUNC_START(entry_SYSENTER_32)
965950

966951
movl %esp, %eax
967952
call do_SYSENTER_32
968-
/* XEN PV guests always use IRET path */
969-
ALTERNATIVE "testl %eax, %eax; jz .Lsyscall_32_done", \
970-
"jmp .Lsyscall_32_done", X86_FEATURE_XENPV
953+
testl %eax, %eax
954+
jz .Lsyscall_32_done
971955

972956
STACKLEAK_ERASE
973957

@@ -1165,95 +1149,6 @@ SYM_FUNC_END(entry_INT80_32)
11651149
#endif
11661150
.endm
11671151

1168-
#ifdef CONFIG_PARAVIRT
1169-
SYM_CODE_START(native_iret)
1170-
iret
1171-
_ASM_EXTABLE(native_iret, asm_iret_error)
1172-
SYM_CODE_END(native_iret)
1173-
#endif
1174-
1175-
#ifdef CONFIG_XEN_PV
1176-
/*
1177-
* See comment in entry_64.S for further explanation
1178-
*
1179-
* Note: This is not an actual IDT entry point. It's a XEN specific entry
1180-
* point and therefore named to match the 64-bit trampoline counterpart.
1181-
*/
1182-
SYM_FUNC_START(xen_asm_exc_xen_hypervisor_callback)
1183-
/*
1184-
* Check to see if we got the event in the critical
1185-
* region in xen_iret_direct, after we've reenabled
1186-
* events and checked for pending events. This simulates
1187-
* iret instruction's behaviour where it delivers a
1188-
* pending interrupt when enabling interrupts:
1189-
*/
1190-
cmpl $xen_iret_start_crit, (%esp)
1191-
jb 1f
1192-
cmpl $xen_iret_end_crit, (%esp)
1193-
jae 1f
1194-
call xen_iret_crit_fixup
1195-
1:
1196-
pushl $-1 /* orig_ax = -1 => not a system call */
1197-
SAVE_ALL
1198-
ENCODE_FRAME_POINTER
1199-
1200-
mov %esp, %eax
1201-
call xen_pv_evtchn_do_upcall
1202-
jmp handle_exception_return
1203-
SYM_FUNC_END(xen_asm_exc_xen_hypervisor_callback)
1204-
1205-
/*
1206-
* Hypervisor uses this for application faults while it executes.
1207-
* We get here for two reasons:
1208-
* 1. Fault while reloading DS, ES, FS or GS
1209-
* 2. Fault while executing IRET
1210-
* Category 1 we fix up by reattempting the load, and zeroing the segment
1211-
* register if the load fails.
1212-
* Category 2 we fix up by jumping to do_iret_error. We cannot use the
1213-
* normal Linux return path in this case because if we use the IRET hypercall
1214-
* to pop the stack frame we end up in an infinite loop of failsafe callbacks.
1215-
* We distinguish between categories by maintaining a status value in EAX.
1216-
*/
1217-
SYM_FUNC_START(xen_failsafe_callback)
1218-
pushl %eax
1219-
movl $1, %eax
1220-
1: mov 4(%esp), %ds
1221-
2: mov 8(%esp), %es
1222-
3: mov 12(%esp), %fs
1223-
4: mov 16(%esp), %gs
1224-
/* EAX == 0 => Category 1 (Bad segment)
1225-
EAX != 0 => Category 2 (Bad IRET) */
1226-
testl %eax, %eax
1227-
popl %eax
1228-
lea 16(%esp), %esp
1229-
jz 5f
1230-
jmp asm_iret_error
1231-
5: pushl $-1 /* orig_ax = -1 => not a system call */
1232-
SAVE_ALL
1233-
ENCODE_FRAME_POINTER
1234-
jmp handle_exception_return
1235-
1236-
.section .fixup, "ax"
1237-
6: xorl %eax, %eax
1238-
movl %eax, 4(%esp)
1239-
jmp 1b
1240-
7: xorl %eax, %eax
1241-
movl %eax, 8(%esp)
1242-
jmp 2b
1243-
8: xorl %eax, %eax
1244-
movl %eax, 12(%esp)
1245-
jmp 3b
1246-
9: xorl %eax, %eax
1247-
movl %eax, 16(%esp)
1248-
jmp 4b
1249-
.previous
1250-
_ASM_EXTABLE(1b, 6b)
1251-
_ASM_EXTABLE(2b, 7b)
1252-
_ASM_EXTABLE(3b, 8b)
1253-
_ASM_EXTABLE(4b, 9b)
1254-
SYM_FUNC_END(xen_failsafe_callback)
1255-
#endif /* CONFIG_XEN_PV */
1256-
12571152
SYM_CODE_START_LOCAL_NOALIGN(handle_exception)
12581153
/* the function address is in %gs's slot on the stack */
12591154
SAVE_ALL switch_stacks=1 skip_gs=1 unwind_espfix=1

arch/x86/entry/vdso/vdso32/note.S

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -16,33 +16,3 @@ ELFNOTE_START(Linux, 0, "a")
1616
ELFNOTE_END
1717

1818
BUILD_SALT
19-
20-
#ifdef CONFIG_XEN
21-
/*
22-
* Add a special note telling glibc's dynamic linker a fake hardware
23-
* flavor that it will use to choose the search path for libraries in the
24-
* same way it uses real hardware capabilities like "mmx".
25-
* We supply "nosegneg" as the fake capability, to indicate that we
26-
* do not like negative offsets in instructions using segment overrides,
27-
* since we implement those inefficiently. This makes it possible to
28-
* install libraries optimized to avoid those access patterns in someplace
29-
* like /lib/i686/tls/nosegneg. Note that an /etc/ld.so.conf.d/file
30-
* corresponding to the bits here is needed to make ldconfig work right.
31-
* It should contain:
32-
* hwcap 1 nosegneg
33-
* to match the mapping of bit to name that we give here.
34-
*
35-
* At runtime, the fake hardware feature will be considered to be present
36-
* if its bit is set in the mask word. So, we start with the mask 0, and
37-
* at boot time we set VDSO_NOTE_NONEGSEG_BIT if running under Xen.
38-
*/
39-
40-
#include "../../xen/vdso.h" /* Defines VDSO_NOTE_NONEGSEG_BIT. */
41-
42-
ELFNOTE_START(GNU, 2, "a")
43-
.long 1 /* ncaps */
44-
VDSO32_NOTE_MASK: /* Symbol used by arch/x86/xen/setup.c */
45-
.long 0 /* mask */
46-
.byte VDSO_NOTE_NONEGSEG_BIT; .asciz "nosegneg" /* bit, name */
47-
ELFNOTE_END
48-
#endif

arch/x86/include/asm/proto.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ void entry_SYSENTER_compat(void);
2525
void __end_entry_SYSENTER_compat(void);
2626
void entry_SYSCALL_compat(void);
2727
void entry_INT80_compat(void);
28-
#if defined(CONFIG_X86_64) && defined(CONFIG_XEN_PV)
28+
#ifdef CONFIG_XEN_PV
2929
void xen_entry_INT80_compat(void);
3030
#endif
3131
#endif

arch/x86/include/asm/segment.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ static inline void vdso_read_cpunode(unsigned *cpu, unsigned *node)
301301
extern const char early_idt_handler_array[NUM_EXCEPTION_VECTORS][EARLY_IDT_HANDLER_SIZE];
302302
extern void early_ignore_irq(void);
303303

304-
#if defined(CONFIG_X86_64) && defined(CONFIG_XEN_PV)
304+
#ifdef CONFIG_XEN_PV
305305
extern const char xen_early_idt_handler_array[NUM_EXCEPTION_VECTORS][XEN_EARLY_IDT_HANDLER_SIZE];
306306
#endif
307307

arch/x86/kernel/head_32.S

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -134,38 +134,7 @@ SYM_CODE_START(startup_32)
134134
movl %eax,pa(initial_page_table+0xffc)
135135
#endif
136136

137-
#ifdef CONFIG_PARAVIRT
138-
/* This is can only trip for a broken bootloader... */
139-
cmpw $0x207, pa(boot_params + BP_version)
140-
jb .Ldefault_entry
141-
142-
/* Paravirt-compatible boot parameters. Look to see what architecture
143-
we're booting under. */
144-
movl pa(boot_params + BP_hardware_subarch), %eax
145-
cmpl $num_subarch_entries, %eax
146-
jae .Lbad_subarch
147-
148-
movl pa(subarch_entries)(,%eax,4), %eax
149-
subl $__PAGE_OFFSET, %eax
150-
jmp *%eax
151-
152-
.Lbad_subarch:
153-
SYM_INNER_LABEL_ALIGN(xen_entry, SYM_L_WEAK)
154-
/* Unknown implementation; there's really
155-
nothing we can do at this point. */
156-
ud2a
157-
158-
__INITDATA
159-
160-
subarch_entries:
161-
.long .Ldefault_entry /* normal x86/PC */
162-
.long xen_entry /* Xen hypervisor */
163-
.long .Ldefault_entry /* Moorestown MID */
164-
num_subarch_entries = (. - subarch_entries) / 4
165-
.previous
166-
#else
167137
jmp .Ldefault_entry
168-
#endif /* CONFIG_PARAVIRT */
169138
SYM_CODE_END(startup_32)
170139

171140
#ifdef CONFIG_HOTPLUG_CPU

arch/x86/xen/Kconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ config XEN_PV
1919
bool "Xen PV guest support"
2020
default y
2121
depends on XEN
22+
depends on X86_64
2223
select PARAVIRT_XXL
2324
select XEN_HAVE_PVMMU
2425
select XEN_HAVE_VPMU
@@ -50,7 +51,7 @@ config XEN_PVHVM_SMP
5051

5152
config XEN_512GB
5253
bool "Limit Xen pv-domain memory to 512GB"
53-
depends on XEN_PV && X86_64
54+
depends on XEN_PV
5455
default y
5556
help
5657
Limit paravirtualized user domains to 512GB of RAM.

arch/x86/xen/apic.c

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,6 @@ static u32 xen_apic_read(u32 reg)
5858

5959
if (reg == APIC_LVR)
6060
return 0x14;
61-
#ifdef CONFIG_X86_32
62-
if (reg == APIC_LDR)
63-
return SET_APIC_LOGICAL_ID(1UL << smp_processor_id());
64-
#endif
6561
if (reg != APIC_ID)
6662
return 0;
6763

@@ -127,14 +123,6 @@ static int xen_phys_pkg_id(int initial_apic_id, int index_msb)
127123
return initial_apic_id >> index_msb;
128124
}
129125

130-
#ifdef CONFIG_X86_32
131-
static int xen_x86_32_early_logical_apicid(int cpu)
132-
{
133-
/* Match with APIC_LDR read. Otherwise setup_local_APIC complains. */
134-
return 1 << cpu;
135-
}
136-
#endif
137-
138126
static void xen_noop(void)
139127
{
140128
}
@@ -197,11 +185,6 @@ static struct apic xen_pv_apic = {
197185
.icr_write = xen_apic_icr_write,
198186
.wait_icr_idle = xen_noop,
199187
.safe_wait_icr_idle = xen_safe_apic_wait_icr_idle,
200-
201-
#ifdef CONFIG_X86_32
202-
/* generic_processor_info and setup_local_APIC. */
203-
.x86_32_early_logical_apicid = xen_x86_32_early_logical_apicid,
204-
#endif
205188
};
206189

207190
static void __init xen_apic_check(void)

0 commit comments

Comments
 (0)