On Wed, 1 Sept 2021 at 22:34, Johannes Stoelp
<johannes.sto...@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.sto...@gmail.com>

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

thanks
-- PMM

Reply via email to