[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] linux-user: fix wait* syscall status returns
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH] linux-user: fix wait* syscall status returns |
Date: |
Wed, 23 Nov 2011 23:48:43 +0000 |
On 23 November 2011 23:31, Alexander Graf <address@hidden> wrote:
> If it was the same value before, it will still be the same value in guest
> memory.
>
> get_guest_s32(status, status_ptr);
> old_status = status;
> wait(...)
> if (old_status != status) {
> status = convert_status(status);
> put_guest_s32(status, status_ptr);
> }
Picking some concrete numbers as an illustration; obviously
they're not really sensible status values:
Suppose guest memory contains the value 1, and that
convert_status(1) == 2. Now if you come out of wait()
and status == 1 (ie old_status == status), then either:
(a) wait() didn't write to status => do nothing
(b) wait() did write to status => since convert_status(1) == 2
we need to write 2 to guest memory
For this approach to work you have to have a conversion
function from guest to host status, I think.
-- PMM