linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHSET 00/10] tools headers: Sync header files with the kernel
@ 2025-04-10  0:11 Namhyung Kim
  2025-04-10  0:11 ` [PATCH 01/10] tools headers: Update the KVM headers with the kernel sources Namhyung Kim
                   ` (11 more replies)
  0 siblings, 12 replies; 18+ messages in thread
From: Namhyung Kim @ 2025-04-10  0:11 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Ian Rogers, Kan Liang
  Cc: Jiri Olsa, Adrian Hunter, Peter Zijlstra, Ingo Molnar, LKML,
	linux-perf-users

Hello,

FYI I'm carrying these changes in the perf tools tree so make perf trace
beautifiers get the recent changes in syscall, ioctl, and so on.  For the
background, please see tools/include/uapi/README.

Still there are some remaining items but it requires a bit more changes.
So I'd like to leave them for the next cycle.

  Warning: Kernel ABI header differences:
    diff -u tools/include/uapi/linux/bits.h include/uapi/linux/bits.h
    diff -u tools/include/linux/bits.h include/linux/bits.h
    diff -u tools/arch/arm64/include/asm/cputype.h arch/arm64/include/asm/cputype.h

Thanks,
Namhyung


Namhyung Kim (10):
  tools headers: Update the KVM headers with the kernel sources
  tools headers: Update the socket headers with the kernel sources
  tools headers: Update the uapi/linux/perf_event.h copy with the kernel sources
  tools headers: Update the VFS headers with the kernel sources
  tools headers: Update the syscall table with the kernel sources
  tools headers: Update the uapi/linux/prctl.h copy with the kernel sources
  tools headers: Update the uapi/asm-generic/mman-common.h copy with the kernel sources
  tools headers: Update the linux/unaligned.h copy with the kernel sources
  tools headers: Update the x86 headers with the kernel sources
  tools headers: Update the arch/x86/lib/memset_64.S copy with the kernel sources

 tools/arch/arm64/include/uapi/asm/kvm.h       |  5 +-
 tools/arch/arm64/include/uapi/asm/unistd.h    | 24 +----
 tools/arch/x86/include/asm/cpufeatures.h      | 28 ++++--
 tools/arch/x86/include/asm/msr-index.h        | 31 +++---
 tools/arch/x86/include/uapi/asm/kvm.h         |  4 +
 tools/arch/x86/include/uapi/asm/svm.h         |  2 +
 tools/arch/x86/lib/memset_64.S                |  3 +-
 tools/include/linux/cfi_types.h               | 45 +++++++++
 tools/include/uapi/asm-generic/mman-common.h  |  1 +
 tools/include/uapi/asm-generic/unistd.h       |  4 +-
 tools/include/uapi/linux/in.h                 |  2 +
 tools/include/uapi/linux/kvm.h                |  9 +-
 tools/include/uapi/linux/perf_event.h         |  2 +
 tools/include/uapi/linux/stat.h               | 99 ++++++++++++++-----
 .../perf/arch/arm/entry/syscalls/syscall.tbl  |  1 +
 .../arch/mips/entry/syscalls/syscall_n64.tbl  |  1 +
 .../arch/powerpc/entry/syscalls/syscall.tbl   |  1 +
 .../perf/arch/s390/entry/syscalls/syscall.tbl |  1 +
 tools/perf/arch/sh/entry/syscalls/syscall.tbl |  1 +
 .../arch/sparc/entry/syscalls/syscall.tbl     |  1 +
 .../arch/x86/entry/syscalls/syscall_32.tbl    |  3 +-
 .../arch/x86/entry/syscalls/syscall_64.tbl    |  1 +
 .../arch/xtensa/entry/syscalls/syscall.tbl    |  1 +
 tools/perf/check-headers.sh                   |  1 +
 .../perf/trace/beauty/include/linux/socket.h  |  2 +
 .../trace/beauty/include/uapi/linux/fcntl.h   |  4 +
 .../perf/trace/beauty/include/uapi/linux/fs.h | 21 +++-
 .../trace/beauty/include/uapi/linux/mount.h   | 10 +-
 .../trace/beauty/include/uapi/linux/prctl.h   | 11 +++
 .../trace/beauty/include/uapi/linux/stat.h    | 99 ++++++++++++++-----
 .../trace/beauty/include/uapi/sound/asound.h  |  8 +-
 tools/scripts/syscall.tbl                     |  1 +
 32 files changed, 318 insertions(+), 109 deletions(-)
 create mode 100644 tools/include/linux/cfi_types.h


base-commit: 0af2f6be1b4281385b618cb86ad946eded089ac8
-- 
2.49.0.504.g3bcea36a83-goog


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 01/10] tools headers: Update the KVM headers with the kernel sources
  2025-04-10  0:11 [PATCHSET 00/10] tools headers: Sync header files with the kernel Namhyung Kim
@ 2025-04-10  0:11 ` Namhyung Kim
  2025-04-10  0:11 ` [PATCH 02/10] tools headers: Update the socket " Namhyung Kim
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Namhyung Kim @ 2025-04-10  0:11 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Ian Rogers, Kan Liang
  Cc: Jiri Olsa, Adrian Hunter, Peter Zijlstra, Ingo Molnar, LKML,
	linux-perf-users, kvm

To pick up the changes in:

  af5366bea2cb9dfb KVM: x86: Drop the now unused KVM_X86_DISABLE_VALID_EXITS
  915d2f0718a42ee0 KVM: Move KVM_REG_SIZE() definition to common uAPI header
  5c17848134ab1ffb KVM: x86/xen: Restrict hypercall MSR to unofficial synthetic range
  9364789567f9b492 KVM: x86: Add a VM type define for TDX
  fa662c9080732b1f KVM: SVM: Add Idle HLT intercept support
  3adaee78306148da KVM: arm64: Allow userspace to change the implementation ID registers
  faf7714a47a25c62 KVM: arm64: nv: Allow userland to set VGIC maintenance IRQ
  c0000e58c74eed07 KVM: arm64: Introduce KVM_REG_ARM_VENDOR_HYP_BMAP_2
  f83c41fb3dddbf47 KVM: arm64: Allow userspace to limit NV support to nVHE

Addressing this perf tools build warning:

  Warning: Kernel ABI header differences:
    diff -u tools/include/uapi/linux/kvm.h include/uapi/linux/kvm.h
    diff -u tools/arch/x86/include/uapi/asm/kvm.h arch/x86/include/uapi/asm/kvm.h
    diff -u tools/arch/x86/include/uapi/asm/svm.h arch/x86/include/uapi/asm/svm.h
    diff -u tools/arch/arm64/include/uapi/asm/kvm.h arch/arm64/include/uapi/asm/kvm.h

Please see tools/include/uapi/README for further details.

Cc: kvm@vger.kernel.org
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/arch/arm64/include/uapi/asm/kvm.h | 5 ++---
 tools/arch/x86/include/uapi/asm/kvm.h   | 4 ++++
 tools/arch/x86/include/uapi/asm/svm.h   | 2 ++
 tools/include/uapi/linux/kvm.h          | 9 +++++----
 4 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/tools/arch/arm64/include/uapi/asm/kvm.h b/tools/arch/arm64/include/uapi/asm/kvm.h
index 6d44f8c8a18fd98e..af9d9acaf9975a88 100644
--- a/tools/arch/arm64/include/uapi/asm/kvm.h
+++ b/tools/arch/arm64/include/uapi/asm/kvm.h
@@ -43,9 +43,6 @@
 #define KVM_COALESCED_MMIO_PAGE_OFFSET 1
 #define KVM_DIRTY_LOG_PAGE_OFFSET 64
 
