* [Qemu-devel] Stuff.
@ 2004-05-04 21:31 David Woodhouse
2004-05-05 12:15 ` Timo Savola
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: David Woodhouse @ 2004-05-04 21:31 UTC (permalink / raw)
To: qemu-devel
Has anyone considered the possibility of emulating libc, rather than
emulating system calls? That's what em86 used to do for emulating i386
code on Alpha -- rather than letting it run a 'real' non-native libc and
then emulating only syscalls.
I appreciate that syscalls are a far more stable ABI to be emulating,
and there are far fewer structures to convert -- but wouldn't it be
faster to emulate the library itself? Especially if we can extend that
to emulate libX11 too :)
It's cute that I have i386 acroread running in a Mozilla window through
mozplugger. It'd be cuter if I could get Mozilla plugins running in the
_same_ process, rather than in a separate process.
----
Also, why do we do what we do in linux-user/path.c? What does it give us
that couldn't be achieved by stat("$prefix/$filename") in a trivial
path() function? Other than taking for ever to start up when
/usr/gnemul/i386-linux is actually an nfs-mounted root file system from
elsewhere. (When I say forever I mean that literally. We keep following
symlinks recursively).
----
And is it possible to use the gdbstub when emulating userspace, rather
than a whole system? I see my ARM ld.so segfaulting, and I'd like to be
able to work out why.
--
dwmw2
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] Stuff.
2004-05-04 21:31 [Qemu-devel] Stuff David Woodhouse
@ 2004-05-05 12:15 ` Timo Savola
2004-05-05 18:28 ` Fabrice Bellard
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Timo Savola @ 2004-05-05 12:15 UTC (permalink / raw)
To: David Woodhouse; +Cc: qemu-devel
> Has anyone considered the possibility of emulating libc, rather than
> emulating system calls? That's what em86 used to do for emulating i386
> code on Alpha -- rather than letting it run a 'real' non-native libc and
> then emulating only syscalls.
I guess that wouldn't work very well with statically linked
applications. Or when some other C library is used (uClibc).
Also, since the library and application code share global variables, it
would be next to impossible to know what data to convert to different
byte order and when.
> I appreciate that syscalls are a far more stable ABI to be emulating,
> and there are far fewer structures to convert -- but wouldn't it be
> faster to emulate the library itself? Especially if we can extend that
> to emulate libX11 too :)
I don't think the stability is so much of an issue than the size of the
interface.
Timo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] Stuff.
2004-05-04 21:31 [Qemu-devel] Stuff David Woodhouse
2004-05-05 12:15 ` Timo Savola
@ 2004-05-05 18:28 ` Fabrice Bellard
2004-05-05 18:55 ` Fabrice Bellard
2004-05-07 11:33 ` Chris Emerson
3 siblings, 0 replies; 5+ messages in thread
From: Fabrice Bellard @ 2004-05-05 18:28 UTC (permalink / raw)
To: qemu-devel
David Woodhouse wrote:
> Has anyone considered the possibility of emulating libc, rather than
> emulating system calls? That's what em86 used to do for emulating i386
> code on Alpha -- rather than letting it run a 'real' non-native libc and
> then emulating only syscalls.
>
> I appreciate that syscalls are a far more stable ABI to be emulating,
> and there are far fewer structures to convert -- but wouldn't it be
> faster to emulate the library itself? Especially if we can extend that
> to emulate libX11 too :)
Emulating libc would be _very_ difficult (there are thousands of calls
to convert). There were provisions in em86 to do that, but it was never
really used. Moreover, I think the speed up would be small compared to
the complexity of the task.
> It's cute that I have i386 acroread running in a Mozilla window through
> mozplugger. It'd be cuter if I could get Mozilla plugins running in the
> _same_ process, rather than in a separate process.
>
>
> ----
>
> Also, why do we do what we do in linux-user/path.c? What does it give us
> that couldn't be achieved by stat("$prefix/$filename") in a trivial
> path() function? Other than taking for ever to start up when
> /usr/gnemul/i386-linux is actually an nfs-mounted root file system from
> elsewhere. (When I say forever I mean that literally. We keep following
> symlinks recursively).
The goal was to avoid making too many syscalls.
Fabrice.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] Stuff.
2004-05-04 21:31 [Qemu-devel] Stuff David Woodhouse
2004-05-05 12:15 ` Timo Savola
2004-05-05 18:28 ` Fabrice Bellard
@ 2004-05-05 18:55 ` Fabrice Bellard
2004-05-07 11:33 ` Chris Emerson
3 siblings, 0 replies; 5+ messages in thread
From: Fabrice Bellard @ 2004-05-05 18:55 UTC (permalink / raw)
To: qemu-devel
> And is it possible to use the gdbstub when emulating userspace, rather
> than a whole system? I see my ARM ld.so segfaulting, and I'd like to be
> able to work out why.
Adding user space gdbstub support is possible. It is not on the top of
my TODO list, so I won't do it in the near future.
Fabrice.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] Stuff.
2004-05-04 21:31 [Qemu-devel] Stuff David Woodhouse
` (2 preceding siblings ...)
2004-05-05 18:55 ` Fabrice Bellard
@ 2004-05-07 11:33 ` Chris Emerson
3 siblings, 0 replies; 5+ messages in thread
From: Chris Emerson @ 2004-05-07 11:33 UTC (permalink / raw)
To: qemu-devel
On Tue, May 04, 2004 at 10:31:09PM +0100, David Woodhouse wrote:
> Has anyone considered the possibility of emulating libc, rather than
> emulating system calls? That's what em86 used to do for emulating i386
> code on Alpha -- rather than letting it run a 'real' non-native libc
> and then emulating only syscalls.
I did this with my own i386-on-ppc emulator. It's a larger and less
well documented ABI, and can get quite messy. OTOH, most of the
functions are easy and could be generated.
> I appreciate that syscalls are a far more stable ABI to be emulating,
> and there are far fewer structures to convert -- but wouldn't it be
> faster to emulate the library itself?
Probably, but I'd be interested to see some profiling data showing how
much time is actually spent emulating the libc etc. first.
> It's cute that I have i386 acroread running in a Mozilla window
> through mozplugger.
Ooh, I'll have to look into that. Maybe I can have Flash on Linux/PPC
after all...
> It'd be cuter if I could get Mozilla plugins running in the _same_
> process, rather than in a separate process.
You'd need to know the prototypes of all the functions you're calling
ahead of time, though...
Chris
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2004-05-07 11:57 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-04 21:31 [Qemu-devel] Stuff David Woodhouse
2004-05-05 12:15 ` Timo Savola
2004-05-05 18:28 ` Fabrice Bellard
2004-05-05 18:55 ` Fabrice Bellard
2004-05-07 11:33 ` Chris Emerson
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).