Commit 06f838e0 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'x86_urgent_for_v5.12-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 fixes from Borislav Petkov:

 - Fix the vDSO exception handling return path to disable interrupts
   again.

 - A fix for the CE collector to return the proper return values to its
   callers which are used to convey what the collector has done with the
   error address.

* tag 'x86_urgent_for_v5.12-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/traps: Correct exc_general_protection() and math_error() return paths
  RAS/CEC: Correct ce_add_elem()'s returned values
parents 52e44129 632a1c20
...@@ -556,7 +556,7 @@ DEFINE_IDTENTRY_ERRORCODE(exc_general_protection) ...@@ -556,7 +556,7 @@ DEFINE_IDTENTRY_ERRORCODE(exc_general_protection)
tsk->thread.trap_nr = X86_TRAP_GP; tsk->thread.trap_nr = X86_TRAP_GP;
if (fixup_vdso_exception(regs, X86_TRAP_GP, error_code, 0)) if (fixup_vdso_exception(regs, X86_TRAP_GP, error_code, 0))
return; goto exit;
show_signal(tsk, SIGSEGV, "", desc, regs, error_code); show_signal(tsk, SIGSEGV, "", desc, regs, error_code);
force_sig(SIGSEGV); force_sig(SIGSEGV);
...@@ -1057,7 +1057,7 @@ static void math_error(struct pt_regs *regs, int trapnr) ...@@ -1057,7 +1057,7 @@ static void math_error(struct pt_regs *regs, int trapnr)
goto exit; goto exit;
if (fixup_vdso_exception(regs, trapnr, 0, 0)) if (fixup_vdso_exception(regs, trapnr, 0, 0))
return; goto exit;
force_sig_fault(SIGFPE, si_code, force_sig_fault(SIGFPE, si_code,
(void __user *)uprobe_get_trap_addr(regs)); (void __user *)uprobe_get_trap_addr(regs));
......
...@@ -309,11 +309,20 @@ static bool sanity_check(struct ce_array *ca) ...@@ -309,11 +309,20 @@ static bool sanity_check(struct ce_array *ca)
return ret; return ret;
} }
/**
* cec_add_elem - Add an element to the CEC array.
* @pfn: page frame number to insert
*
* Return values:
* - <0: on error
* - 0: on success
* - >0: when the inserted pfn was offlined
*/
static int cec_add_elem(u64 pfn) static int cec_add_elem(u64 pfn)
{ {
struct ce_array *ca = &ce_arr; struct ce_array *ca = &ce_arr;
int count, err, ret = 0;
unsigned int to = 0; unsigned int to = 0;
int count, ret = 0;
/* /*
* We can be called very early on the identify_cpu() path where we are * We can be called very early on the identify_cpu() path where we are
...@@ -330,8 +339,8 @@ static int cec_add_elem(u64 pfn) ...@@ -330,8 +339,8 @@ static int cec_add_elem(u64 pfn)
if (ca->n == MAX_ELEMS) if (ca->n == MAX_ELEMS)
WARN_ON(!del_lru_elem_unlocked(ca)); WARN_ON(!del_lru_elem_unlocked(ca));
ret = find_elem(ca, pfn, &to); err = find_elem(ca, pfn, &to);
if (ret < 0) { if (err < 0) {
/* /*
* Shift range [to-end] to make room for one more element. * Shift range [to-end] to make room for one more element.
*/ */
......
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