Re: [PATCH 1/1] tools headers UAPI: Sync linux/kvm.h with the kernel sources
From: Fuad Tabba
Date: Mon Nov 03 2025 - 11:29:01 EST
Hi,
On Mon, 3 Nov 2025 at 14:40, Arnaldo Carvalho de Melo <acme@xxxxxxxxxx> wrote:
>
> tldr; Just FYI, I'm carrying this on the perf tools tree.
>
> Full explanation:
>
> There used to be no copies, with tools/ code using kernel headers
> directly. From time to time tools/perf/ broke due to legitimate kernel
> hacking. At some point Linus complained about such direct usage. Then we
> adopted the current model.
>
> See further details at:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/include/uapi/README
>
> To pick the changes in:
>
> fe2bf6234e947bf5 ("KVM: guest_memfd: Add INIT_SHARED flag, reject user page faults if not set")
> d2042d8f96ddefde ("KVM: Rework KVM_CAP_GUEST_MEMFD_MMAP into KVM_CAP_GUEST_MEMFD_FLAGS")
> 3d3a04fad25a6621 ("KVM: Allow and advertise support for host mmap() on guest_memfd files")
>
> That just rebuilds perf, as these patches don't add any new KVM ioctl to
> be harvested for the the 'perf trace' ioctl syscall argument
> beautifiers.
nit: "the" is repeated. I've noticed this in earlier commits of yours
to this file as well :)
> This addresses this perf build warning:
>
> Warning: Kernel ABI header differences:
> diff -u tools/include/uapi/linux/kvm.h include/uapi/linux/kvm.h
>
> Please see tools/include/uapi/README for further details.
>
> Cc: Sean Christopherson <seanjc@xxxxxxxxxx>
> Cc: Fuad Tabba <tabba@xxxxxxxxxx>
> Cc: Paolo Bonzini <pbonzini@xxxxxxxxxx>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
> ---
Reviewed-by: Fuad Tabba <tabba@xxxxxxxxxx>
Cheers,
/fuad
> tools/include/uapi/linux/kvm.h | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/tools/include/uapi/linux/kvm.h b/tools/include/uapi/linux/kvm.h
> index f0f0d49d25443552..52f6000ab020840e 100644
> --- a/tools/include/uapi/linux/kvm.h
> +++ b/tools/include/uapi/linux/kvm.h
> @@ -962,6 +962,7 @@ struct kvm_enable_cap {
> #define KVM_CAP_ARM_EL2_E2H0 241
> #define KVM_CAP_RISCV_MP_STATE_RESET 242
> #define KVM_CAP_ARM_CACHEABLE_PFNMAP_SUPPORTED 243
> +#define KVM_CAP_GUEST_MEMFD_FLAGS 244
>
> struct kvm_irq_routing_irqchip {
> __u32 irqchip;
> @@ -1598,6 +1599,8 @@ struct kvm_memory_attributes {
> #define KVM_MEMORY_ATTRIBUTE_PRIVATE (1ULL << 3)
>
> #define KVM_CREATE_GUEST_MEMFD _IOWR(KVMIO, 0xd4, struct kvm_create_guest_memfd)
> +#define GUEST_MEMFD_FLAG_MMAP (1ULL << 0)
> +#define GUEST_MEMFD_FLAG_INIT_SHARED (1ULL << 1)
>
> struct kvm_create_guest_memfd {
> __u64 size;
> --
> 2.51.1
>