x86 fixes for 4.15
Subsystems (5)
Linus,
please pull the latest x86-urgent-for-linus git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-urgent-for-linus
A couple of fixlets for x86:
- Fix the ESPFIX double fault handling for 5-level pagetables
- Fix the commandline parsing for 'apic=' on 32bit systems and update documentation
- Make zombie stack traces reliable
- Fix kexec with stack canary
- Fix the delivery mode for APICs which was missed when the x86 vector management was converted to single target delivery. Caused a regression due to the broken hardware which ignores affinity settings in lowest prio delivery mode.
- Unbreak modules when AMD memory encryption is enabled
- Remove an unused parameter of prepare_switch_to
Thanks,
tglx
------------------>
Andy Lutomirski (1):
x86/espfix/64: Fix espfix double-fault handling on 5-level systems
Dou Liyang (2):
x86/apic: Avoid wrong warning when parsing 'apic=' in X86-32 case x86/apic: Update the 'apic=' description of setting APIC driver
Josh Poimboeuf (1):
x86/stacktrace: Make zombie stack traces reliable
Linus Torvalds (1):
x86-32: Fix kexec with stack canary (CONFIG_CC_STACKPROTECTOR)
Matthew Wilcox (1):
x86/build: Make isoimage work on Debian
Thomas Gleixner (1):
x86/apic: Switch all APICs to Fixed delivery mode
Tom Lendacky (1):
x86/mm: Unbreak modules that use the DMA API
rodrigosiqueira (1):
x86: Remove unused parameter of prepare_switch_to
Documentation/admin-guide/kernel-parameters.txt | 6 +++++- arch/x86/boot/genimage.sh | 28 ++++++++++++++----------- arch/x86/include/asm/switch_to.h | 5 ++--- arch/x86/kernel/apic/apic.c | 2 ++ arch/x86/kernel/apic/apic_flat_64.c | 2 +- arch/x86/kernel/apic/apic_noop.c | 2 +- arch/x86/kernel/apic/msi.c | 8 ++----- arch/x86/kernel/apic/probe_32.c | 2 +- arch/x86/kernel/apic/x2apic_cluster.c | 2 +- arch/x86/kernel/machine_kexec_32.c | 4 +--- arch/x86/kernel/stacktrace.c | 6 +++++- arch/x86/kernel/traps.c | 2 +- arch/x86/mm/mem_encrypt.c | 4 ++-- drivers/pci/host/pci-hyperv.c | 8 ++----- 14 files changed, 42 insertions(+), 39 deletions(-)
Documentation/admin-guide/kernel-parameters.txt +5 -1
@@ -328,11 +328,15 @@ not play well with APC CPU idle - disable it if you have APC and your system crashes randomly. - apic= [APIC,X86-32] Advanced Programmable Interrupt Controller + apic= [APIC,X86] Advanced Programmable Interrupt Controller Change the output verbosity whilst booting Format: { quiet (default) | verbose | debug } Change the amount of debugging information output when initialising the APIC and IO-APIC components. + For X86-32, this can also be used to specify an APIC + driver name. + Format: apic=driver_name + Examples: apic=bigsmp apic_extnmi= [APIC,X86] External NMI delivery setting Format: { bsp (default) | all | none }
arch/x86/boot/genimage.sh +16 -12
@@ -80,39 +80,43 @@ genfdimage288() { mcopy $FBZIMAGE w:linux } -genisoimage() { +geniso() { tmp_dir=`dirname $FIMAGE`/isoimage rm -rf $tmp_dir mkdir $tmp_dir - for i in lib lib64 share end ; do + for i in lib lib64 share ; do for j in syslinux ISOLINUX ; do if [ -f /usr/$i/$j/isolinux.bin ] ; then isolinux=/usr/$i/$j/isolinux.bin - cp $isolinux $tmp_dir fi done for j in syslinux syslinux/modules/bios ; do if [ -f /usr/$i/$j/ldlinux.c32 ]; then ldlinux=/usr/$i/$j/ldlinux.c32 - cp $ldlinux $tmp_dir fi done if [ -n "$isolinux" -a -n "$ldlinux" ] ; then break fi - if [ $i = end -a -z "$isolinux" ] ; then - echo 'Need an isolinux.bin file, please install syslinux/isolinux.' - exit 1 - fi done + if [ -z "$isolinux" ] ; then + echo 'Need an isolinux.bin file, please install syslinux/isolinux.' + exit 1 + fi + if [ -z "$ldlinux" ] ; then + echo 'Need an ldlinux.c32 file, please install syslinux/isolinux.' + exit 1 + fi + cp $isolinux $tmp_dir + cp $ldlinux $tmp_dir cp $FBZIMAGE $tmp_dir/linux echo "$KCMDLINE" > $tmp_dir/isolinux.cfg if [ -f "$FDINITRD" ] ; then cp "$FDINITRD" $tmp_dir/initrd.img fi - mkisofs -J -r -input-charset=utf-8 -quiet -o $FIMAGE -b isolinux.bin \ - -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table \ - $tmp_dir + genisoimage -J -r -input-charset=utf-8 -quiet -o $FIMAGE \ + -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 \ + -boot-info-table $tmp_dir isohybrid $FIMAGE 2>/dev/null || true rm -rf $tmp_dir }
@@ -121,6 +125,6 @@ case $1 in bzdisk) genbzdisk;; fdimage144) genfdimage144;; fdimage288) genfdimage288;; - isoimage) genisoimage;; + isoimage) geniso;; *) echo 'Unknown image format'; exit 1; esac
arch/x86/include/asm/switch_to.h +2 -3
@@ -16,8 +16,7 @@ void __switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p, struct tss_struct *tss);/* This runs runs on the previous thread's stack. */ -static inline void prepare_switch_to (struct task_struct *prev, -struct task_struct *next) +static inline void prepare_switch_to (struct task_struct *next) {#ifdef CONFIG_VMAP_STACK /*
@@ -70,7 +69,7 @@ struct fork_frame {#define switch_to (prev, next, last) \ do { \ - prepare_switch_to(prev, next); \ + prepare_switch_to(next); \ \ ((last) = __switch_to_asm((prev), (next))); \ } while (0)
arch/x86/kernel/apic/apic.c +2 -0
@@ -2626,11 +2626,13 @@ static int __init apic_set_verbosity(char *arg) apic_verbosity =APIC_DEBUG ; else if (strcmp("verbose", arg) == 0) apic_verbosity =APIC_VERBOSE ; +#ifdef CONFIG_X86_64 else {pr_warning ("APIC Verbosity level %s not recognised" " use apic=verbose or apic=debug\n" , arg);return -EINVAL ; } +#endif return 0 ; }
arch/x86/kernel/apic/apic_flat_64.c +1 -1
@@ -151,7 +151,7 @@ static struct apic apic_flat __ro_after_init = { .apic_id_valid = default_apic_id_valid, .apic_id_registered = flat_apic_id_registered, - .irq_delivery_mode = dest_LowestPrio, + .irq_delivery_mode = dest_Fixed, .irq_dest_mode = 1, /* logical */ .disable_esr = 0,
arch/x86/kernel/apic/apic_noop.c +1 -1
@@ -110,7 +110,7 @@ struct apic apic_noop __ro_after_init = { .apic_id_valid = default_apic_id_valid, .apic_id_registered = noop_apic_id_registered, - .irq_delivery_mode = dest_LowestPrio, + .irq_delivery_mode = dest_Fixed,/* logical delivery broadcast to all CPUs: */ .irq_dest_mode = 1,
arch/x86/kernel/apic/msi.c +2 -6
@@ -39,17 +39,13 @@ static void irq_msi_compose_msg(struct irq_data *data, struct msi_msg *msg) ((apic->irq_dest_mode ==0 ) ?MSI_ADDR_DEST_MODE_PHYSICAL :MSI_ADDR_DEST_MODE_LOGICAL ) | - ((apic->irq_delivery_mode != dest_LowestPrio) ? -MSI_ADDR_REDIRECTION_CPU : -MSI_ADDR_REDIRECTION_LOWPRI ) | +MSI_ADDR_REDIRECTION_CPU |MSI_ADDR_DEST_ID (cfg->dest_apicid); msg->data =MSI_DATA_TRIGGER_EDGE |MSI_DATA_LEVEL_ASSERT | - ((apic->irq_delivery_mode != dest_LowestPrio) ? -MSI_DATA_DELIVERY_FIXED : -MSI_DATA_DELIVERY_LOWPRI ) | +MSI_DATA_DELIVERY_FIXED |MSI_DATA_VECTOR (cfg->vector); }
arch/x86/kernel/apic/probe_32.c +1 -1
@@ -105,7 +105,7 @@ static struct apic apic_default __ro_after_init = { .apic_id_valid = default_apic_id_valid, .apic_id_registered = default_apic_id_registered, - .irq_delivery_mode = dest_LowestPrio, + .irq_delivery_mode = dest_Fixed,/* logical delivery broadcast to all CPUs: */ .irq_dest_mode = 1,
arch/x86/kernel/apic/x2apic_cluster.c +1 -1
@@ -184,7 +184,7 @@ static struct apic apic_x2apic_cluster __ro_after_init = { .apic_id_valid = x2apic_apic_id_valid, .apic_id_registered = x2apic_apic_id_registered, - .irq_delivery_mode = dest_LowestPrio, + .irq_delivery_mode = dest_Fixed, .irq_dest_mode = 1, /* logical */ .disable_esr = 0,
arch/x86/kernel/machine_kexec_32.c +1 -3
@@ -48,8 +48,6 @@ static void load_segments(void) "\tmovl $"STR(__KERNEL_DS)",%%eax\n" "\tmovl %%eax,%%ds\n" "\tmovl %%eax,%%es\n" -"\tmovl %%eax,%%fs\n" -"\tmovl %%eax,%%gs\n" "\tmovl %%eax,%%ss\n" : : : "eax", "memory");#undef STR
@@ -232,8 +230,8 @@ void machine_kexec(struct kimage *image)* The gdt & idt are now invalid. * If you want to load them you must set up your own idt & gdt. */ -set_gdt (phys_to_virt (0 ),0 );idt_invalidate (phys_to_virt (0 )); +set_gdt (phys_to_virt (0 ),0 );/* now call it */ image->start = relocate_kernel_ptr((unsigned long)image->head,
arch/x86/kernel/stacktrace.c +5 -1
@@ -164,8 +164,12 @@ int save_stack_trace_tsk_reliable(struct task_struct *tsk, {int ret; +/* +* If the task doesn't have a stack (e.g., a zombie), the stack is +* "reliably" empty. +*/ if (!try_get_task_stack (tsk)) -return -EINVAL ; +return 0 ; ret =__save_stack_trace_reliable (trace, tsk);
arch/x86/kernel/traps.c +1 -1
@@ -355,7 +355,7 @@ dotraplinkage void do_double_fault(struct pt_regs *regs, long error_code)* * No need for ist_enter here because we don't use RCU. */ -if (((long )regs->sp >>PGDIR_SHIFT ) ==ESPFIX_PGD_ENTRY && +if (((long )regs->sp >>P4D_SHIFT ) ==ESPFIX_PGD_ENTRY && regs->cs == __KERNEL_CS && regs->ip == (unsigned long )native_irq_return_iret) {
arch/x86/mm/mem_encrypt.c +2 -2
@@ -405,13 +405,13 @@ bool sme_active(void) {return sme_me_mask && !sev_enabled; } -EXPORT_SYMBOL_GPL (sme_active); +EXPORT_SYMBOL (sme_active);bool sev_active (void ) {return sme_me_mask && sev_enabled; } -EXPORT_SYMBOL_GPL (sev_active); +EXPORT_SYMBOL (sev_active);static const struct dma_map_ops sev_dma_ops = { .alloc = sev_alloc,
drivers/pci/host/pci-hyperv.c +2 -6
@@ -985,9 +985,7 @@ static u32 hv_compose_msi_req_v1( int_pkt->wslot.slot = slot; int_pkt->int_desc.vector = vector; int_pkt->int_desc.vector_count =1 ; - int_pkt->int_desc.delivery_mode = - (apic->irq_delivery_mode == dest_LowestPrio) ? - dest_LowestPrio : dest_Fixed; + int_pkt->int_desc.delivery_mode = dest_Fixed;/* * Create MSI w/ dummy vCPU set, overwritten by subsequent retarget in
@@ -1008,9 +1006,7 @@ static u32 hv_compose_msi_req_v2( int_pkt->wslot.slot = slot; int_pkt->int_desc.vector = vector; int_pkt->int_desc.vector_count =1 ; - int_pkt->int_desc.delivery_mode = - (apic->irq_delivery_mode == dest_LowestPrio) ? - dest_LowestPrio : dest_Fixed; + int_pkt->int_desc.delivery_mode = dest_Fixed;/* * Create MSI w/ dummy vCPU set targeting just one vCPU, overwritten
Quoted 2 lines · Thomas Gleixner
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.gitx86-urgent-for-linus
This doesn't contain what you claim it does, it's old x86 fixes from two weeks ago.
Forgot to push out?
Linus
Quoted 8 lines · Linus Torvalds
Quoted 2 lines · Thomas Gleixner
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.gitx86-urgent-for-linusThis doesn't contain what you claim it does, it's old x86 fixes from two weeks ago.
Forgot to push out?
Looks like the patches you wanted me to pull are all in the x86/urgent branch.
Will pull that instead.
Linus
Quoted 6 lines · Linus Torvalds
Quoted 4 lines · Linus Torvalds
Quoted 2 lines · Thomas Gleixner
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.gitx86-urgent-for-linus
Quoted 8 lines
Quoted 4 lines
This doesn't contain what you claim it does, it's old x86 fixes from two weeks ago.
Forgot to push out?
Looks like the patches you wanted me to pull are all in the x86/urgent branch.
Will pull that instead.
Sorry for burdening you with extra detective work
tglx
Quoted 8 lines · Linus Torvalds
Quoted 2 lines · Thomas Gleixner
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.gitx86-urgent-for-linusThis doesn't contain what you claim it does, it's old x86 fixes from two weeks ago.
Forgot to push out?
Indeed. I'm sure I double checked ...
/me blames kaiser and the subtle signs of alzheimer
Pushed now.
Thanks,
tglx