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 <[email protected]>
>
> 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 <[email protected]>
> Signed-off-by: David Woodhouse <[email protected]>
> Reviewed-by: Paul Durrant <[email protected]>
> ---
> 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 <[email protected]>
> L: [email protected] (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)