qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH for-6.0] target/arm: Set ARMMMUFaultInfo.level in user-only arm_cpu_tlb_fill
@ 2021-03-20  0:06 Richard Henderson
  2021-03-22 14:10 ` Peter Maydell
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Henderson @ 2021-03-20  0:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, Laurent Vivier

Pretend the fault always happens at page table level 3.

Failure to set this leaves level = 0, which is impossible for
ARMFault_Permission, and produces an invalid syndrome, which
reaches g_assert_not_reached in cpu_loop.

Fixes: 8db94ab4e5db ("linux-user/aarch64: Pass syndrome to EXC_*_ABORT")
Reported-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/tlb_helper.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/arm/tlb_helper.c b/target/arm/tlb_helper.c
index 9609333cbd..3107f9823e 100644
--- a/target/arm/tlb_helper.c
+++ b/target/arm/tlb_helper.c
@@ -163,6 +163,7 @@ bool arm_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
     } else {
         fi.type = ARMFault_Translation;
     }
+    fi.level = 3;
 
     /* now we have a real cpu fault */
     cpu_restore_state(cs, retaddr, true);
-- 
2.25.1



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

* Re: [PATCH for-6.0] target/arm: Set ARMMMUFaultInfo.level in user-only arm_cpu_tlb_fill
  2021-03-20  0:06 [PATCH for-6.0] target/arm: Set ARMMMUFaultInfo.level in user-only arm_cpu_tlb_fill Richard Henderson
@ 2021-03-22 14:10 ` Peter Maydell
  2021-03-23 14:07   ` Peter Maydell
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Maydell @ 2021-03-22 14:10 UTC (permalink / raw)
  To: Richard Henderson; +Cc: QEMU Developers, Laurent Vivier

On Sat, 20 Mar 2021 at 00:06, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Pretend the fault always happens at page table level 3.
>
> Failure to set this leaves level = 0, which is impossible for
> ARMFault_Permission, and produces an invalid syndrome, which
> reaches g_assert_not_reached in cpu_loop.
>
> Fixes: 8db94ab4e5db ("linux-user/aarch64: Pass syndrome to EXC_*_ABORT")
> Reported-by: Laurent Vivier <laurent@vivier.eu>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>  target/arm/tlb_helper.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/target/arm/tlb_helper.c b/target/arm/tlb_helper.c
> index 9609333cbd..3107f9823e 100644
> --- a/target/arm/tlb_helper.c
> +++ b/target/arm/tlb_helper.c
> @@ -163,6 +163,7 @@ bool arm_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
>      } else {
>          fi.type = ARMFault_Translation;
>      }
> +    fi.level = 3;
>
>      /* now we have a real cpu fault */
>      cpu_restore_state(cs, retaddr, true);


Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM


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

* Re: [PATCH for-6.0] target/arm: Set ARMMMUFaultInfo.level in user-only arm_cpu_tlb_fill
  2021-03-22 14:10 ` Peter Maydell
@ 2021-03-23 14:07   ` Peter Maydell
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2021-03-23 14:07 UTC (permalink / raw)
  To: Richard Henderson; +Cc: QEMU Developers, Laurent Vivier

On Mon, 22 Mar 2021 at 14:10, Peter Maydell <peter.maydell@linaro.org> wrote:
>
> On Sat, 20 Mar 2021 at 00:06, Richard Henderson
> <richard.henderson@linaro.org> wrote:
> >
> > Pretend the fault always happens at page table level 3.
> >
> > Failure to set this leaves level = 0, which is impossible for
> > ARMFault_Permission, and produces an invalid syndrome, which
> > reaches g_assert_not_reached in cpu_loop.
> >
> > Fixes: 8db94ab4e5db ("linux-user/aarch64: Pass syndrome to EXC_*_ABORT")
> > Reported-by: Laurent Vivier <laurent@vivier.eu>
> > Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> > ---
> >  target/arm/tlb_helper.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/target/arm/tlb_helper.c b/target/arm/tlb_helper.c
> > index 9609333cbd..3107f9823e 100644
> > --- a/target/arm/tlb_helper.c
> > +++ b/target/arm/tlb_helper.c
> > @@ -163,6 +163,7 @@ bool arm_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
> >      } else {
> >          fi.type = ARMFault_Translation;
> >      }
> > +    fi.level = 3;
> >
> >      /* now we have a real cpu fault */
> >      cpu_restore_state(cs, retaddr, true);
>
>
> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

...and applied to target-arm.next.

thanks
-- PMM


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

end of thread, other threads:[~2021-03-23 14:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-20  0:06 [PATCH for-6.0] target/arm: Set ARMMMUFaultInfo.level in user-only arm_cpu_tlb_fill Richard Henderson
2021-03-22 14:10 ` Peter Maydell
2021-03-23 14:07   ` Peter Maydell

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).