[PATCH v8 3/4] arm64: Add do_softirq_own_stack() and enable irq_stacks

Catalin Marinas catalin.marinas at arm.com
Fri Dec 4 05:46:36 PST 2015


On Fri, Dec 04, 2015 at 11:02:27AM +0000, James Morse wrote:
> +/*
> + * do_softirq_own_stack() is called from irq_exit() before __do_softirq()
> + * re-enables interrupts, at which point we may re-enter el?_irq(). We
> + * increase irq_count here so that el1_irq() knows that it is already on the
> + * irq stack.
> + *
> + * Called with interrupts disabled, so we don't worry about moving cpu, or
> + * being interrupted while modifying irq_count.
> + *
> + * This function doesn't actually switch stack.
> + */
> +void do_softirq_own_stack(void)
> +{
> +	int cpu = smp_processor_id();
> +
> +	WARN_ON_ONCE(!irqs_disabled());
> +
> +	if (on_irq_stack(current_stack_pointer, cpu)) {
> +		IRQ_COUNT()++;
> +		__do_softirq();
> +		IRQ_COUNT()--;
> +	} else {
> +		__do_softirq();
> +	}

Following your and my reply on the previous series, should we not
_always_ switch to the irqstack here?

-- 
Catalin



More information about the linux-arm-kernel mailing list