diff mbox series

[2/7] target/moxie: Fix tlb_fill

Message ID 20171215170732.31125-3-richard.henderson@linaro.org
State Superseded
Headers show
Series TCG misc patches | expand

Commit Message

Richard Henderson Dec. 15, 2017, 5:07 p.m. UTC
We should not exit unless moxie_cpu_handle_mmu_fault has failed.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

---
 target/moxie/helper.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

-- 
2.14.3

Comments

Peter Maydell Dec. 15, 2017, 5:31 p.m. UTC | #1
On 15 December 2017 at 17:07, Richard Henderson
<richard.henderson@linaro.org> wrote:
> We should not exit unless moxie_cpu_handle_mmu_fault has failed.

>

> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

> ---

>  target/moxie/helper.c | 3 +--

>  1 file changed, 1 insertion(+), 2 deletions(-)

>

> diff --git a/target/moxie/helper.c b/target/moxie/helper.c

> index 2ecee89f11..6890ffd71c 100644

> --- a/target/moxie/helper.c

> +++ b/target/moxie/helper.c

> @@ -36,9 +36,8 @@ void tlb_fill(CPUState *cs, target_ulong addr, MMUAccessType access_type,

>

>      ret = moxie_cpu_handle_mmu_fault(cs, addr, access_type, mmu_idx);

>      if (unlikely(ret)) {

> -        cpu_restore_state(cs, retaddr);

> +        cpu_loop_exit_restore(cs, retaddr);

>      }

> -    cpu_loop_exit(cs);

>  }

>

>  void helper_raise_exception(CPUMoxieState *env, int ex)

> --


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


I suspect this codepath has never been tested. There's another
bug in moxie_cpu_handle_mmu_fault() where it will call
tlb_set_page() even in the "mmu lookup missed, we're
going to throw an exception" codepath.

Is moxie even worth bothering to keep in QEMU? As far as I can tell:
 * the only changes to target/moxie since the target was added in
   2013 have been generic cross-tree changes and cleanups and
   minor bugs found by static analysis etc
 * the last commit signed-off-by the moxie maintainer was
   in March 2013
 * last email to qemu-devel by the maintainer was December 2013
 * as far as I can tell nobody's ever reported a bug to us,
   which is suggestive that it has no users

This target is costing us maintenance effort -- is it actually
useful to anybody ?

thanks
-- PMM
Richard Henderson Dec. 18, 2017, 6:47 p.m. UTC | #2
On 12/15/2017 09:31 AM, Peter Maydell wrote:
> I suspect this codepath has never been tested. There's another

> bug in moxie_cpu_handle_mmu_fault() where it will call

> tlb_set_page() even in the "mmu lookup missed, we're

> going to throw an exception" codepath.


Ah, didn't notice that one, but yes.

> Is moxie even worth bothering to keep in QEMU? As far as I can tell:

>  * the only changes to target/moxie since the target was added in

>    2013 have been generic cross-tree changes and cleanups and

>    minor bugs found by static analysis etc

>  * the last commit signed-off-by the moxie maintainer was

>    in March 2013

>  * last email to qemu-devel by the maintainer was December 2013

>  * as far as I can tell nobody's ever reported a bug to us,

>    which is suggestive that it has no users

> 

> This target is costing us maintenance effort -- is it actually

> useful to anybody ?


I doubt it.  I'd be ok removing it.


r~
diff mbox series

Patch

diff --git a/target/moxie/helper.c b/target/moxie/helper.c
index 2ecee89f11..6890ffd71c 100644
--- a/target/moxie/helper.c
+++ b/target/moxie/helper.c
@@ -36,9 +36,8 @@  void tlb_fill(CPUState *cs, target_ulong addr, MMUAccessType access_type,
 
     ret = moxie_cpu_handle_mmu_fault(cs, addr, access_type, mmu_idx);
     if (unlikely(ret)) {
-        cpu_restore_state(cs, retaddr);
+        cpu_loop_exit_restore(cs, retaddr);
     }
-    cpu_loop_exit(cs);
 }
 
 void helper_raise_exception(CPUMoxieState *env, int ex)