From: Christopher Covington <cov@codeaurora.org>
To: Serge Vakulenko <serge@vak.ru>,
Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Cc: Leon Alrae <leon.alrae@imgtec.com>,
"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
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: Thu, 09 Jul 2015 12:29:08 -0400 [thread overview]
Message-ID: <559EA154.30406@codeaurora.org> (raw)
In-Reply-To: <CANacOGW_vCtAnxFXKLtKwRh5QeVC_2WaAr11p3sq=t34WW6v=w@mail.gmail.com>
On 06/30/2015 09:57 PM, Serge Vakulenko wrote:
> Hi Peter and Leon,
>
> With a bit of thinking, I agree, that the question of session
> termination on WAIT instruction is quite complicated in case of
> multi-core system, background i/o activity, mipsR6 core etc. So I'm
> going to find another solution for the task. What I essentially want
> here is to stop the simulator when the target Unix system is halted,
> like:
>
> $ /usr/local/qemu-mips/bin/qemu-system-mipsel -M pic32mx7-max32
> -nographic -monitor none -serial stdio -bios boot-max32.hex -kernel
> unix.hex -sd sdcard.img
> Board: chipKIT Max32
> Processor: M4K
> RAM size: 128 kbytes
> Load file: 'boot-max32.hex', 6720 bytes
> Load file: 'unix.hex', 144992 bytes
> Card0 image 'sdcard.img', 102888 kbytes
> [...]
> 2.11 BSD UNIX (pic32) (console)
>
> login: root
> Password:
> Welcome to RetroBSD!
> erase, kill ^U, intr ^C
> # halt
> killing processes... done
> syncing disks... done
> halted
> $ _ <-- QEMU terminated
>
> On BSD, the halt command uses reboot(RB_HALT) system call to terminate
> the operating system. It essentially results in an endless loop on
> wait instruction with interrupts disabled., like "for(;;) {
> asm("wait"); }". For pic32 it makes little sense to continue
> simulation in this case.
>
> Fortunately, I've found a solution which does not require modification
> of generic code. Everything can be done in the platform-specific part.
Why doesn't the OS do more than busy-loop in halt()? For example poke a
memory-mapped register, or make a firmware or semihosting call?
Chris
--
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
next prev parent reply other threads:[~2015-07-09 16:29 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
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 [this message]
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=559EA154.30406@codeaurora.org \
--to=cov@codeaurora.org \
--cc=aurelien@aurel32.net \
--cc=leon.alrae@imgtec.com \
--cc=peter.crosthwaite@xilinx.com \
--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.