diff mbox series

[06/11] target/hppa: ignore DIAG opcode

Message ID 20190311191602.25796-7-svens@stackframe.org (mailing list archive)
State New, archived
Headers show
Series target/hppa patches | expand

Commit Message

Sven Schnelle March 11, 2019, 7:15 p.m. UTC
DIAG is usually only used by diagnostics software as it's CPU
specific. In most of the cases it's better to ignore it and log
a message that it's not implemented.

Signed-off-by: Sven Schnelle <svens@stackframe.org>
---
 target/hppa/insns.decode | 3 +++
 target/hppa/translate.c  | 6 ++++++
 2 files changed, 9 insertions(+)

Comments

Richard Henderson March 12, 2019, 12:22 a.m. UTC | #1
On 3/11/19 12:15 PM, Sven Schnelle wrote:
> +static bool trans_diag(DisasContext *ctx, arg_diag *a)
> +{
> +    qemu_log_mask(LOG_UNIMP, "DIAG opcode ignored\n");
> +    return true;

This needs to free the nullify condition, as with trans_nop.
I've fixed this up while applying.


r~
diff mbox series

Patch

diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode
index 55ff39dd05..098370c2f0 100644
--- a/target/hppa/insns.decode
+++ b/target/hppa/insns.decode
@@ -525,3 +525,6 @@  fmpy_d          001110 ..... ..... 010 ..... ... .....  @f0e_d_3
 fdiv_d          001110 ..... ..... 011 ..... ... .....  @f0e_d_3
 
 xmpyu           001110 ..... ..... 010 .0111 .00 t:5    r1=%ra64 r2=%rb64
+
+# diag
+diag            000101 ----- ----- ---- ---- ---- ----
diff --git a/target/hppa/translate.c b/target/hppa/translate.c
index 7001c2eb80..441f0ea9d6 100644
--- a/target/hppa/translate.c
+++ b/target/hppa/translate.c
@@ -4292,3 +4292,9 @@  void restore_state_to_opc(CPUHPPAState *env, TranslationBlock *tb,
        that the instruction was not nullified.  */
     env->psw_n = 0;
 }
+
+static bool trans_diag(DisasContext *ctx, arg_diag *a)
+{
+    qemu_log_mask(LOG_UNIMP, "DIAG opcode ignored\n");
+    return true;
+}