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

Re: [PATCH v4 03/30] UAPI: x86: Move pvclock-abi to UAPI for x86 platforms


  • To: David Woodhouse <dwmw2@xxxxxxxxxxxxx>, kvm@xxxxxxxxxxxxxxx
  • From: Dongli Zhang <dongli.zhang@xxxxxxxxxx>
  • Date: Tue, 19 May 2026 00:35:15 -0700
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=sqR5XvwemEPJCCdSjqODNkS+O1pHp5KBn6JxHJTmJeM=; b=u9unHoKxHr1ZCaiZzaUzMDIMrxumZWw+CyuqUv1Suon+s8rEBN30WWgvZC9NRBgi9kfcbK3giy0ih0iB9E8QUZagzFqbx2fVC3R7Onux6pczX5/VGxHKN1+pDt/Yjqi/W81QslJ22B9SiYoS4mcD2yr/T2N/SIQaNJARglRzhhCm2raI6tJdlmHSOU/HjZ+eBZu888DVozHJEh2UwxnarmxkD5Vz+IvQmUgEEtqdtuRCKMwtmqHSj9ZGmN9LKn/E3tyTaGjzs95bDYnxxwupl7wavLknLKPd1/JV36Fvl0GuB8GaUM7VPLtzsutcpbxY0il3E6QQIKn0QZyhyZeSTg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=YzPS0vM73LgQ7sSFh9tTqaW98tA04iGHRzEO2cTbEF8qpMuWGo13SqLsnqubNLiAEniXDab/lNiVXZkfpJOXGPEP/EgvYqyGkPTC4yC/wkoq8P4tnEtDZFsJWj+4P43dKZAQ3hTGdZZsQwCqw1O56+m0l8WSnpFZPPb9Iq5FIMXmEXzvxwVRnKJu5MvHR+g5gtqJBXddjRe5alduyr55Yq+8mSAbU9y6Yz9IdWodi54lLR3/zfi6ArLUlic7ras9E2/cRir+A3mcFOAFGpej7Mor8HnSpX7Ulcw1uLfYZQmffs5LmtAcJQNu/84lNWzAiBULKOZdadfBj6aWnO8Ogw==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=corp-2025-04-25 header.d=oracle.com header.i="@oracle.com" header.h="Cc:Content-Transfer-Encoding:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=selector2-oracle-onmicrosoft-com header.d=oracle.onmicrosoft.com header.i="@oracle.onmicrosoft.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Cc: Paolo Bonzini <pbonzini@xxxxxxxxxx>, Jonathan Corbet <corbet@xxxxxxx>, Shuah Khan <skhan@xxxxxxxxxxxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxx>, Sean Christopherson <seanjc@xxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, Borislav Petkov <bp@xxxxxxxxx>, Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>, x86@xxxxxxxxxx, "H. Peter Anvin" <hpa@xxxxxxxxx>, Vitaly Kuznetsov <vkuznets@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, Jonathan Cameron <jic23@xxxxxxxxxx>, Sascha Bischoff <Sascha.Bischoff@xxxxxxx>, Marc Zyngier <maz@xxxxxxxxxx>, Joey Gouly <joey.gouly@xxxxxxx>, Jack Allister <jalliste@xxxxxxxxxx>, joe.jin@xxxxxxxxxx, linux-doc@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, linux-kselftest@xxxxxxxxxxxxxxx
  • Delivery-date: Tue, 19 May 2026 07:36:12 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

I have encountered below build warning.

Perhaps it is because of PATCH 03?

In file included from ./include/linux/types.h:5,
                 from ./arch/x86/include/uapi/asm/pvclock-abi.h:5,
                 from ./arch/x86/include/asm/xen/interface.h:197,
                 from ./include/xen/interface/xen.h:13,
                 from <command-line>:
./include/uapi/linux/types.h:10:2: warning: #warning "Attempt to use kernel
headers from user space, see https://kernelnewbies.org/KernelHeaders"; [-Wcpp]
   10 | #warning "Attempt to use kernel headers from user space, see
https://kernelnewbies.org/KernelHeaders";
      |  ^~~~~~~
In file included from ./include/linux/types.h:5,
                 from ./arch/x86/include/uapi/asm/pvclock-abi.h:5,
                 from ./arch/x86/include/asm/xen/interface.h:197,
                 from ./include/xen/interface/xen.h:13,
                 from ./include/xen/interface/xenpmu.h:5,
                 from <command-line>:
