Patchwork [v4,5/6] arm64: add CVADP support to the cache maintenance helper

login
register
mail settings
Submitter Andrew Murray
Date April 3, 2019, 10:56 a.m.
Message ID <20190403105628.39798-6-andrew.murray@arm.com>
Download mbox | patch
Permalink /patch/32151/
State New
Headers show

Comments

Andrew Murray - April 3, 2019, 10:56 a.m.
Allow users of dcache_by_line_op to specify cvadp as an op.

Signed-off-by: Andrew Murray <andrew.murray@arm.com>
---
 arch/arm64/include/asm/assembler.h | 4 ++++
 1 file changed, 4 insertions(+)
Dave Martin - April 3, 2019, 1:21 p.m.
On Wed, Apr 03, 2019 at 11:56:27AM +0100, Andrew Murray wrote:
> Allow users of dcache_by_line_op to specify cvadp as an op.
> 
> Signed-off-by: Andrew Murray <andrew.murray@arm.com>
> ---
>  arch/arm64/include/asm/assembler.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/arm64/include/asm/assembler.h b/arch/arm64/include/asm/assembler.h
> index c5308d01e228..d50caf0e6b64 100644
> --- a/arch/arm64/include/asm/assembler.h
> +++ b/arch/arm64/include/asm/assembler.h
> @@ -407,10 +407,14 @@ alternative_endif
>  	.ifc	\op, cvap
>  	sys	3, c7, c12, 1, \kaddr	// dc cvap
>  	.else
> +	.ifc	\op, cvadp
> +	sys	3, c7, c13, 1, \kaddr	// dc cvadp
> +	.else
>  	dc	\op, \kaddr
>  	.endif
>  	.endif
>  	.endif
> +	.endif

This is a bit annoying, but short of moving this .if chain into a
separate macro and doing something like:

	.ifc	\op, cvap
	sys	3, c7, c12, 1, \kaddr	// dc cvap
	.exitm
	.endif

	.ifc	\op, cvadp
	sys	3, c7, c12, 1, \kaddr	// dc cvap
	.exitm
	.endif

	// ...

I don't see an obvious fix.  For now, this seems like overkill...


Anyway, with the patch as-is:

Reviewed-by: Dave Martin <Dave.Martin@arm.com>


It's logical to have dcache_by_line_op understanding cvadp, even if we
don't use it yet.

Cheers
---Dave

Patch

diff --git a/arch/arm64/include/asm/assembler.h b/arch/arm64/include/asm/assembler.h
index c5308d01e228..d50caf0e6b64 100644
--- a/arch/arm64/include/asm/assembler.h
+++ b/arch/arm64/include/asm/assembler.h
@@ -407,10 +407,14 @@  alternative_endif
 	.ifc	\op, cvap
 	sys	3, c7, c12, 1, \kaddr	// dc cvap
 	.else
+	.ifc	\op, cvadp
+	sys	3, c7, c13, 1, \kaddr	// dc cvadp
+	.else
 	dc	\op, \kaddr
 	.endif
 	.endif
 	.endif
+	.endif
 	add	\kaddr, \kaddr, \tmp1
 	cmp	\kaddr, \size
 	b.lo	9998b