x86/irq/64: Init hardirq_stack_ptr during CPU hotplug
Preparatory change for disentangling the irq stack union as a prerequisite for irq stacks with guard pages. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Borislav Petkov <bp@suse.de> Cc: Andy Lutomirski <luto@kernel.org> Cc: "Chang S. Bae" <chang.seok.bae@intel.com> Cc: Dominik Brodowski <linux@dominikbrodowski.net> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Josh Poimboeuf <jpoimboe@redhat.com> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Cc: Nicolai Stange <nstange@suse.de> Cc: Pavel Tatashin <pasha.tatashin@oracle.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Sean Christopherson <sean.j.christopherson@intel.com> Cc: x86-ml <x86@kernel.org> Cc: Yi Wang <wang.yi59@zte.com.cn> Link: https://lkml.kernel.org/r/20190414160146.177558566@linutronix.de
This commit is contained in:

committed by
Borislav Petkov

parent
66c7ceb47f
commit
0ac2610420
@@ -87,3 +87,18 @@ bool handle_irq(struct irq_desc *desc, struct pt_regs *regs)
|
||||
generic_handle_irq_desc(desc);
|
||||
return true;
|
||||
}
|
||||
|
||||
static int map_irq_stack(unsigned int cpu)
|
||||
{
|
||||
void *va = per_cpu_ptr(irq_stack_union.irq_stack, cpu);
|
||||
|
||||
per_cpu(hardirq_stack_ptr, cpu) = va + IRQ_STACK_SIZE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int irq_init_percpu_irqstack(unsigned int cpu)
|
||||
{
|
||||
if (per_cpu(hardirq_stack_ptr, cpu))
|
||||
return 0;
|
||||
return map_irq_stack(cpu);
|
||||
}
|
||||
|
Reference in New Issue
Block a user