./include/uapi/linux/types.h:10:2: warning: #warning "Attempt to use kernel
headers from user space, see https://kernelnewbies.org/KernelHeaders"; [-Wcpp]
   10 | #warning "Attempt to use kernel headers from user space, see
https://kernelnewbies.org/KernelHeaders";
      |  ^~~~~~~

Thank you very much!

Dongli Zhang

On 2026-05-09 3:46 PM, David Woodhouse wrote:
> From: Jack Allister <jalliste@xxxxxxxxxx>
> 
> A subsequent commit will provide a new KVM interface for performing a
> fixup/correction of the KVM clock against the reference TSC. The
> KVM_[GS]ET_CLOCK_GUEST API requires a pvclock_vcpu_time_info, as such
> the caller must know about this definition.
> 
> Move the definition to the UAPI folder so that it is exported to
> usermode and also change the type definitions to use the standard for
> UAPI exports.
> 
> Signed-off-by: Jack Allister <jalliste@xxxxxxxxxx>
> Signed-off-by: David Woodhouse <dwmw@xxxxxxxxxxxx>
> Reviewed-by: Paul Durrant <paul@xxxxxxx>
> ---
>  MAINTAINERS                                   |  4 +--
>  arch/x86/include/{ => uapi}/asm/pvclock-abi.h | 27 ++++++++++---------
>  2 files changed, 17 insertions(+), 14 deletions(-)
>  rename arch/x86/include/{ => uapi}/asm/pvclock-abi.h (82%)
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index e0b307b2108c..e49676955c0c 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -14406,7 +14406,7 @@ S:    Supported
>  T:   git git://git.kernel.org/pub/scm/virt/kvm/kvm.git
>  F:   arch/um/include/asm/kvm_para.h
>  F:   arch/x86/include/asm/kvm_para.h
> -F:   arch/x86/include/asm/pvclock-abi.h
> +F:   arch/x86/include/uapi/asm/pvclock-abi.h
>  F:   arch/x86/include/uapi/asm/kvm_para.h
>  F:   arch/x86/kernel/kvm.c
>  F:   arch/x86/kernel/kvmclock.c
> @@ -29087,7 +29087,7 @@ R:    Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
>  L:   xen-devel@xxxxxxxxxxxxxxxxxxxx (moderated for non-subscribers)
>  S:   Supported
>  F:   arch/x86/configs/xen.config
> -F:   arch/x86/include/asm/pvclock-abi.h
> +F:   arch/x86/include/uapi/asm/pvclock-abi.h
>  F:   arch/x86/include/asm/xen/
>  F:   arch/x86/platform/pvh/
>  F:   arch/x86/xen/
> diff --git a/arch/x86/include/asm/pvclock-abi.h 
> b/arch/x86/include/uapi/asm/pvclock-abi.h
> similarity index 82%
> rename from arch/x86/include/asm/pvclock-abi.h
> rename to arch/x86/include/uapi/asm/pvclock-abi.h
> index b9fece5fc96d..6d70cf640362 100644
> --- a/arch/x86/include/asm/pvclock-abi.h
> +++ b/arch/x86/include/uapi/asm/pvclock-abi.h
> @@ -1,6 +1,9 @@
> -/* SPDX-License-Identifier: GPL-2.0 */
> +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
>  #ifndef _ASM_X86_PVCLOCK_ABI_H
>  #define _ASM_X86_PVCLOCK_ABI_H
> +
> +#include <linux/types.h>
> +
>  #ifndef __ASSEMBLER__
>  
>  /*
> @@ -24,20 +27,20 @@
>   */
>  
>  struct pvclock_vcpu_time_info {
> -     u32   version;
> -     u32   pad0;
> -     u64   tsc_timestamp;
> -     u64   system_time;
> -     u32   tsc_to_system_mul;
> -     s8    tsc_shift;
> -     u8    flags;
> -     u8    pad[2];
> +     __u32   version;
> +     __u32   pad0;
> +     __u64   tsc_timestamp;
> +     __u64   system_time;
> +     __u32   tsc_to_system_mul;
> +     __s8    tsc_shift;
> +     __u8    flags;
> +     __u8    pad[2];
>  } __attribute__((__packed__)); /* 32 bytes */
>  
>  struct pvclock_wall_clock {
> -     u32   version;
> -     u32   sec;
> -     u32   nsec;
> +     __u32   version;
> +     __u32   sec;
> +     __u32   nsec;
>  } __attribute__((__packed__));
>  
>  #define PVCLOCK_TSC_STABLE_BIT       (1 << 0)




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.