Skip to content

Commit 19e0d5f

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 Ingo Molnar: "Fixes from all around the place: - hyper-V 32-bit PAE guest kernel fix - two IRQ allocation fixes on certain x86 boards - intel-mid boot crash fix - intel-quark quirk - /proc/interrupts duplicate irq chip name fix - cma boot crash fix - syscall audit fix - boot crash fix with certain TSC configurations (seen on Qemu) - smpboot.c build warning fix" * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86, pageattr: Prevent overflow in slow_virt_to_phys() for X86_PAE ACPI, irq, x86: Return IRQ instead of GSI in mp_register_gsi() x86, intel-mid: Create IRQs for APB timers and RTC timers x86: Don't enable F00F workaround on Intel Quark processors x86/irq: Fix XT-PIC-XT-PIC in /proc/interrupts x86, cma: Reserve DMA contiguous area after initmem_init() i386/audit: stop scribbling on the stack frame x86, apic: Handle a bad TSC more gracefully x86: ACPI: Do not translate GSI number if IOAPIC is disabled x86/smpboot: Move data structure to its primary usage scope
2 parents f5fa363 + d1cd121 commit 19e0d5f

12 files changed

Lines changed: 34 additions & 29 deletions

File tree

‎arch/x86/kernel/acpi/boot.c‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ static int mp_register_gsi(struct device *dev, u32 gsi, int trigger,
397397

398398
/* Don't set up the ACPI SCI because it's already set up */
399399
if (acpi_gbl_FADT.sci_interrupt == gsi)
400-
return gsi;
400+
return mp_map_gsi_to_irq(gsi, IOAPIC_MAP_ALLOC);
401401

402402
trigger = trigger == ACPI_EDGE_SENSITIVE ? 0 : 1;
403403
polarity = polarity == ACPI_ACTIVE_HIGH ? 0 : 1;
@@ -604,14 +604,18 @@ void __init acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger)
604604

605605
int acpi_gsi_to_irq(u32 gsi, unsigned int *irqp)
606606
{
607-
int irq = mp_map_gsi_to_irq(gsi, IOAPIC_MAP_ALLOC | IOAPIC_MAP_CHECK);
607+
int irq;
608608

609-
if (irq >= 0) {
609+
if (acpi_irq_model == ACPI_IRQ_MODEL_PIC) {
610+
*irqp = gsi;
611+
} else {
612+
irq = mp_map_gsi_to_irq(gsi,
613+
IOAPIC_MAP_ALLOC | IOAPIC_MAP_CHECK);
614+
if (irq < 0)
615+
return -1;
610616
*irqp = irq;
611-
return 0;
612617
}
613-
614-
return -1;
618+
return 0;
615619
}
616620
EXPORT_SYMBOL_GPL(acpi_gsi_to_irq);
617621

‎arch/x86/kernel/apb_timer.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,6 @@ static void apbt_setup_irq(struct apbt_dev *adev)
185185

186186
irq_modify_status(adev->irq, 0, IRQ_MOVE_PCNTXT);
187187
irq_set_affinity(adev->irq, cpumask_of(adev->cpu));
188-
/* APB timer irqs are set up as mp_irqs, timer is edge type */
189-
__irq_set_handler(adev->irq, handle_edge_irq, 0, "edge");
190188
}
191189

192190
/* Should be called with per cpu */

‎arch/x86/kernel/apic/apic.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1297,7 +1297,7 @@ void setup_local_APIC(void)
12971297
unsigned int value, queued;
12981298
int i, j, acked = 0;
12991299
unsigned long long tsc = 0, ntsc;
1300-
long long max_loops = cpu_khz;
1300+
long long max_loops = cpu_khz ? cpu_khz : 1000000;
13011301

