Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: KVM: fix L_PTE_S2_RDWR to actually be Read/Write
@ 2013-04-12 13:00 Marc Zyngier
  2013-04-12 13:26 ` Alexander Graf
  2013-04-15  4:52 ` Christoffer Dall
  0 siblings, 2 replies; 5+ messages in thread
From: Marc Zyngier @ 2013-04-12 13:00 UTC (permalink / raw)
  To: linux-arm-kernel

Looks like our L_PTE_S2_RDWR definition is slightly wrong,
and is actually write only (see ARM ARM Table B3-9, Stage 2 control
of access permissions). Didn't make a difference for normal pages,
as we OR the flags together, but I'm still wondering how it worked
for Stage-2 mapped devices, such as the GIC.

Brown paper bag time, again.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 arch/arm/include/asm/pgtable-3level.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/include/asm/pgtable-3level.h b/arch/arm/include/asm/pgtable-3level.h
index 6ef8afd..86b8fe3 100644
--- a/arch/arm/include/asm/pgtable-3level.h
+++ b/arch/arm/include/asm/pgtable-3level.h
@@ -111,7 +111,7 @@
 #define L_PTE_S2_MT_WRITETHROUGH (_AT(pteval_t, 0xa) << 2) /* MemAttr[3:0] */
 #define L_PTE_S2_MT_WRITEBACK	 (_AT(pteval_t, 0xf) << 2) /* MemAttr[3:0] */
 #define L_PTE_S2_RDONLY		 (_AT(pteval_t, 1) << 6)   /* HAP[1]   */
