* [Qemu-devel] qemu-system-sparc uses all host cpu while target system is idle
@ 2006-09-20 9:32 Aurelien Jarno
2006-09-20 12:27 ` WaxDragon
2006-09-20 13:45 ` Paul Brook
0 siblings, 2 replies; 5+ messages in thread
From: Aurelien Jarno @ 2006-09-20 9:32 UTC (permalink / raw)
To: qemu-devel
Hi all,
I have successully installed a Debian Etch for Sparc under qemu (CVS
version), and successfully updated it to unstable. Everything seems to
work correctly, the performances are ok, but I have remarked than
qemu-system-sparc is using all the CPU on the host system, while the
sparc target system is idle. Maybe the problem is in the sparc kernel? I
am using the one from unstable, ie a 2.6.17 kernel.
Any idea?
Thanks,
Aurelien
--
.''`. Aurelien Jarno | GPG: 1024D/F1BCDB73
: :' : Debian developer | Electrical Engineer
`. `' aurel32@debian.org | aurelien@aurel32.net
`- people.debian.org/~aurel32 | www.aurel32.net
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] qemu-system-sparc uses all host cpu while target system is idle
2006-09-20 9:32 [Qemu-devel] qemu-system-sparc uses all host cpu while target system is idle Aurelien Jarno
@ 2006-09-20 12:27 ` WaxDragon
2006-09-20 13:45 ` Paul Brook
1 sibling, 0 replies; 5+ messages in thread
From: WaxDragon @ 2006-09-20 12:27 UTC (permalink / raw)
To: qemu-devel
I've seen this same behaviour with 2.4.x and 2.6.x kernels.
On 9/20/06, Aurelien Jarno <aurelien@aurel32.net> wrote:
> Hi all,
>
> I have successully installed a Debian Etch for Sparc under qemu (CVS
> version), and successfully updated it to unstable. Everything seems to
> work correctly, the performances are ok, but I have remarked than
> qemu-system-sparc is using all the CPU on the host system, while the
> sparc target system is idle. Maybe the problem is in the sparc kernel? I
> am using the one from unstable, ie a 2.6.17 kernel.
>
> Any idea?
>
> Thanks,
> Aurelien
>
> --
> .''`. Aurelien Jarno | GPG: 1024D/F1BCDB73
> : :' : Debian developer | Electrical Engineer
> `. `' aurel32@debian.org | aurelien@aurel32.net
> `- people.debian.org/~aurel32 | www.aurel32.net
>
>
> _______________________________________________
> Qemu-devel mailing list
> Qemu-devel@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/qemu-devel
>
--
22:38 <@WaxDragon> false ^ true
22:39 < false> :(
22:39 < false> dont you think you can XOR me and get away with it! I
always return!
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] qemu-system-sparc uses all host cpu while target system is idle
2006-09-20 9:32 [Qemu-devel] qemu-system-sparc uses all host cpu while target system is idle Aurelien Jarno
2006-09-20 12:27 ` WaxDragon
@ 2006-09-20 13:45 ` Paul Brook
2006-09-20 15:48 ` [Qemu-devel] qemu-system-sparc uses all host cpu while targetsystem " Blue Swirl
1 sibling, 1 reply; 5+ messages in thread
From: Paul Brook @ 2006-09-20 13:45 UTC (permalink / raw)
To: qemu-devel
On Wednesday 20 September 2006 10:32, Aurelien Jarno wrote:
> Hi all,
>
> I have successully installed a Debian Etch for Sparc under qemu (CVS
> version), and successfully updated it to unstable. Everything seems to
> work correctly, the performances are ok, but I have remarked than
> qemu-system-sparc is using all the CPU on the host system, while the
> sparc target system is idle. Maybe the problem is in the sparc kernel? I
> am using the one from unstable, ie a 2.6.17 kernel.
CPU suspend is not implemented for sparc guests.
Unlike most other targets, suspending the CPU is controlled by the system
chipset, not by an instruction on the CPU. See slavio_misc.c
Paul
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] qemu-system-sparc uses all host cpu while targetsystem is idle
2006-09-20 13:45 ` Paul Brook
@ 2006-09-20 15:48 ` Blue Swirl
2006-09-20 18:44 ` Aurelien Jarno
0 siblings, 1 reply; 5+ messages in thread
From: Blue Swirl @ 2006-09-20 15:48 UTC (permalink / raw)
To: qemu-devel
>CPU suspend is not implemented for sparc guests.
>Unlike most other targets, suspending the CPU is controlled by the system
>chipset, not by an instruction on the CPU. See slavio_misc.c
Suspending is disabled, because it crashes qemu. It can be tested by
tweaking slavio_misc.c and renaming the device in OpenBIOS from
xxxpower-management to power-management. I can't see why it should crash,
the implementation is very straightforward. Or maybe halting the CPU should
be delayed until the TB is finished executing and halt only from main loop?
_________________________________________________________________
Don't just search. Find. Check out the new MSN Search!
http://search.msn.click-url.com/go/onm00200636ave/direct/01/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] qemu-system-sparc uses all host cpu while targetsystem is idle
2006-09-20 15:48 ` [Qemu-devel] qemu-system-sparc uses all host cpu while targetsystem " Blue Swirl
@ 2006-09-20 18:44 ` Aurelien Jarno
0 siblings, 0 replies; 5+ messages in thread
From: Aurelien Jarno @ 2006-09-20 18:44 UTC (permalink / raw)
To: qemu-devel
On Wed, Sep 20, 2006 at 05:48:48PM +0200, Blue Swirl wrote:
> >CPU suspend is not implemented for sparc guests.
> >Unlike most other targets, suspending the CPU is controlled by the system
> >chipset, not by an instruction on the CPU. See slavio_misc.c
>
> Suspending is disabled, because it crashes qemu. It can be tested by
> tweaking slavio_misc.c and renaming the device in OpenBIOS from
> xxxpower-management to power-management. I can't see why it should crash,
> the implementation is very straightforward. Or maybe halting the CPU should
> be delayed until the TB is finished executing and halt only from main loop?
>
Please find below a patch that "works". It is probably wrong as I wrote it
by copying code from other architectures and trying until it works. Well
I am however convinced of two things:
- "return EXCP_HALTED;" causes the crash. By removing this line qemu
doesn't crash anymore, but the patch does not work as expected
(freeze of the target).
- The interrupt should be cleared, if not the target freeze.
Now the host CPU is not used at 100% when the Sparc target is idle. I am
using it for about one our with a Debian unstable, and I am writing this
mail from this emulated system.
Ah yes, you aslo need to the trivial patch to openbios.
Bye,
Aurelien
Index: hw/slavio_misc.c
===================================================================
RCS file: /sources/qemu/qemu/hw/slavio_misc.c,v
retrieving revision 1.3
diff -u -r1.3 slavio_misc.c
--- hw/slavio_misc.c 5 Dec 2005 20:31:52 -0000 1.3
+++ hw/slavio_misc.c 20 Sep 2006 18:16:29 -0000
@@ -123,7 +123,7 @@
break;
case 0xa000000:
MISC_DPRINTF("Write power management %2.2x\n", val & 0xff);
-#if 0
+#if 1
// XXX almost works
cpu_interrupt(cpu_single_env, CPU_INTERRUPT_HALT);
#endif
Index: cpu-exec.c
===================================================================
RCS file: /sources/qemu/qemu/cpu-exec.c,v
retrieving revision 1.84
diff -u -r1.84 cpu-exec.c
--- cpu-exec.c 29 Jul 2006 19:09:31 -0000 1.84
+++ cpu-exec.c 20 Sep 2006 18:16:30 -0000
@@ -548,8 +548,10 @@
//do_interrupt(0, 0, 0, 0, 0);
env->interrupt_request &= ~CPU_INTERRUPT_TIMER;
} else if (interrupt_request & CPU_INTERRUPT_HALT) {
- env1->halted = 1;
- return EXCP_HALTED;
+ env->interrupt_request &= ~CPU_INTERRUPT_HALT;
+ env->halted = 1;
+ env->exception_index = EXCP_HLT;
+ cpu_loop_exit();
}
#elif defined(TARGET_ARM)
if (interrupt_request & CPU_INTERRUPT_FIQ
--
.''`. Aurelien Jarno | GPG: 1024D/F1BCDB73
: :' : Debian developer | Electrical Engineer
`. `' aurel32@debian.org | aurelien@aurel32.net
`- people.debian.org/~aurel32 | www.aurel32.net
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-09-20 18:46 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-20 9:32 [Qemu-devel] qemu-system-sparc uses all host cpu while target system is idle Aurelien Jarno
2006-09-20 12:27 ` WaxDragon
2006-09-20 13:45 ` Paul Brook
2006-09-20 15:48 ` [Qemu-devel] qemu-system-sparc uses all host cpu while targetsystem " Blue Swirl
2006-09-20 18:44 ` Aurelien Jarno
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).