From: Laurent Desnogues <laurent.desnogues@gmail.com>
To: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] User mode: Handle x86_64 vsyscall
Date: Sun, 18 Oct 2009 02:16:33 +0200 [thread overview]
Message-ID: <761ea48b0910171716p1243c63cqac0f8a4085f84c9b@mail.gmail.com> (raw)
In-Reply-To: <20091017195726.GB9922@laped.iglesias.mooo.com>
Hi Edgar,
On Sat, Oct 17, 2009 at 9:57 PM, Edgar E. Iglesias
<edgar.iglesias@gmail.com> wrote:
>
> It feels a bit strange to have the CPU model know about linux vsyscalls.
> Did you consider having the linux-user loader pass a qemu version of the
> x86_64 vdso to the guest through the auxvector? That version could probably
> implement the vsyscalls by translating them into syscalls with x86_64 code.
> It probably doesn't even need to do that btw, just make sure to fill it
> with syscall insns to raise exceptions and then have the linux-user/ code
> treat syscalls with eip from vdso page differently. That way the CPU model
> doesn't need to know about vdso and you can implement vsyscalls that may
> need magic interactions with qemu.
>
> Or does that not work for some reason? Performance?
> Are there maybe old binaries that don't look in the auxvector and just assume
> a fixed address for the vdso?
A recent compiler (gcc 4.4.0) produces this code for a statically
compiled program:
00000000005779e0 <time>:
5779e0: 48 83 ec 08 sub $0x8,%rsp
5779e4: 48 c7 c0 00 04 60 ff mov $0xffffffffff600400,%rax
5779eb: ff d0 callq *%rax
5779ed: 48 83 c4 08 add $0x8,%rsp
5779f1: c3 retq
I never heard of "auxvector" before. Is this related to what is
discussed here?
http://manugarg.googlepages.com/aboutelfauxiliaryvectors
I dumped 4KB mapped at AT_SYSINFO_EHDR and processed
it through readelf. Nothing matches the address above:
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
1: ffffffffff70030c 0 SECTION LOCAL DEFAULT 7
2: ffffffffff700800 74 FUNC WEAK DEFAULT 12
clock_gettime@@LINUX_2.6
3: 0000000000000000 0 OBJECT GLOBAL DEFAULT ABS LINUX_2.6
4: ffffffffff7006c0 137 FUNC GLOBAL DEFAULT 12
__vdso_gettimeofday@@LINUX_2.6
5: ffffffffff700850 61 FUNC GLOBAL DEFAULT 12
__vdso_getcpu@@LINUX_2.6
6: ffffffffff7006c0 137 FUNC WEAK DEFAULT 12
gettimeofday@@LINUX_2.6
7: ffffffffff700850 61 FUNC WEAK DEFAULT 12 getcpu@@LINUX_2.6
8: ffffffffff700800 74 FUNC GLOBAL DEFAULT 12
__vdso_clock_gettime@@LINUX_2.6
I probably missed your point :-)
Thanks,
Laurent
next prev parent reply other threads:[~2009-10-18 0:16 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-11 15:14 [Qemu-devel] [PATCH] User mode: Handle x86_64 vsyscall Laurent Desnogues
2009-10-17 15:42 ` [Qemu-devel] " Laurent Desnogues
2009-10-17 19:57 ` [Qemu-devel] " Edgar E. Iglesias
2009-10-18 0:16 ` Laurent Desnogues [this message]
2009-10-18 2:47 ` Jamie Lokier
2009-10-18 11:23 ` Laurent Desnogues
2009-10-18 3:09 ` Jamie Lokier
2009-10-18 7:17 ` Edgar E. Iglesias
2009-10-18 11:29 ` Laurent Desnogues
2010-02-04 22:15 ` Stefan Weil
2010-02-05 22:57 ` Stefan Weil
2010-02-06 1:37 ` Laurent Desnogues
2010-02-06 7:49 ` Stefan Weil
2010-02-06 23:50 ` Laurent Desnogues
2010-02-07 0:22 ` Jamie Lokier
2010-02-07 3:11 ` malc
2010-02-07 10:06 ` Laurent Desnogues
2010-02-07 23:18 ` Richard Henderson
2010-02-08 14:57 ` Vince Weaver
2010-02-06 20:12 ` Richard Henderson
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=761ea48b0910171716p1243c63cqac0f8a4085f84c9b@mail.gmail.com \
--to=laurent.desnogues@gmail.com \
--cc=edgar.iglesias@gmail.com \
--cc=qemu-devel@nongnu.org \
/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 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).