From: Helge Deller <del...@gmx.de>

CHECK_MOST_PRIVILEGED() should check the privilege level only when the PSW.P
bit is set.

Signed-off-by: Helge Deller <del...@gmx.de>
---
 target/hppa/translate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/hppa/translate.c b/target/hppa/translate.c
index 7e58775bbf..21c2734a1f 100644
--- a/target/hppa/translate.c
+++ b/target/hppa/translate.c
@@ -604,7 +604,7 @@ static bool gen_illegal(DisasContext *ctx)
 #else
 #define CHECK_MOST_PRIVILEGED(EXCP) \
     do {                                     \
-        if (ctx->privilege != 0) {           \
+        if (ctx->privilege != 0 && (ctx->tb_flags & PSW_P)) { \
             return gen_excp_iir(ctx, EXCP);  \
         }                                    \
     } while (0)
-- 
2.43.0


Reply via email to