13021302
if (cpu_has_tsc)
13031303
rdtscll(tsc);
@@ -1383,7 +1383,7 @@ void setup_local_APIC(void)
13831383
break;
13841384
}
13851385
if (queued) {
1386-
if (cpu_has_tsc) {
1386+
if (cpu_has_tsc && cpu_khz) {
13871387
rdtscll(ntsc);
13881388
max_loops = (cpu_khz << 10) - (ntsc - tsc);
13891389
} else

‎arch/x86/kernel/cpu/intel.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,12 +213,13 @@ static void intel_workarounds(struct cpuinfo_x86 *c)
213213
{
214214
#ifdef CONFIG_X86_F00F_BUG
215215
/*
216-
* All current models of Pentium and Pentium with MMX technology CPUs
216+
* All models of Pentium and Pentium with MMX technology CPUs
217217
* have the F0 0F bug, which lets nonprivileged users lock up the
218218
* system. Announce that the fault handler will be checking for it.
219+
* The Quark is also family 5, but does not have the same bug.
219220
*/
220221
clear_cpu_bug(c, X86_BUG_F00F);
221-
if (!paravirt_enabled() && c->x86 == 5) {
222+
if (!paravirt_enabled() && c->x86 == 5 && c->x86_model < 9) {
222223
static int f00f_workaround_enabled;
223224

224225
set_cpu_bug(c, X86_BUG_F00F);

‎arch/x86/kernel/entry_32.S‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -447,15 +447,14 @@ sysenter_exit:
447447
sysenter_audit:
448448
testl $(_TIF_WORK_SYSCALL_ENTRY & ~_TIF_SYSCALL_AUDIT),TI_flags(%ebp)
449449
jnz syscall_trace_entry
450-
addl $4,%esp
451-
CFI_ADJUST_CFA_OFFSET -4
452-
movl %esi,4(%esp) /* 5th arg: 4th syscall arg */
453-
movl %edx,(%esp) /* 4th arg: 3rd syscall arg */
454-
/* %ecx already in %ecx 3rd arg: 2nd syscall arg */
455-
movl %ebx,%edx /* 2nd arg: 1st syscall arg */
456-
/* %eax already in %eax 1st arg: syscall number */
450+
/* movl PT_EAX(%esp), %eax already set, syscall number: 1st arg to audit */
451+
movl PT_EBX(%esp), %edx /* ebx/a0: 2nd arg to audit */
452+
/* movl PT_ECX(%esp), %ecx already set, a1: 3nd arg to audit */
453+
pushl_cfi PT_ESI(%esp) /* a3: 5th arg */
454+
pushl_cfi PT_EDX+4(%esp) /* a2: 4th arg */
457455
call __audit_syscall_entry
458-
pushl_cfi %ebx
456+
popl_cfi %ecx /* get that remapped edx off the stack */
457+
popl_cfi %ecx /* get that remapped esi off the stack */
459458
movl PT_EAX(%esp),%eax /* reload syscall number */
460459
jmp sysenter_do_call
461460

‎arch/x86/kernel/i8259.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,7 @@ static void make_8259A_irq(unsigned int irq)
111111
{
112112
disable_irq_nosync(irq);
113113
io_apic_irqs &= ~(1<<irq);
114-
irq_set_chip_and_handler_name(irq, &i8259A_chip, handle_level_irq,
115-
i8259A_chip.name);
114+
irq_set_chip_and_handler(irq, &i8259A_chip, handle_level_irq);
116115
enable_irq(irq);
117116
}
118117

‎arch/x86/kernel/irqinit.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ int vector_used_by_percpu_irq(unsigned int vector)
7070
void __init init_ISA_irqs(void)
7171
{
7272
struct irq_chip *chip = legacy_pic->chip;
73-
const char *name = chip->name;
7473
int i;
7574

7675
#if defined(CONFIG_X86_64) || defined(CONFIG_X86_LOCAL_APIC)
@@ -79,7 +78,7 @@ void __init init_ISA_irqs(void)
7978
legacy_pic->init(0);
8079

8180
for (i = 0; i < nr_legacy_irqs(); i++)
82-
irq_set_chip_and_handler_name(i, chip, handle_level_irq, name);
81+
irq_set_chip_and_handler(i, chip, handle_level_irq);
8382
}
8483

8584
void __init init_IRQ(void)

‎arch/x86/kernel/setup.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1128,7 +1128,6 @@ void __init setup_arch(char **cmdline_p)
11281128
setup_real_mode();
11291129

11301130
memblock_set_current_limit(get_max_mapped());
1131-
dma_contiguous_reserve(max_pfn_mapped << PAGE_SHIFT);
11321131

11331132
/*
11341133
* NOTE: On x86-32, only from this point on, fixmaps are ready for use.
@@ -1159,6 +1158,7 @@ void __init setup_arch(char **cmdline_p)
11591158
early_acpi_boot_init();
11601159

11611160
initmem_init();
1161+
dma_contiguous_reserve(max_pfn_mapped << PAGE_SHIFT);
11621162

11631163
/*
11641164
* Reserve memory for crash kernel after SRAT is parsed so that it

‎arch/x86/kernel/smpboot.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,6 @@ DEFINE_PER_CPU_READ_MOSTLY(cpumask_var_t, cpu_llc_shared_map);
102102
DEFINE_PER_CPU_SHARED_ALIGNED(struct cpuinfo_x86, cpu_info);
103103
EXPORT_PER_CPU_SYMBOL(cpu_info);
104104

105-
static DEFINE_PER_CPU(struct completion, die_complete);
106-
107105
atomic_t init_deasserted;
108106

109107
/*
@@ -1318,6 +1316,8 @@ void cpu_disable_common(void)
13181316
fixup_irqs();
13191317
}
13201318

1319+
static DEFINE_PER_CPU(struct completion, die_complete);
1320+
13211321
int native_cpu_disable(void)
13221322
{
13231323
int ret;

‎arch/x86/kernel/tsc.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1166,14 +1166,17 @@ void __init tsc_init(void)
11661166

11671167
x86_init.timers.tsc_pre_init();
11681168

1169-
if (!cpu_has_tsc)
1169+
if (!cpu_has_tsc) {
1170+
setup_clear_cpu_cap(X86_FEATURE_TSC_DEADLINE_TIMER);
11701171
return;
1172+
}
11711173

11721174
tsc_khz = x86_platform.calibrate_tsc();
11731175
cpu_khz = tsc_khz;
11741176

11751177
if (!tsc_khz) {
11761178
mark_tsc_unstable("could not calculate TSC khz");
1179+
setup_clear_cpu_cap(X86_FEATURE_TSC_DEADLINE_TIMER);
11771180
return;
11781181
}
11791182

0 commit comments

Comments
 (0)