Skip to content

Commit 45e713e

Browse files
committed
Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: intr_remapping: Fix section mismatch in ir_dev_scope_init() intel-iommu: Fix section mismatch in dmar_parse_rmrr_atsr_dev() x86, amd: Fix up numa_node information for AMD CPU family 15h model 0-0fh northbridge functions x86, AMD: Correct align_va_addr documentation x86/rtc, mrst: Don't register a platform RTC device for for Intel MID platforms x86/mrst: Battery fixes x86/paravirt: PTE updates in k(un)map_atomic need to be synchronous, regardless of lazy_mmu mode x86: Fix "Acer Aspire 1" reboot hang x86/mtrr: Resolve inconsistency with Intel processor manual x86: Document rdmsr_safe restrictions x86, microcode: Fix the failure path of microcode update driver init code Add TAINT_FIRMWARE_WORKAROUND on MTRR fixup x86/mpparse: Account for bus types other than ISA and PCI x86, mrst: Change the pmic_gpio device type to IPC mrst: Added some platform data for the SFI translations x86,mrst: Power control commands update x86/reboot: Blacklist Dell OptiPlex 990 known to require PCI reboot x86, UV: Fix UV2 hub part number x86: Add user_mode_vm check in stack_overflow_check
2 parents 232ea34 + 61ed26e commit 45e713e

File tree

19 files changed

+164
-39
lines changed

19 files changed

+164
-39
lines changed

Documentation/kernel-parameters.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
315315
CPU-intensive style benchmark, and it can vary highly in
316316
a microbenchmark depending on workload and compiler.
317317

318-
1: only for 32-bit processes
319-
2: only for 64-bit processes
318+
32: only for 32-bit processes
319+
64: only for 64-bit processes
320320
on: enable for both 32- and 64-bit processes
321321
off: disable for both 32- and 64-bit processes
322322

arch/x86/include/asm/intel_scu_ipc.h

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@
33

44
#include <linux/notifier.h>
55

6-
#define IPCMSG_VRTC 0xFA /* Set vRTC device */
7-
8-
/* Command id associated with message IPCMSG_VRTC */
9-
#define IPC_CMD_VRTC_SETTIME 1 /* Set time */
10-
#define IPC_CMD_VRTC_SETALARM 2 /* Set alarm */
6+
#define IPCMSG_WARM_RESET 0xF0
7+
#define IPCMSG_COLD_RESET 0xF1
8+
#define IPCMSG_SOFT_RESET 0xF2
9+
#define IPCMSG_COLD_BOOT 0xF3
10+
11+
#define IPCMSG_VRTC 0xFA /* Set vRTC device */
12+
/* Command id associated with message IPCMSG_VRTC */
13+
#define IPC_CMD_VRTC_SETTIME 1 /* Set time */
14+
#define IPC_CMD_VRTC_SETALARM 2 /* Set alarm */
1115

1216
/* Read single register */
1317
int intel_scu_ipc_ioread8(u16 addr, u8 *data);

arch/x86/include/asm/mrst.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,20 @@ enum mrst_cpu_type {
3131
};
3232

3333
extern enum mrst_cpu_type __mrst_cpu_chip;
34+
35+
#ifdef CONFIG_X86_INTEL_MID
36+
3437
static inline enum mrst_cpu_type mrst_identify_cpu(void)
3538
{
3639
return __mrst_cpu_chip;
3740
}
3841

42+
#else /* !CONFIG_X86_INTEL_MID */
43+
44+
#define mrst_identify_cpu() (0)
45+
46+
#endif /* !CONFIG_X86_INTEL_MID */
47+
3948
enum mrst_timer_options {
4049
MRST_TIMER_DEFAULT,
4150
MRST_TIMER_APBT_ONLY,

arch/x86/include/asm/msr.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,14 @@ static inline int wrmsr_safe(unsigned msr, unsigned low, unsigned high)
169169
return native_write_msr_safe(msr, low, high);
170170
}
171171

