Message ID | 20240207182023.36316-11-deller@kernel.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | target/hppa: Enhancements and fixes | expand |
On 2/7/24 08:20, deller@kernel.org wrote: > From: Helge Deller <deller@gmx.de> > > CHECK_MOST_PRIVILEGED() should check the privilege level only when the PSW.P > bit is set. > > Signed-off-by: Helge Deller <deller@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) PSW_P is documented as applying only to protection identifiers. I do not believe this to be correct at all. r~
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)