[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] User mode: Handle x86_64 vsyscall
From: |
Jamie Lokier |
Subject: |
Re: [Qemu-devel] [PATCH] User mode: Handle x86_64 vsyscall |
Date: |
Sun, 18 Oct 2009 03:47:35 +0100 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
Laurent Desnogues wrote:
> 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
Yes. It's a fixed address. See the kernel at
linux/arch/x86/kernel/vsyscall_64.c. There are only 3 vsyscall
functions defined: vgettimeofday, vtime and vgetcpu.
Even though it's a statically linked program, I'm not sure if the
above code will work on really old kernels.
The vsyscall page is different from the vdso, which has variable
address, and the address is supplied to Glibc. vdso provides nearly
the same functions in a different way.
-- Jamie