Skip to content

Commit c6dd78f

Browse files
committed
Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fixes from Thomas Gleixner: "A set of x86 specific fixes and updates: - The CR2 corruption fixes which store CR2 early in the entry code and hand the stored address to the fault handlers. - Revert a forgotten leftover of the dropped FSGSBASE series. - Plug a memory leak in the boot code. - Make the Hyper-V assist functionality robust by zeroing the shadow page. - Remove a useless check for dead processes with LDT - Update paravirt and VMware maintainers entries. - A few cleanup patches addressing various compiler warnings" * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/entry/64: Prevent clobbering of saved CR2 value x86/hyper-v: Zero out the VP ASSIST PAGE on allocation x86, boot: Remove multiple copy of static function sanitize_boot_params() x86/boot/compressed/64: Remove unused variable x86/boot/efi: Remove unused variables x86/mm, tracing: Fix CR2 corruption x86/entry/64: Update comments and sanity tests for create_gap x86/entry/64: Simplify idtentry a little x86/entry/32: Simplify common_exception x86/paravirt: Make read_cr2() CALLEE_SAVE MAINTAINERS: Update PARAVIRT_OPS_INTERFACE and VMWARE_HYPERVISOR_INTERFACE x86/process: Delete useless check for dead process with LDT x86: math-emu: Hide clang warnings for 16-bit overflow x86/e820: Use proper booleans instead of 0/1 x86/apic: Silence -Wtype-limits compiler warnings x86/mm: Free sme_early_buffer after init x86/boot: Fix memory leak in default_get_smp_config() Revert "x86/ptrace: Prevent ptrace from clearing the FS/GS selector" and fix the test
2 parents 46f5c0c + 6879298 commit c6dd78f

33 files changed

+226
-215
lines changed

MAINTAINERS

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12133,7 +12133,8 @@ F: Documentation/driver-api/parport*.rst
1213312133

1213412134
PARAVIRT_OPS INTERFACE
1213512135
M: Juergen Gross <[email protected]>
12136-
M: Alok Kataria <[email protected]>
12136+
M: Thomas Hellstrom <[email protected]>
12137+
M: "VMware, Inc." <[email protected]>
1213712138
1213812139
S: Supported
1213912140
F: Documentation/virtual/paravirt_ops.txt
@@ -17179,7 +17180,8 @@ S: Maintained
1717917180
F: drivers/misc/vmw_balloon.c
1718017181

1718117182
VMWARE HYPERVISOR INTERFACE
17182-
M: Alok Kataria <[email protected]>
17183+
M: Thomas Hellstrom <[email protected]>
17184+
M: "VMware, Inc." <[email protected]>
1718317185
1718417186
S: Supported
1718517187
F: arch/x86/kernel/cpu/vmware.c

arch/x86/boot/compressed/eboot.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -384,14 +384,11 @@ struct boot_params *make_boot_params(struct efi_config *c)
384384
struct apm_bios_info *bi;
385385
struct setup_header *hdr;
386386
efi_loaded_image_t *image;
387-
void *options, *handle;
387+
void *handle;
388388
efi_guid_t proto = LOADED_IMAGE_PROTOCOL_GUID;
389389
int options_size = 0;
390390
efi_status_t status;
391391
char *cmdline_ptr;
392-
u16 *s2;
393-
u8 *s1;
394-
int i;
395392
unsigned long ramdisk_addr;
396393
unsigned long ramdisk_size;
397394

