Skip to content

Commit 0520058

Browse files
committed
Merge tag 'for-linus-5.9-rc1b-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip
Pull more xen updates from Juergen Gross: - Remove support for running as 32-bit Xen PV-guest. 32-bit PV guests are rarely used, are lacking security fixes for Meltdown, and can be easily replaced by PVH mode. Another series for doing more cleanup will follow soon (removal of 32-bit-only pvops functionality). - Fixes and additional features for the Xen display frontend driver. * tag 'for-linus-5.9-rc1b-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: drm/xen-front: Pass dumb buffer data offset to the backend xen: Sync up with the canonical protocol definition in Xen drm/xen-front: Add YUYV to supported formats drm/xen-front: Fix misused IS_ERR_OR_NULL checks xen/gntdev: Fix dmabuf import with non-zero sgt offset x86/xen: drop tests for highmem in pv code x86/xen: eliminate xen-asm_64.S x86/xen: remove 32-bit Xen PV guest support
2 parents cd94257 + 585c6ed commit 0520058

27 files changed

+397
-1143
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/Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# SPDX-License-Identifier: GPL-2.0
2-
OBJECT_FILES_NON_STANDARD_xen-asm_$(BITS).o := y
2+
OBJECT_FILES_NON_STANDARD_xen-asm.o := y
33

44
ifdef CONFIG_FUNCTION_TRACER
55
# Do not profile debug and lowlevel utilities
@@ -33,7 +33,6 @@ obj-$(CONFIG_XEN_PV) += mmu_pv.o
3333
obj-$(CONFIG_XEN_PV) += irq.o
3434
obj-$(CONFIG_XEN_PV) += multicalls.o
3535
obj-$(CONFIG_XEN_PV) += xen-asm.o
36-
obj-$(CONFIG_XEN_PV) += xen-asm_$(BITS).o
3736

3837
obj-$(CONFIG_XEN_PVH) += enlighten_pvh.o
3938

arch/x86/xen/apic.c

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

6161
if (reg == APIC_LVR)
6262
return 0x14;
63-
#ifdef CONFIG_X86_32
64-
if (reg == APIC_LDR)
65-
return SET_APIC_LOGICAL_ID(1UL << smp_processor_id());
66-
#endif
6763
if (reg != APIC_ID)
6864
return 0;
6965

@@ -129,14 +125,6 @@ static int xen_phys_pkg_id(int initial_apic_id, int index_msb)
129125
return initial_apic_id >> index_msb;
130126
}
131127

132-
#ifdef CONFIG_X86_32
133-
static int xen_x86_32_early_logical_apicid(int cpu)
134-
{
135-
/* Match with APIC_LDR read. Otherwise setup_local_APIC complains. */
136-
return 1 << cpu;
137-
}
138-
#endif
139-
140128
static void xen_noop(void)
141129
{
142130
}
@@ -199,11 +187,6 @@ static struct apic xen_pv_apic = {
199187
.icr_write = xen_apic_icr_write,
200188
.wait_icr_idle = xen_noop,
201189
.safe_wait_icr_idle = xen_safe_apic_wait_icr_idle,
202-
203-
#ifdef CONFIG_X86_32
204-
/* generic_processor_info and setup_local_APIC. */
205-
.x86_32_early_logical_apicid = xen_x86_32_early_logical_apicid,
206-
#endif
207190
};
208191

209192
static void __init xen_apic_check(void)

0 commit comments

Comments
 (0)