-#define L_PTE_S2_RDWR		 (_AT(pteval_t, 2) << 6)   /* HAP[2:1] */
+#define L_PTE_S2_RDWR		 (_AT(pteval_t, 3) << 6)   /* HAP[2:1] */
 
 /*
  * Hyp-mode PL2 PTE definitions for LPAE.
-- 
1.8.1.4

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

* [PATCH] ARM: KVM: fix L_PTE_S2_RDWR to actually be Read/Write
  2013-04-12 13:00 [PATCH] ARM: KVM: fix L_PTE_S2_RDWR to actually be Read/Write Marc Zyngier
@ 2013-04-12 13:26 ` Alexander Graf
  2013-04-12 13:33   ` Marc Zyngier
  2013-04-15  4:52 ` Christoffer Dall
  1 sibling, 1 reply; 5+ messages in thread
From: Alexander Graf @ 2013-04-12 13:26 UTC (permalink / raw)
  To: linux-arm-kernel


On 12.04.2013, at 15:00, Marc Zyngier wrote:

> Looks like our L_PTE_S2_RDWR definition is slightly wrong,
> and is actually write only (see ARM ARM Table B3-9, Stage 2 control
> of access permissions). Didn't make a difference for normal pages,
> as we OR the flags together, but I'm still wondering how it worked
> for Stage-2 mapped devices, such as the GIC.
> 
> Brown paper bag time, again.
> 
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>

CC stable?


Alex

> ---
> arch/arm/include/asm/pgtable-3level.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/include/asm/pgtable-3level.h b/arch/arm/include/asm/pgtable-3level.h
> index 6ef8afd..86b8fe3 100644
> --- a/arch/arm/include/asm/pgtable-3level.h
> +++ b/arch/arm/include/asm/pgtable-3level.h
> @@ -111,7 +111,7 @@
> #define L_PTE_S2_MT_WRITETHROUGH (_AT(pteval_t, 0xa) << 2) /* MemAttr[3:0] */
> #define L_PTE_S2_MT_WRITEBACK	 (_AT(pteval_t, 0xf) << 2) /* MemAttr[3:0] */
> #define L_PTE_S2_RDONLY		 (_AT(pteval_t, 1) << 6)   /* HAP[1]   */
> -#define L_PTE_S2_RDWR		 (_AT(pteval_t, 2) << 6)   /* HAP[2:1] */
> +#define L_PTE_S2_RDWR		 (_AT(pteval_t, 3) << 6)   /* HAP[2:1] */
> 
> /*
>  * Hyp-mode PL2 PTE definitions for LPAE.
> -- 
> 1.8.1.4
> 
> 
> 
> _______________________________________________
> kvmarm mailing list
> kvmarm at lists.cs.columbia.edu
> https://lists.cs.columbia.edu/cucslists/listinfo/kvmarm

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

* [PATCH] ARM: KVM: fix L_PTE_S2_RDWR to actually be Read/Write
  2013-04-12 13:26 ` Alexander Graf
@ 2013-04-12 13:33   ` Marc Zyngier
  2013-04-12 13:35     ` Alexander Graf
  0 siblings, 1 reply; 5+ messages in thread
From: Marc Zyngier @ 2013-04-12 13:33 UTC (permalink / raw)
  To: linux-arm-kernel

On 12/04/13 14:26, Alexander Graf wrote:
> 
> On 12.04.2013, at 15:00, Marc Zyngier wrote:
> 
>> Looks like our L_PTE_S2_RDWR definition is slightly wrong,
>> and is actually write only (see ARM ARM Table B3-9, Stage 2 control
>> of access permissions). Didn't make a difference for normal pages,
>> as we OR the flags together, but I'm still wondering how it worked
>> for Stage-2 mapped devices, such as the GIC.
>>
>> Brown paper bag time, again.
>>
>> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> 
> CC stable?

Only if this doesn't make it into the final 3.9, which will be the first
version with KVM/arm.

	M.
-- 
Jazz is not dead. It just smells funny...

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

* [PATCH] ARM: KVM: fix L_PTE_S2_RDWR to actually be Read/Write
  2013-04-12 13:33   ` Marc Zyngier
@ 2013-04-12 13:35     ` Alexander Graf
  0 siblings, 0 replies; 5+ messages in thread
From: Alexander Graf @ 2013-04-12 13:35 UTC (permalink / raw)
  To: linux-arm-kernel


On 12.04.2013, at 15:33, Marc Zyngier wrote:

> On 12/04/13 14:26, Alexander Graf wrote:
>> 
>> On 12.04.2013, at 15:00, Marc Zyngier wrote:
>> 
>>> Looks like our L_PTE_S2_RDWR definition is slightly wrong,
>>> and is actually write only (see ARM ARM Table B3-9, Stage 2 control
>>> of access permissions). Didn't make a difference for normal pages,
>>> as we OR the flags together, but I'm still wondering how it worked
>>> for Stage-2 mapped devices, such as the GIC.
>>> 
>>> Brown paper bag time, again.
>>> 
>>> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
>> 
>> CC stable?
> 
> Only if this doesn't make it into the final 3.9, which will be the first
> version with KVM/arm.

Given that we're at rc6, I'd presume that's rather likely if you don't make a fuss about it :)


Alex

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

* [PATCH] ARM: KVM: fix L_PTE_S2_RDWR to actually be Read/Write
  2013-04-12 13:00 [PATCH] ARM: KVM: fix L_PTE_S2_RDWR to actually be Read/Write Marc Zyngier
  2013-04-12 13:26 ` Alexander Graf
@ 2013-04-15  4:52 ` Christoffer Dall
  1 sibling, 0 replies; 5+ messages in thread
From: Christoffer Dall @ 2013-04-15  4:52 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Apr 12, 2013 at 6:00 AM, Marc Zyngier <marc.zyngier@arm.com> wrote:
> Looks like our L_PTE_S2_RDWR definition is slightly wrong,
> and is actually write only (see ARM ARM Table B3-9, Stage 2 control
> of access permissions). Didn't make a difference for normal pages,
> as we OR the flags together, but I'm still wondering how it worked
> for Stage-2 mapped devices, such as the GIC.

PAGE_S2_DEVICE uses L_PTE_USER which sets bit 6, so that's why it works.

The define used to be called _WRITE, which is how this creeped in. We
should probably change this to be completely independent of
L_PTE_USER, I'll cook up a patch.

>
> Brown paper bag time, again.

thanks

>
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> ---
>  arch/arm/include/asm/pgtable-3level.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm/include/asm/pgtable-3level.h b/arch/arm/include/asm/pgtable-3level.h
> index 6ef8afd..86b8fe3 100644
> --- a/arch/arm/include/asm/pgtable-3level.h
> +++ b/arch/arm/include/asm/pgtable-3level.h
> @@ -111,7 +111,7 @@
>  #define L_PTE_S2_MT_WRITETHROUGH (_AT(pteval_t, 0xa) << 2) /* MemAttr[3:0] */
>  #define L_PTE_S2_MT_WRITEBACK   (_AT(pteval_t, 0xf) << 2) /* MemAttr[3:0] */
>  #define L_PTE_S2_RDONLY                 (_AT(pteval_t, 1) << 6)   /* HAP[1]   */
> -#define L_PTE_S2_RDWR           (_AT(pteval_t, 2) << 6)   /* HAP[2:1] */
> +#define L_PTE_S2_RDWR           (_AT(pteval_t, 3) << 6)   /* HAP[2:1] */
>
>  /*
>   * Hyp-mode PL2 PTE definitions for LPAE.
> --
> 1.8.1.4
>
>
>
> _______________________________________________
> kvmarm mailing list
> kvmarm at lists.cs.columbia.edu
> https://lists.cs.columbia.edu/cucslists/listinfo/kvmarm

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

end of thread, other threads:[~2013-04-15  4:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-12 13:00 [PATCH] ARM: KVM: fix L_PTE_S2_RDWR to actually be Read/Write Marc Zyngier
2013-04-12 13:26 ` Alexander Graf
2013-04-12 13:33   ` Marc Zyngier
2013-04-12 13:35     ` Alexander Graf
2013-04-15  4:52 ` Christoffer Dall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox