From: Leon Alrae <leon.alrae@imgtec.com>
To: Serge Vakulenko <serge@vak.ru>, qemu-devel@nongnu.org
Cc: Aurelien Jarno <aurelien@aurel32.net>
Subject: Re: [Qemu-devel] [PATCH pic32 2/7] Stop simulation when processor is suspended forever by WAIT instruction with interrupts disabled.
Date: Tue, 30 Jun 2015 15:10:50 +0100 [thread overview]
Message-ID: <5592A36A.1090608@imgtec.com> (raw)
In-Reply-To: <CANacOGXM+7Zr=rpyGV-kvmD6FsF4JXUMZQCwknzDP7frug2GHA@mail.gmail.com>
Hi Serge,
On 30/06/2015 06:02, Serge Vakulenko wrote:
> Signed-off-by: Serge Vakulenko <serge@vak.ru>
> ---
> target-mips/op_helper.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/target-mips/op_helper.c b/target-mips/op_helper.c
> index 2a9ddff..1b7caeb 100644
> --- a/target-mips/op_helper.c
> +++ b/target-mips/op_helper.c
> @@ -22,6 +22,7 @@
> #include "exec/helper-proto.h"
> #include "exec/cpu_ldst.h"
> #include "sysemu/kvm.h"
> +#include "sysemu/sysemu.h"
>
> #ifndef CONFIG_USER_ONLY
> static inline void cpu_mips_tlb_flush (CPUMIPSState *env, int flush_global);
> @@ -2235,6 +2236,12 @@ void helper_wait(CPUMIPSState *env)
> {
> CPUState *cs = CPU(mips_env_get_cpu(env));
>
> +#ifndef CONFIG_USER_ONLY
> + if (!(env->CP0_Status & (1 << CP0St_IE))) {
> + /* WAIT instruction with interrupts disabled - halt the simulation. */
> + qemu_system_shutdown_request();
> + }
> +#endif
Why do you want to stop the simulation, wouldn't it be beneficial to leave it
running? For debugging for example, the user would be still able to inspect
the state, that could help to find a clue why CPU got suspended forever.
Also, if we take into account implementations (currently not supported in
QEMU) where CPU can be woken up by a disabled interrupt (the Config7.WII bit
in P5600 for example), then this won't be correct.
Thanks,
Leon
next prev parent reply other threads:[~2015-06-30 14:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-30 5:02 [Qemu-devel] [PATCH pic32 2/7] Stop simulation when processor is suspended forever by WAIT instruction with interrupts disabled Serge Vakulenko
2015-06-30 14:10 ` Leon Alrae [this message]
2015-06-30 18:08 ` Peter Crosthwaite
2015-07-01 1:57 ` Serge Vakulenko
2015-07-01 2:21 ` Peter Crosthwaite
2015-07-01 20:30 ` Serge Vakulenko
2015-07-09 16:29 ` Christopher Covington
2015-07-11 5:35 ` Serge Vakulenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5592A36A.1090608@imgtec.com \
--to=leon.alrae@imgtec.com \
--cc=aurelien@aurel32.net \
--cc=qemu-devel@nongnu.org \
--cc=serge@vak.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.