All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] target/arm: Fix sve_ld1_z and sve_st1_z vs MMIO
@ 2022-03-24  1:09 Richard Henderson
  2022-03-25 13:06 ` Peter Maydell
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Henderson @ 2022-03-24  1:09 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell

Both of these functions missed handling the TLB_MMIO flag
during the conversion to handle MTE.

Fixes: 10a85e2c8ab6 ("target/arm: Reuse sve_probe_page for gather loads")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/925
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/arm/sve_helper.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/target/arm/sve_helper.c b/target/arm/sve_helper.c
index 07be55b7e1..d45d088615 100644
--- a/target/arm/sve_helper.c
+++ b/target/arm/sve_helper.c
@@ -6734,7 +6734,11 @@ void sve_ld1_z(CPUARMState *env, void *vd, uint64_t *vg, void *vm,
                     if (mtedesc && arm_tlb_mte_tagged(&info.attrs)) {
                         mte_check(env, mtedesc, addr, retaddr);
                     }
-                    host_fn(&scratch, reg_off, info.host);
+                    if (unlikely(info.flags & TLB_MMIO)) {
+                        tlb_fn(env, &scratch, reg_off, addr, retaddr);
+                    } else {
+                        host_fn(&scratch, reg_off, info.host);
+                    }
                 } else {
                     /* Element crosses the page boundary. */
                     sve_probe_page(&info2, false, env, addr + in_page, 0,
@@ -7112,7 +7116,9 @@ void sve_st1_z(CPUARMState *env, void *vd, uint64_t *vg, void *vm,
                 if (likely(in_page >= msize)) {
                     sve_probe_page(&info, false, env, addr, 0, MMU_DATA_STORE,
                                    mmu_idx, retaddr);
-                    host[i] = info.host;
+                    if (!(info.flags & TLB_MMIO)) {
+                        host[i] = info.host;
+                    }
                 } else {
                     /*
                      * Element crosses the page boundary.
-- 
2.25.1



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

* Re: [PATCH] target/arm: Fix sve_ld1_z and sve_st1_z vs MMIO
  2022-03-24  1:09 [PATCH] target/arm: Fix sve_ld1_z and sve_st1_z vs MMIO Richard Henderson
@ 2022-03-25 13:06 ` Peter Maydell
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Maydell @ 2022-03-25 13:06 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-devel

On Thu, 24 Mar 2022 at 01:09, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Both of these functions missed handling the TLB_MMIO flag
> during the conversion to handle MTE.
>
> Fixes: 10a85e2c8ab6 ("target/arm: Reuse sve_probe_page for gather loads")
> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/925
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>



Applied to target-arm.next, thanks.

-- PMM


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

end of thread, other threads:[~2022-03-25 13:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-24  1:09 [PATCH] target/arm: Fix sve_ld1_z and sve_st1_z vs MMIO Richard Henderson
2022-03-25 13:06 ` Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.