-#define KVM_REG_SIZE(id)						\
-	(1U << (((id) & KVM_REG_SIZE_MASK) >> KVM_REG_SIZE_SHIFT))
-
 struct kvm_regs {
 	struct user_pt_regs regs;	/* sp = sp_el0 */
 
@@ -108,6 +105,7 @@ struct kvm_regs {
 #define KVM_ARM_VCPU_PTRAUTH_ADDRESS	5 /* VCPU uses address authentication */
 #define KVM_ARM_VCPU_PTRAUTH_GENERIC	6 /* VCPU uses generic authentication */
 #define KVM_ARM_VCPU_HAS_EL2		7 /* Support nested virtualization */
+#define KVM_ARM_VCPU_HAS_EL2_E2H0	8 /* Limit NV support to E2H RES0 */
 
 struct kvm_vcpu_init {
 	__u32 target;
@@ -418,6 +416,7 @@ enum {
 #define KVM_DEV_ARM_VGIC_GRP_CPU_SYSREGS 6
 #define KVM_DEV_ARM_VGIC_GRP_LEVEL_INFO  7
 #define KVM_DEV_ARM_VGIC_GRP_ITS_REGS 8
+#define KVM_DEV_ARM_VGIC_GRP_MAINT_IRQ  9
 #define KVM_DEV_ARM_VGIC_LINE_LEVEL_INFO_SHIFT	10
 #define KVM_DEV_ARM_VGIC_LINE_LEVEL_INFO_MASK \
 			(0x3fffffULL << KVM_DEV_ARM_VGIC_LINE_LEVEL_INFO_SHIFT)
diff --git a/tools/arch/x86/include/uapi/asm/kvm.h b/tools/arch/x86/include/uapi/asm/kvm.h
index 88585c1de416fa6f..460306b35a4bfee9 100644
--- a/tools/arch/x86/include/uapi/asm/kvm.h
+++ b/tools/arch/x86/include/uapi/asm/kvm.h
@@ -559,6 +559,9 @@ struct kvm_x86_mce {
 #define KVM_XEN_HVM_CONFIG_PVCLOCK_TSC_UNSTABLE	(1 << 7)
 #define KVM_XEN_HVM_CONFIG_SHARED_INFO_HVA	(1 << 8)
 
+#define KVM_XEN_MSR_MIN_INDEX			0x40000000u
+#define KVM_XEN_MSR_MAX_INDEX			0x4fffffffu
+
 struct kvm_xen_hvm_config {
 	__u32 flags;
 	__u32 msr;
@@ -925,5 +928,6 @@ struct kvm_hyperv_eventfd {
 #define KVM_X86_SEV_VM		2
 #define KVM_X86_SEV_ES_VM	3
 #define KVM_X86_SNP_VM		4
+#define KVM_X86_TDX_VM		5
 
 #endif /* _ASM_X86_KVM_H */
diff --git a/tools/arch/x86/include/uapi/asm/svm.h b/tools/arch/x86/include/uapi/asm/svm.h
index 1814b413fd5783d2..ec1321248dac2ab5 100644
--- a/tools/arch/x86/include/uapi/asm/svm.h
+++ b/tools/arch/x86/include/uapi/asm/svm.h
@@ -95,6 +95,7 @@
 #define SVM_EXIT_CR14_WRITE_TRAP		0x09e
 #define SVM_EXIT_CR15_WRITE_TRAP		0x09f
 #define SVM_EXIT_INVPCID       0x0a2
+#define SVM_EXIT_IDLE_HLT      0x0a6
 #define SVM_EXIT_NPF           0x400
 #define SVM_EXIT_AVIC_INCOMPLETE_IPI		0x401
 #define SVM_EXIT_AVIC_UNACCELERATED_ACCESS	0x402
@@ -224,6 +225,7 @@
 	{ SVM_EXIT_CR4_WRITE_TRAP,	"write_cr4_trap" }, \
 	{ SVM_EXIT_CR8_WRITE_TRAP,	"write_cr8_trap" }, \
 	{ SVM_EXIT_INVPCID,     "invpcid" }, \
+	{ SVM_EXIT_IDLE_HLT,     "idle-halt" }, \
 	{ SVM_EXIT_NPF,         "npf" }, \
 	{ SVM_EXIT_AVIC_INCOMPLETE_IPI,		"avic_incomplete_ipi" }, \
 	{ SVM_EXIT_AVIC_UNACCELERATED_ACCESS,   "avic_unaccelerated_access" }, \
diff --git a/tools/include/uapi/linux/kvm.h b/tools/include/uapi/linux/kvm.h
index 502ea63b5d2e7371..b6ae8ad8934b52c7 100644
--- a/tools/include/uapi/linux/kvm.h
+++ b/tools/include/uapi/linux/kvm.h
@@ -617,10 +617,6 @@ struct kvm_ioeventfd {
 #define KVM_X86_DISABLE_EXITS_HLT            (1 << 1)
 #define KVM_X86_DISABLE_EXITS_PAUSE          (1 << 2)
 #define KVM_X86_DISABLE_EXITS_CSTATE         (1 << 3)
-#define KVM_X86_DISABLE_VALID_EXITS          (KVM_X86_DISABLE_EXITS_MWAIT | \
-                                              KVM_X86_DISABLE_EXITS_HLT | \
-                                              KVM_X86_DISABLE_EXITS_PAUSE | \
-                                              KVM_X86_DISABLE_EXITS_CSTATE)
 
 /* for KVM_ENABLE_CAP */
 struct kvm_enable_cap {
@@ -933,6 +929,7 @@ struct kvm_enable_cap {
 #define KVM_CAP_PRE_FAULT_MEMORY 236
 #define KVM_CAP_X86_APIC_BUS_CYCLES_NS 237
 #define KVM_CAP_X86_GUEST_MODE 238
+#define KVM_CAP_ARM_WRITABLE_IMP_ID_REGS 239
 
 struct kvm_irq_routing_irqchip {
 	__u32 irqchip;
@@ -1070,6 +1067,10 @@ struct kvm_dirty_tlb {
 
 #define KVM_REG_SIZE_SHIFT	52
 #define KVM_REG_SIZE_MASK	0x00f0000000000000ULL
+
+#define KVM_REG_SIZE(id)		\
+	(1U << (((id) & KVM_REG_SIZE_MASK) >> KVM_REG_SIZE_SHIFT))
+
 #define KVM_REG_SIZE_U8		0x0000000000000000ULL
 #define KVM_REG_SIZE_U16	0x0010000000000000ULL
 #define KVM_REG_SIZE_U32	0x0020000000000000ULL
-- 
2.49.0.504.g3bcea36a83-goog


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 02/10] tools headers: Update the socket headers with the kernel sources
  2025-04-10  0:11 [PATCHSET 00/10] tools headers: Sync header files with the kernel Namhyung Kim
  2025-04-10  0:11 ` [PATCH 01/10] tools headers: Update the KVM headers with the kernel sources Namhyung Kim
@ 2025-04-10  0:11 ` Namhyung Kim
  2025-04-10  0:11 ` [PATCH 03/10] tools headers: Update the uapi/linux/perf_event.h copy " Namhyung Kim
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Namhyung Kim @ 2025-04-10  0:11 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Ian Rogers, Kan Liang
  Cc: Jiri Olsa, Adrian Hunter, Peter Zijlstra, Ingo Molnar, LKML,
	linux-perf-users, netdev

To pick up the changes in:

  64e844505bc08cde include: uapi: protocol number and packet structs for AGGFRAG in ESP
  18912c520674ec4d tcp: devmem: don't write truncated dmabuf CMSGs to userspace

Addressing this perf tools build warning:

  Warning: Kernel ABI header differences:
    diff -u tools/include/uapi/linux/in.h include/uapi/linux/in.h
    diff -u tools/perf/trace/beauty/include/linux/socket.h include/linux/socket.h

Please see tools/include/uapi/README for further details.

Cc: netdev@vger.kernel.org
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/include/uapi/linux/in.h                  | 2 ++
 tools/perf/trace/beauty/include/linux/socket.h | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/tools/include/uapi/linux/in.h b/tools/include/uapi/linux/in.h
index 5d32d53508d99f86..ced0fc3c3aa5343a 100644
--- a/tools/include/uapi/linux/in.h
+++ b/tools/include/uapi/linux/in.h
@@ -79,6 +79,8 @@ enum {
 #define IPPROTO_MPLS		IPPROTO_MPLS
   IPPROTO_ETHERNET = 143,	/* Ethernet-within-IPv6 Encapsulation	*/
 #define IPPROTO_ETHERNET	IPPROTO_ETHERNET
+  IPPROTO_AGGFRAG = 144,	/* AGGFRAG in ESP (RFC 9347)		*/
+#define IPPROTO_AGGFRAG		IPPROTO_AGGFRAG
   IPPROTO_RAW = 255,		/* Raw IP packets			*/
 #define IPPROTO_RAW		IPPROTO_RAW
   IPPROTO_SMC = 256,		/* Shared Memory Communications		*/
diff --git a/tools/perf/trace/beauty/include/linux/socket.h b/tools/perf/trace/beauty/include/linux/socket.h
index d18cc47e89bd0164..c3322eb3d6865d5e 100644
--- a/tools/perf/trace/beauty/include/linux/socket.h
+++ b/tools/perf/trace/beauty/include/linux/socket.h
@@ -392,6 +392,8 @@ struct ucred {
 
 extern int move_addr_to_kernel(void __user *uaddr, int ulen, struct sockaddr_storage *kaddr);
 extern int put_cmsg(struct msghdr*, int level, int type, int len, void *data);
+extern int put_cmsg_notrunc(struct msghdr *msg, int level, int type, int len,
+			    void *data);
 
 struct timespec64;
 struct __kernel_timespec;
-- 
2.49.0.504.g3bcea36a83-goog


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 03/10] tools headers: Update the uapi/linux/perf_event.h copy with the kernel sources
  2025-04-10  0:11 [PATCHSET 00/10] tools headers: Sync header files with the kernel Namhyung Kim
  2025-04-10  0:11 ` [PATCH 01/10] tools headers: Update the KVM headers with the kernel sources Namhyung Kim
  2025-04-10  0:11 ` [PATCH 02/10] tools headers: Update the socket " Namhyung Kim
@ 2025-04-10  0:11 ` Namhyung Kim
  2025-04-10  0:11 ` [PATCH 04/10] tools headers: Update the VFS headers " Namhyung Kim
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Namhyung Kim @ 2025-04-10  0:11 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Ian Rogers, Kan Liang
  Cc: Jiri Olsa, Adrian Hunter, Peter Zijlstra, Ingo Molnar, LKML,
	linux-perf-users

To pick up the changes in:

  c53e14f1ea4a8f8d perf: Extend per event callchain limit to branch stack

Addressing this perf tools build warning:

  Warning: Kernel ABI header differences:
    diff -u tools/include/uapi/linux/perf_event.h include/uapi/linux/perf_event.h

Please see tools/include/uapi/README for further details.

Cc: linux-perf-users@vger.kernel.org
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/include/uapi/linux/perf_event.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/include/uapi/linux/perf_event.h b/tools/include/uapi/linux/perf_event.h
index 0524d541d4e3d501..5fc753c23734dfc4 100644
--- a/tools/include/uapi/linux/perf_event.h
+++ b/tools/include/uapi/linux/perf_event.h
@@ -385,6 +385,8 @@ enum perf_event_read_format {
  *
  * @sample_max_stack: Max number of frame pointers in a callchain,
  *		      should be < /proc/sys/kernel/perf_event_max_stack
+ *		      Max number of entries of branch stack
+ *		      should be < hardware limit
  */
 struct perf_event_attr {
 
-- 
2.49.0.504.g3bcea36a83-goog


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 04/10] tools headers: Update the VFS headers with the kernel sources
  2025-04-10  0:11 [PATCHSET 00/10] tools headers: Sync header files with the kernel Namhyung Kim
                   ` (2 preceding siblings ...)
  2025-04-10  0:11 ` [PATCH 03/10] tools headers: Update the uapi/linux/perf_event.h copy " Namhyung Kim
@ 2025-04-10  0:11 ` Namhyung Kim
  2025-04-10  0:11 ` [PATCH 05/10] tools headers: Update the syscall table " Namhyung Kim
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Namhyung Kim @ 2025-04-10  0:11 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Ian Rogers, Kan Liang
  Cc: Jiri Olsa, Adrian Hunter, Peter Zijlstra, Ingo Molnar, LKML,
	linux-perf-users, linux-fsdevel

To pick up the changes in:

  7ed6cbe0f8caa6ee fs: add STATX_DIO_READ_ALIGN
  8fc7e23a9bd851e6 fs: reformat the statx definition
  a5874fde3c0884a3 exec: Add a new AT_EXECVE_CHECK flag to execveat(2)
  1ebd4a3c095cd538 blk-crypto: add ioctls to create and prepare hardware-wrapped keys
  af6505e5745b9f3a fs: add RWF_DONTCACHE iocb and FOP_DONTCACHE file_operations flag
  10783d0ba0d7731e fs, iov_iter: define meta io descriptor
  8f6116b5b77b0536 statmount: add a new supported_mask field
  37c4a9590e1efcae statmount: allow to retrieve idmappings

Addressing this perf tools build warning:

  Warning: Kernel ABI header differences:
    diff -u tools/include/uapi/linux/stat.h include/uapi/linux/stat.h
    diff -u tools/perf/trace/beauty/include/uapi/linux/stat.h include/uapi/linux/stat.h
    diff -u tools/perf/trace/beauty/include/uapi/linux/fcntl.h include/uapi/linux/fcntl.h
    diff -u tools/perf/trace/beauty/include/uapi/linux/fs.h include/uapi/linux/fs.h
    diff -u tools/perf/trace/beauty/include/uapi/linux/mount.h include/uapi/linux/mount.h

Please see tools/include/uapi/README for further details.

Cc: linux-fsdevel@vger.kernel.org
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/include/uapi/linux/stat.h               | 99 ++++++++++++++-----
 .../trace/beauty/include/uapi/linux/fcntl.h   |  4 +
 .../perf/trace/beauty/include/uapi/linux/fs.h | 21 +++-
 .../trace/beauty/include/uapi/linux/mount.h   | 10 +-
 .../trace/beauty/include/uapi/linux/stat.h    | 99 ++++++++++++++-----
 5 files changed, 179 insertions(+), 54 deletions(-)

diff --git a/tools/include/uapi/linux/stat.h b/tools/include/uapi/linux/stat.h
index 887a2528644168a3..f78ee3670dd5d7c8 100644
--- a/tools/include/uapi/linux/stat.h
+++ b/tools/include/uapi/linux/stat.h
@@ -98,43 +98,93 @@ struct statx_timestamp {
  */
 struct statx {
 	/* 0x00 */
-	__u32	stx_mask;	/* What results were written [uncond] */
-	__u32	stx_blksize;	/* Preferred general I/O size [uncond] */
-	__u64	stx_attributes;	/* Flags conveying information about the file [uncond] */
+	/* What results were written [uncond] */
+	__u32	stx_mask;
+
+	/* Preferred general I/O size [uncond] */
+	__u32	stx_blksize;
+
+	/* Flags conveying information about the file [uncond] */
+	__u64	stx_attributes;
+
 	/* 0x10 */
-	__u32	stx_nlink;	/* Number of hard links */
-	__u32	stx_uid;	/* User ID of owner */
-	__u32	stx_gid;	/* Group ID of owner */
-	__u16	stx_mode;	/* File mode */
+	/* Number of hard links */
+	__u32	stx_nlink;
+
+	/* User ID of owner */
+	__u32	stx_uid;
+
+	/* Group ID of owner */
+	__u32	stx_gid;
+
+	/* File mode */
+	__u16	stx_mode;
 	__u16	__spare0[1];
+
 	/* 0x20 */
-	__u64	stx_ino;	/* Inode number */
-	__u64	stx_size;	/* File size */
-	__u64	stx_blocks;	/* Number of 512-byte blocks allocated */
-	__u64	stx_attributes_mask; /* Mask to show what's supported in stx_attributes */
+	/* Inode number */
+	__u64	stx_ino;
+
+	/* File size */
+	__u64	stx_size;
+
+	/* Number of 512-byte blocks allocated */
+	__u64	stx_blocks;
+
+	/* Mask to show what's supported in stx_attributes */
+	__u64	stx_attributes_mask;
+
 	/* 0x40 */
-	struct statx_timestamp	stx_atime;	/* Last access time */
-	struct statx_timestamp	stx_btime;	/* File creation time */
-	struct statx_timestamp	stx_ctime;	/* Last attribute change time */
-	struct statx_timestamp	stx_mtime;	/* Last data modification time */
+	/* Last access time */
+	struct statx_timestamp	stx_atime;
+
+	/* File creation time */
+	struct statx_timestamp	stx_btime;
+
+	/* Last attribute change time */
+	struct statx_timestamp	stx_ctime;
+
+	/* Last data modification time */
+	struct statx_timestamp	stx_mtime;
+
 	/* 0x80 */
-	__u32	stx_rdev_major;	/* Device ID of special file [if bdev/cdev] */
+	/* Device ID of special file [if bdev/cdev] */
+	__u32	stx_rdev_major;
 	__u32	stx_rdev_minor;
-	__u32	stx_dev_major;	/* ID of device containing file [uncond] */
+
+	/* ID of device containing file [uncond] */
+	__u32	stx_dev_major;
 	__u32	stx_dev_minor;
+
 	/* 0x90 */
 	__u64	stx_mnt_id;
-	__u32	stx_dio_mem_align;	/* Memory buffer alignment for direct I/O */
-	__u32	stx_dio_offset_align;	/* File offset alignment for direct I/O */
+
+	/* Memory buffer alignment for direct I/O */
+	__u32	stx_dio_mem_align;
+
+	/* File offset alignment for direct I/O */
+	__u32	stx_dio_offset_align;
+
 	/* 0xa0 */
-	__u64	stx_subvol;	/* Subvolume identifier */
-	__u32	stx_atomic_write_unit_min;	/* Min atomic write unit in bytes */
-	__u32	stx_atomic_write_unit_max;	/* Max atomic write unit in bytes */
+	/* Subvolume identifier */
+	__u64	stx_subvol;
+
+	/* Min atomic write unit in bytes */
+	__u32	stx_atomic_write_unit_min;
+
+	/* Max atomic write unit in bytes */
+	__u32	stx_atomic_write_unit_max;
+
 	/* 0xb0 */
-	__u32   stx_atomic_write_segments_max;	/* Max atomic write segment count */
-	__u32   __spare1[1];
+	/* Max atomic write segment count */
+	__u32   stx_atomic_write_segments_max;
+
+	/* File offset alignment for direct I/O reads */
+	__u32	stx_dio_read_offset_align;
+
 	/* 0xb8 */
 	__u64	__spare3[9];	/* Spare space for future expansion */
+
 	/* 0x100 */
 };
 
@@ -164,6 +214,7 @@ struct statx {
 #define STATX_MNT_ID_UNIQUE	0x00004000U	/* Want/got extended stx_mount_id */
 #define STATX_SUBVOL		0x00008000U	/* Want/got stx_subvol */
 #define STATX_WRITE_ATOMIC	0x00010000U	/* Want/got atomic_write_* fields */
+#define STATX_DIO_READ_ALIGN	0x00020000U	/* Want/got dio read alignment info */
 
 #define STATX__RESERVED		0x80000000U	/* Reserved for future struct statx expansion */
 
diff --git a/tools/perf/trace/beauty/include/uapi/linux/fcntl.h b/tools/perf/trace/beauty/include/uapi/linux/fcntl.h
index 6e6907e63bfc2b4d..a15ac2fa4b202fa0 100644
--- a/tools/perf/trace/beauty/include/uapi/linux/fcntl.h
+++ b/tools/perf/trace/beauty/include/uapi/linux/fcntl.h
@@ -155,4 +155,8 @@
 #define AT_HANDLE_MNT_ID_UNIQUE	0x001	/* Return the u64 unique mount ID. */
 #define AT_HANDLE_CONNECTABLE	0x002	/* Request a connectable file handle */
 
+/* Flags for execveat2(2). */
+#define AT_EXECVE_CHECK		0x10000	/* Only perform a check if execution
+					   would be allowed. */
+
 #endif /* _UAPI_LINUX_FCNTL_H */
diff --git a/tools/perf/trace/beauty/include/uapi/linux/fs.h b/tools/perf/trace/beauty/include/uapi/linux/fs.h
index 7539717707337a8c..e762e1af650c4bf0 100644
--- a/tools/perf/trace/beauty/include/uapi/linux/fs.h
+++ b/tools/perf/trace/beauty/include/uapi/linux/fs.h
@@ -40,6 +40,15 @@
 #define BLOCK_SIZE_BITS 10
 #define BLOCK_SIZE (1<<BLOCK_SIZE_BITS)
 
+/* flags for integrity meta */
+#define IO_INTEGRITY_CHK_GUARD		(1U << 0) /* enforce guard check */
+#define IO_INTEGRITY_CHK_REFTAG		(1U << 1) /* enforce ref check */
+#define IO_INTEGRITY_CHK_APPTAG		(1U << 2) /* enforce app check */
+
+#define IO_INTEGRITY_VALID_FLAGS (IO_INTEGRITY_CHK_GUARD | \
+				  IO_INTEGRITY_CHK_REFTAG | \
+				  IO_INTEGRITY_CHK_APPTAG)
+
 #define SEEK_SET	0	/* seek relative to beginning of file */
 #define SEEK_CUR	1	/* seek relative to current file position */
 #define SEEK_END	2	/* seek relative to end of file */
@@ -203,10 +212,8 @@ struct fsxattr {
 #define BLKROTATIONAL _IO(0x12,126)
 #define BLKZEROOUT _IO(0x12,127)
 #define BLKGETDISKSEQ _IOR(0x12,128,__u64)
-/*
- * A jump here: 130-136 are reserved for zoned block devices
- * (see uapi/linux/blkzoned.h)
- */
+/* 130-136 are used by zoned block device ioctls (uapi/linux/blkzoned.h) */
+/* 137-141 are used by blk-crypto ioctls (uapi/linux/blk-crypto.h) */
 
 #define BMAP_IOCTL 1		/* obsolete - kept for compatibility */
 #define FIBMAP	   _IO(0x00,1)	/* bmap access */
@@ -332,9 +339,13 @@ typedef int __bitwise __kernel_rwf_t;
 /* Atomic Write */
 #define RWF_ATOMIC	((__force __kernel_rwf_t)0x00000040)
 
+/* buffered IO that drops the cache after reading or writing data */
+#define RWF_DONTCACHE	((__force __kernel_rwf_t)0x00000080)
+
 /* mask of flags supported by the kernel */
 #define RWF_SUPPORTED	(RWF_HIPRI | RWF_DSYNC | RWF_SYNC | RWF_NOWAIT |\
-			 RWF_APPEND | RWF_NOAPPEND | RWF_ATOMIC)
+			 RWF_APPEND | RWF_NOAPPEND | RWF_ATOMIC |\
+			 RWF_DONTCACHE)
 
 #define PROCFS_IOCTL_MAGIC 'f'
 
diff --git a/tools/perf/trace/beauty/include/uapi/linux/mount.h b/tools/perf/trace/beauty/include/uapi/linux/mount.h
index c07008816acae89c..7fa67c2031a5db52 100644
--- a/tools/perf/trace/beauty/include/uapi/linux/mount.h
+++ b/tools/perf/trace/beauty/include/uapi/linux/mount.h
@@ -179,7 +179,12 @@ struct statmount {
 	__u32 opt_array;	/* [str] Array of nul terminated fs options */
 	__u32 opt_sec_num;	/* Number of security options */
 	__u32 opt_sec_array;	/* [str] Array of nul terminated security options */
-	__u64 __spare2[46];
+	__u64 supported_mask;	/* Mask flags that this kernel supports */
+	__u32 mnt_uidmap_num;	/* Number of uid mappings */
+	__u32 mnt_uidmap;	/* [str] Array of uid mappings (as seen from callers namespace) */
+	__u32 mnt_gidmap_num;	/* Number of gid mappings */
+	__u32 mnt_gidmap;	/* [str] Array of gid mappings (as seen from callers namespace) */
+	__u64 __spare2[43];
 	char str[];		/* Variable size part containing strings */
 };
 
@@ -217,6 +222,9 @@ struct mnt_id_req {
 #define STATMOUNT_SB_SOURCE		0x00000200U	/* Want/got sb_source */
 #define STATMOUNT_OPT_ARRAY		0x00000400U	/* Want/got opt_... */
 #define STATMOUNT_OPT_SEC_ARRAY		0x00000800U	/* Want/got opt_sec... */
+#define STATMOUNT_SUPPORTED_MASK	0x00001000U	/* Want/got supported mask flags */
+#define STATMOUNT_MNT_UIDMAP		0x00002000U	/* Want/got uidmap... */
+#define STATMOUNT_MNT_GIDMAP		0x00004000U	/* Want/got gidmap... */
 
 /*
  * Special @mnt_id values that can be passed to listmount
diff --git a/tools/perf/trace/beauty/include/uapi/linux/stat.h b/tools/perf/trace/beauty/include/uapi/linux/stat.h
index 887a2528644168a3..f78ee3670dd5d7c8 100644
--- a/tools/perf/trace/beauty/include/uapi/linux/stat.h
+++ b/tools/perf/trace/beauty/include/uapi/linux/stat.h
@@ -98,43 +98,93 @@ struct statx_timestamp {
  */
 struct statx {
 	/* 0x00 */
-	__u32	stx_mask;	/* What results were written [uncond] */
-	__u32	stx_blksize;	/* Preferred general I/O size [uncond] */
-	__u64	stx_attributes;	/* Flags conveying information about the file [uncond] */
+	/* What results were written [uncond] */
+	__u32	stx_mask;
+
+	/* Preferred general I/O size [uncond] */
+	__u32	stx_blksize;
+
+	/* Flags conveying information about the file [uncond] */
+	__u64	stx_attributes;
+
 	/* 0x10 */
-	__u32	stx_nlink;	/* Number of hard links */
-	__u32	stx_uid;	/* User ID of owner */
-	__u32	stx_gid;	/* Group ID of owner */
-	__u16	stx_mode;	/* File mode */
+	/* Number of hard links */
+	__u32	stx_nlink;
+
+	/* User ID of owner */
+	__u32	stx_uid;
+
+	/* Group ID of owner */
+	__u32	stx_gid;
+
+	/* File mode */
+	__u16	stx_mode;
 	__u16	__spare0[1];
+
 	/* 0x20 */
-	__u64	stx_ino;	/* Inode number */
-	__u64	stx_size;	/* File size */
-	__u64	stx_blocks;	/* Number of 512-byte blocks allocated */
-	__u64	stx_attributes_mask; /* Mask to show what's supported in stx_attributes */
+	/* Inode number */
+	__u64	stx_ino;
+
+	/* File size */
+	__u64	stx_size;
+
+	/* Number of 512-byte blocks allocated */
+	__u64	stx_blocks;
+
+	/* Mask to show what's supported in stx_attributes */
+	__u64	stx_attributes_mask;
+
 	/* 0x40 */
-	struct statx_timestamp	stx_atime;	/* Last access time */
-	struct statx_timestamp	stx_btime;	/* File creation time */
-	struct statx_timestamp	stx_ctime;	/* Last attribute change time */
-	struct statx_timestamp	stx_mtime;	/* Last data modification time */
+	/* Last access time */
+	struct statx_timestamp	stx_atime;
+
+	/* File creation time */
+	struct statx_timestamp	stx_btime;
+
+	/* Last attribute change time */
+	struct statx_timestamp	stx_ctime;
+
+	/* Last data modification time */
+	struct statx_timestamp	stx_mtime;
+
 	/* 0x80 */
-	__u32	stx_rdev_major;	/* Device ID of special file [if bdev/cdev] */
+	/* Device ID of special file [if bdev/cdev] */
+	__u32	stx_rdev_major;
 	__u32	stx_rdev_minor;
-	__u32	stx_dev_major;	/* ID of device containing file [uncond] */
+
+	/* ID of device containing file [uncond] */
+	__u32	stx_dev_major;
 	__u32	stx_dev_minor;
+
 	/* 0x90 */
 	__u64	stx_mnt_id;
-	__u32	stx_dio_mem_align;	/* Memory buffer alignment for direct I/O */
-	__u32	stx_dio_offset_align;	/* File offset alignment for direct I/O */
+
+	/* Memory buffer alignment for direct I/O */
+	__u32	stx_dio_mem_align;
+
+	/* File offset alignment for direct I/O */
+	__u32	stx_dio_offset_align;
+
 	/* 0xa0 */
-	__u64	stx_subvol;	/* Subvolume identifier */
-	__u32	stx_atomic_write_unit_min;	/* Min atomic write unit in bytes */
-	__u32	stx_atomic_write_unit_max;	/* Max atomic write unit in bytes */
+	/* Subvolume identifier */
+	__u64	stx_subvol;
+
+	/* Min atomic write unit in bytes */
+	__u32	stx_atomic_write_unit_min;
+
+	/* Max atomic write unit in bytes */
+	__u32	stx_atomic_write_unit_max;
+
 	/* 0xb0 */
-	__u32   stx_atomic_write_segments_max;	/* Max atomic write segment count */
-	__u32   __spare1[1];
+	/* Max atomic write segment count */
+	__u32   stx_atomic_write_segments_max;
+
+	/* File offset alignment for direct I/O reads */
+	__u32	stx_dio_read_offset_align;
+
 	/* 0xb8 */
 	__u64	__spare3[9];	/* Spare space for future expansion */
+
 	/* 0x100 */
 };
 
@@ -164,6 +214,7 @@ struct statx {
 #define STATX_MNT_ID_UNIQUE	0x00004000U	/* Want/got extended stx_mount_id */
 #define STATX_SUBVOL		0x00008000U	/* Want/got stx_subvol */
 #define STATX_WRITE_ATOMIC	0x00010000U	/* Want/got atomic_write_* fields */
+#define STATX_DIO_READ_ALIGN	0x00020000U	/* Want/got dio read alignment info */
 
 #define STATX__RESERVED		0x80000000U	/* Reserved for future struct statx expansion */
 
-- 
2.49.0.504.g3bcea36a83-goog


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 05/10] tools headers: Update the syscall table with the kernel sources
  2025-04-10  0:11 [PATCHSET 00/10] tools headers: Sync header files with the kernel Namhyung Kim
                   ` (3 preceding siblings ...)
  2025-04-10  0:11 ` [PATCH 04/10] tools headers: Update the VFS headers " Namhyung Kim
@ 2025-04-10  0:11 ` Namhyung Kim
  2025-04-14 16:28   ` James Clark
  2025-04-10  0:11 ` [PATCH 06/10] tools headers: Update the uapi/linux/prctl.h copy " Namhyung Kim
                   ` (6 subsequent siblings)
  11 siblings, 1 reply; 18+ messages in thread
From: Namhyung Kim @ 2025-04-10  0:11 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Ian Rogers, Kan Liang
  Cc: Jiri Olsa, Adrian Hunter, Peter Zijlstra, Ingo Molnar, LKML,
	linux-perf-users, linux-arch

To pick up the changes in:

  c4a16820d9019940 fs: add open_tree_attr()
  2df1ad0d25803399 x86/arch_prctl: Simplify sys_arch_prctl()
  e632bca07c8eef1d arm64: generate 64-bit syscall.tbl

This is basically to support the new open_tree_attr syscall.  But it
also needs to update asm-generic unistd.h header to get the new syscall
number.  And arm64 unistd.h header was converted to use the generic
64-bit header.

Addressing this perf tools build warning:

  Warning: Kernel ABI header differences:
    diff -u tools/scripts/syscall.tbl scripts/syscall.tbl
    diff -u tools/perf/arch/x86/entry/syscalls/syscall_32.tbl arch/x86/entry/syscalls/syscall_32.tbl
    diff -u tools/perf/arch/x86/entry/syscalls/syscall_64.tbl arch/x86/entry/syscalls/syscall_64.tbl
    diff -u tools/perf/arch/powerpc/entry/syscalls/syscall.tbl arch/powerpc/kernel/syscalls/syscall.tbl
    diff -u tools/perf/arch/s390/entry/syscalls/syscall.tbl arch/s390/kernel/syscalls/syscall.tbl
    diff -u tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl arch/mips/kernel/syscalls/syscall_n64.tbl
    diff -u tools/perf/arch/arm/entry/syscalls/syscall.tbl arch/arm/tools/syscall.tbl
    diff -u tools/perf/arch/sh/entry/syscalls/syscall.tbl arch/sh/kernel/syscalls/syscall.tbl
    diff -u tools/perf/arch/sparc/entry/syscalls/syscall.tbl arch/sparc/kernel/syscalls/syscall.tbl
    diff -u tools/perf/arch/xtensa/entry/syscalls/syscall.tbl arch/xtensa/kernel/syscalls/syscall.tbl
    diff -u tools/arch/arm64/include/uapi/asm/unistd.h arch/arm64/include/uapi/asm/unistd.h
    diff -u tools/include/uapi/asm-generic/unistd.h include/uapi/asm-generic/unistd.h

Please see tools/include/uapi/README for further details.

Cc: linux-arch@vger.kernel.org
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/arch/arm64/include/uapi/asm/unistd.h    | 24 +------------------
 tools/include/uapi/asm-generic/unistd.h       |  4 +++-
 .../perf/arch/arm/entry/syscalls/syscall.tbl  |  1 +
 .../arch/mips/entry/syscalls/syscall_n64.tbl  |  1 +
 .../arch/powerpc/entry/syscalls/syscall.tbl   |  1 +
 .../perf/arch/s390/entry/syscalls/syscall.tbl |  1 +
 tools/perf/arch/sh/entry/syscalls/syscall.tbl |  1 +
 .../arch/sparc/entry/syscalls/syscall.tbl     |  1 +
 .../arch/x86/entry/syscalls/syscall_32.tbl    |  3 ++-
 .../arch/x86/entry/syscalls/syscall_64.tbl    |  1 +
 .../arch/xtensa/entry/syscalls/syscall.tbl    |  1 +
 tools/scripts/syscall.tbl                     |  1 +
 12 files changed, 15 insertions(+), 25 deletions(-)

diff --git a/tools/arch/arm64/include/uapi/asm/unistd.h b/tools/arch/arm64/include/uapi/asm/unistd.h
index 9306726337fe005e..df36f23876e863ff 100644
--- a/tools/arch/arm64/include/uapi/asm/unistd.h
+++ b/tools/arch/arm64/include/uapi/asm/unistd.h
@@ -1,24 +1,2 @@
 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
-/*
- * Copyright (C) 2012 ARM Ltd.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#define __ARCH_WANT_RENAMEAT
-#define __ARCH_WANT_NEW_STAT
-#define __ARCH_WANT_SET_GET_RLIMIT
-#define __ARCH_WANT_TIME32_SYSCALLS
-#define __ARCH_WANT_MEMFD_SECRET
-
-#include <asm-generic/unistd.h>
+#include <asm/unistd_64.h>
diff --git a/tools/include/uapi/asm-generic/unistd.h b/tools/include/uapi/asm-generic/unistd.h
index 88dc393c2bca38c0..2892a45023af6d3e 100644
--- a/tools/include/uapi/asm-generic/unistd.h
+++ b/tools/include/uapi/asm-generic/unistd.h
@@ -849,9 +849,11 @@ __SYSCALL(__NR_getxattrat, sys_getxattrat)
 __SYSCALL(__NR_listxattrat, sys_listxattrat)
 #define __NR_removexattrat 466
 __SYSCALL(__NR_removexattrat, sys_removexattrat)
+#define __NR_open_tree_attr 467
+__SYSCALL(__NR_open_tree_attr, sys_open_tree_attr)
 
 #undef __NR_syscalls
-#define __NR_syscalls 467
+#define __NR_syscalls 468
 
 /*
  * 32 bit systems traditionally used different
diff --git a/tools/perf/arch/arm/entry/syscalls/syscall.tbl b/tools/perf/arch/arm/entry/syscalls/syscall.tbl
index 49eeb2ad8dbd8e07..27c1d5ebcd91c8c2 100644
--- a/tools/perf/arch/arm/entry/syscalls/syscall.tbl
+++ b/tools/perf/arch/arm/entry/syscalls/syscall.tbl
@@ -481,3 +481,4 @@
 464	common	getxattrat			sys_getxattrat
 465	common	listxattrat			sys_listxattrat
 466	common	removexattrat			sys_removexattrat
+467	common	open_tree_attr			sys_open_tree_attr
diff --git a/tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl b/tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl
index c844cd5cda620b28..1e8c44c7b61492ea 100644
--- a/tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl
+++ b/tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl
@@ -381,3 +381,4 @@
 464	n64	getxattrat			sys_getxattrat
 465	n64	listxattrat			sys_listxattrat
 466	n64	removexattrat			sys_removexattrat
+467	n64	open_tree_attr			sys_open_tree_attr
diff --git a/tools/perf/arch/powerpc/entry/syscalls/syscall.tbl b/tools/perf/arch/powerpc/entry/syscalls/syscall.tbl
index d8b4ab78bef076bd..9a084bdb892694bc 100644
--- a/tools/perf/arch/powerpc/entry/syscalls/syscall.tbl
+++ b/tools/perf/arch/powerpc/entry/syscalls/syscall.tbl
@@ -557,3 +557,4 @@
 464	common	getxattrat			sys_getxattrat
 465	common	listxattrat			sys_listxattrat
 466	common	removexattrat			sys_removexattrat
+467	common	open_tree_attr			sys_open_tree_attr
diff --git a/tools/perf/arch/s390/entry/syscalls/syscall.tbl b/tools/perf/arch/s390/entry/syscalls/syscall.tbl
index e9115b4d8b635b84..a4569b96ef06c54c 100644
--- a/tools/perf/arch/s390/entry/syscalls/syscall.tbl
+++ b/tools/perf/arch/s390/entry/syscalls/syscall.tbl
@@ -469,3 +469,4 @@
 464  common	getxattrat		sys_getxattrat			sys_getxattrat
 465  common	listxattrat		sys_listxattrat			sys_listxattrat
 466  common	removexattrat		sys_removexattrat		sys_removexattrat
+467  common	open_tree_attr		sys_open_tree_attr		sys_open_tree_attr
diff --git a/tools/perf/arch/sh/entry/syscalls/syscall.tbl b/tools/perf/arch/sh/entry/syscalls/syscall.tbl
index c8cad33bf250ea11..52a7652fcff6394b 100644
--- a/tools/perf/arch/sh/entry/syscalls/syscall.tbl
+++ b/tools/perf/arch/sh/entry/syscalls/syscall.tbl
@@ -470,3 +470,4 @@
 464	common	getxattrat			sys_getxattrat
 465	common	listxattrat			sys_listxattrat
 466	common	removexattrat			sys_removexattrat
+467	common	open_tree_attr			sys_open_tree_attr
diff --git a/tools/perf/arch/sparc/entry/syscalls/syscall.tbl b/tools/perf/arch/sparc/entry/syscalls/syscall.tbl
index 727f99d333b304b3..83e45eb6c095a36b 100644
--- a/tools/perf/arch/sparc/entry/syscalls/syscall.tbl
+++ b/tools/perf/arch/sparc/entry/syscalls/syscall.tbl
@@ -512,3 +512,4 @@
 464	common	getxattrat			sys_getxattrat
 465	common	listxattrat			sys_listxattrat
 466	common	removexattrat			sys_removexattrat
+467	common	open_tree_attr			sys_open_tree_attr
diff --git a/tools/perf/arch/x86/entry/syscalls/syscall_32.tbl b/tools/perf/arch/x86/entry/syscalls/syscall_32.tbl
index 4d0fb2fba7e208ae..ac007ea00979dc28 100644
--- a/tools/perf/arch/x86/entry/syscalls/syscall_32.tbl
+++ b/tools/perf/arch/x86/entry/syscalls/syscall_32.tbl
@@ -396,7 +396,7 @@
 381	i386	pkey_alloc		sys_pkey_alloc
 382	i386	pkey_free		sys_pkey_free
 383	i386	statx			sys_statx
-384	i386	arch_prctl		sys_arch_prctl			compat_sys_arch_prctl
+384	i386	arch_prctl		sys_arch_prctl
 385	i386	io_pgetevents		sys_io_pgetevents_time32	compat_sys_io_pgetevents
 386	i386	rseq			sys_rseq
 393	i386	semget			sys_semget
@@ -472,3 +472,4 @@
 464	i386	getxattrat		sys_getxattrat
 465	i386	listxattrat		sys_listxattrat
 466	i386	removexattrat		sys_removexattrat
+467	i386	open_tree_attr		sys_open_tree_attr
diff --git a/tools/perf/arch/x86/entry/syscalls/syscall_64.tbl b/tools/perf/arch/x86/entry/syscalls/syscall_64.tbl
index 5eb708bff1c791de..cfb5ca41e30de1a4 100644
--- a/tools/perf/arch/x86/entry/syscalls/syscall_64.tbl
+++ b/tools/perf/arch/x86/entry/syscalls/syscall_64.tbl
@@ -390,6 +390,7 @@
 464	common	getxattrat		sys_getxattrat
 465	common	listxattrat		sys_listxattrat
 466	common	removexattrat		sys_removexattrat
+467	common	open_tree_attr		sys_open_tree_attr
 
 #
 # Due to a historical design error, certain syscalls are numbered differently
diff --git a/tools/perf/arch/xtensa/entry/syscalls/syscall.tbl b/tools/perf/arch/xtensa/entry/syscalls/syscall.tbl
index 37effc1b134eea06..f657a77314f8667f 100644
--- a/tools/perf/arch/xtensa/entry/syscalls/syscall.tbl
+++ b/tools/perf/arch/xtensa/entry/syscalls/syscall.tbl
@@ -437,3 +437,4 @@
 464	common	getxattrat			sys_getxattrat
 465	common	listxattrat			sys_listxattrat
 466	common	removexattrat			sys_removexattrat
+467	common	open_tree_attr			sys_open_tree_attr
diff --git a/tools/scripts/syscall.tbl b/tools/scripts/syscall.tbl
index ebbdb3c42e9f7461..580b4e246aecd5f0 100644
--- a/tools/scripts/syscall.tbl
+++ b/tools/scripts/syscall.tbl
@@ -407,3 +407,4 @@
 464	common	getxattrat			sys_getxattrat
 465	common	listxattrat			sys_listxattrat
 466	common	removexattrat			sys_removexattrat
+467	common	open_tree_attr			sys_open_tree_attr
-- 
2.49.0.504.g3bcea36a83-goog


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 06/10] tools headers: Update the uapi/linux/prctl.h copy with the kernel sources
  2025-04-10  0:11 [PATCHSET 00/10] tools headers: Sync header files with the kernel Namhyung Kim
                   ` (4 preceding siblings ...)
  2025-04-10  0:11 ` [PATCH 05/10] tools headers: Update the syscall table " Namhyung Kim
@ 2025-04-10  0:11 ` Namhyung Kim
  2025-04-10  0:11 ` [PATCH 07/10] tools headers: Update the uapi/asm-generic/mman-common.h " Namhyung Kim
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Namhyung Kim @ 2025-04-10  0:11 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Ian Rogers, Kan Liang
  Cc: Jiri Olsa, Adrian Hunter, Peter Zijlstra, Ingo Molnar, LKML,
	linux-perf-users, Thomas Gleixner

To pick up the changes in:

  ec2d0c04624b3c8a posix-timers: Provide a mechanism to allocate a given timer ID

Addressing this perf tools build warning:

  Warning: Kernel ABI header differences:
    diff -u tools/perf/trace/beauty/include/uapi/linux/prctl.h include/uapi/linux/prctl.h

Please see tools/include/uapi/README for further details.

Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/trace/beauty/include/uapi/linux/prctl.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/tools/perf/trace/beauty/include/uapi/linux/prctl.h b/tools/perf/trace/beauty/include/uapi/linux/prctl.h
index 5c6080680cb27b19..15c18ef4eb11a013 100644
--- a/tools/perf/trace/beauty/include/uapi/linux/prctl.h
+++ b/tools/perf/trace/beauty/include/uapi/linux/prctl.h
@@ -353,4 +353,15 @@ struct prctl_mm_map {
  */
 #define PR_LOCK_SHADOW_STACK_STATUS      76
 
+/*
+ * Controls the mode of timer_create() for CRIU restore operations.
+ * Enabling this allows CRIU to restore timers with explicit IDs.
+ *
+ * Don't use for normal operations as the result might be undefined.
+ */
+#define PR_TIMER_CREATE_RESTORE_IDS		77
+# define PR_TIMER_CREATE_RESTORE_IDS_OFF	0
+# define PR_TIMER_CREATE_RESTORE_IDS_ON		1
+# define PR_TIMER_CREATE_RESTORE_IDS_GET	2
+
 #endif /* _LINUX_PRCTL_H */
-- 
2.49.0.504.g3bcea36a83-goog


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 07/10] tools headers: Update the uapi/asm-generic/mman-common.h copy with the kernel sources
  2025-04-10  0:11 [PATCHSET 00/10] tools headers: Sync header files with the kernel Namhyung Kim
                   ` (5 preceding siblings ...)
  2025-04-10  0:11 ` [PATCH 06/10] tools headers: Update the uapi/linux/prctl.h copy " Namhyung Kim
@ 2025-04-10  0:11 ` Namhyung Kim
  2025-04-10  0:11 ` [PATCH 08/10] tools headers: Update the linux/unaligned.h " Namhyung Kim
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Namhyung Kim @ 2025-04-10  0:11 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Ian Rogers, Kan Liang
  Cc: Jiri Olsa, Adrian Hunter, Peter Zijlstra, Ingo Molnar, LKML,
	linux-perf-users, linux-arch

To pick up the changes in:

   6d61527d931ba07b mm/pkey: Add PKEY_UNRESTRICTED macro

Addressing this perf tools build warning:

  Warning: Kernel ABI header differences:
    diff -u tools/include/uapi/asm-generic/mman-common.h include/uapi/asm-generic/mman-common.h

Please see tools/include/uapi/README for further details.

Cc: linux-arch@vger.kernel.org
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/include/uapi/asm-generic/mman-common.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/include/uapi/asm-generic/mman-common.h b/tools/include/uapi/asm-generic/mman-common.h
index 1ea2c4c33b86a263..ef1c27fa3c570fa4 100644
--- a/tools/include/uapi/asm-generic/mman-common.h
+++ b/tools/include/uapi/asm-generic/mman-common.h
@@ -85,6 +85,7 @@
 /* compatibility flags */
 #define MAP_FILE	0
 
+#define PKEY_UNRESTRICTED	0x0
 #define PKEY_DISABLE_ACCESS	0x1
 #define PKEY_DISABLE_WRITE	0x2
 #define PKEY_ACCESS_MASK	(PKEY_DISABLE_ACCESS |\
-- 
2.49.0.504.g3bcea36a83-goog


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 08/10] tools headers: Update the linux/unaligned.h copy with the kernel sources
  2025-04-10  0:11 [PATCHSET 00/10] tools headers: Sync header files with the kernel Namhyung Kim
                   ` (6 preceding siblings ...)
  2025-04-10  0:11 ` [PATCH 07/10] tools headers: Update the uapi/asm-generic/mman-common.h " Namhyung Kim
@ 2025-04-10  0:11 ` Namhyung Kim
  2025-04-10  0:11 ` [PATCH 09/10] tools headers: Update the x86 headers " Namhyung Kim
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Namhyung Kim @ 2025-04-10  0:11 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Ian Rogers, Kan Liang
  Cc: Jiri Olsa, Adrian Hunter, Peter Zijlstra, Ingo Molnar, LKML,
	linux-perf-users, linux-sound

To pick up the changes in:

  3846699217798061 ALSA: rawmidi: Make tied_device=0 as default / unknown
  7bb49d2e8b52adac ALSA: rawmidi: Bump protocol version to 2.0.5
  b8fefed73a952a33 ALSA: rawmidi: Show substream activity in info ioctl
  bdf46443f350dd5d ALSA: rawmidi: Expose the tied device number in info ioctl

Addressing this perf tools build warning:

  Warning: Kernel ABI header differences:
    diff -u tools/perf/trace/beauty/include/uapi/sound/asound.h include/uapi/sound/asound.h

Please see tools/include/uapi/README for further details.

Cc: linux-sound@vger.kernel.org
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/trace/beauty/include/uapi/sound/asound.h | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tools/perf/trace/beauty/include/uapi/sound/asound.h b/tools/perf/trace/beauty/include/uapi/sound/asound.h
index 4cd513215bcd8f74..5a049eeaeccea59f 100644
--- a/tools/perf/trace/beauty/include/uapi/sound/asound.h
+++ b/tools/perf/trace/beauty/include/uapi/sound/asound.h
@@ -716,7 +716,7 @@ enum {
  *  Raw MIDI section - /dev/snd/midi??
  */
 
-#define SNDRV_RAWMIDI_VERSION		SNDRV_PROTOCOL_VERSION(2, 0, 4)
+#define SNDRV_RAWMIDI_VERSION		SNDRV_PROTOCOL_VERSION(2, 0, 5)
 
 enum {
 	SNDRV_RAWMIDI_STREAM_OUTPUT = 0,
@@ -728,6 +728,9 @@ enum {
 #define SNDRV_RAWMIDI_INFO_INPUT		0x00000002
 #define SNDRV_RAWMIDI_INFO_DUPLEX		0x00000004
 #define SNDRV_RAWMIDI_INFO_UMP			0x00000008
+#define SNDRV_RAWMIDI_INFO_STREAM_INACTIVE	0x00000010
+
+#define SNDRV_RAWMIDI_DEVICE_UNKNOWN		0
 
 struct snd_rawmidi_info {
 	unsigned int device;		/* RO/WR (control): device number */
@@ -740,7 +743,8 @@ struct snd_rawmidi_info {
 	unsigned char subname[32];	/* name of active or selected subdevice */
 	unsigned int subdevices_count;
 	unsigned int subdevices_avail;
-	unsigned char reserved[64];	/* reserved for future use */
+	int tied_device;		/* R: tied rawmidi device (UMP/legacy) */
+	unsigned char reserved[60];	/* reserved for future use */
 };
 
 #define SNDRV_RAWMIDI_MODE_FRAMING_MASK		(7<<0)
-- 
2.49.0.504.g3bcea36a83-goog


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 09/10] tools headers: Update the x86 headers with the kernel sources
  2025-04-10  0:11 [PATCHSET 00/10] tools headers: Sync header files with the kernel Namhyung Kim
                   ` (7 preceding siblings ...)
  2025-04-10  0:11 ` [PATCH 08/10] tools headers: Update the linux/unaligned.h " Namhyung Kim
@ 2025-04-10  0:11 ` Namhyung Kim
  2025-04-10  0:11 ` [PATCH 10/10] tools headers: Update the arch/x86/lib/memset_64.S copy " Namhyung Kim
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 18+ messages in thread
From: Namhyung Kim @ 2025-04-10  0:11 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Ian Rogers, Kan Liang
  Cc: Jiri Olsa, Adrian Hunter, Peter Zijlstra, Ingo Molnar, LKML,
	linux-perf-users, x86

To pick up the changes in:

  841326332bcb13ae x86/cpufeatures: Generate the <asm/cpufeaturemasks.h> header based on build config
  440a65b7d25fb06f x86/mm: Enable AMD translation cache extensions
  767ae437a32d6447 x86/mm: Add INVLPGB feature and Kconfig entry
  b4cc466b97359011 cpufreq/amd-pstate: Replace all AMD_CPPC_* macros with masks
  98c7a713db91c5a9 x86/bugs: Add X86_BUG_SPECTRE_V2_USER
  8f64eee70cdd3bb8 x86/bugs: Remove X86_FEATURE_USE_IBPB
  8442df2b49ed9bcd x86/bugs: KVM: Add support for SRSO_MSR_FIX
  70792aed14551e31 x86/cpufeatures: Add CPUID feature bit for Idle HLT intercept
  968e9bc4cef87054 x86: move ZMM exclusion list into CPU feature flag
  c631a2de7ae48d50 perf/x86/intel: Ensure LBRs are disabled when a CPU is starting
  38cc6495cdec18a4 x86/sev: Prevent GUEST_TSC_FREQ MSR interception for Secure TSC enabled guests
  288bba2f4c8be1e1 x86/cpufeatures: Remove "AMD" from the comments to the AMD-specific leaf
  877818802c3e970f x86/bugs: Add SRSO_USER_KERNEL_NO support
  8ae3291f773befee x86/sev: Add full support for a segmented RMP table
  0cbc0258415814c8 x86/sev: Add support for the RMPREAD instruction
  7a470e826d7521be x86/cpufeatures: Free up unused feature bits

Addressing this perf tools build warning:

  Warning: Kernel ABI header differences:
    diff -u tools/arch/x86/include/asm/cpufeatures.h arch/x86/include/asm/cpufeatures.h
    diff -u tools/arch/x86/include/asm/msr-index.h arch/x86/include/asm/msr-index.h

Please see tools/include/uapi/README for further details.

Cc: x86@kernel.org
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/arch/x86/include/asm/cpufeatures.h | 28 +++++++++++++++------
 tools/arch/x86/include/asm/msr-index.h   | 31 +++++++++++++++---------
 2 files changed, 39 insertions(+), 20 deletions(-)

diff --git a/tools/arch/x86/include/asm/cpufeatures.h b/tools/arch/x86/include/asm/cpufeatures.h
index 9e3fa7942e7d3f24..6c2c152d8a67b9bf 100644
--- a/tools/arch/x86/include/asm/cpufeatures.h
+++ b/tools/arch/x86/include/asm/cpufeatures.h
@@ -75,8 +75,8 @@
 #define X86_FEATURE_CENTAUR_MCR		( 3*32+ 3) /* "centaur_mcr" Centaur MCRs (= MTRRs) */
 #define X86_FEATURE_K8			( 3*32+ 4) /* Opteron, Athlon64 */
 #define X86_FEATURE_ZEN5		( 3*32+ 5) /* CPU based on Zen5 microarchitecture */
-#define X86_FEATURE_P3			( 3*32+ 6) /* P3 */
-#define X86_FEATURE_P4			( 3*32+ 7) /* P4 */
+/* Free                                 ( 3*32+ 6) */
+/* Free                                 ( 3*32+ 7) */
 #define X86_FEATURE_CONSTANT_TSC	( 3*32+ 8) /* "constant_tsc" TSC ticks at a constant rate */
 #define X86_FEATURE_UP			( 3*32+ 9) /* "up" SMP kernel running on UP */
 #define X86_FEATURE_ART			( 3*32+10) /* "art" Always running timer (ART) */
@@ -329,6 +329,7 @@
 #define X86_FEATURE_CLZERO		(13*32+ 0) /* "clzero" CLZERO instruction */
 #define X86_FEATURE_IRPERF		(13*32+ 1) /* "irperf" Instructions Retired Count */
 #define X86_FEATURE_XSAVEERPTR		(13*32+ 2) /* "xsaveerptr" Always save/restore FP error pointers */
+#define X86_FEATURE_INVLPGB		(13*32+ 3) /* INVLPGB and TLBSYNC instructions supported */
 #define X86_FEATURE_RDPRU		(13*32+ 4) /* "rdpru" Read processor register at user level */
 #define X86_FEATURE_WBNOINVD		(13*32+ 9) /* "wbnoinvd" WBNOINVD instruction */
 #define X86_FEATURE_AMD_IBPB		(13*32+12) /* Indirect Branch Prediction Barrier */
@@ -377,6 +378,7 @@
 #define X86_FEATURE_V_SPEC_CTRL		(15*32+20) /* "v_spec_ctrl" Virtual SPEC_CTRL */
 #define X86_FEATURE_VNMI		(15*32+25) /* "vnmi" Virtual NMI */
 #define X86_FEATURE_SVME_ADDR_CHK	(15*32+28) /* SVME addr check */
+#define X86_FEATURE_IDLE_HLT		(15*32+30) /* IDLE HLT intercept */
 
 /* Intel-defined CPU features, CPUID level 0x00000007:0 (ECX), word 16 */
 #define X86_FEATURE_AVX512VBMI		(16*32+ 1) /* "avx512vbmi" AVX512 Vector Bit Manipulation instructions*/
@@ -434,15 +436,18 @@
 #define X86_FEATURE_SPEC_CTRL_SSBD	(18*32+31) /* Speculative Store Bypass Disable */
 
 /* AMD-defined memory encryption features, CPUID level 0x8000001f (EAX), word 19 */
-#define X86_FEATURE_SME			(19*32+ 0) /* "sme" AMD Secure Memory Encryption */
-#define X86_FEATURE_SEV			(19*32+ 1) /* "sev" AMD Secure Encrypted Virtualization */
+#define X86_FEATURE_SME			(19*32+ 0) /* "sme" Secure Memory Encryption */
+#define X86_FEATURE_SEV			(19*32+ 1) /* "sev" Secure Encrypted Virtualization */
 #define X86_FEATURE_VM_PAGE_FLUSH	(19*32+ 2) /* VM Page Flush MSR is supported */
-#define X86_FEATURE_SEV_ES		(19*32+ 3) /* "sev_es" AMD Secure Encrypted Virtualization - Encrypted State */
-#define X86_FEATURE_SEV_SNP		(19*32+ 4) /* "sev_snp" AMD Secure Encrypted Virtualization - Secure Nested Paging */
+#define X86_FEATURE_SEV_ES		(19*32+ 3) /* "sev_es" Secure Encrypted Virtualization - Encrypted State */
+#define X86_FEATURE_SEV_SNP		(19*32+ 4) /* "sev_snp" Secure Encrypted Virtualization - Secure Nested Paging */
 #define X86_FEATURE_V_TSC_AUX		(19*32+ 9) /* Virtual TSC_AUX */
-#define X86_FEATURE_SME_COHERENT	(19*32+10) /* AMD hardware-enforced cache coherency */
-#define X86_FEATURE_DEBUG_SWAP		(19*32+14) /* "debug_swap" AMD SEV-ES full debug state swap support */
+#define X86_FEATURE_SME_COHERENT	(19*32+10) /* hardware-enforced cache coherency */
+#define X86_FEATURE_DEBUG_SWAP		(19*32+14) /* "debug_swap" SEV-ES full debug state swap support */
+#define X86_FEATURE_RMPREAD		(19*32+21) /* RMPREAD instruction */
+#define X86_FEATURE_SEGMENTED_RMP	(19*32+23) /* Segmented RMP support */
 #define X86_FEATURE_SVSM		(19*32+28) /* "svsm" SVSM present */
+#define X86_FEATURE_HV_INUSE_WR_ALLOWED	(19*32+30) /* Allow Write to in-use hypervisor-owned pages */
 
 /* AMD-defined Extended Feature 2 EAX, CPUID level 0x80000021 (EAX), word 20 */
 #define X86_FEATURE_NO_NESTED_DATA_BP	(20*32+ 0) /* No Nested Data Breakpoints */
@@ -455,6 +460,11 @@
 #define X86_FEATURE_SBPB		(20*32+27) /* Selective Branch Prediction Barrier */
 #define X86_FEATURE_IBPB_BRTYPE		(20*32+28) /* MSR_PRED_CMD[IBPB] flushes all branch type predictions */
 #define X86_FEATURE_SRSO_NO		(20*32+29) /* CPU is not affected by SRSO */
+#define X86_FEATURE_SRSO_USER_KERNEL_NO	(20*32+30) /* CPU is not affected by SRSO across user/kernel boundaries */
+#define X86_FEATURE_SRSO_BP_SPEC_REDUCE	(20*32+31) /*
+						    * BP_CFG[BpSpecReduce] can be used to mitigate SRSO for VMs.
+						    * (SRSO_MSR_FIX in the official doc).
+						    */
 
 /*
  * Extended auxiliary flags: Linux defined - for features scattered in various
@@ -470,6 +480,7 @@
 #define X86_FEATURE_AMD_FAST_CPPC	(21*32 + 5) /* Fast CPPC */
 #define X86_FEATURE_AMD_HETEROGENEOUS_CORES (21*32 + 6) /* Heterogeneous Core Topology */
 #define X86_FEATURE_AMD_WORKLOAD_CLASS	(21*32 + 7) /* Workload Classification */
+#define X86_FEATURE_PREFER_YMM		(21*32 + 8) /* Avoid ZMM registers due to downclocking */
 
 /*
  * BUG word(s)
@@ -521,4 +532,5 @@
 #define X86_BUG_RFDS			X86_BUG(1*32 + 2) /* "rfds" CPU is vulnerable to Register File Data Sampling */
 #define X86_BUG_BHI			X86_BUG(1*32 + 3) /* "bhi" CPU is affected by Branch History Injection */
 #define X86_BUG_IBPB_NO_RET	   	X86_BUG(1*32 + 4) /* "ibpb_no_ret" IBPB omits return target predictions */
+#define X86_BUG_SPECTRE_V2_USER		X86_BUG(1*32 + 5) /* "spectre_v2_user" CPU is affected by Spectre variant 2 attack between user processes */
 #endif /* _ASM_X86_CPUFEATURES_H */
diff --git a/tools/arch/x86/include/asm/msr-index.h b/tools/arch/x86/include/asm/msr-index.h
index dc1c1057f26e45a8..e6134ef2263d50d1 100644
--- a/tools/arch/x86/include/asm/msr-index.h
+++ b/tools/arch/x86/include/asm/msr-index.h
@@ -397,7 +397,8 @@
 #define MSR_IA32_PASID_VALID		BIT_ULL(31)
 
 /* DEBUGCTLMSR bits (others vary by model): */
-#define DEBUGCTLMSR_LBR			(1UL <<  0) /* last branch recording */
+#define DEBUGCTLMSR_LBR_BIT		0	     /* last branch recording */
+#define DEBUGCTLMSR_LBR			(1UL <<  DEBUGCTLMSR_LBR_BIT)
 #define DEBUGCTLMSR_BTF_SHIFT		1
 #define DEBUGCTLMSR_BTF			(1UL <<  1) /* single-step on branches */
 #define DEBUGCTLMSR_BUS_LOCK_DETECT	(1UL <<  2)
@@ -610,6 +611,7 @@
 #define MSR_AMD_PERF_CTL		0xc0010062
 #define MSR_AMD_PERF_STATUS		0xc0010063
 #define MSR_AMD_PSTATE_DEF_BASE		0xc0010064
+#define MSR_AMD64_GUEST_TSC_FREQ	0xc0010134
 #define MSR_AMD64_OSVW_ID_LENGTH	0xc0010140
 #define MSR_AMD64_OSVW_STATUS		0xc0010141
 #define MSR_AMD_PPIN_CTL		0xc00102f0
@@ -646,6 +648,7 @@
 #define MSR_AMD64_IBS_REG_COUNT_MAX	8 /* includes MSR_AMD64_IBSBRTARGET */
 #define MSR_AMD64_SVM_AVIC_DOORBELL	0xc001011b
 #define MSR_AMD64_VM_PAGE_FLUSH		0xc001011e
+#define MSR_AMD64_VIRT_SPEC_CTRL	0xc001011f
 #define MSR_AMD64_SEV_ES_GHCB		0xc0010130
 #define MSR_AMD64_SEV			0xc0010131
 #define MSR_AMD64_SEV_ENABLED_BIT	0
@@ -684,11 +687,12 @@
 #define MSR_AMD64_SNP_SMT_PROT		BIT_ULL(MSR_AMD64_SNP_SMT_PROT_BIT)
 #define MSR_AMD64_SNP_RESV_BIT		18
 #define MSR_AMD64_SNP_RESERVED_MASK	GENMASK_ULL(63, MSR_AMD64_SNP_RESV_BIT)
-
-#define MSR_AMD64_VIRT_SPEC_CTRL	0xc001011f
-
 #define MSR_AMD64_RMP_BASE		0xc0010132
 #define MSR_AMD64_RMP_END		0xc0010133
+#define MSR_AMD64_RMP_CFG		0xc0010136
+#define MSR_AMD64_SEG_RMP_ENABLED_BIT	0
+#define MSR_AMD64_SEG_RMP_ENABLED	BIT_ULL(MSR_AMD64_SEG_RMP_ENABLED_BIT)
+#define MSR_AMD64_RMP_SEGMENT_SHIFT(x)	(((x) & GENMASK_ULL(13, 8)) >> 8)
 
 #define MSR_SVSM_CAA			0xc001f000
 
@@ -699,15 +703,17 @@
 #define MSR_AMD_CPPC_REQ		0xc00102b3
 #define MSR_AMD_CPPC_STATUS		0xc00102b4
 
-#define AMD_CPPC_LOWEST_PERF(x)		(((x) >> 0) & 0xff)
-#define AMD_CPPC_LOWNONLIN_PERF(x)	(((x) >> 8) & 0xff)
-#define AMD_CPPC_NOMINAL_PERF(x)	(((x) >> 16) & 0xff)
-#define AMD_CPPC_HIGHEST_PERF(x)	(((x) >> 24) & 0xff)
+/* Masks for use with MSR_AMD_CPPC_CAP1 */
+#define AMD_CPPC_LOWEST_PERF_MASK	GENMASK(7, 0)
+#define AMD_CPPC_LOWNONLIN_PERF_MASK	GENMASK(15, 8)
+#define AMD_CPPC_NOMINAL_PERF_MASK	GENMASK(23, 16)
+#define AMD_CPPC_HIGHEST_PERF_MASK	GENMASK(31, 24)
 
-#define AMD_CPPC_MAX_PERF(x)		(((x) & 0xff) << 0)
-#define AMD_CPPC_MIN_PERF(x)		(((x) & 0xff) << 8)
-#define AMD_CPPC_DES_PERF(x)		(((x) & 0xff) << 16)
-#define AMD_CPPC_ENERGY_PERF_PREF(x)	(((x) & 0xff) << 24)
+/* Masks for use with MSR_AMD_CPPC_REQ */
+#define AMD_CPPC_MAX_PERF_MASK		GENMASK(7, 0)
+#define AMD_CPPC_MIN_PERF_MASK		GENMASK(15, 8)
+#define AMD_CPPC_DES_PERF_MASK		GENMASK(23, 16)
+#define AMD_CPPC_EPP_PERF_MASK		GENMASK(31, 24)
 
 /* AMD Performance Counter Global Status and Control MSRs */
 #define MSR_AMD64_PERF_CNTR_GLOBAL_STATUS	0xc0000300
@@ -719,6 +725,7 @@
 
 /* Zen4 */
 #define MSR_ZEN4_BP_CFG                 0xc001102e
+#define MSR_ZEN4_BP_CFG_BP_SPEC_REDUCE_BIT 4
 #define MSR_ZEN4_BP_CFG_SHARED_BTB_FIX_BIT 5
 
 /* Fam 19h MSRs */
-- 
2.49.0.504.g3bcea36a83-goog


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 10/10] tools headers: Update the arch/x86/lib/memset_64.S copy with the kernel sources
  2025-04-10  0:11 [PATCHSET 00/10] tools headers: Sync header files with the kernel Namhyung Kim
                   ` (8 preceding siblings ...)
  2025-04-10  0:11 ` [PATCH 09/10] tools headers: Update the x86 headers " Namhyung Kim
@ 2025-04-10  0:11 ` Namhyung Kim
  2025-04-10  6:02 ` [PATCHSET 00/10] tools headers: Sync header files with the kernel Ingo Molnar
  2025-04-10 11:31 ` Venkat
  11 siblings, 0 replies; 18+ messages in thread
From: Namhyung Kim @ 2025-04-10  0:11 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Ian Rogers, Kan Liang
  Cc: Jiri Olsa, Adrian Hunter, Peter Zijlstra, Ingo Molnar, LKML,
	linux-perf-users, x86

To pick up the changes in:

  2981557cb0408e14 x86,kcfi: Fix EXPORT_SYMBOL vs kCFI

That required adding a copy of include/linux/cfi_types.h and its checking
in tools/perf/check-headers.h.

Addressing this perf tools build warning:

  Warning: Kernel ABI header differences:
    diff -u tools/arch/x86/lib/memset_64.S arch/x86/lib/memset_64.S

Please see tools/include/uapi/README for further details.

Cc: x86@kernel.org
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/arch/x86/lib/memset_64.S  |  3 ++-
 tools/include/linux/cfi_types.h | 45 +++++++++++++++++++++++++++++++++
 tools/perf/check-headers.sh     |  1 +
 3 files changed, 48 insertions(+), 1 deletion(-)
 create mode 100644 tools/include/linux/cfi_types.h

diff --git a/tools/arch/x86/lib/memset_64.S b/tools/arch/x86/lib/memset_64.S
index 0199d56cb479d88c..d66b710d628f8865 100644
--- a/tools/arch/x86/lib/memset_64.S
+++ b/tools/arch/x86/lib/memset_64.S
@@ -3,6 +3,7 @@
 
 #include <linux/export.h>
 #include <linux/linkage.h>
+#include <linux/cfi_types.h>
 #include <asm/cpufeatures.h>
 #include <asm/alternative.h>
 
@@ -28,7 +29,7 @@
  * only for the return value that is the same as the source input,
  * which the compiler could/should do much better anyway.
  */
-SYM_FUNC_START(__memset)
+SYM_TYPED_FUNC_START(__memset)
 	ALTERNATIVE "jmp memset_orig", "", X86_FEATURE_FSRS
 
 	movq %rdi,%r9
diff --git a/tools/include/linux/cfi_types.h b/tools/include/linux/cfi_types.h
new file mode 100644
index 0000000000000000..6b87136757655c05
--- /dev/null
+++ b/tools/include/linux/cfi_types.h
@@ -0,0 +1,45 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Clang Control Flow Integrity (CFI) type definitions.
+ */
+#ifndef _LINUX_CFI_TYPES_H
+#define _LINUX_CFI_TYPES_H
+
+#ifdef __ASSEMBLY__
+#include <linux/linkage.h>
+
+#ifdef CONFIG_CFI_CLANG
+/*
+ * Use the __kcfi_typeid_<function> type identifier symbol to
+ * annotate indirectly called assembly functions. The compiler emits
+ * these symbols for all address-taken function declarations in C
+ * code.
+ */
+#ifndef __CFI_TYPE
+#define __CFI_TYPE(name)				\
+	.4byte __kcfi_typeid_##name
+#endif
+
+#define SYM_TYPED_ENTRY(name, linkage, align...)	\
+	linkage(name) ASM_NL				\
+	align ASM_NL					\
+	__CFI_TYPE(name) ASM_NL				\
+	name:
+
+#define SYM_TYPED_START(name, linkage, align...)	\
+	SYM_TYPED_ENTRY(name, linkage, align)
+
+#else /* CONFIG_CFI_CLANG */
+
+#define SYM_TYPED_START(name, linkage, align...)	\
+	SYM_START(name, linkage, align)
+
+#endif /* CONFIG_CFI_CLANG */
+
+#ifndef SYM_TYPED_FUNC_START
+#define SYM_TYPED_FUNC_START(name) 			\
+	SYM_TYPED_START(name, SYM_L_GLOBAL, SYM_A_ALIGN)
+#endif
+
+#endif /* __ASSEMBLY__ */
+#endif /* _LINUX_CFI_TYPES_H */
diff --git a/tools/perf/check-headers.sh b/tools/perf/check-headers.sh
index a4499e5a6f9cb00c..857f6646cc23e949 100755
--- a/tools/perf/check-headers.sh
+++ b/tools/perf/check-headers.sh
@@ -20,6 +20,7 @@ FILES=(
   "include/uapi/linux/stat.h"
   "include/linux/bits.h"
   "include/vdso/bits.h"
+  "include/linux/cfi_types.h"
   "include/linux/const.h"
   "include/vdso/const.h"
   "include/vdso/unaligned.h"
-- 
2.49.0.504.g3bcea36a83-goog


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCHSET 00/10] tools headers: Sync header files with the kernel
  2025-04-10  0:11 [PATCHSET 00/10] tools headers: Sync header files with the kernel Namhyung Kim
                   ` (9 preceding siblings ...)
  2025-04-10  0:11 ` [PATCH 10/10] tools headers: Update the arch/x86/lib/memset_64.S copy " Namhyung Kim
@ 2025-04-10  6:02 ` Ingo Molnar
  2025-04-10 11:31 ` Venkat
  11 siblings, 0 replies; 18+ messages in thread
From: Ingo Molnar @ 2025-04-10  6:02 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Arnaldo Carvalho de Melo, Ian Rogers, Kan Liang, Jiri Olsa,
	Adrian Hunter, Peter Zijlstra, LKML, linux-perf-users


* Namhyung Kim <namhyung@kernel.org> wrote:

> Hello,
> 
> FYI I'm carrying these changes in the perf tools tree so make perf trace
> beautifiers get the recent changes in syscall, ioctl, and so on.  For the
> background, please see tools/include/uapi/README.
> 
> Still there are some remaining items but it requires a bit more changes.
> So I'd like to leave them for the next cycle.
> 
>   Warning: Kernel ABI header differences:
>     diff -u tools/include/uapi/linux/bits.h include/uapi/linux/bits.h
>     diff -u tools/include/linux/bits.h include/linux/bits.h
>     diff -u tools/arch/arm64/include/asm/cputype.h arch/arm64/include/asm/cputype.h
> 
> Thanks,
> Namhyung
> 
> 
> Namhyung Kim (10):
>   tools headers: Update the KVM headers with the kernel sources
>   tools headers: Update the socket headers with the kernel sources
>   tools headers: Update the uapi/linux/perf_event.h copy with the kernel sources
>   tools headers: Update the VFS headers with the kernel sources
>   tools headers: Update the syscall table with the kernel sources
>   tools headers: Update the uapi/linux/prctl.h copy with the kernel sources
>   tools headers: Update the uapi/asm-generic/mman-common.h copy with the kernel sources
>   tools headers: Update the linux/unaligned.h copy with the kernel sources
>   tools headers: Update the x86 headers with the kernel sources
>   tools headers: Update the arch/x86/lib/memset_64.S copy with the kernel sources

>  32 files changed, 318 insertions(+), 109 deletions(-)

LGTM, I was eying those warnings too, glad you did this. :-)

Acked-by: Ingo Molnar <mingo@kernel.org>

	Ingo

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCHSET 00/10] tools headers: Sync header files with the kernel
  2025-04-10  0:11 [PATCHSET 00/10] tools headers: Sync header files with the kernel Namhyung Kim
                   ` (10 preceding siblings ...)
  2025-04-10  6:02 ` [PATCHSET 00/10] tools headers: Sync header files with the kernel Ingo Molnar
@ 2025-04-10 11:31 ` Venkat
  11 siblings, 0 replies; 18+ messages in thread
From: Venkat @ 2025-04-10 11:31 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Arnaldo Carvalho de Melo, Ian Rogers, Kan Liang, Jiri Olsa,
	Adrian Hunter, Peter Zijlstra, Ingo Molnar, LKML,
	linux-perf-users



> On 10 Apr 2025, at 5:41 AM, Namhyung Kim <namhyung@kernel.org> wrote:
> 
> Hello,
> 
> FYI I'm carrying these changes in the perf tools tree so make perf trace
> beautifiers get the recent changes in syscall, ioctl, and so on.  For the
> background, please see tools/include/uapi/README.
> 
> Still there are some remaining items but it requires a bit more changes.
> So I'd like to leave them for the next cycle.
> 
>  Warning: Kernel ABI header differences:
>    diff -u tools/include/uapi/linux/bits.h include/uapi/linux/bits.h
>    diff -u tools/include/linux/bits.h include/linux/bits.h
>    diff -u tools/arch/arm64/include/asm/cputype.h arch/arm64/include/asm/cputype.h
> 
> Thanks,
> Namhyung
> 
> 
> Namhyung Kim (10):
>  tools headers: Update the KVM headers with the kernel sources
>  tools headers: Update the socket headers with the kernel sources
>  tools headers: Update the uapi/linux/perf_event.h copy with the kernel sources
>  tools headers: Update the VFS headers with the kernel sources
>  tools headers: Update the syscall table with the kernel sources
>  tools headers: Update the uapi/linux/prctl.h copy with the kernel sources
>  tools headers: Update the uapi/asm-generic/mman-common.h copy with the kernel sources
>  tools headers: Update the linux/unaligned.h copy with the kernel sources
>  tools headers: Update the x86 headers with the kernel sources
>  tools headers: Update the arch/x86/lib/memset_64.S copy with the kernel sources
> 
> tools/arch/arm64/include/uapi/asm/kvm.h       |  5 +-
> tools/arch/arm64/include/uapi/asm/unistd.h    | 24 +----
> tools/arch/x86/include/asm/cpufeatures.h      | 28 ++++--
> tools/arch/x86/include/asm/msr-index.h        | 31 +++---
> tools/arch/x86/include/uapi/asm/kvm.h         |  4 +
> tools/arch/x86/include/uapi/asm/svm.h         |  2 +
> tools/arch/x86/lib/memset_64.S                |  3 +-
> tools/include/linux/cfi_types.h               | 45 +++++++++
> tools/include/uapi/asm-generic/mman-common.h  |  1 +
> tools/include/uapi/asm-generic/unistd.h       |  4 +-
> tools/include/uapi/linux/in.h                 |  2 +
> tools/include/uapi/linux/kvm.h                |  9 +-
> tools/include/uapi/linux/perf_event.h         |  2 +
> tools/include/uapi/linux/stat.h               | 99 ++++++++++++++-----
> .../perf/arch/arm/entry/syscalls/syscall.tbl  |  1 +
> .../arch/mips/entry/syscalls/syscall_n64.tbl  |  1 +
> .../arch/powerpc/entry/syscalls/syscall.tbl   |  1 +
> .../perf/arch/s390/entry/syscalls/syscall.tbl |  1 +
> tools/perf/arch/sh/entry/syscalls/syscall.tbl |  1 +
> .../arch/sparc/entry/syscalls/syscall.tbl     |  1 +
> .../arch/x86/entry/syscalls/syscall_32.tbl    |  3 +-
> .../arch/x86/entry/syscalls/syscall_64.tbl    |  1 +
> .../arch/xtensa/entry/syscalls/syscall.tbl    |  1 +
> tools/perf/check-headers.sh                   |  1 +
> .../perf/trace/beauty/include/linux/socket.h  |  2 +
> .../trace/beauty/include/uapi/linux/fcntl.h   |  4 +
> .../perf/trace/beauty/include/uapi/linux/fs.h | 21 +++-
> .../trace/beauty/include/uapi/linux/mount.h   | 10 +-
> .../trace/beauty/include/uapi/linux/prctl.h   | 11 +++
> .../trace/beauty/include/uapi/linux/stat.h    | 99 ++++++++++++++-----
> .../trace/beauty/include/uapi/sound/asound.h  |  8 +-
> tools/scripts/syscall.tbl                     |  1 +
> 32 files changed, 318 insertions(+), 109 deletions(-)

Tested this patch series by applying on the base commit: 0af2f6be1b4281385b618cb86ad946eded089ac8 and it fixes the warnings.

Tested-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com>



Before this patch:

 make
  BUILD:   Doing 'make -j32' parallel build
Warning: Kernel ABI header differences:
  diff -u tools/include/uapi/linux/bits.h include/uapi/linux/bits.h
  diff -u tools/include/uapi/linux/kvm.h include/uapi/linux/kvm.h
  diff -u tools/include/uapi/linux/in.h include/uapi/linux/in.h
  diff -u tools/include/uapi/linux/perf_event.h include/uapi/linux/perf_event.h
  diff -u tools/include/uapi/linux/stat.h include/uapi/linux/stat.h
  diff -u tools/include/linux/bits.h include/linux/bits.h
  diff -u tools/arch/x86/include/asm/cpufeatures.h arch/x86/include/asm/cpufeatures.h
  diff -u tools/arch/x86/include/asm/msr-index.h arch/x86/include/asm/msr-index.h
  diff -u tools/arch/x86/include/uapi/asm/kvm.h arch/x86/include/uapi/asm/kvm.h
  diff -u tools/arch/x86/include/uapi/asm/svm.h arch/x86/include/uapi/asm/svm.h
  diff -u tools/arch/arm64/include/uapi/asm/kvm.h arch/arm64/include/uapi/asm/kvm.h
  diff -u tools/arch/arm64/include/uapi/asm/unistd.h arch/arm64/include/uapi/asm/unistd.h
  diff -u tools/include/uapi/asm-generic/mman-common.h include/uapi/asm-generic/mman-common.h
  diff -u tools/include/uapi/asm-generic/unistd.h include/uapi/asm-generic/unistd.h
  diff -u tools/scripts/syscall.tbl scripts/syscall.tbl
  diff -u tools/arch/x86/lib/memset_64.S arch/x86/lib/memset_64.S
  diff -u tools/arch/arm64/include/asm/cputype.h arch/arm64/include/asm/cputype.h
  diff -u tools/perf/arch/x86/entry/syscalls/syscall_32.tbl arch/x86/entry/syscalls/syscall_32.tbl
  diff -u tools/perf/arch/x86/entry/syscalls/syscall_64.tbl arch/x86/entry/syscalls/syscall_64.tbl
  diff -u tools/perf/arch/powerpc/entry/syscalls/syscall.tbl arch/powerpc/kernel/syscalls/syscall.tbl
  diff -u tools/perf/arch/s390/entry/syscalls/syscall.tbl arch/s390/kernel/syscalls/syscall.tbl
  diff -u tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl arch/mips/kernel/syscalls/syscall_n64.tbl
  diff -u tools/perf/arch/arm/entry/syscalls/syscall.tbl arch/arm/tools/syscall.tbl
  diff -u tools/perf/arch/sh/entry/syscalls/syscall.tbl arch/sh/kernel/syscalls/syscall.tbl
  diff -u tools/perf/arch/sparc/entry/syscalls/syscall.tbl arch/sparc/kernel/syscalls/syscall.tbl
  diff -u tools/perf/arch/xtensa/entry/syscalls/syscall.tbl arch/xtensa/kernel/syscalls/syscall.tbl
  diff -u tools/perf/trace/beauty/include/linux/socket.h include/linux/socket.h
  diff -u tools/perf/trace/beauty/include/uapi/linux/fcntl.h include/uapi/linux/fcntl.h
  diff -u tools/perf/trace/beauty/include/uapi/linux/fs.h include/uapi/linux/fs.h
  diff -u tools/perf/trace/beauty/include/uapi/linux/mount.h include/uapi/linux/mount.h
  diff -u tools/perf/trace/beauty/include/uapi/linux/prctl.h include/uapi/linux/prctl.h
  diff -u tools/perf/trace/beauty/include/uapi/linux/stat.h include/uapi/linux/stat.h
  diff -u tools/perf/trace/beauty/include/uapi/sound/asound.h include/uapi/sound/asound.h
Makefile.config:1093: No libcapstone found, disables disasm engine support for 'perf script', please install libcapstone-dev/capstone-devel
Makefile.config:1155: libpfm4 not found, disables libpfm4 support. Please install libpfm4-dev

Auto-detecting system features:
...                                   libdw: [ on  ]
...                                   glibc: [ on  ]
...                                  libbfd: [ on  ]
...                          libbfd-buildid: [ on  ]
...                                  libelf: [ on  ]
...                                 libnuma: [ on  ]
...                  numa_num_possible_cpus: [ on  ]
...                                 libperl: [ on  ]
...                               libpython: [ on  ]
...                               libcrypto: [ on  ]
...                               libunwind: [ OFF ]
...                             libcapstone: [ OFF ]
...                               llvm-perf: [ on  ]
...                                    zlib: [ on  ]
...                                    lzma: [ on  ]
...                               get_cpuid: [ OFF ]
...                                     bpf: [ on  ]
...                                  libaio: [ on  ]
...                                 libzstd: [ on  ]

  GEN     common-cmds.h
  GEN     /root/linux/tools/perf/arch/arm64/include/generated/asm/sysreg-defs.h
  PERF_VERSION = 6.15.rc1.g0af2f6be1b42
  GEN     perf-archive


After this patch:

 make
  BUILD:   Doing 'make -j32' parallel build
Warning: Kernel ABI header differences:
  diff -u tools/include/uapi/linux/bits.h include/uapi/linux/bits.h
  diff -u tools/include/linux/bits.h include/linux/bits.h
  diff -u tools/arch/arm64/include/asm/cputype.h arch/arm64/include/asm/cputype.h
Makefile.config:1093: No libcapstone found, disables disasm engine support for 'perf script', please install libcapstone-dev/capstone-devel
Makefile.config:1155: libpfm4 not found, disables libpfm4 support. Please install libpfm4-dev

Auto-detecting system features:
...                                   libdw: [ on  ]
...                                   glibc: [ on  ]
...                                  libbfd: [ on  ]
...                          libbfd-buildid: [ on  ]
...                                  libelf: [ on  ]
...                                 libnuma: [ on  ]
...                  numa_num_possible_cpus: [ on  ]
...                                 libperl: [ on  ]
...                               libpython: [ on  ]
...                               libcrypto: [ on  ]
...                               libunwind: [ OFF ]
...                             libcapstone: [ OFF ]
...                               llvm-perf: [ on  ]
...                                    zlib: [ on  ]
...                                    lzma: [ on  ]
...                               get_cpuid: [ OFF ]
...                                     bpf: [ on  ]
...                                  libaio: [ on  ]
...                                 libzstd: [ on  ]

  GEN     common-cmds.h
  GEN     /root/linux/tools/perf/arch/arm64/include/generated/asm/sysreg-defs.h
  PERF_VERSION = 6.15.rc1.g634c975b88f0
  GEN     perf-archive



>  create mode 100644 tools/include/linux/cfi_types.h
> 
> 
> base-commit: 0af2f6be1b4281385b618cb86ad946eded089ac8
> -- 
> 2.49.0.504.g3bcea36a83-goog
> 
> 


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 05/10] tools headers: Update the syscall table with the kernel sources
  2025-04-10  0:11 ` [PATCH 05/10] tools headers: Update the syscall table " Namhyung Kim
@ 2025-04-14 16:28   ` James Clark
  2025-04-16 13:26     ` James Clark
  0 siblings, 1 reply; 18+ messages in thread
From: James Clark @ 2025-04-14 16:28 UTC (permalink / raw)
  To: Namhyung Kim, Arnd Bergmann
  Cc: Jiri Olsa, Adrian Hunter, Peter Zijlstra, Ingo Molnar, LKML,
	linux-perf-users, linux-arch, Arnaldo Carvalho de Melo,
	Ian Rogers, Kan Liang



On 10/04/2025 1:11 am, Namhyung Kim wrote:
> To pick up the changes in:
> 
>    c4a16820d9019940 fs: add open_tree_attr()
>    2df1ad0d25803399 x86/arch_prctl: Simplify sys_arch_prctl()
>    e632bca07c8eef1d arm64: generate 64-bit syscall.tbl
> 
> This is basically to support the new open_tree_attr syscall.  But it
> also needs to update asm-generic unistd.h header to get the new syscall
> number.  And arm64 unistd.h header was converted to use the generic
> 64-bit header.
> 
> Addressing this perf tools build warning:
> 
>    Warning: Kernel ABI header differences:
>      diff -u tools/scripts/syscall.tbl scripts/syscall.tbl
>      diff -u tools/perf/arch/x86/entry/syscalls/syscall_32.tbl arch/x86/entry/syscalls/syscall_32.tbl
>      diff -u tools/perf/arch/x86/entry/syscalls/syscall_64.tbl arch/x86/entry/syscalls/syscall_64.tbl
>      diff -u tools/perf/arch/powerpc/entry/syscalls/syscall.tbl arch/powerpc/kernel/syscalls/syscall.tbl
>      diff -u tools/perf/arch/s390/entry/syscalls/syscall.tbl arch/s390/kernel/syscalls/syscall.tbl
>      diff -u tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl arch/mips/kernel/syscalls/syscall_n64.tbl
>      diff -u tools/perf/arch/arm/entry/syscalls/syscall.tbl arch/arm/tools/syscall.tbl
>      diff -u tools/perf/arch/sh/entry/syscalls/syscall.tbl arch/sh/kernel/syscalls/syscall.tbl
>      diff -u tools/perf/arch/sparc/entry/syscalls/syscall.tbl arch/sparc/kernel/syscalls/syscall.tbl
>      diff -u tools/perf/arch/xtensa/entry/syscalls/syscall.tbl arch/xtensa/kernel/syscalls/syscall.tbl
>      diff -u tools/arch/arm64/include/uapi/asm/unistd.h arch/arm64/include/uapi/asm/unistd.h
>      diff -u tools/include/uapi/asm-generic/unistd.h include/uapi/asm-generic/unistd.h
> 
> Please see tools/include/uapi/README for further details.
> 
> Cc: linux-arch@vger.kernel.org
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> ---
>   tools/arch/arm64/include/uapi/asm/unistd.h    | 24 +------------------
>   tools/include/uapi/asm-generic/unistd.h       |  4 +++-
>   .../perf/arch/arm/entry/syscalls/syscall.tbl  |  1 +
>   .../arch/mips/entry/syscalls/syscall_n64.tbl  |  1 +
>   .../arch/powerpc/entry/syscalls/syscall.tbl   |  1 +
>   .../perf/arch/s390/entry/syscalls/syscall.tbl |  1 +
>   tools/perf/arch/sh/entry/syscalls/syscall.tbl |  1 +
>   .../arch/sparc/entry/syscalls/syscall.tbl     |  1 +
>   .../arch/x86/entry/syscalls/syscall_32.tbl    |  3 ++-
>   .../arch/x86/entry/syscalls/syscall_64.tbl    |  1 +
>   .../arch/xtensa/entry/syscalls/syscall.tbl    |  1 +
>   tools/scripts/syscall.tbl                     |  1 +
>   12 files changed, 15 insertions(+), 25 deletions(-)
> 
> diff --git a/tools/arch/arm64/include/uapi/asm/unistd.h b/tools/arch/arm64/include/uapi/asm/unistd.h
> index 9306726337fe005e..df36f23876e863ff 100644
> --- a/tools/arch/arm64/include/uapi/asm/unistd.h
> +++ b/tools/arch/arm64/include/uapi/asm/unistd.h
> @@ -1,24 +1,2 @@
>   /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
> -/*
> - * Copyright (C) 2012 ARM Ltd.
> - *
> - * This program is free software; you can redistribute it and/or modify
> - * it under the terms of the GNU General Public License version 2 as
> - * published by the Free Software Foundation.
> - *
> - * This program is distributed in the hope that it will be useful,
> - * but WITHOUT ANY WARRANTY; without even the implied warranty of
> - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> - * GNU General Public License for more details.
> - *
> - * You should have received a copy of the GNU General Public License
> - * along with this program.  If not, see <http://www.gnu.org/licenses/>.
> - */
> -
> -#define __ARCH_WANT_RENAMEAT
> -#define __ARCH_WANT_NEW_STAT
> -#define __ARCH_WANT_SET_GET_RLIMIT
> -#define __ARCH_WANT_TIME32_SYSCALLS
> -#define __ARCH_WANT_MEMFD_SECRET
> -
> -#include <asm-generic/unistd.h>
> +#include <asm/unistd_64.h>

Hi Namhyung,

Since we're not including the generic syscalls here anymore we now need 
to generate the syscall header file for the Perf build to work (build 
error pasted at the end for reference).

I had a go at adding the rule for it, but I saw that we'd need to pull 
in quite a bit from the kernel so it was blurring the lines about the 
separation of the tools/ folder. For example this file has the arm64 defs:

  arch/arm64/kernel/Makefile.syscalls

To make this common part of the makefile work:

  scripts/Makefile.asm-headers

Maybe we can just copy or reimplement Makefile.syscalls, but I'm not 
even sure if Makefile.asm-headers will work with the tools/ build 
structure so maybe that has to be re-implemented too. Adding Arnd to see 
what he thinks.

As far as I can tell this is a separate issue to the work that Charlie 
and Ian did recently to build all arch's syscall numbers into Perf to 
use for reporting, as this is requires a single header for the build.

Thanks
James

---

In file included from /usr/include/aarch64-linux-gnu/sys/syscall.h:24,
                  from evsel.c:4:
/home/jamcla02/workspace/linux/linux/tools/arch/arm64/include/uapi/asm/unistd.h:2:10: 
fatal error: asm/unistd_64.h: No such file or directory
     2 | #include <asm/unistd_64.h>
       |          ^~~~~~~~~~~~~~~~~




^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 05/10] tools headers: Update the syscall table with the kernel sources
  2025-04-14 16:28   ` James Clark
@ 2025-04-16 13:26     ` James Clark
  2025-04-23  9:24       ` Jon Hunter
  0 siblings, 1 reply; 18+ messages in thread
From: James Clark @ 2025-04-16 13:26 UTC (permalink / raw)
  To: Namhyung Kim, Arnd Bergmann
  Cc: Jiri Olsa, Adrian Hunter, Peter Zijlstra, Ingo Molnar, LKML,
	linux-perf-users, linux-arch, Arnaldo Carvalho de Melo,
	Ian Rogers, Kan Liang



On 14/04/2025 5:28 pm, James Clark wrote:
> 
> 
> On 10/04/2025 1:11 am, Namhyung Kim wrote:
>> To pick up the changes in:
>>
>>    c4a16820d9019940 fs: add open_tree_attr()
>>    2df1ad0d25803399 x86/arch_prctl: Simplify sys_arch_prctl()
>>    e632bca07c8eef1d arm64: generate 64-bit syscall.tbl
>>
>> This is basically to support the new open_tree_attr syscall.  But it
>> also needs to update asm-generic unistd.h header to get the new syscall
>> number.  And arm64 unistd.h header was converted to use the generic
>> 64-bit header.
>>
>> Addressing this perf tools build warning:
>>
>>    Warning: Kernel ABI header differences:
>>      diff -u tools/scripts/syscall.tbl scripts/syscall.tbl
>>      diff -u tools/perf/arch/x86/entry/syscalls/syscall_32.tbl arch/ 
>> x86/entry/syscalls/syscall_32.tbl
>>      diff -u tools/perf/arch/x86/entry/syscalls/syscall_64.tbl arch/ 
>> x86/entry/syscalls/syscall_64.tbl
>>      diff -u tools/perf/arch/powerpc/entry/syscalls/syscall.tbl arch/ 
>> powerpc/kernel/syscalls/syscall.tbl
>>      diff -u tools/perf/arch/s390/entry/syscalls/syscall.tbl arch/ 
>> s390/kernel/syscalls/syscall.tbl
>>      diff -u tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl arch/ 
>> mips/kernel/syscalls/syscall_n64.tbl
>>      diff -u tools/perf/arch/arm/entry/syscalls/syscall.tbl arch/arm/ 
>> tools/syscall.tbl
>>      diff -u tools/perf/arch/sh/entry/syscalls/syscall.tbl arch/sh/ 
>> kernel/syscalls/syscall.tbl
>>      diff -u tools/perf/arch/sparc/entry/syscalls/syscall.tbl arch/ 
>> sparc/kernel/syscalls/syscall.tbl
>>      diff -u tools/perf/arch/xtensa/entry/syscalls/syscall.tbl arch/ 
>> xtensa/kernel/syscalls/syscall.tbl
>>      diff -u tools/arch/arm64/include/uapi/asm/unistd.h arch/arm64/ 
>> include/uapi/asm/unistd.h
>>      diff -u tools/include/uapi/asm-generic/unistd.h include/uapi/asm- 
>> generic/unistd.h
>>
>> Please see tools/include/uapi/README for further details.
>>
>> Cc: linux-arch@vger.kernel.org
>> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
>> ---
>>   tools/arch/arm64/include/uapi/asm/unistd.h    | 24 +------------------
>>   tools/include/uapi/asm-generic/unistd.h       |  4 +++-
>>   .../perf/arch/arm/entry/syscalls/syscall.tbl  |  1 +
>>   .../arch/mips/entry/syscalls/syscall_n64.tbl  |  1 +
>>   .../arch/powerpc/entry/syscalls/syscall.tbl   |  1 +
>>   .../perf/arch/s390/entry/syscalls/syscall.tbl |  1 +
>>   tools/perf/arch/sh/entry/syscalls/syscall.tbl |  1 +
>>   .../arch/sparc/entry/syscalls/syscall.tbl     |  1 +
>>   .../arch/x86/entry/syscalls/syscall_32.tbl    |  3 ++-
>>   .../arch/x86/entry/syscalls/syscall_64.tbl    |  1 +
>>   .../arch/xtensa/entry/syscalls/syscall.tbl    |  1 +
>>   tools/scripts/syscall.tbl                     |  1 +
>>   12 files changed, 15 insertions(+), 25 deletions(-)
>>
>> diff --git a/tools/arch/arm64/include/uapi/asm/unistd.h b/tools/arch/ 
>> arm64/include/uapi/asm/unistd.h
>> index 9306726337fe005e..df36f23876e863ff 100644
>> --- a/tools/arch/arm64/include/uapi/asm/unistd.h
>> +++ b/tools/arch/arm64/include/uapi/asm/unistd.h
>> @@ -1,24 +1,2 @@
>>   /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
>> -/*
>> - * Copyright (C) 2012 ARM Ltd.
>> - *
>> - * This program is free software; you can redistribute it and/or modify
>> - * it under the terms of the GNU General Public License version 2 as
>> - * published by the Free Software Foundation.
>> - *
>> - * This program is distributed in the hope that it will be useful,
>> - * but WITHOUT ANY WARRANTY; without even the implied warranty of
>> - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>> - * GNU General Public License for more details.
>> - *
>> - * You should have received a copy of the GNU General Public License
>> - * along with this program.  If not, see <http://www.gnu.org/licenses/>.
>> - */
>> -
>> -#define __ARCH_WANT_RENAMEAT
>> -#define __ARCH_WANT_NEW_STAT
>> -#define __ARCH_WANT_SET_GET_RLIMIT
>> -#define __ARCH_WANT_TIME32_SYSCALLS
>> -#define __ARCH_WANT_MEMFD_SECRET
>> -
>> -#include <asm-generic/unistd.h>
>> +#include <asm/unistd_64.h>
> 
> Hi Namhyung,
> 
> Since we're not including the generic syscalls here anymore we now need 
> to generate the syscall header file for the Perf build to work (build 
> error pasted at the end for reference).
> 
> I had a go at adding the rule for it, but I saw that we'd need to pull 
> in quite a bit from the kernel so it was blurring the lines about the 
> separation of the tools/ folder. For example this file has the arm64 defs:
> 
>   arch/arm64/kernel/Makefile.syscalls
> 
> To make this common part of the makefile work:
> 
>   scripts/Makefile.asm-headers
> 
> Maybe we can just copy or reimplement Makefile.syscalls, but I'm not 
> even sure if Makefile.asm-headers will work with the tools/ build 
> structure so maybe that has to be re-implemented too. Adding Arnd to see 
> what he thinks.
> 
> As far as I can tell this is a separate issue to the work that Charlie 
> and Ian did recently to build all arch's syscall numbers into Perf to 
> use for reporting, as this is requires a single header for the build.
> 
> Thanks
> James
> 
> ---
> 
> In file included from /usr/include/aarch64-linux-gnu/sys/syscall.h:24,
>                   from evsel.c:4:
> /home/jamcla02/workspace/linux/linux/tools/arch/arm64/include/uapi/asm/ 
> unistd.h:2:10: fatal error: asm/unistd_64.h: No such file or directory
>      2 | #include <asm/unistd_64.h>
>        |          ^~~~~~~~~~~~~~~~~
> 
> 
> 

Hmmm I see this was also mentioned a while ago here [1]. Maybe I can 
have another go at adding the makerule to generate the file. I'll 
probably start by including as much as possible from the existing make 
rules from the kernel side. I think something similar was already done 
for generating the sysreg defs in commit 02e85f74668e ("tools: arm64: 
Add a Makefile for generating sysreg-defs.h")


[1]: 
https://lore.kernel.org/lkml/ZrO5HR9x2xyPKttx@google.com/T/#m269c1d3c64e3e0c96f45102d358d9583c69b722f




^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 05/10] tools headers: Update the syscall table with the kernel sources
  2025-04-16 13:26     ` James Clark
@ 2025-04-23  9:24       ` Jon Hunter
  2025-04-23 14:57         ` James Clark
  0 siblings, 1 reply; 18+ messages in thread
From: Jon Hunter @ 2025-04-23  9:24 UTC (permalink / raw)
  To: James Clark, Namhyung Kim, Arnd Bergmann
  Cc: Jiri Olsa, Adrian Hunter, Peter Zijlstra, Ingo Molnar, LKML,
	linux-perf-users, linux-arch, Arnaldo Carvalho de Melo,
	Ian Rogers, Kan Liang, linux-tegra@vger.kernel.org


On 16/04/2025 14:26, James Clark wrote:
> 
> 
> On 14/04/2025 5:28 pm, James Clark wrote:
>>
>>
>> On 10/04/2025 1:11 am, Namhyung Kim wrote:
>>> To pick up the changes in:
>>>
>>>    c4a16820d9019940 fs: add open_tree_attr()
>>>    2df1ad0d25803399 x86/arch_prctl: Simplify sys_arch_prctl()
>>>    e632bca07c8eef1d arm64: generate 64-bit syscall.tbl
>>>
>>> This is basically to support the new open_tree_attr syscall.  But it
>>> also needs to update asm-generic unistd.h header to get the new syscall
>>> number.  And arm64 unistd.h header was converted to use the generic
>>> 64-bit header.
>>>
>>> Addressing this perf tools build warning:
>>>
>>>    Warning: Kernel ABI header differences:
>>>      diff -u tools/scripts/syscall.tbl scripts/syscall.tbl
>>>      diff -u tools/perf/arch/x86/entry/syscalls/syscall_32.tbl arch/ 
>>> x86/entry/syscalls/syscall_32.tbl
>>>      diff -u tools/perf/arch/x86/entry/syscalls/syscall_64.tbl arch/ 
>>> x86/entry/syscalls/syscall_64.tbl
>>>      diff -u tools/perf/arch/powerpc/entry/syscalls/syscall.tbl arch/ 
>>> powerpc/kernel/syscalls/syscall.tbl
>>>      diff -u tools/perf/arch/s390/entry/syscalls/syscall.tbl arch/ 
>>> s390/kernel/syscalls/syscall.tbl
>>>      diff -u tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl 
>>> arch/ mips/kernel/syscalls/syscall_n64.tbl
>>>      diff -u tools/perf/arch/arm/entry/syscalls/syscall.tbl arch/arm/ 
>>> tools/syscall.tbl
>>>      diff -u tools/perf/arch/sh/entry/syscalls/syscall.tbl arch/sh/ 
>>> kernel/syscalls/syscall.tbl
>>>      diff -u tools/perf/arch/sparc/entry/syscalls/syscall.tbl arch/ 
>>> sparc/kernel/syscalls/syscall.tbl
>>>      diff -u tools/perf/arch/xtensa/entry/syscalls/syscall.tbl arch/ 
>>> xtensa/kernel/syscalls/syscall.tbl
>>>      diff -u tools/arch/arm64/include/uapi/asm/unistd.h arch/arm64/ 
>>> include/uapi/asm/unistd.h
>>>      diff -u tools/include/uapi/asm-generic/unistd.h include/uapi/ 
>>> asm- generic/unistd.h
>>>
>>> Please see tools/include/uapi/README for further details.
>>>
>>> Cc: linux-arch@vger.kernel.org
>>> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
>>> ---
>>>   tools/arch/arm64/include/uapi/asm/unistd.h    | 24 +------------------
>>>   tools/include/uapi/asm-generic/unistd.h       |  4 +++-
>>>   .../perf/arch/arm/entry/syscalls/syscall.tbl  |  1 +
>>>   .../arch/mips/entry/syscalls/syscall_n64.tbl  |  1 +
>>>   .../arch/powerpc/entry/syscalls/syscall.tbl   |  1 +
>>>   .../perf/arch/s390/entry/syscalls/syscall.tbl |  1 +
>>>   tools/perf/arch/sh/entry/syscalls/syscall.tbl |  1 +
>>>   .../arch/sparc/entry/syscalls/syscall.tbl     |  1 +
>>>   .../arch/x86/entry/syscalls/syscall_32.tbl    |  3 ++-
>>>   .../arch/x86/entry/syscalls/syscall_64.tbl    |  1 +
>>>   .../arch/xtensa/entry/syscalls/syscall.tbl    |  1 +
>>>   tools/scripts/syscall.tbl                     |  1 +
>>>   12 files changed, 15 insertions(+), 25 deletions(-)
>>>
>>> diff --git a/tools/arch/arm64/include/uapi/asm/unistd.h b/tools/arch/ 
>>> arm64/include/uapi/asm/unistd.h
>>> index 9306726337fe005e..df36f23876e863ff 100644
>>> --- a/tools/arch/arm64/include/uapi/asm/unistd.h
>>> +++ b/tools/arch/arm64/include/uapi/asm/unistd.h
>>> @@ -1,24 +1,2 @@
>>>   /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
>>> -/*
>>> - * Copyright (C) 2012 ARM Ltd.
>>> - *
>>> - * This program is free software; you can redistribute it and/or modify
>>> - * it under the terms of the GNU General Public License version 2 as
>>> - * published by the Free Software Foundation.
>>> - *
>>> - * This program is distributed in the hope that it will be useful,
>>> - * but WITHOUT ANY WARRANTY; without even the implied warranty of
>>> - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>>> - * GNU General Public License for more details.
>>> - *
>>> - * You should have received a copy of the GNU General Public License
>>> - * along with this program.  If not, see <http://www.gnu.org/ 
>>> licenses/>.
>>> - */
>>> -
>>> -#define __ARCH_WANT_RENAMEAT
>>> -#define __ARCH_WANT_NEW_STAT
>>> -#define __ARCH_WANT_SET_GET_RLIMIT
>>> -#define __ARCH_WANT_TIME32_SYSCALLS
>>> -#define __ARCH_WANT_MEMFD_SECRET
>>> -
>>> -#include <asm-generic/unistd.h>
>>> +#include <asm/unistd_64.h>
>>
>> Hi Namhyung,
>>
>> Since we're not including the generic syscalls here anymore we now 
>> need to generate the syscall header file for the Perf build to work 
>> (build error pasted at the end for reference).
>>
>> I had a go at adding the rule for it, but I saw that we'd need to pull 
>> in quite a bit from the kernel so it was blurring the lines about the 
>> separation of the tools/ folder. For example this file has the arm64 
>> defs:
>>
>>   arch/arm64/kernel/Makefile.syscalls
>>
>> To make this common part of the makefile work:
>>
>>   scripts/Makefile.asm-headers
>>
>> Maybe we can just copy or reimplement Makefile.syscalls, but I'm not 
>> even sure if Makefile.asm-headers will work with the tools/ build 
>> structure so maybe that has to be re-implemented too. Adding Arnd to 
>> see what he thinks.
>>
>> As far as I can tell this is a separate issue to the work that Charlie 
>> and Ian did recently to build all arch's syscall numbers into Perf to 
>> use for reporting, as this is requires a single header for the build.
>>
>> Thanks
>> James
>>
>> ---
>>
>> In file included from /usr/include/aarch64-linux-gnu/sys/syscall.h:24,
>>                   from evsel.c:4:
>> /home/jamcla02/workspace/linux/linux/tools/arch/arm64/include/uapi/ 
>> asm/ unistd.h:2:10: fatal error: asm/unistd_64.h: No such file or 
>> directory
>>      2 | #include <asm/unistd_64.h>
>>        |          ^~~~~~~~~~~~~~~~~
>>
>>
>>
> 
> Hmmm I see this was also mentioned a while ago here [1]. Maybe I can 
> have another go at adding the makerule to generate the file. I'll 
> probably start by including as much as possible from the existing make 
> rules from the kernel side. I think something similar was already done 
> for generating the sysreg defs in commit 02e85f74668e ("tools: arm64: 
> Add a Makefile for generating sysreg-defs.h")
> 
> 
> [1]: https://lore.kernel.org/lkml/ZrO5HR9x2xyPKttx@google.com/T/ 
> #m269c1d3c64e3e0c96f45102d358d9583c69b722f


FWIW I am seeing this build issue too on ARM64 and these changes have 
now landed in the mainline :-(

So would be great to get this fixed or reverted.

Jon

-- 
nvpublic


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 05/10] tools headers: Update the syscall table with the kernel sources
  2025-04-23  9:24       ` Jon Hunter
@ 2025-04-23 14:57         ` James Clark
  2025-04-24  7:33           ` Jon Hunter
  0 siblings, 1 reply; 18+ messages in thread
From: James Clark @ 2025-04-23 14:57 UTC (permalink / raw)
  To: Jon Hunter, Namhyung Kim, Arnd Bergmann
  Cc: Jiri Olsa, Adrian Hunter, Peter Zijlstra, Ingo Molnar, LKML,
	linux-perf-users, linux-arch, Arnaldo Carvalho de Melo,
	Ian Rogers, Kan Liang, linux-tegra@vger.kernel.org



On 23/04/2025 10:24 am, Jon Hunter wrote:
> 
> On 16/04/2025 14:26, James Clark wrote:
>>
>>
>> On 14/04/2025 5:28 pm, James Clark wrote:
>>>
>>>
>>> On 10/04/2025 1:11 am, Namhyung Kim wrote:
>>>> To pick up the changes in:
>>>>
>>>>    c4a16820d9019940 fs: add open_tree_attr()
>>>>    2df1ad0d25803399 x86/arch_prctl: Simplify sys_arch_prctl()
>>>>    e632bca07c8eef1d arm64: generate 64-bit syscall.tbl
>>>>
>>>> This is basically to support the new open_tree_attr syscall.  But it
>>>> also needs to update asm-generic unistd.h header to get the new syscall
>>>> number.  And arm64 unistd.h header was converted to use the generic
>>>> 64-bit header.
>>>>
>>>> Addressing this perf tools build warning:
>>>>
>>>>    Warning: Kernel ABI header differences:
>>>>      diff -u tools/scripts/syscall.tbl scripts/syscall.tbl
>>>>      diff -u tools/perf/arch/x86/entry/syscalls/syscall_32.tbl arch/ 
>>>> x86/entry/syscalls/syscall_32.tbl
>>>>      diff -u tools/perf/arch/x86/entry/syscalls/syscall_64.tbl arch/ 
>>>> x86/entry/syscalls/syscall_64.tbl
>>>>      diff -u tools/perf/arch/powerpc/entry/syscalls/syscall.tbl 
>>>> arch/ powerpc/kernel/syscalls/syscall.tbl
>>>>      diff -u tools/perf/arch/s390/entry/syscalls/syscall.tbl arch/ 
>>>> s390/kernel/syscalls/syscall.tbl
>>>>      diff -u tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl 
>>>> arch/ mips/kernel/syscalls/syscall_n64.tbl
>>>>      diff -u tools/perf/arch/arm/entry/syscalls/syscall.tbl arch/ 
>>>> arm/ tools/syscall.tbl
>>>>      diff -u tools/perf/arch/sh/entry/syscalls/syscall.tbl arch/sh/ 
>>>> kernel/syscalls/syscall.tbl
>>>>      diff -u tools/perf/arch/sparc/entry/syscalls/syscall.tbl arch/ 
>>>> sparc/kernel/syscalls/syscall.tbl
>>>>      diff -u tools/perf/arch/xtensa/entry/syscalls/syscall.tbl arch/ 
>>>> xtensa/kernel/syscalls/syscall.tbl
>>>>      diff -u tools/arch/arm64/include/uapi/asm/unistd.h arch/arm64/ 
>>>> include/uapi/asm/unistd.h
>>>>      diff -u tools/include/uapi/asm-generic/unistd.h include/uapi/ 
>>>> asm- generic/unistd.h
>>>>
>>>> Please see tools/include/uapi/README for further details.
>>>>
>>>> Cc: linux-arch@vger.kernel.org
>>>> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
>>>> ---
>>>>   tools/arch/arm64/include/uapi/asm/unistd.h    | 24 
>>>> +------------------
>>>>   tools/include/uapi/asm-generic/unistd.h       |  4 +++-
>>>>   .../perf/arch/arm/entry/syscalls/syscall.tbl  |  1 +
>>>>   .../arch/mips/entry/syscalls/syscall_n64.tbl  |  1 +
>>>>   .../arch/powerpc/entry/syscalls/syscall.tbl   |  1 +
>>>>   .../perf/arch/s390/entry/syscalls/syscall.tbl |  1 +
>>>>   tools/perf/arch/sh/entry/syscalls/syscall.tbl |  1 +
>>>>   .../arch/sparc/entry/syscalls/syscall.tbl     |  1 +
>>>>   .../arch/x86/entry/syscalls/syscall_32.tbl    |  3 ++-
>>>>   .../arch/x86/entry/syscalls/syscall_64.tbl    |  1 +
>>>>   .../arch/xtensa/entry/syscalls/syscall.tbl    |  1 +
>>>>   tools/scripts/syscall.tbl                     |  1 +
>>>>   12 files changed, 15 insertions(+), 25 deletions(-)
>>>>
>>>> diff --git a/tools/arch/arm64/include/uapi/asm/unistd.h b/tools/ 
>>>> arch/ arm64/include/uapi/asm/unistd.h
>>>> index 9306726337fe005e..df36f23876e863ff 100644
>>>> --- a/tools/arch/arm64/include/uapi/asm/unistd.h
>>>> +++ b/tools/arch/arm64/include/uapi/asm/unistd.h
>>>> @@ -1,24 +1,2 @@
>>>>   /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
>>>> -/*
>>>> - * Copyright (C) 2012 ARM Ltd.
>>>> - *
>>>> - * This program is free software; you can redistribute it and/or 
>>>> modify
>>>> - * it under the terms of the GNU General Public License version 2 as
>>>> - * published by the Free Software Foundation.
>>>> - *
>>>> - * This program is distributed in the hope that it will be useful,
>>>> - * but WITHOUT ANY WARRANTY; without even the implied warranty of
>>>> - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>>>> - * GNU General Public License for more details.
>>>> - *
>>>> - * You should have received a copy of the GNU General Public License
>>>> - * along with this program.  If not, see <http://www.gnu.org/ 
>>>> licenses/>.
>>>> - */
>>>> -
>>>> -#define __ARCH_WANT_RENAMEAT
>>>> -#define __ARCH_WANT_NEW_STAT
>>>> -#define __ARCH_WANT_SET_GET_RLIMIT
>>>> -#define __ARCH_WANT_TIME32_SYSCALLS
>>>> -#define __ARCH_WANT_MEMFD_SECRET
>>>> -
>>>> -#include <asm-generic/unistd.h>
>>>> +#include <asm/unistd_64.h>
>>>
>>> Hi Namhyung,
>>>
>>> Since we're not including the generic syscalls here anymore we now 
>>> need to generate the syscall header file for the Perf build to work 
>>> (build error pasted at the end for reference).
>>>
>>> I had a go at adding the rule for it, but I saw that we'd need to 
>>> pull in quite a bit from the kernel so it was blurring the lines 
>>> about the separation of the tools/ folder. For example this file has 
>>> the arm64 defs:
>>>
>>>   arch/arm64/kernel/Makefile.syscalls
>>>
>>> To make this common part of the makefile work:
>>>
>>>   scripts/Makefile.asm-headers
>>>
>>> Maybe we can just copy or reimplement Makefile.syscalls, but I'm not 
>>> even sure if Makefile.asm-headers will work with the tools/ build 
>>> structure so maybe that has to be re-implemented too. Adding Arnd to 
>>> see what he thinks.
>>>
>>> As far as I can tell this is a separate issue to the work that 
>>> Charlie and Ian did recently to build all arch's syscall numbers into 
>>> Perf to use for reporting, as this is requires a single header for 
>>> the build.
>>>
>>> Thanks
>>> James
>>>
>>> ---
>>>
>>> In file included from /usr/include/aarch64-linux-gnu/sys/syscall.h:24,
>>>                   from evsel.c:4:
>>> /home/jamcla02/workspace/linux/linux/tools/arch/arm64/include/uapi/ 
>>> asm/ unistd.h:2:10: fatal error: asm/unistd_64.h: No such file or 
>>> directory
>>>      2 | #include <asm/unistd_64.h>
>>>        |          ^~~~~~~~~~~~~~~~~
>>>
>>>
>>>
>>
>> Hmmm I see this was also mentioned a while ago here [1]. Maybe I can 
>> have another go at adding the makerule to generate the file. I'll 
>> probably start by including as much as possible from the existing make 
>> rules from the kernel side. I think something similar was already done 
>> for generating the sysreg defs in commit 02e85f74668e ("tools: arm64: 
>> Add a Makefile for generating sysreg-defs.h")
>>
>>
>> [1]: https://lore.kernel.org/lkml/ZrO5HR9x2xyPKttx@google.com/T/ 
>> #m269c1d3c64e3e0c96f45102d358d9583c69b722f
> 
> 
> FWIW I am seeing this build issue too on ARM64 and these changes have 
> now landed in the mainline :-(
> 
> So would be great to get this fixed or reverted.
> 
> Jon
> 

Hi Jon,

I probably should have updated this thread, but the fix is here:

https://lore.kernel.org/linux-perf-users/20250417-james-perf-fix-gen-syscall-v1-1-1d268c923901@linaro.org/

Thanks
James


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH 05/10] tools headers: Update the syscall table with the kernel sources
  2025-04-23 14:57         ` James Clark
@ 2025-04-24  7:33           ` Jon Hunter
  0 siblings, 0 replies; 18+ messages in thread
From: Jon Hunter @ 2025-04-24  7:33 UTC (permalink / raw)
  To: James Clark, Namhyung Kim, Arnd Bergmann
  Cc: Jiri Olsa, Adrian Hunter, Peter Zijlstra, Ingo Molnar, LKML,
	linux-perf-users, linux-arch, Arnaldo Carvalho de Melo,
	Ian Rogers, Kan Liang, linux-tegra@vger.kernel.org


On 23/04/2025 15:57, James Clark wrote:

...

>> FWIW I am seeing this build issue too on ARM64 and these changes have 
>> now landed in the mainline :-(
>>
>> So would be great to get this fixed or reverted.
>>
>> Jon
>>
> 
> Hi Jon,
> 
> I probably should have updated this thread, but the fix is here:
> 
> https://lore.kernel.org/linux-perf-users/20250417-james-perf-fix-gen- 
> syscall-v1-1-1d268c923901@linaro.org/

Great!

Tested-by: Jon Hunter <jonathanh@nvidia.com>

Thanks for fixing and sharing!

Jon

-- 
nvpublic


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2025-04-24  7:33 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-10  0:11 [PATCHSET 00/10] tools headers: Sync header files with the kernel Namhyung Kim
2025-04-10  0:11 ` [PATCH 01/10] tools headers: Update the KVM headers with the kernel sources Namhyung Kim
2025-04-10  0:11 ` [PATCH 02/10] tools headers: Update the socket " Namhyung Kim
2025-04-10  0:11 ` [PATCH 03/10] tools headers: Update the uapi/linux/perf_event.h copy " Namhyung Kim
2025-04-10  0:11 ` [PATCH 04/10] tools headers: Update the VFS headers " Namhyung Kim
2025-04-10  0:11 ` [PATCH 05/10] tools headers: Update the syscall table " Namhyung Kim
2025-04-14 16:28   ` James Clark
2025-04-16 13:26     ` James Clark
2025-04-23  9:24       ` Jon Hunter
2025-04-23 14:57         ` James Clark
2025-04-24  7:33           ` Jon Hunter
2025-04-10  0:11 ` [PATCH 06/10] tools headers: Update the uapi/linux/prctl.h copy " Namhyung Kim
2025-04-10  0:11 ` [PATCH 07/10] tools headers: Update the uapi/asm-generic/mman-common.h " Namhyung Kim
2025-04-10  0:11 ` [PATCH 08/10] tools headers: Update the linux/unaligned.h " Namhyung Kim
2025-04-10  0:11 ` [PATCH 09/10] tools headers: Update the x86 headers " Namhyung Kim
2025-04-10  0:11 ` [PATCH 10/10] tools headers: Update the arch/x86/lib/memset_64.S copy " Namhyung Kim
2025-04-10  6:02 ` [PATCHSET 00/10] tools headers: Sync header files with the kernel Ingo Molnar
2025-04-10 11:31 ` Venkat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).