linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: sysreg: fix wrong PAR_EL1.F macro
@ 2019-10-16  3:42 Yang Yingliang
  2019-10-16 10:49 ` Mark Rutland
  0 siblings, 1 reply; 2+ messages in thread
From: Yang Yingliang @ 2019-10-16  3:42 UTC (permalink / raw)
  To: will, linux-arm-kernel

According to the spec:

Field descriptions
The PAR_EL1 bit assignments are:
For all register layouts:
    F, bit [0]
               Indicates whether the conversion completed successfully.
               0 VA to PA conversion completed successfully.
               1 VA to PA conversion aborted.

PAR_EL1.F is bit0.

Fixes: e8620cff9994 ("arm64: sysreg: Add some field definitions for PAR_EL1")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 arch/arm64/include/asm/sysreg.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/include/asm/sysreg.h b/arch/arm64/include/asm/sysreg.h
index 972d196..6e919fa 100644
--- a/arch/arm64/include/asm/sysreg.h
+++ b/arch/arm64/include/asm/sysreg.h
@@ -212,7 +212,7 @@
 #define SYS_FAR_EL1			sys_reg(3, 0, 6, 0, 0)
 #define SYS_PAR_EL1			sys_reg(3, 0, 7, 4, 0)
 
-#define SYS_PAR_EL1_F			BIT(1)
+#define SYS_PAR_EL1_F			BIT(0)
 #define SYS_PAR_EL1_FST			GENMASK(6, 1)
 
 /*** Statistical Profiling Extension ***/
-- 
1.8.3


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] arm64: sysreg: fix wrong PAR_EL1.F macro
  2019-10-16  3:42 [PATCH] arm64: sysreg: fix wrong PAR_EL1.F macro Yang Yingliang
@ 2019-10-16 10:49 ` Mark Rutland
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Rutland @ 2019-10-16 10:49 UTC (permalink / raw)
  To: Yang Yingliang; +Cc: will, linux-arm-kernel

On Wed, Oct 16, 2019 at 11:42:57AM +0800, Yang Yingliang wrote:
> According to the spec:
> 
> Field descriptions
> The PAR_EL1 bit assignments are:
> For all register layouts:
>     F, bit [0]
>                Indicates whether the conversion completed successfully.
>                0 VA to PA conversion completed successfully.
>                1 VA to PA conversion aborted.
> 
> PAR_EL1.F is bit0.
>
> Fixes: e8620cff9994 ("arm64: sysreg: Add some field definitions for PAR_EL1")
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
>  arch/arm64/include/asm/sysreg.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/include/asm/sysreg.h b/arch/arm64/include/asm/sysreg.h
> index 972d196..6e919fa 100644
> --- a/arch/arm64/include/asm/sysreg.h
> +++ b/arch/arm64/include/asm/sysreg.h
> @@ -212,7 +212,7 @@
>  #define SYS_FAR_EL1			sys_reg(3, 0, 6, 0, 0)
>  #define SYS_PAR_EL1			sys_reg(3, 0, 7, 4, 0)
>  
> -#define SYS_PAR_EL1_F			BIT(1)
> +#define SYS_PAR_EL1_F			BIT(0)

Looks like this was a thinko, as we converted 1 -> BIT(1) in the
original patch.

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

That said, looking at is_spurious_el1_translation_fault() where this is
used, we currently have:

| if (!(par & SYS_PAR_EL1_F))
| 	return false;

... which I think is inverted.  If PAR_EL1.F == 0, we now have a valid
translation, so the fault *was* spurious, and we should return true.

I'll spin a patch...

Mark.

>  #define SYS_PAR_EL1_FST			GENMASK(6, 1)
>  
>  /*** Statistical Profiling Extension ***/
> -- 
> 1.8.3
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-10-16 10:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-16  3:42 [PATCH] arm64: sysreg: fix wrong PAR_EL1.F macro Yang Yingliang
2019-10-16 10:49 ` Mark Rutland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).