* [Qemu-devel] [PATCH] m68: fix exception stack frame for 68000
@ 2018-04-13 11:12 Pavel Dovgalyuk
2018-04-13 12:43 ` Laurent Vivier
0 siblings, 1 reply; 3+ messages in thread
From: Pavel Dovgalyuk @ 2018-04-13 11:12 UTC (permalink / raw)
To: qemu-devel; +Cc: maria.klimushenkova, dovgaluk, laurent, pavel.dovgaluk
68000 CPUs do not save format in the exception stack frame.
This patch adds feature checking to prevent format saving for 68000.
m68k_ret() already includes this modification, this patch fixes
the exception processing function too.
Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
---
target/m68k/op_helper.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/target/m68k/op_helper.c b/target/m68k/op_helper.c
index 3a7f7f2..e367133 100644
--- a/target/m68k/op_helper.c
+++ b/target/m68k/op_helper.c
@@ -301,8 +301,11 @@ static inline void do_stack_frame(CPUM68KState *env, uint32_t *sp,
cpu_stl_kernel(env, *sp, addr);
break;
}
- *sp -= 2;
- cpu_stw_kernel(env, *sp, (format << 12) + (cs->exception_index << 2));
+ if (m68k_feature(env, M68K_FEATURE_QUAD_MULDIV)) {
+ /* all except 68000 */
+ *sp -= 2;
+ cpu_stw_kernel(env, *sp, (format << 12) + (cs->exception_index << 2));
+ }
*sp -= 4;
cpu_stl_kernel(env, *sp, retaddr);
*sp -= 2;
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] m68: fix exception stack frame for 68000
2018-04-13 11:12 [Qemu-devel] [PATCH] m68: fix exception stack frame for 68000 Pavel Dovgalyuk
@ 2018-04-13 12:43 ` Laurent Vivier
2018-04-13 13:12 ` Pavel Dovgalyuk
0 siblings, 1 reply; 3+ messages in thread
From: Laurent Vivier @ 2018-04-13 12:43 UTC (permalink / raw)
To: Pavel Dovgalyuk, qemu-devel; +Cc: maria.klimushenkova, dovgaluk
Le 13/04/2018 à 13:12, Pavel Dovgalyuk a écrit :
> 68000 CPUs do not save format in the exception stack frame.
> This patch adds feature checking to prevent format saving for 68000.
> m68k_ret() already includes this modification, this patch fixes
> the exception processing function too.
>
> Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
> ---
> target/m68k/op_helper.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/target/m68k/op_helper.c b/target/m68k/op_helper.c
> index 3a7f7f2..e367133 100644
> --- a/target/m68k/op_helper.c
> +++ b/target/m68k/op_helper.c
> @@ -301,8 +301,11 @@ static inline void do_stack_frame(CPUM68KState *env, uint32_t *sp,
> cpu_stl_kernel(env, *sp, addr);
> break;
> }
> - *sp -= 2;
> - cpu_stw_kernel(env, *sp, (format << 12) + (cs->exception_index << 2));
> + if (m68k_feature(env, M68K_FEATURE_QUAD_MULDIV)) {
> + /* all except 68000 */
> + *sp -= 2;
> + cpu_stw_kernel(env, *sp, (format << 12) + (cs->exception_index << 2));
> + }
> *sp -= 4;
> cpu_stl_kernel(env, *sp, retaddr);
> *sp -= 2;
>
To be the exact counterpart of m68k_rte(), I think you should include
the "switch () { }" into the "if () { }".
Thanks,
Laurent
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] m68: fix exception stack frame for 68000
2018-04-13 12:43 ` Laurent Vivier
@ 2018-04-13 13:12 ` Pavel Dovgalyuk
0 siblings, 0 replies; 3+ messages in thread
From: Pavel Dovgalyuk @ 2018-04-13 13:12 UTC (permalink / raw)
To: 'Laurent Vivier', 'Pavel Dovgalyuk', qemu-devel
Cc: maria.klimushenkova
> From: Laurent Vivier [mailto:laurent@vivier.eu]
> Le 13/04/2018 à 13:12, Pavel Dovgalyuk a écrit :
> > 68000 CPUs do not save format in the exception stack frame.
> > This patch adds feature checking to prevent format saving for 68000.
> > m68k_ret() already includes this modification, this patch fixes
> > the exception processing function too.
> >
> > Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
> > ---
> > target/m68k/op_helper.c | 7 +++++--
> > 1 file changed, 5 insertions(+), 2 deletions(-)
> >
> > diff --git a/target/m68k/op_helper.c b/target/m68k/op_helper.c
> > index 3a7f7f2..e367133 100644
> > --- a/target/m68k/op_helper.c
> > +++ b/target/m68k/op_helper.c
> > @@ -301,8 +301,11 @@ static inline void do_stack_frame(CPUM68KState *env, uint32_t *sp,
> > cpu_stl_kernel(env, *sp, addr);
> > break;
> > }
> > - *sp -= 2;
> > - cpu_stw_kernel(env, *sp, (format << 12) + (cs->exception_index << 2));
> > + if (m68k_feature(env, M68K_FEATURE_QUAD_MULDIV)) {
> > + /* all except 68000 */
> > + *sp -= 2;
> > + cpu_stw_kernel(env, *sp, (format << 12) + (cs->exception_index << 2));
> > + }
> > *sp -= 4;
> > cpu_stl_kernel(env, *sp, retaddr);
> > *sp -= 2;
> >
>
> To be the exact counterpart of m68k_rte(), I think you should include
> the "switch () { }" into the "if () { }".
That's right, thank you.
Pavel Dovgalyuk
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-04-13 13:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-13 11:12 [Qemu-devel] [PATCH] m68: fix exception stack frame for 68000 Pavel Dovgalyuk
2018-04-13 12:43 ` Laurent Vivier
2018-04-13 13:12 ` Pavel Dovgalyuk
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).