lkml.org 
[lkml]   [2022]   [Jan]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] kvm: Move KVM_GET_XSAVE2 IOCTL definition at the end of kvm.h
On 1/29/22 02:35, Wang, Wei W wrote:
> On Friday, January 28, 2022 11:40 PM, Janosch Frank wrote:
>> This way we can more easily find the next free IOCTL number when adding
>> new IOCTLs.
>
> Yes, this is good, but sometimes the relevant code tend to be put together (e.g. ioctl for vm fd and ioctls for vcpu fds), so not necessary to force them to be put in the number order.
> I think it would be better to record the last used number in the comment on top, and new additions need to update it (similar to the case that we update the api doc):

It's not only the fact that it's not at the end, it's also in the middle
of a block of s390 IOCTLs which are not relevant for this x86 IOCTL.

Allowing an arbitrary order makes searching and adding harder. Imagine
we'd start grouping capabilities. Let's not go there.

>
> diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
> index 9563d294f181..b7e5199ec47e 100644
> --- a/include/uapi/linux/kvm.h
> +++ b/include/uapi/linux/kvm.h
> @@ -6,6 +6,9 @@
> * Userspace interface for /dev/kvm - kernel based virtual machine
> *
> * Note: you must update KVM_API_VERSION if you change this interface.
> + *
> + * Last used cap number: KVM_CAP_XSAVE2(208)
> + * Last used ioctl number: KVM_HAS_DEVICE_ATTR(0xe3)
> */
>
> #include <linux/const.h>
>
> Thanks,
> Wei
>

\
 
 \ /
  Last update: 2022-01-31 07:30    [W:0.059 / U:1.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site