qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Question on pointers in the qemu user space emulation


From: Peter Maydell
Subject: Re: [Qemu-devel] Question on pointers in the qemu user space emulation
Date: Sat, 18 Jan 2014 10:11:25 +0000

On 17 January 2014 19:20, Erik de Castro Lopo <address@hidden> wrote:
> When I implemented the POSIX timer syscalls a little while ago I got
> them working for my specific use case. Since then someone pointed
> out that the implementation was not complete and I'd like to fix
> that. The ticket is here:
>
>     https://bugs.launchpad.net/qemu/+bug/1042388#27
>
> and the guest user space test case here:
>
>     
> https://bugs.launchpad.net/qemu/+bug/1042388/+attachment/3948443/+files/timer_test.c

OK, so the test case is using a sigevent with type SIGEV_THREAD,
which means "Notify the process by invoking sigev_notify_function
 "as if" it were the start function of a new thread." However, this
is not what you need to implement, because that is the libc API,
not the syscall API. The syscall actually being done here is:

timer_create(CLOCK_REALTIME, {0x8331098, 32, SIGEV_THREAD_ID, {8113}},
{0x1}) = 0

(libc creates a thread for purposes of making the function calls,
and then asks the kernel to signal that thread so it knows when
to do the calls).

So all you need to do is implement SIGEV_THREAD_ID
correctly, which should be pretty straightforward (you can let
the host kernel deal with the error checking on the thread
ID, you just need to pass all the information through, I think).

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]