172-
/* rdmsr with exception handling */
172+
/*
173+
* rdmsr with exception handling.
174+
*
175+
* Please note that the exception handling works only after we've
176+
* switched to the "smart" #GP handler in trap_init() which knows about
177+
* exception tables - using this macro earlier than that causes machine
178+
* hangs on boxes which do not implement the @msr in the first argument.
179+
*/
173180
#define rdmsr_safe(msr, p1, p2) \
174181
({ \
175182
int __err; \

arch/x86/include/asm/uv/uv_mmrs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757

5858
#define UV1_HUB_PART_NUMBER 0x88a5
5959
#define UV2_HUB_PART_NUMBER 0x8eb8
60+
#define UV2_HUB_PART_NUMBER_X 0x1111
6061

6162
/* Compat: if this #define is present, UV headers support UV2 */
6263
#define UV2_HUB_IS_SUPPORTED 1

arch/x86/kernel/apic/x2apic_uv_x.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ static int __init early_get_pnodeid(void)
9393

9494
if (node_id.s.part_number == UV2_HUB_PART_NUMBER)
9595
uv_min_hub_revision_id += UV2_HUB_REVISION_BASE - 1;
96+
if (node_id.s.part_number == UV2_HUB_PART_NUMBER_X)
97+
uv_min_hub_revision_id += UV2_HUB_REVISION_BASE - 1;
9698

9799
uv_hub_info->hub_revision = uv_min_hub_revision_id;
98100
pnode = (node_id.s.node_id >> 1) & ((1 << m_n_config.s.n_skt) - 1);

arch/x86/kernel/cpu/mtrr/generic.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,7 @@ static void generic_get_mtrr(unsigned int reg, unsigned long *base,
547547

548548
if (tmp != mask_lo) {
549549
printk(KERN_WARNING "mtrr: your BIOS has configured an incorrect mask, fixing it.\n");
550+
add_taint(TAINT_FIRMWARE_WORKAROUND);
550551
mask_lo = tmp;
551552
}
552553
}
@@ -693,6 +694,7 @@ static void prepare_set(void) __acquires(set_atomicity_lock)
693694

694695
/* Disable MTRRs, and set the default type to uncached */
695696
mtrr_wrmsr(MSR_MTRRdefType, deftype_lo & ~0xcff, deftype_hi);
697+
wbinvd();
696698
}
697699

698700
static void post_set(void) __releases(set_atomicity_lock)

arch/x86/kernel/irq_64.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ static inline void stack_overflow_check(struct pt_regs *regs)
3838
#ifdef CONFIG_DEBUG_STACKOVERFLOW
3939
u64 curbase = (u64)task_stack_page(current);
4040

41+
if (user_mode_vm(regs))
42+
return;
43+
4144
WARN_ONCE(regs->sp >= curbase &&
4245
regs->sp <= curbase + THREAD_SIZE &&
4346
regs->sp < curbase + sizeof(struct thread_info) +

arch/x86/kernel/microcode_core.c

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ static int __init microcode_dev_init(void)
256256
return 0;
257257
}
258258

259-
static void microcode_dev_exit(void)
259+
static void __exit microcode_dev_exit(void)
260260
{
261261
misc_deregister(&microcode_dev);
262262
}
@@ -519,10 +519,8 @@ static int __init microcode_init(void)
519519

520520
microcode_pdev = platform_device_register_simple("microcode", -1,
521521
NULL, 0);
522-
if (IS_ERR(microcode_pdev)) {
523-
microcode_dev_exit();
522+
if (IS_ERR(microcode_pdev))
524523
return PTR_ERR(microcode_pdev);
525-
}
526524

527525
get_online_cpus();
528526
mutex_lock(&microcode_mutex);
@@ -532,14 +530,12 @@ static int __init microcode_init(void)
532530
mutex_unlock(&microcode_mutex);
533531
put_online_cpus();
534532

535-
if (error) {
536-
platform_device_unregister(microcode_pdev);
537-
return error;
538-
}
533+
if (error)
534+
goto out_pdev;
539535

540536
error = microcode_dev_init();
541537
if (error)
542-
return error;
538+
goto out_sysdev_driver;
543539

544540
register_syscore_ops(&mc_syscore_ops);
545541
register_hotcpu_notifier(&mc_cpu_notifier);
@@ -548,6 +544,20 @@ static int __init microcode_init(void)
548544
" <[email protected]>, Peter Oruba\n");
549545

550546
return 0;
547+
548+
out_sysdev_driver:
549+
get_online_cpus();
550+
mutex_lock(&microcode_mutex);
551+
552+
sysdev_driver_unregister(&cpu_sysdev_class, &mc_sysdev_driver);
553+
554+
mutex_unlock(&microcode_mutex);
555+
put_online_cpus();
556+
557+
out_pdev:
558+
platform_device_unregister(microcode_pdev);
559+
return error;
560+
551561
}
552562
module_init(microcode_init);
553563

arch/x86/kernel/mpparse.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ static void __init MP_bus_info(struct mpc_bus *m)
9595
}
9696
#endif
9797

