Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fixes from Ingo Molnar: "Various fixes" * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86-64, kcmp: The kcmp system call can be common arch/x86/kernel/kdebugfs.c: Ensure a consistent return value in error case x86/mce: Add quirk for instruction recovery on Sandy Bridge processors x86/mce: Move MCACOD defines from mce-severity.c to <asm/mce.h> x86/ioapic: Fix NULL pointer dereference on CPU hotplug after disabling irqs x86, nops: Missing break resulting in incorrect selection on Intel x86: CONFIG_CC_STACKPROTECTOR=y is no longer experimental
This commit is contained in:
@@ -1527,7 +1527,7 @@ config SECCOMP
|
|||||||
If unsure, say Y. Only embedded should say N here.
|
If unsure, say Y. Only embedded should say N here.
|
||||||
|
|
||||||
config CC_STACKPROTECTOR
|
config CC_STACKPROTECTOR
|
||||||
bool "Enable -fstack-protector buffer overflow detection (EXPERIMENTAL)"
|
bool "Enable -fstack-protector buffer overflow detection"
|
||||||
---help---
|
---help---
|
||||||
This option turns on the -fstack-protector GCC feature. This
|
This option turns on the -fstack-protector GCC feature. This
|
||||||
feature puts, at the beginning of functions, a canary value on
|
feature puts, at the beginning of functions, a canary value on
|
||||||
|
@@ -33,6 +33,14 @@
|
|||||||
#define MCI_STATUS_PCC (1ULL<<57) /* processor context corrupt */
|
#define MCI_STATUS_PCC (1ULL<<57) /* processor context corrupt */
|
||||||
#define MCI_STATUS_S (1ULL<<56) /* Signaled machine check */
|
#define MCI_STATUS_S (1ULL<<56) /* Signaled machine check */
|
||||||
#define MCI_STATUS_AR (1ULL<<55) /* Action required */
|
#define MCI_STATUS_AR (1ULL<<55) /* Action required */
|
||||||
|
#define MCACOD 0xffff /* MCA Error Code */
|
||||||
|
|
||||||
|
/* Architecturally defined codes from SDM Vol. 3B Chapter 15 */
|
||||||
|
#define MCACOD_SCRUB 0x00C0 /* 0xC0-0xCF Memory Scrubbing */
|
||||||
|
#define MCACOD_SCRUBMSK 0xfff0
|
||||||
|
#define MCACOD_L3WB 0x017A /* L3 Explicit Writeback */
|
||||||
|
#define MCACOD_DATA 0x0134 /* Data Load */
|
||||||
|
#define MCACOD_INSTR 0x0150 /* Instruction Fetch */
|
||||||
|
|
||||||
/* MCi_MISC register defines */
|
/* MCi_MISC register defines */
|
||||||
#define MCI_MISC_ADDR_LSB(m) ((m) & 0x3f)
|
#define MCI_MISC_ADDR_LSB(m) ((m) & 0x3f)
|
||||||
|
@@ -224,7 +224,7 @@ void __init arch_init_ideal_nops(void)
|
|||||||
ideal_nops = intel_nops;
|
ideal_nops = intel_nops;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
#ifdef CONFIG_X86_64
|
#ifdef CONFIG_X86_64
|
||||||
ideal_nops = k8_nops;
|
ideal_nops = k8_nops;
|
||||||
|
@@ -1204,7 +1204,7 @@ static void __clear_irq_vector(int irq, struct irq_cfg *cfg)
|
|||||||
BUG_ON(!cfg->vector);
|
BUG_ON(!cfg->vector);
|
||||||
|
|
||||||
vector = cfg->vector;
|
vector = cfg->vector;
|
||||||
for_each_cpu(cpu, cfg->domain)
|
for_each_cpu_and(cpu, cfg->domain, cpu_online_mask)
|
||||||
per_cpu(vector_irq, cpu)[vector] = -1;
|
per_cpu(vector_irq, cpu)[vector] = -1;
|
||||||
|
|
||||||
cfg->vector = 0;
|
cfg->vector = 0;
|
||||||
@@ -1212,7 +1212,7 @@ static void __clear_irq_vector(int irq, struct irq_cfg *cfg)
|
|||||||
|
|
||||||
if (likely(!cfg->move_in_progress))
|
if (likely(!cfg->move_in_progress))
|
||||||
return;
|
return;
|
||||||
for_each_cpu(cpu, cfg->old_domain) {
|
for_each_cpu_and(cpu, cfg->old_domain, cpu_online_mask) {
|
||||||
for (vector = FIRST_EXTERNAL_VECTOR; vector < NR_VECTORS;
|
for (vector = FIRST_EXTERNAL_VECTOR; vector < NR_VECTORS;
|
||||||
vector++) {
|
vector++) {
|
||||||
if (per_cpu(vector_irq, cpu)[vector] != irq)
|
if (per_cpu(vector_irq, cpu)[vector] != irq)
|
||||||
|
@@ -55,13 +55,6 @@ static struct severity {
|
|||||||
#define MCI_UC_S (MCI_STATUS_UC|MCI_STATUS_S)
|
#define MCI_UC_S (MCI_STATUS_UC|MCI_STATUS_S)
|
||||||
#define MCI_UC_SAR (MCI_STATUS_UC|MCI_STATUS_S|MCI_STATUS_AR)
|
#define MCI_UC_SAR (MCI_STATUS_UC|MCI_STATUS_S|MCI_STATUS_AR)
|
||||||
#define MCI_ADDR (MCI_STATUS_ADDRV|MCI_STATUS_MISCV)
|
#define MCI_ADDR (MCI_STATUS_ADDRV|MCI_STATUS_MISCV)
|
||||||
#define MCACOD 0xffff
|
|
||||||
/* Architecturally defined codes from SDM Vol. 3B Chapter 15 */
|
|
||||||
#define MCACOD_SCRUB 0x00C0 /* 0xC0-0xCF Memory Scrubbing */
|
|
||||||
#define MCACOD_SCRUBMSK 0xfff0
|
|
||||||
#define MCACOD_L3WB 0x017A /* L3 Explicit Writeback */
|
|
||||||
#define MCACOD_DATA 0x0134 /* Data Load */
|
|
||||||
#define MCACOD_INSTR 0x0150 /* Instruction Fetch */
|
|
||||||
|
|
||||||
MCESEV(
|
MCESEV(
|
||||||
NO, "Invalid",
|
NO, "Invalid",
|
||||||
|
@@ -103,6 +103,8 @@ DEFINE_PER_CPU(mce_banks_t, mce_poll_banks) = {
|
|||||||
|
|
||||||
static DEFINE_PER_CPU(struct work_struct, mce_work);
|
static DEFINE_PER_CPU(struct work_struct, mce_work);
|
||||||
|
|
||||||
|
static void (*quirk_no_way_out)(int bank, struct mce *m, struct pt_regs *regs);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* CPU/chipset specific EDAC code can register a notifier call here to print
|
* CPU/chipset specific EDAC code can register a notifier call here to print
|
||||||
* MCE errors in a human-readable form.
|
* MCE errors in a human-readable form.
|
||||||
@@ -650,14 +652,18 @@ EXPORT_SYMBOL_GPL(machine_check_poll);
|
|||||||
* Do a quick check if any of the events requires a panic.
|
* Do a quick check if any of the events requires a panic.
|
||||||
* This decides if we keep the events around or clear them.
|
* This decides if we keep the events around or clear them.
|
||||||
*/
|
*/
|
||||||
static int mce_no_way_out(struct mce *m, char **msg, unsigned long *validp)
|
static int mce_no_way_out(struct mce *m, char **msg, unsigned long *validp,
|
||||||
|
struct pt_regs *regs)
|
||||||
{
|
{
|
||||||
int i, ret = 0;
|
int i, ret = 0;
|
||||||
|
|
||||||
for (i = 0; i < banks; i++) {
|
for (i = 0; i < banks; i++) {
|
||||||
m->status = mce_rdmsrl(MSR_IA32_MCx_STATUS(i));
|
m->status = mce_rdmsrl(MSR_IA32_MCx_STATUS(i));
|
||||||
if (m->status & MCI_STATUS_VAL)
|
if (m->status & MCI_STATUS_VAL) {
|
||||||
__set_bit(i, validp);
|
__set_bit(i, validp);
|
||||||
|
if (quirk_no_way_out)
|
||||||
|
quirk_no_way_out(i, m, regs);
|
||||||
|
}
|
||||||
if (mce_severity(m, tolerant, msg) >= MCE_PANIC_SEVERITY)
|
if (mce_severity(m, tolerant, msg) >= MCE_PANIC_SEVERITY)
|
||||||
ret = 1;
|
ret = 1;
|
||||||
}
|
}
|
||||||
@@ -1040,7 +1046,7 @@ void do_machine_check(struct pt_regs *regs, long error_code)
|
|||||||
*final = m;
|
*final = m;
|
||||||
|
|
||||||
memset(valid_banks, 0, sizeof(valid_banks));
|
memset(valid_banks, 0, sizeof(valid_banks));
|
||||||
no_way_out = mce_no_way_out(&m, &msg, valid_banks);
|
no_way_out = mce_no_way_out(&m, &msg, valid_banks, regs);
|
||||||
|
|
||||||
barrier();
|
barrier();
|
||||||
|
|
||||||
@@ -1418,6 +1424,34 @@ static void __mcheck_cpu_init_generic(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* During IFU recovery Sandy Bridge -EP4S processors set the RIPV and
|
||||||
|
* EIPV bits in MCG_STATUS to zero on the affected logical processor (SDM
|
||||||
|
* Vol 3B Table 15-20). But this confuses both the code that determines
|
||||||
|
* whether the machine check occurred in kernel or user mode, and also
|
||||||
|
* the severity assessment code. Pretend that EIPV was set, and take the
|
||||||
|
* ip/cs values from the pt_regs that mce_gather_info() ignored earlier.
|
||||||
|
*/
|
||||||
|
static void quirk_sandybridge_ifu(int bank, struct mce *m, struct pt_regs *regs)
|
||||||
|
{
|
||||||
|
if (bank != 0)
|
||||||
|
return;
|
||||||
|
if ((m->mcgstatus & (MCG_STATUS_EIPV|MCG_STATUS_RIPV)) != 0)
|
||||||
|
return;
|
||||||
|
if ((m->status & (MCI_STATUS_OVER|MCI_STATUS_UC|
|
||||||
|
MCI_STATUS_EN|MCI_STATUS_MISCV|MCI_STATUS_ADDRV|
|
||||||
|
MCI_STATUS_PCC|MCI_STATUS_S|MCI_STATUS_AR|
|
||||||
|
MCACOD)) !=
|
||||||
|
(MCI_STATUS_UC|MCI_STATUS_EN|
|
||||||
|
MCI_STATUS_MISCV|MCI_STATUS_ADDRV|MCI_STATUS_S|
|
||||||
|
MCI_STATUS_AR|MCACOD_INSTR))
|
||||||
|
return;
|
||||||
|
|
||||||
|
m->mcgstatus |= MCG_STATUS_EIPV;
|
||||||
|
m->ip = regs->ip;
|
||||||
|
m->cs = regs->cs;
|
||||||
|
}
|
||||||
|
|
||||||
/* Add per CPU specific workarounds here */
|
/* Add per CPU specific workarounds here */
|
||||||
static int __cpuinit __mcheck_cpu_apply_quirks(struct cpuinfo_x86 *c)
|
static int __cpuinit __mcheck_cpu_apply_quirks(struct cpuinfo_x86 *c)
|
||||||
{
|
{
|
||||||
@@ -1515,6 +1549,9 @@ static int __cpuinit __mcheck_cpu_apply_quirks(struct cpuinfo_x86 *c)
|
|||||||
*/
|
*/
|
||||||
if (c->x86 == 6 && c->x86_model <= 13 && mce_bootlog < 0)
|
if (c->x86 == 6 && c->x86_model <= 13 && mce_bootlog < 0)
|
||||||
mce_bootlog = 0;
|
mce_bootlog = 0;
|
||||||
|
|
||||||
|
if (c->x86 == 6 && c->x86_model == 45)
|
||||||
|
quirk_no_way_out = quirk_sandybridge_ifu;
|
||||||
}
|
}
|
||||||
if (monarch_timeout < 0)
|
if (monarch_timeout < 0)
|
||||||
monarch_timeout = 0;
|
monarch_timeout = 0;
|
||||||
|
@@ -328,6 +328,7 @@ void fixup_irqs(void)
|
|||||||
chip->irq_retrigger(data);
|
chip->irq_retrigger(data);
|
||||||
raw_spin_unlock(&desc->lock);
|
raw_spin_unlock(&desc->lock);
|
||||||
}
|
}
|
||||||
|
__this_cpu_write(vector_irq[vector], -1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@@ -107,7 +107,7 @@ static int __init create_setup_data_nodes(struct dentry *parent)
|
|||||||
{
|
{
|
||||||
struct setup_data_node *node;
|
struct setup_data_node *node;
|
||||||
struct setup_data *data;
|
struct setup_data *data;
|
||||||
int error = -ENOMEM;
|
int error;
|
||||||
struct dentry *d;
|
struct dentry *d;
|
||||||
struct page *pg;
|
struct page *pg;
|
||||||
u64 pa_data;
|
u64 pa_data;
|
||||||
@@ -121,8 +121,10 @@ static int __init create_setup_data_nodes(struct dentry *parent)
|
|||||||
|
|
||||||
while (pa_data) {
|
while (pa_data) {
|
||||||
node = kmalloc(sizeof(*node), GFP_KERNEL);
|
node = kmalloc(sizeof(*node), GFP_KERNEL);
|
||||||
if (!node)
|
if (!node) {
|
||||||
|
error = -ENOMEM;
|
||||||
goto err_dir;
|
goto err_dir;
|
||||||
|
}
|
||||||
|
|
||||||
pg = pfn_to_page((pa_data+sizeof(*data)-1) >> PAGE_SHIFT);
|
pg = pfn_to_page((pa_data+sizeof(*data)-1) >> PAGE_SHIFT);
|
||||||
if (PageHighMem(pg)) {
|
if (PageHighMem(pg)) {
|
||||||
|
@@ -318,7 +318,7 @@
|
|||||||
309 common getcpu sys_getcpu
|
309 common getcpu sys_getcpu
|
||||||
310 64 process_vm_readv sys_process_vm_readv
|
310 64 process_vm_readv sys_process_vm_readv
|
||||||
311 64 process_vm_writev sys_process_vm_writev
|
311 64 process_vm_writev sys_process_vm_writev
|
||||||
312 64 kcmp sys_kcmp
|
312 common kcmp sys_kcmp
|
||||||
|
|
||||||
#
|
#
|
||||||
# x32-specific system call numbers start at 512 to avoid cache impact
|
# x32-specific system call numbers start at 512 to avoid cache impact
|
||||||
|
Reference in New Issue
Block a user