@@ -494,8 +491,6 @@ static void add_e820ext(struct boot_params *params,
494491
struct setup_data *e820ext, u32 nr_entries)
495492
{
496493
struct setup_data *data;
497-
efi_status_t status;
498-
unsigned long size;
499494

500495
e820ext->type = SETUP_E820_EXT;
501496
e820ext->len = nr_entries * sizeof(struct boot_e820_entry);
@@ -677,8 +672,6 @@ static efi_status_t exit_boot_func(efi_system_table_t *sys_table_arg,
677672
void *priv)
678673
{
679674
const char *signature;
680-
__u32 nr_desc;
681-
efi_status_t status;
682675
struct exit_boot_struct *p = priv;
683676

684677
signature = efi_is_64bit() ? EFI64_LOADER_SIGNATURE
@@ -747,7 +740,6 @@ struct boot_params *
747740
efi_main(struct efi_config *c, struct boot_params *boot_params)
748741
{
749742
struct desc_ptr *gdt = NULL;
750-
efi_loaded_image_t *image;
751743
struct setup_header *hdr = &boot_params->hdr;
752744
efi_status_t status;
753745
struct desc_struct *desc;

arch/x86/boot/compressed/misc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "pgtable.h"
1818
#include "../string.h"
1919
#include "../voffset.h"
20+
#include <asm/bootparam_utils.h>
2021

2122
/*
2223
* WARNING!!

arch/x86/boot/compressed/misc.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include <asm/page.h>
2424
#include <asm/boot.h>
2525
#include <asm/bootparam.h>
26-
#include <asm/bootparam_utils.h>
2726

2827
#define BOOT_CTYPE_H
2928
#include <linux/acpi.h>

arch/x86/boot/compressed/pgtable_64.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ int cmdline_find_option_bool(const char *option);
4040
static unsigned long find_trampoline_placement(void)
4141
{
4242
unsigned long bios_start = 0, ebda_start = 0;
43-
unsigned long trampoline_start;
4443
struct boot_e820_entry *entry;
4544
char *signature;
4645
int i;

arch/x86/entry/calling.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,3 +343,9 @@ For 32-bit we have the following conventions - kernel is built with
343343
.Lafter_call_\@:
344344
#endif
345345
.endm
346+
347+
#ifdef CONFIG_PARAVIRT_XXL
348+
#define GET_CR2_INTO(reg) GET_CR2_INTO_AX ; _ASM_MOV %_ASM_AX, reg
349+
#else
350+
#define GET_CR2_INTO(reg) _ASM_MOV %cr2, reg
351+
#endif

arch/x86/entry/entry_32.S

Lines changed: 35 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -294,9 +294,11 @@
294294
.Lfinished_frame_\@:
295295
.endm
296296

297-
.macro SAVE_ALL pt_regs_ax=%eax switch_stacks=0
297+
.macro SAVE_ALL pt_regs_ax=%eax switch_stacks=0 skip_gs=0
298298
cld
299+
.if \skip_gs == 0
299300
PUSH_GS
301+
.endif
300302
FIXUP_FRAME
301303
pushl %fs
302304
pushl %es
@@ -313,13 +315,13 @@
313315
movl %edx, %es
314316
movl $(__KERNEL_PERCPU), %edx
315317
movl %edx, %fs
318+
.if \skip_gs == 0
316319
SET_KERNEL_GS %edx
317-
320+
.endif
318321
/* Switch to kernel stack if necessary */
319322
.if \switch_stacks > 0
320323
SWITCH_TO_KERNEL_STACK
321324
.endif
322-
323325
.endm
324326

325327
.macro SAVE_ALL_NMI cr3_reg:req
@@ -1441,39 +1443,46 @@ BUILD_INTERRUPT3(hv_stimer0_callback_vector, HYPERV_STIMER0_VECTOR,
14411443

14421444
ENTRY(page_fault)
14431445
ASM_CLAC
1444-
pushl $do_page_fault
1445-
ALIGN
1446-
jmp common_exception
1446+
pushl $0; /* %gs's slot on the stack */
1447+
1448+
SAVE_ALL switch_stacks=1 skip_gs=1
1449+
1450+
ENCODE_FRAME_POINTER
1451+
UNWIND_ESPFIX_STACK
1452+
1453+
/* fixup %gs */
1454+
GS_TO_REG %ecx
1455+
REG_TO_PTGS %ecx
1456+
SET_KERNEL_GS %ecx
1457+
1458+
GET_CR2_INTO(%ecx) # might clobber %eax
1459+
1460+
/* fixup orig %eax */
1461+
movl PT_ORIG_EAX(%esp), %edx # get the error code
1462+
movl $-1, PT_ORIG_EAX(%esp) # no syscall to restart
1463+
1464+
TRACE_IRQS_OFF
1465+
movl %esp, %eax # pt_regs pointer
1466+
call do_page_fault
1467+
jmp ret_from_exception
14471468
END(page_fault)
14481469

14491470
common_exception:
14501471
/* the function address is in %gs's slot on the stack */
1451-
FIXUP_FRAME
1452-
pushl %fs
1453-
pushl %es
1454-
pushl %ds
1455-
pushl %eax
1456-
movl $(__USER_DS), %eax
1457-
movl %eax, %ds
1458-
movl %eax, %es
1459-
movl $(__KERNEL_PERCPU), %eax
1460-
movl %eax, %fs
1461-
pushl %ebp
1462-
pushl %edi
1463-
pushl %esi
1464-
pushl %edx
1465-
pushl %ecx
1466-
pushl %ebx
1467-
SWITCH_TO_KERNEL_STACK
1472+
SAVE_ALL switch_stacks=1 skip_gs=1
14681473
ENCODE_FRAME_POINTER
1469-
cld
14701474
UNWIND_ESPFIX_STACK
1475+
1476+
/* fixup %gs */
14711477
GS_TO_REG %ecx
14721478
movl PT_GS(%esp), %edi # get the function address
1473-
movl PT_ORIG_EAX(%esp), %edx # get the error code
1474-
movl $-1, PT_ORIG_EAX(%esp) # no syscall to restart
14751479
REG_TO_PTGS %ecx
14761480
SET_KERNEL_GS %ecx
1481+
1482+
/* fixup orig %eax */
1483+
movl PT_ORIG_EAX(%esp), %edx # get the error code
1484+
movl $-1, PT_ORIG_EAX(%esp) # no syscall to restart
1485+
14771486
TRACE_IRQS_OFF
14781487
movl %esp, %eax # pt_regs pointer
14791488
CALL_NOSPEC %edi

0 commit comments

Comments
 (0)