Re: [Qemu-devel] [PATCH] target-arm: Stage 2 permission fault was fixed in AArch32 state

2016-05-04 Thread Peter Maydell
On 18 April 2016 at 19:00, Sergey Sorokin  wrote:
> As described in AArch32.CheckS2Permission an instruction fetch fails if
> XN bit is set or there is no read permission for the address.
>
> Signed-off-by: Sergey Sorokin 
> ---
>  target-arm/helper.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/target-arm/helper.c b/target-arm/helper.c
> index 09638b2..59efb90 100644
> --- a/target-arm/helper.c
> +++ b/target-arm/helper.c
> @@ -6708,7 +6708,9 @@ static int get_S2prot(CPUARMState *env, int s2ap, int 
> xn)
>  prot |= PAGE_WRITE;
>  }
>  if (!xn) {
> -prot |= PAGE_EXEC;
> +if (arm_el_is_aa64(env, 2) || prot & PAGE_READ) {
> +prot |= PAGE_EXEC;
> +}
>  }
>  return prot;
>  }

Thanks, applied to target-arm.next.

-- PMM



[Qemu-devel] [PATCH] target-arm: Stage 2 permission fault was fixed in AArch32 state

2016-04-18 Thread Sergey Sorokin
As described in AArch32.CheckS2Permission an instruction fetch fails if
XN bit is set or there is no read permission for the address.

Signed-off-by: Sergey Sorokin 
---
 target-arm/helper.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/target-arm/helper.c b/target-arm/helper.c
index 09638b2..59efb90 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -6708,7 +6708,9 @@ static int get_S2prot(CPUARMState *env, int s2ap, int xn)
 prot |= PAGE_WRITE;
 }
 if (!xn) {
-prot |= PAGE_EXEC;
+if (arm_el_is_aa64(env, 2) || prot & PAGE_READ) {
+prot |= PAGE_EXEC;
+}
 }
 return prot;
 }
-- 
1.9.3