diff mbox

[01/13] target-s390x: fix exception for invalid operation code

Message ID 1433193897-24110-2-git-send-email-aurelien@aurel32.net
State New
Headers show

Commit Message

Aurelien Jarno June 1, 2015, 9:24 p.m. UTC
When an operation code is not recognized (ie invalid instruction) an
operation exception should be generated instead of a specification
exception. The latter is for valid opcode, with invalid operands or
modifiers.

This give a very basic GDB support in the guest, as it uses the invalid
opcode 0x0001 to generate a trap.

Cc: Alexander Graf <agraf@suse.de>
Cc: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 target-s390x/translate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Richard Henderson June 2, 2015, 4:41 p.m. UTC | #1
On 06/01/2015 02:24 PM, Aurelien Jarno wrote:
> When an operation code is not recognized (ie invalid instruction) an
> operation exception should be generated instead of a specification
> exception. The latter is for valid opcode, with invalid operands or
> modifiers.
> 
> This give a very basic GDB support in the guest, as it uses the invalid
> opcode 0x0001 to generate a trap.
> 
> Cc: Alexander Graf <agraf@suse.de>
> Cc: Richard Henderson <rth@twiddle.net>
> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
> ---
>  target-s390x/translate.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Richard Henderson <rth@twiddle.net>


r~
diff mbox

Patch

diff --git a/target-s390x/translate.c b/target-s390x/translate.c
index d508bc2..c7ebd21 100644
--- a/target-s390x/translate.c
+++ b/target-s390x/translate.c
@@ -320,7 +320,7 @@  static void gen_program_exception(DisasContext *s, int code)
 
 static inline void gen_illegal_opcode(DisasContext *s)
 {
-    gen_program_exception(s, PGM_SPECIFICATION);
+    gen_program_exception(s, PGM_OPERATION);
 }
 
 #ifndef CONFIG_USER_ONLY