98+
set_bit(m->busid, mp_bus_not_pci);
9899
if (strncmp(str, BUSTYPE_ISA, sizeof(BUSTYPE_ISA) - 1) == 0) {
99-
set_bit(m->busid, mp_bus_not_pci);
100100
#if defined(CONFIG_EISA) || defined(CONFIG_MCA)
101101
mp_bus_id_to_type[m->busid] = MP_BUS_ISA;
102102
#endif

arch/x86/kernel/quirks.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,4 +553,17 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_10H_NB_MISC,
553553
quirk_amd_nb_node);
554554
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_10H_NB_LINK,
555555
quirk_amd_nb_node);
556+
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_15H_NB_F0,
557+
quirk_amd_nb_node);
558+
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_15H_NB_F1,
559+
quirk_amd_nb_node);
560+
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_15H_NB_F2,
561+
quirk_amd_nb_node);
562+
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_15H_NB_F3,
563+
quirk_amd_nb_node);
564+
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_15H_NB_F4,
565+
quirk_amd_nb_node);
566+
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_15H_NB_F5,
567+
quirk_amd_nb_node);
568+
556569
#endif

arch/x86/kernel/reboot.c

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ __setup("reboot=", reboot_setup);
124124
*/
125125

126126
/*
127-
* Some machines require the "reboot=b" commandline option,
127+
* Some machines require the "reboot=b" or "reboot=k" commandline options,
128128
* this quirk makes that automatic.
129129
*/
130130
static int __init set_bios_reboot(const struct dmi_system_id *d)
@@ -136,6 +136,15 @@ static int __init set_bios_reboot(const struct dmi_system_id *d)
136136
return 0;
137137
}
138138

