Skip to content

Commit f39d7d7

Browse files
committed
Merge branch 'x86/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fixes from Thomas Gleixner: "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" * 'x86/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/apic: Switch all APICs to Fixed delivery mode x86/apic: Update the 'apic=' description of setting APIC driver x86/apic: Avoid wrong warning when parsing 'apic=' in X86-32 case x86-32: Fix kexec with stack canary (CONFIG_CC_STACKPROTECTOR) x86: Remove unused parameter of prepare_switch_to x86/stacktrace: Make zombie stack traces reliable x86/mm: Unbreak modules that use the DMA API x86/build: Make isoimage work on Debian x86/espfix/64: Fix espfix double-fault handling on 5-level systems
2 parents 52c90f2 + a31e58e commit f39d7d7

File tree

14 files changed

+42
-39
lines changed

14 files changed

+42
-39
lines changed

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,11 +328,15 @@
328328
not play well with APC CPU idle - disable it if you have
329329
APC and your system crashes randomly.
330330

331-
apic= [APIC,X86-32] Advanced Programmable Interrupt Controller
331+
apic= [APIC,X86] Advanced Programmable Interrupt Controller
332332
Change the output verbosity whilst booting
333333
Format: { quiet (default) | verbose | debug }
334334
Change the amount of debugging information output
335335
when initialising the APIC and IO-APIC components.
336+
For X86-32, this can also be used to specify an APIC
337+
driver name.
338+
Format: apic=driver_name
339+
Examples: apic=bigsmp
336340

337341
apic_extnmi= [APIC,X86] External NMI delivery setting
338342
Format: { bsp (default) | all | none }

arch/x86/boot/genimage.sh

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -80,39 +80,43 @@ genfdimage288() {
8080
mcopy $FBZIMAGE w:linux
8181
}
8282

83-
genisoimage() {
83+
geniso() {
8484
tmp_dir=`dirname $FIMAGE`/isoimage
8585
rm -rf $tmp_dir
8686
mkdir $tmp_dir
87-
for i in lib lib64 share end ; do
87+
for i in lib lib64 share ; do
8888
for j in syslinux ISOLINUX ; do
8989
if [ -f /usr/$i/$j/isolinux.bin ] ; then
9090
isolinux=/usr/$i/$j/isolinux.bin
91-
cp $isolinux $tmp_dir
9291
fi
9392
done
9493
for j in syslinux syslinux/modules/bios ; do
9594
if [ -f /usr/$i/$j/ldlinux.c32 ]; then
9695
ldlinux=/usr/$i/$j/ldlinux.c32
97-
cp $ldlinux $tmp_dir
9896
fi
9997
done
10098
if [ -n "$isolinux" -a -n "$ldlinux" ] ; then
10199
break
102100
fi
103-
if [ $i = end -a -z "$isolinux" ] ; then
104-
echo 'Need an isolinux.bin file, please install syslinux/isolinux.'
105-
exit 1
106-
fi
107101
done
102+
if [ -z "$isolinux" ] ; then
103+
echo 'Need an isolinux.bin file, please install syslinux/isolinux.'
104+
exit 1
105+
fi
106+
if [ -z "$ldlinux" ] ; then
107+
echo 'Need an ldlinux.c32 file, please install syslinux/isolinux.'
108+
exit 1
109+
fi
110+
cp $isolinux $tmp_dir
111+
cp $ldlinux $tmp_dir
108112
cp $FBZIMAGE $tmp_dir/linux
109113
echo "$KCMDLINE" > $tmp_dir/isolinux.cfg
110114
if [ -f "$FDINITRD" ] ; then
111115
cp "$FDINITRD" $tmp_dir/initrd.img
112116
fi
113-
mkisofs -J -r -input-charset=utf-8 -quiet -o $FIMAGE -b isolinux.bin \
114-
-c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table \
115-
$tmp_dir
117+
genisoimage -J -r -input-charset=utf-8 -quiet -o $FIMAGE \
118+
-b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 \
119+
-boot-info-table $tmp_dir
116120
isohybrid $FIMAGE 2>/dev/null || true
117121
rm -rf $tmp_dir
118122
}
@@ -121,6 +125,6 @@ case $1 in
121125
bzdisk) genbzdisk;;
122126
fdimage144) genfdimage144;;
123127
fdimage288) genfdimage288;;
124-
isoimage) genisoimage;;
128+
isoimage) geniso;;
125129
*) echo 'Unknown image format'; exit 1;
126130
esac

