Commit 7b86572a authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

* 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86-64: Fix CFI data for interrupt frames
  x86-64: Don't apply destructive erratum workaround on unaffected CPUs
parents 0791e98d eab9e613
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#define CFI_REMEMBER_STATE .cfi_remember_state #define CFI_REMEMBER_STATE .cfi_remember_state
#define CFI_RESTORE_STATE .cfi_restore_state #define CFI_RESTORE_STATE .cfi_restore_state
#define CFI_UNDEFINED .cfi_undefined #define CFI_UNDEFINED .cfi_undefined
#define CFI_ESCAPE .cfi_escape
#ifdef CONFIG_AS_CFI_SIGNAL_FRAME #ifdef CONFIG_AS_CFI_SIGNAL_FRAME
#define CFI_SIGNAL_FRAME .cfi_signal_frame #define CFI_SIGNAL_FRAME .cfi_signal_frame
...@@ -68,6 +69,7 @@ ...@@ -68,6 +69,7 @@
#define CFI_REMEMBER_STATE cfi_ignore #define CFI_REMEMBER_STATE cfi_ignore
#define CFI_RESTORE_STATE cfi_ignore #define CFI_RESTORE_STATE cfi_ignore
#define CFI_UNDEFINED cfi_ignore #define CFI_UNDEFINED cfi_ignore
#define CFI_ESCAPE cfi_ignore
#define CFI_SIGNAL_FRAME cfi_ignore #define CFI_SIGNAL_FRAME cfi_ignore
#endif #endif
......
...@@ -331,10 +331,15 @@ ENDPROC(native_usergs_sysret64) ...@@ -331,10 +331,15 @@ ENDPROC(native_usergs_sysret64)
1: incl PER_CPU_VAR(irq_count) 1: incl PER_CPU_VAR(irq_count)
jne 2f jne 2f
mov PER_CPU_VAR(irq_stack_ptr),%rsp mov PER_CPU_VAR(irq_stack_ptr),%rsp
EMPTY_FRAME 0 CFI_DEF_CFA_REGISTER rsi
2: /* Store previous stack value */ 2: /* Store previous stack value */
pushq %rsi pushq %rsi
CFI_ESCAPE 0x0f /* DW_CFA_def_cfa_expression */, 6, \
0x77 /* DW_OP_breg7 */, 0, \
0x06 /* DW_OP_deref */, \
0x08 /* DW_OP_const1u */, SS+8-RBP, \
0x22 /* DW_OP_plus */
/* We entered an interrupt context - irqs are off: */ /* We entered an interrupt context - irqs are off: */
TRACE_IRQS_OFF TRACE_IRQS_OFF
.endm .endm
...@@ -788,7 +793,6 @@ END(interrupt) ...@@ -788,7 +793,6 @@ END(interrupt)
subq $ORIG_RAX-RBP, %rsp subq $ORIG_RAX-RBP, %rsp
CFI_ADJUST_CFA_OFFSET ORIG_RAX-RBP CFI_ADJUST_CFA_OFFSET ORIG_RAX-RBP
SAVE_ARGS_IRQ SAVE_ARGS_IRQ
PARTIAL_FRAME 0
call \func call \func
.endm .endm
...@@ -813,10 +817,10 @@ ret_from_intr: ...@@ -813,10 +817,10 @@ ret_from_intr:
/* Restore saved previous stack */ /* Restore saved previous stack */
popq %rsi popq %rsi
leaq 16(%rsi), %rsp CFI_DEF_CFA_REGISTER rsi
leaq ARGOFFSET-RBP(%rsi), %rsp
CFI_DEF_CFA_REGISTER rsp CFI_DEF_CFA_REGISTER rsp
CFI_ADJUST_CFA_OFFSET -16 CFI_ADJUST_CFA_OFFSET RBP-ARGOFFSET
exit_intr: exit_intr:
GET_THREAD_INFO(%rcx) GET_THREAD_INFO(%rcx)
......
...@@ -420,12 +420,14 @@ static noinline __kprobes int vmalloc_fault(unsigned long address) ...@@ -420,12 +420,14 @@ static noinline __kprobes int vmalloc_fault(unsigned long address)
return 0; return 0;
} }
#ifdef CONFIG_CPU_SUP_AMD
static const char errata93_warning[] = static const char errata93_warning[] =
KERN_ERR KERN_ERR
"******* Your BIOS seems to not contain a fix for K8 errata #93\n" "******* Your BIOS seems to not contain a fix for K8 errata #93\n"
"******* Working around it, but it may cause SEGVs or burn power.\n" "******* Working around it, but it may cause SEGVs or burn power.\n"
"******* Please consider a BIOS update.\n" "******* Please consider a BIOS update.\n"
"******* Disabling USB legacy in the BIOS may also help.\n"; "******* Disabling USB legacy in the BIOS may also help.\n";
#endif
/* /*
* No vm86 mode in 64-bit mode: * No vm86 mode in 64-bit mode:
...@@ -505,7 +507,11 @@ static void dump_pagetable(unsigned long address) ...@@ -505,7 +507,11 @@ static void dump_pagetable(unsigned long address)
*/ */
static int is_errata93(struct pt_regs *regs, unsigned long address) static int is_errata93(struct pt_regs *regs, unsigned long address)
{ {
#ifdef CONFIG_X86_64 #if defined(CONFIG_X86_64) && defined(CONFIG_CPU_SUP_AMD)
if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD
|| boot_cpu_data.x86 != 0xf)
return 0;
if (address != regs->ip) if (address != regs->ip)
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment