qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] /* XXX: suppress this hack */
@ 2004-10-10 17:59 Magnus Damm
  2004-10-10 18:23 ` Johannes Schindelin
  0 siblings, 1 reply; 4+ messages in thread
From: Magnus Damm @ 2004-10-10 17:59 UTC (permalink / raw)
  To: qemu-devel

Hi,

Better performance for i386-softmmu under PowerPC? Yes, please!
At line 96 in "dyngen-exec.h" sits the following code:

/* XXX: suppress this hack */
#if defined(CONFIG_USER_ONLY)
#define AREG4 "r16"
#define AREG5 "r17"
#define AREG6 "r18"
#define AREG7 "r19"
#define AREG8 "r20"
#define AREG9 "r21"
#define AREG10 "r22"
#define AREG11 "r23"
#endif

I would like to "suppress that hack", ie make sure that AREG4 to AREG11
gets defined for i386-softmmu. Someone that knows the code - what needs
to be done? Just removing the ifdef does not work for sure. Is it some
issue with setjmp()/longjmp()? I'm willing to set aside some hours to
fix this if someone who knows points me in the right direction.

Thanks!

/ magnus

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

* Re: [Qemu-devel] /* XXX: suppress this hack */
  2004-10-10 17:59 [Qemu-devel] /* XXX: suppress this hack */ Magnus Damm
@ 2004-10-10 18:23 ` Johannes Schindelin
  2004-10-10 18:50   ` Magnus Damm
  0 siblings, 1 reply; 4+ messages in thread
From: Johannes Schindelin @ 2004-10-10 18:23 UTC (permalink / raw)
  To: qemu-devel

Hi,

On Sun, 10 Oct 2004, Magnus Damm wrote:

> Hi,
>
> Better performance for i386-softmmu under PowerPC? Yes, please!
> At line 96 in "dyngen-exec.h" sits the following code:
>
> /* XXX: suppress this hack */
> #if defined(CONFIG_USER_ONLY)
> #define AREG4 "r16"
> #define AREG5 "r17"
> #define AREG6 "r18"
> #define AREG7 "r19"
> #define AREG8 "r20"
> #define AREG9 "r21"
> #define AREG10 "r22"
> #define AREG11 "r23"
> #endif
>
> I would like to "suppress that hack", ie make sure that AREG4 to AREG11
> gets defined for i386-softmmu. Someone that knows the code - what needs
> to be done? Just removing the ifdef does not work for sure. Is it some
> issue with setjmp()/longjmp()? I'm willing to set aside some hours to
> fix this if someone who knows points me in the right direction.

It's all about ABIs: see

http://www-106.ibm.com/developerworks/linux/library/l-ppc/#h4

You want all those registers you use to be volatile, i.e. every function
which wants to use one of those has to make sure that their original
contents gets restored before returning.

Hth,
Dscho

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

* Re: [Qemu-devel] /* XXX: suppress this hack */
  2004-10-10 18:23 ` Johannes Schindelin
@ 2004-10-10 18:50   ` Magnus Damm
  2004-10-11 12:51     ` Johannes Schindelin
  0 siblings, 1 reply; 4+ messages in thread
From: Magnus Damm @ 2004-10-10 18:50 UTC (permalink / raw)
  To: qemu-devel

Hello there, thanks for the reply!

[snip]

> > I would like to "suppress that hack", ie make sure that AREG4 to AREG11
> > gets defined for i386-softmmu. Someone that knows the code - what needs
> > to be done? Just removing the ifdef does not work for sure. Is it some
> > issue with setjmp()/longjmp()? I'm willing to set aside some hours to
> > fix this if someone who knows points me in the right direction.
> 
> It's all about ABIs: see
> 
> http://www-106.ibm.com/developerworks/linux/library/l-ppc/#h4
> 
> You want all those registers you use to be volatile, i.e. every function
> which wants to use one of those has to make sure that their original
> contents gets restored before returning.

Yeah, registers "r3" to "r12" are "caller save", ie these registers must
be saved before a function is called. But what about "r16" to "r23",
these are currently only used when CONFIG_USER_ONLY is set - I thought
that they were supposed to be saved by the called function prior use,
"callee save". But how does that affect the softmmu code in a bad way
but the user code works? Any ideas?

Thanks!

/ magnus

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

* Re: [Qemu-devel] /* XXX: suppress this hack */
  2004-10-10 18:50   ` Magnus Damm
@ 2004-10-11 12:51     ` Johannes Schindelin
  0 siblings, 0 replies; 4+ messages in thread
From: Johannes Schindelin @ 2004-10-11 12:51 UTC (permalink / raw)
  To: qemu-devel

Hi,

On Sun, 10 Oct 2004, Magnus Damm wrote:

> Yeah, registers "r3" to "r12" are "caller save", ie these registers must
> be saved before a function is called. But what about "r16" to "r23",
> these are currently only used when CONFIG_USER_ONLY is set - I thought
> that they were supposed to be saved by the called function prior use,
> "callee save". But how does that affect the softmmu code in a bad way
> but the user code works? Any ideas?

*scratcheshishead* I cannot think of one way that code should work in user
mode... IMHO there is no protection to those registers when calling libc
or a syscall.

Ciao,
Dscho

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

end of thread, other threads:[~2004-10-11 12:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-10 17:59 [Qemu-devel] /* XXX: suppress this hack */ Magnus Damm
2004-10-10 18:23 ` Johannes Schindelin
2004-10-10 18:50   ` Magnus Damm
2004-10-11 12:51     ` Johannes Schindelin

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).