arch/x86/include/asm/switch_to.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ void __switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p,
1616
struct tss_struct *tss);
1717

1818
/* This runs runs on the previous thread's stack. */
19-
static inline void prepare_switch_to(struct task_struct *prev,
20-
struct task_struct *next)
19+
static inline void prepare_switch_to(struct task_struct *next)
2120
{
2221
#ifdef CONFIG_VMAP_STACK
2322
/*
@@ -70,7 +69,7 @@ struct fork_frame {
7069

7170
#define switch_to(prev, next, last) \
7271
do { \
73-
prepare_switch_to(prev, next); \
72+
prepare_switch_to(next); \
7473
\
7574
((last) = __switch_to_asm((prev), (next))); \
7675
} while (0)

arch/x86/kernel/apic/apic.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2626,11 +2626,13 @@ static int __init apic_set_verbosity(char *arg)
26262626
apic_verbosity = APIC_DEBUG;
26272627
else if (strcmp("verbose", arg) == 0)
26282628
apic_verbosity = APIC_VERBOSE;
2629+
#ifdef CONFIG_X86_64
26292630
else {
26302631
pr_warning("APIC Verbosity level %s not recognised"
26312632
" use apic=verbose or apic=debug\n", arg);
26322633
return -EINVAL;
26332634
}
2635+
#endif
26342636

26352637
return 0;
26362638
}

arch/x86/kernel/apic/apic_flat_64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ static struct apic apic_flat __ro_after_init = {
151151
.apic_id_valid = default_apic_id_valid,
152152
.apic_id_registered = flat_apic_id_registered,
153153

154-
.irq_delivery_mode = dest_LowestPrio,
154+
.irq_delivery_mode = dest_Fixed,
155155
.irq_dest_mode = 1, /* logical */
156156

157157
.disable_esr = 0,

arch/x86/kernel/apic/apic_noop.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ struct apic apic_noop __ro_after_init = {
110110
.apic_id_valid = default_apic_id_valid,
111111
.apic_id_registered = noop_apic_id_registered,
112112

113-
.irq_delivery_mode = dest_LowestPrio,
113+
.irq_delivery_mode = dest_Fixed,
114114
/* logical delivery broadcast to all CPUs: */
115115
.irq_dest_mode = 1,
116116

arch/x86/kernel/apic/msi.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,13 @@ static void irq_msi_compose_msg(struct irq_data *data, struct msi_msg *msg)
3939
((apic->irq_dest_mode == 0) ?
4040
MSI_ADDR_DEST_MODE_PHYSICAL :
4141
MSI_ADDR_DEST_MODE_LOGICAL) |
42-
((apic->irq_delivery_mode != dest_LowestPrio) ?
43-
MSI_ADDR_REDIRECTION_CPU :
44-
MSI_ADDR_REDIRECTION_LOWPRI) |
42+
MSI_ADDR_REDIRECTION_CPU |
4543
MSI_ADDR_DEST_ID(cfg->dest_apicid);
4644

4745
msg->data =
4846
MSI_DATA_TRIGGER_EDGE |
4947
MSI_DATA_LEVEL_ASSERT |
50-
((apic->irq_delivery_mode != dest_LowestPrio) ?
51-
MSI_DATA_DELIVERY_FIXED :
52-
MSI_DATA_DELIVERY_LOWPRI) |
48+
MSI_DATA_DELIVERY_FIXED |
5349
MSI_DATA_VECTOR(cfg->vector);
5450
}
5551

arch/x86/kernel/apic/probe_32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ static struct apic apic_default __ro_after_init = {
105105
.apic_id_valid = default_apic_id_valid,
106106
.apic_id_registered = default_apic_id_registered,
107107

108-
.irq_delivery_mode = dest_LowestPrio,
108+
.irq_delivery_mode = dest_Fixed,
109109
/* logical delivery broadcast to all CPUs: */
110110
.irq_dest_mode = 1,
111111

arch/x86/kernel/apic/x2apic_cluster.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ static struct apic apic_x2apic_cluster __ro_after_init = {
184184
.apic_id_valid = x2apic_apic_id_valid,
185185
.apic_id_registered = x2apic_apic_id_registered,
186186

187-
.irq_delivery_mode = dest_LowestPrio,
187+
.irq_delivery_mode = dest_Fixed,
188188
.irq_dest_mode = 1, /* logical */
189189

190190
.disable_esr = 0,

arch/x86/kernel/machine_kexec_32.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ static void load_segments(void)
4848
"\tmovl $"STR(__KERNEL_DS)",%%eax\n"
4949
"\tmovl %%eax,%%ds\n"
5050
"\tmovl %%eax,%%es\n"
51-
"\tmovl %%eax,%%fs\n"
52-
"\tmovl %%eax,%%gs\n"
5351
"\tmovl %%eax,%%ss\n"
5452
: : : "eax", "memory");
5553
#undef STR
@@ -232,8 +230,8 @@ void machine_kexec(struct kimage *image)
232230
* The gdt & idt are now invalid.
233231
* If you want to load them you must set up your own idt & gdt.
234232
*/
235-
set_gdt(phys_to_virt(0), 0);
236233
idt_invalidate(phys_to_virt(0));
234+
set_gdt(phys_to_virt(0), 0);
237235

238236
/* now call it */
239237
image->start = relocate_kernel_ptr((unsigned long)image->head,

arch/x86/kernel/stacktrace.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,12 @@ int save_stack_trace_tsk_reliable(struct task_struct *tsk,
164164
{
165165
int ret;
166166

167+
/*
168+
* If the task doesn't have a stack (e.g., a zombie), the stack is
169+
* "reliably" empty.
170+
*/
167171
if (!try_get_task_stack(tsk))
168-
return -EINVAL;
172+
return 0;
169173

170174
ret = __save_stack_trace_reliable(trace, tsk);
171175

arch/x86/kernel/traps.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ dotraplinkage void do_double_fault(struct pt_regs *regs, long error_code)
361361
*
362362
* No need for ist_enter here because we don't use RCU.
363363
*/
364-
if (((long)regs->sp >> PGDIR_SHIFT) == ESPFIX_PGD_ENTRY &&
364+
if (((long)regs->sp >> P4D_SHIFT) == ESPFIX_PGD_ENTRY &&
365365
regs->cs == __KERNEL_CS &&
366366
regs->ip == (unsigned long)native_irq_return_iret)
367367
{

arch/x86/mm/mem_encrypt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,13 +405,13 @@ bool sme_active(void)
405405
{
406406
return sme_me_mask && !sev_enabled;
407407
}
408-
EXPORT_SYMBOL_GPL(sme_active);
408+
EXPORT_SYMBOL(sme_active);
409409

410410
bool sev_active(void)
411411
{
412412
return sme_me_mask && sev_enabled;
413413
}
414-
EXPORT_SYMBOL_GPL(sev_active);
414+
EXPORT_SYMBOL(sev_active);
415415

416416
static const struct dma_map_ops sev_dma_ops = {
417417
.alloc = sev_alloc,

drivers/pci/host/pci-hyperv.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -985,9 +985,7 @@ static u32 hv_compose_msi_req_v1(
985985
int_pkt->wslot.slot = slot;
986986
int_pkt->int_desc.vector = vector;
987987
int_pkt->int_desc.vector_count = 1;
988-
int_pkt->int_desc.delivery_mode =
989-
(apic->irq_delivery_mode == dest_LowestPrio) ?
990-
dest_LowestPrio : dest_Fixed;
988+
int_pkt->int_desc.delivery_mode = dest_Fixed;
991989

992990
/*
993991
* Create MSI w/ dummy vCPU set, overwritten by subsequent retarget in
@@ -1008,9 +1006,7 @@ static u32 hv_compose_msi_req_v2(
10081006
int_pkt->wslot.slot = slot;
10091007
int_pkt->int_desc.vector = vector;
10101008
int_pkt->int_desc.vector_count = 1;
1011-
int_pkt->int_desc.delivery_mode =
1012-
(apic->irq_delivery_mode == dest_LowestPrio) ?
1013-
dest_LowestPrio : dest_Fixed;
1009+
int_pkt->int_desc.delivery_mode = dest_Fixed;
10141010

10151011
/*
10161012
* Create MSI w/ dummy vCPU set targeting just one vCPU, overwritten

0 commit comments

Comments
 (0)