139+
static int __init set_kbd_reboot(const struct dmi_system_id *d)
140+
{
141+
if (reboot_type != BOOT_KBD) {
142+
reboot_type = BOOT_KBD;
143+
printk(KERN_INFO "%s series board detected. Selecting KBD-method for reboot.\n", d->ident);
144+
}
145+
return 0;
146+
}
147+
139148
static struct dmi_system_id __initdata reboot_dmi_table[] = {
140149
{ /* Handle problems with rebooting on Dell E520's */
141150
.callback = set_bios_reboot,
@@ -295,7 +304,7 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = {
295304
},
296305
},
297306
{ /* Handle reboot issue on Acer Aspire one */
298-
.callback = set_bios_reboot,
307+
.callback = set_kbd_reboot,
299308
.ident = "Acer Aspire One A110",
300309
.matches = {
301310
DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
@@ -443,6 +452,14 @@ static struct dmi_system_id __initdata pci_reboot_dmi_table[] = {
443452
DMI_MATCH(DMI_PRODUCT_NAME, "Latitude E6420"),
444453
},
445454
},
455+
{ /* Handle problems with rebooting on the OptiPlex 990. */
456+
.callback = set_pci_reboot,
457+
.ident = "Dell OptiPlex 990",
458+
.matches = {
459+
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
460+
DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 990"),
461+
},
462+
},
446463
{ }
447464
};
448465

arch/x86/kernel/rtc.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <asm/vsyscall.h>
1313
#include <asm/x86_init.h>
1414
#include <asm/time.h>
15+
#include <asm/mrst.h>
1516

1617
#ifdef CONFIG_X86_32
1718
/*
@@ -242,6 +243,10 @@ static __init int add_rtc_cmos(void)
242243
if (of_have_populated_dt())
243244
return 0;
244245

246+
/* Intel MID platforms don't have ioport rtc */
247+
if (mrst_identify_cpu())
248+
return -ENODEV;
249+
245250
platform_device_register(&rtc_device);
246251
dev_info(&rtc_device.dev,
247252
"registered platform RTC device (no PNP device found)\n");

arch/x86/mm/highmem_32.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ void *kmap_atomic_prot(struct page *page, pgprot_t prot)
4545
vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
4646
BUG_ON(!pte_none(*(kmap_pte-idx)));
4747
set_pte(kmap_pte-idx, mk_pte(page, prot));
48+
arch_flush_lazy_mmu_mode();
4849

4950
return (void *)vaddr;
5051
}
@@ -88,6 +89,7 @@ void __kunmap_atomic(void *kvaddr)
8889
*/
8990
kpte_clear_flush(kmap_pte-idx, vaddr);
9091
kmap_atomic_idx_pop();
92+
arch_flush_lazy_mmu_mode();
9193
}
9294
#ifdef CONFIG_DEBUG_HIGHMEM
9395
else {

arch/x86/platform/mrst/mrst.c

Lines changed: 57 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,20 @@ struct sfi_rtc_table_entry sfi_mrtc_array[SFI_MRTC_MAX];
7676
EXPORT_SYMBOL_GPL(sfi_mrtc_array);
7777
int sfi_mrtc_num;
7878

79+
static void mrst_power_off(void)
80+
{
81+
if (__mrst_cpu_chip == MRST_CPU_CHIP_LINCROFT)
82+
intel_scu_ipc_simple_command(IPCMSG_COLD_RESET, 1);
83+
}
84+
85+
static void mrst_reboot(void)
86+
{
87+
if (__mrst_cpu_chip == MRST_CPU_CHIP_LINCROFT)
88+
intel_scu_ipc_simple_command(IPCMSG_COLD_RESET, 0);
89+
else
90+
intel_scu_ipc_simple_command(IPCMSG_COLD_BOOT, 0);
91+
}
92+
7993
/* parse all the mtimer info to a static mtimer array */
8094
static int __init sfi_parse_mtmr(struct sfi_table_header *table)
8195
{
@@ -265,17 +279,6 @@ static int mrst_i8042_detect(void)
265279
return 0;
266280
}
267281

268-
/* Reboot and power off are handled by the SCU on a MID device */
269-
static void mrst_power_off(void)
270-
{
271-
intel_scu_ipc_simple_command(0xf1, 1);
272-
}
273-
274-
static void mrst_reboot(void)
275-
{
276-
intel_scu_ipc_simple_command(0xf1, 0);
277-
}
278-
279282
/*
280283
* Moorestown does not have external NMI source nor port 0x61 to report
281284
* NMI status. The possible NMI sources are from pmu as a result of NMI
@@ -484,6 +487,46 @@ static void __init *max7315_platform_data(void *info)
484487
return max7315;
485488
}
486489

490+
static void *tca6416_platform_data(void *info)
491+
{
492+
static struct pca953x_platform_data tca6416;
493+
struct i2c_board_info *i2c_info = info;
494+
int gpio_base, intr;
495+
char base_pin_name[SFI_NAME_LEN + 1];
496+
char intr_pin_name[SFI_NAME_LEN + 1];
497+
498+
strcpy(i2c_info->type, "tca6416");
499+
strcpy(base_pin_name, "tca6416_base");
500+
strcpy(intr_pin_name, "tca6416_int");
501+
502+
gpio_base = get_gpio_by_name(base_pin_name);
503+
intr = get_gpio_by_name(intr_pin_name);
504+
505+
if (gpio_base == -1)
506+
return NULL;
507+
tca6416.gpio_base = gpio_base;
508+
if (intr != -1) {
509+
i2c_info->irq = intr + MRST_IRQ_OFFSET;
510+
tca6416.irq_base = gpio_base + MRST_IRQ_OFFSET;
511+
} else {
512+
i2c_info->irq = -1;
513+
tca6416.irq_base = -1;
514+
}
515+
return &tca6416;
516+
}
517+
518+
static void *mpu3050_platform_data(void *info)
519+
{
520+
struct i2c_board_info *i2c_info = info;
521+
int intr = get_gpio_by_name("mpu3050_int");
522+
523+
if (intr == -1)
524+
return NULL;
525+
526+
i2c_info->irq = intr + MRST_IRQ_OFFSET;
527+
return NULL;
528+
}
529+
487530
static void __init *emc1403_platform_data(void *info)
488531
{
489532
static short intr2nd_pdata;
@@ -646,12 +689,15 @@ static void *msic_ocd_platform_data(void *info)
646689
static const struct devs_id __initconst device_ids[] = {
647690
{"bma023", SFI_DEV_TYPE_I2C, 1, &no_platform_data},
648691
{"pmic_gpio", SFI_DEV_TYPE_SPI, 1, &pmic_gpio_platform_data},
692+
{"pmic_gpio", SFI_DEV_TYPE_IPC, 1, &pmic_gpio_platform_data},
649693
{"spi_max3111", SFI_DEV_TYPE_SPI, 0, &max3111_platform_data},
650694
{"i2c_max7315", SFI_DEV_TYPE_I2C, 1, &max7315_platform_data},
651695
{"i2c_max7315_2", SFI_DEV_TYPE_I2C, 1, &max7315_platform_data},
696+
{"tca6416", SFI_DEV_TYPE_I2C, 1, &tca6416_platform_data},
652697
{"emc1403", SFI_DEV_TYPE_I2C, 1, &emc1403_platform_data},
653698
{"i2c_accel", SFI_DEV_TYPE_I2C, 0, &lis331dl_platform_data},
654699
{"pmic_audio", SFI_DEV_TYPE_IPC, 1, &no_platform_data},
700+
{"mpu3050", SFI_DEV_TYPE_I2C, 1, &mpu3050_platform_data},
655701

656702
/* MSIC subdevices */
657703
{"msic_battery", SFI_DEV_TYPE_IPC, 1, &msic_battery_platform_data},

drivers/iommu/intel-iommu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3524,7 +3524,7 @@ int dmar_find_matched_atsr_unit(struct pci_dev *dev)
35243524
return 0;
35253525
}
35263526

3527-
int dmar_parse_rmrr_atsr_dev(void)
3527+
int __init dmar_parse_rmrr_atsr_dev(void)
35283528
{
35293529
struct dmar_rmrr_unit *rmrr, *rmrr_n;
35303530
struct dmar_atsr_unit *atsr, *atsr_n;

0 commit comments

Comments
 (0)