qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] m68k: fix 'bkpt' instruction in softmmu mode
@ 2023-01-26 12:52 Laurent Vivier
  2023-01-26 15:28 ` Richard Henderson
  2023-01-26 22:12 ` Mark Cave-Ayland
  0 siblings, 2 replies; 4+ messages in thread
From: Laurent Vivier @ 2023-01-26 12:52 UTC (permalink / raw)
  To: qemu-devel; +Cc: Laurent Vivier

In linux-user mode, 'bkpt' generates an EXP_DEBUG exception to allow
QEMU gdb server to intercept and manage the operation with an external
debugger.

In softmmu mode, the instruction must generate an illegal instruction
exception as it is on real hardware to be managed by the kernel.

Buglink: https://gitlab.com/qemu-project/qemu/-/issues/146
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 target/m68k/translate.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/target/m68k/translate.c b/target/m68k/translate.c
index 18418312b14b..31178c3b1d17 100644
--- a/target/m68k/translate.c
+++ b/target/m68k/translate.c
@@ -2774,7 +2774,11 @@ DISAS_INSN(swap)
 
 DISAS_INSN(bkpt)
 {
+#if defined(CONFIG_SOFTMMU)
+    gen_exception(s, s->base.pc_next, EXCP_ILLEGAL);
+#else
     gen_exception(s, s->base.pc_next, EXCP_DEBUG);
+#endif
 }
 
 DISAS_INSN(pea)
-- 
2.38.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] m68k: fix 'bkpt' instruction in softmmu mode
  2023-01-26 12:52 [PATCH] m68k: fix 'bkpt' instruction in softmmu mode Laurent Vivier
@ 2023-01-26 15:28 ` Richard Henderson
  2023-01-26 22:12 ` Mark Cave-Ayland
  1 sibling, 0 replies; 4+ messages in thread
From: Richard Henderson @ 2023-01-26 15:28 UTC (permalink / raw)
  To: Laurent Vivier, qemu-devel

On 1/26/23 02:52, Laurent Vivier wrote:
> In linux-user mode, 'bkpt' generates an EXP_DEBUG exception to allow
> QEMU gdb server to intercept and manage the operation with an external
> debugger.
> 
> In softmmu mode, the instruction must generate an illegal instruction
> exception as it is on real hardware to be managed by the kernel.
> 
> Buglink:https://gitlab.com/qemu-project/qemu/-/issues/146
> Signed-off-by: Laurent Vivier<laurent@vivier.eu>
> ---
>   target/m68k/translate.c | 4 ++++
>   1 file changed, 4 insertions(+)

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

r~


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] m68k: fix 'bkpt' instruction in softmmu mode
  2023-01-26 12:52 [PATCH] m68k: fix 'bkpt' instruction in softmmu mode Laurent Vivier
  2023-01-26 15:28 ` Richard Henderson
@ 2023-01-26 22:12 ` Mark Cave-Ayland
  2023-01-27 10:50   ` Laurent Vivier
  1 sibling, 1 reply; 4+ messages in thread
From: Mark Cave-Ayland @ 2023-01-26 22:12 UTC (permalink / raw)
  To: Laurent Vivier, qemu-devel

On 26/01/2023 12:52, Laurent Vivier wrote:

> In linux-user mode, 'bkpt' generates an EXP_DEBUG exception to allow
> QEMU gdb server to intercept and manage the operation with an external
> debugger.
> 
> In softmmu mode, the instruction must generate an illegal instruction
> exception as it is on real hardware to be managed by the kernel.
> 
> Buglink: https://gitlab.com/qemu-project/qemu/-/issues/146

Hi Laurent,

I think this should be https://gitlab.com/qemu-project/qemu/-/issues/1462?

> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
> ---
>   target/m68k/translate.c | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/target/m68k/translate.c b/target/m68k/translate.c
> index 18418312b14b..31178c3b1d17 100644
> --- a/target/m68k/translate.c
> +++ b/target/m68k/translate.c
> @@ -2774,7 +2774,11 @@ DISAS_INSN(swap)
>   
>   DISAS_INSN(bkpt)
>   {
> +#if defined(CONFIG_SOFTMMU)
> +    gen_exception(s, s->base.pc_next, EXCP_ILLEGAL);
> +#else
>       gen_exception(s, s->base.pc_next, EXCP_DEBUG);
> +#endif
>   }
>   
>   DISAS_INSN(pea)


ATB,

Mark.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] m68k: fix 'bkpt' instruction in softmmu mode
  2023-01-26 22:12 ` Mark Cave-Ayland
@ 2023-01-27 10:50   ` Laurent Vivier
  0 siblings, 0 replies; 4+ messages in thread
From: Laurent Vivier @ 2023-01-27 10:50 UTC (permalink / raw)
  To: Mark Cave-Ayland, qemu-devel

Le 26/01/2023 à 23:12, Mark Cave-Ayland a écrit :
> On 26/01/2023 12:52, Laurent Vivier wrote:
> 
>> In linux-user mode, 'bkpt' generates an EXP_DEBUG exception to allow
>> QEMU gdb server to intercept and manage the operation with an external
>> debugger.
>>
>> In softmmu mode, the instruction must generate an illegal instruction
>> exception as it is on real hardware to be managed by the kernel.
>>
>> Buglink: https://gitlab.com/qemu-project/qemu/-/issues/146
> 
> Hi Laurent,
> 
> I think this should be https://gitlab.com/qemu-project/qemu/-/issues/1462?

oh, yes, thank you

Laurent



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-01-27 10:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-26 12:52 [PATCH] m68k: fix 'bkpt' instruction in softmmu mode Laurent Vivier
2023-01-26 15:28 ` Richard Henderson
2023-01-26 22:12 ` Mark Cave-Ayland
2023-01-27 10:50   ` Laurent Vivier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).