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

2021-09-01 Thread Johannes S
On Mon, Aug 30, 2021 at 10:15 PM Peter Maydell wrote: > I think I would vote for following the type used by the ioctl() > function as declared in the headers for both Linux and the BSDs, > and using 'unsigned long'. > (We should change KVMState::irq_set_ioctl too, to match.) I would agree to 'uns

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

2021-08-30 Thread Peter Maydell
On Mon, 30 Aug 2021 at 20:37, Johannes S wrote: > In my opinion we should use 'unsigned' data types here for the ioctl > request in the ioctl wrappers or would you prefer to keep the ioctl > wrapper definition as is today? What is you opinion? I think I would vote for following the type used by t

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

2021-08-30 Thread Johannes S
On Sun, Aug 29, 2021 at 11:10 PM Peter Maydell wrote: > It would be more helpful to readers to state the reason directly > in the commit message, rather than requiring them to go and look > up a comment in some other file. Thanks for the tip, that makes sense. I will follow it next time. > > Of

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

2021-08-30 Thread Ed Maste
On Mon, 30 Aug 2021 at 13:34, Peter Maydell wrote: > > # As noted, this does not actually cause problems on Linux, because > # unlike FreeBSD, Linux knows what the f*ck it is doing, and just > # ignores the upper bits exactly because of possible sign confusion. > > Whether that's still true a deca

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

2021-08-30 Thread Peter Maydell
On Mon, 30 Aug 2021 at 16:47, Eric Blake wrote: > > On Sun, Aug 29, 2021 at 10:09:19PM +0100, Peter Maydell wrote: > > Of the various KVM_* ioctls we use via these functions, do > > any actually have values that would result in invalid sign > > extension here ? That is, is this fixing an existing

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

2021-08-30 Thread Eric Blake
On Sun, Aug 29, 2021 at 10:09:19PM +0100, Peter Maydell wrote: > On Thu, 5 Aug 2021 at 21:34, johannst wrote: > > > > Dear all, > > > > in my opinion the `type` argument in the kvm ioctl wrappers should be of > > type unsigned. Please correct me if I am wrong. > > (Ccing Eric as our resident POSI

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

2021-08-29 Thread Peter Maydell
On Thu, 5 Aug 2021 at 21:34, johannst wrote: > > Dear all, > > in my opinion the `type` argument in the kvm ioctl wrappers should be of > type unsigned. Please correct me if I am wrong. (Ccing Eric as our resident POSIX expert.) > Due to the same reason as explained in the comment on the > `irq_

[PATCH v0] kvm: unsigned datatype in ioctl wrapper

2021-08-29 Thread Johannes Stoelp
From: johannst Ping. https://patchew.org/QEMU/20210805193950.514357-1-johannes.sto...@gmail.com/ https://lore.kernel.org/qemu-devel/20210805193950.514357-1-johannes.sto...@gmail.com/ Thanks and best, Johannes

[PATCH v0] kvm: unsigned datatype in ioctl wrapper

2021-08-13 Thread Johannes Stoelp
From: johannst Ping. https://patchew.org/QEMU/20210805193950.514357-1-johannes.sto...@gmail.com/ https://lore.kernel.org/qemu-devel/20210805193950.514357-1-johannes.sto...@gmail.com/ Thanks and best, Johannes

[PATCH v0] kvm: unsigned datatype in ioctl wrapper

2021-08-05 Thread johannst
Dear all, in my opinion the `type` argument in the kvm ioctl wrappers should be of type unsigned. Please correct me if I am wrong. - Due to the same reason as explained in the comment on the `irq_set_ioctl` field in `struct KVMState` (accel/kvm/kvm-all.c), the kvm ioctl wrapper should take `type