Skip to content

Commit

Permalink
Merge tag 'x86-urgent-2020-05-24' of git://git.kernel.org/pub/scm/lin…
Browse files Browse the repository at this point in the history
…ux/kernel/git/tip/tip

Pull x86 fixes from Thomas Gleixner:
 "Two fixes for x86:

   - Unbreak stack dumps for inactive tasks by interpreting the special
     first frame left by __switch_to_asm() correctly.

     The recent change not to skip the first frame so ORC and frame
     unwinder behave in the same way caused all entries to be
     unreliable, i.e. prepended with '?'.

   - Use cpumask_available() instead of an implicit NULL check of a
     cpumask_var_t in mmio trace to prevent a Clang build warning"

* tag 'x86-urgent-2020-05-24' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/unwind/orc: Fix unwind_get_return_address_ptr() for inactive tasks
  x86/mmiotrace: Use cpumask_available() for cpumask_var_t variables
  • Loading branch information
Linus Torvalds committed May 24, 2020
2 parents 9e61d12 + 187b96d commit 667b624
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions arch/x86/kernel/unwind_orc.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,12 +320,19 @@ EXPORT_SYMBOL_GPL(unwind_get_return_address);

unsigned long *unwind_get_return_address_ptr(struct unwind_state *state)
{
struct task_struct *task = state->task;

if (unwind_done(state))
return NULL;

if (state->regs)
return &state->regs->ip;

if (task != current && state->sp == task->thread.sp) {
struct inactive_task_frame *frame = (void *)task->thread.sp;
return &frame->ret_addr;
}

if (state->sp)
return (unsigned long *)state->sp - 1;

Expand Down
4 changes: 2 additions & 2 deletions arch/x86/mm/mmio-mod.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ static void enter_uniprocessor(void)
int cpu;
int err;

if (downed_cpus == NULL &&
if (!cpumask_available(downed_cpus) &&
!alloc_cpumask_var(&downed_cpus, GFP_KERNEL)) {
pr_notice("Failed to allocate mask\n");
goto out;
Expand Down Expand Up @@ -402,7 +402,7 @@ static void leave_uniprocessor(void)
int cpu;
int err;

if (downed_cpus == NULL || cpumask_weight(downed_cpus) == 0)
if (!cpumask_available(downed_cpus) || cpumask_weight(downed_cpus) == 0)
return;
pr_notice("Re-enabling CPUs...\n");
for_each_cpu(cpu, downed_cpus) {
Expand Down

0 comments on commit 667b624

Please sign in to comment.