[PATCH 1/2] irqchip/gic-v3: Convert arm64 GIC accessors to {read, write}_sysreg_s

Mark Rutland mark.rutland at arm.com
Fri Oct 28 07:54:22 PDT 2016


On Fri, Oct 28, 2016 at 12:23:57PM +0100, Will Deacon wrote:
> The GIC system registers are accessed using open-coded wrappers around
> the mrs_s/msr_s asm macros.
> 
> This patch moves the code over to the {read,wrote}_sysreg_s accessors
> instead, reducing the amount of explicit asm blocks in the arch headers.

It's nice to see more of this going away!

[...]

> @@ -134,10 +124,12 @@ static inline u64 gic_read_iar_cavium_thunderx(void)
>  
>  	asm volatile(
>  		"nop;nop;nop;nop\n\t"
> -		"nop;nop;nop;nop\n\t"
> -		"mrs_s %0, " __stringify(ICC_IAR1_EL1) "\n\t"
> -		"nop;nop;nop;nop"
> -		: "=r" (irqstat));
> +		"nop;nop;nop;nop");
> +
> +	irqstat = read_sysreg_s(ICC_IAR1_EL1);
> +
> +	asm volatile(
> +		"nop;nop;nop;nop");

This looks odd, but I see that it disappears in the next patch anyway,
and mirrors the above.

Otherwise, all the transformations look correct to me. FWIW:

Reviewed-by: Mark Rutland <mark.rutland at arm.com>

Thanks,
Mark.



More information about the linux-arm-kernel mailing list