qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v1] kvm: unsigned datatype in ioctl wrapper


From: Peter Maydell
Subject: Re: [PATCH v1] kvm: unsigned datatype in ioctl wrapper
Date: Thu, 2 Sep 2021 08:38:00 +0100

On Wed, 1 Sept 2021 at 22:34, Johannes Stoelp
<johannes.stoelp@googlemail.com> wrote:
>
> Change the data type of the ioctl _request_ argument from 'int' to
> 'unsigned long' for the kvm ioctl wrappers.
>
> POSIX defines the request argument as 'int' but the glibc defines the ioctl
> call as follows
>     int ioctl (int fd, unsigned long int request, ...);
>
> Requests with the 0x8000_0000 bit set will be sign-extended.
> Fortunately the Linux Kernel truncates the upper 32bit of the request on
> 64bit machines [1].
>
> On x86_64 one such example is the KVM_IRQ_LINE_STATUS request.
> But requests with the _IOC_READ direction bit set, will have the high
> bit set.
>
> [1]: https://sourceware.org/bugzilla/show_bug.cgi?id=14362
>
> Signed-off-by: Johannes Stoelp <johannes.stoelp@gmail.com>

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM



reply via email to

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