Skip to contentSkip to conversation

perf tools: Sync tools and kernel headers for v6.13

PATCH Applied Namhyung Kim 2 participants 18 messages Dec 3, 2024 – Dec 5, 2024

Subsystems (8)
VFS KVM MIPS perf events +4 more subsystems
lore
Share & tools
lore

Namhyung Kim

author maintainer
#0 lore raw

cover perf tools: Sync tools and kernel headers for v6.13

Hello,

I'll carry these changes on the perf tools tree to update perf tools to understand new syscalls and parameters. You can refer to README file in the tools/include/uapi directory why it's needed.

Thanks,
Namhyung

Namhyung Kim (11):
tools headers: Sync uapi/drm/drm.h with the kernel sources tools headers: Sync uapi/linux/perf_event.h with the kernel sources tools headers: Sync uapi/linux/kvm.h with the kernel sources tools headers: Sync x86 kvm and cpufeature headers with the kernel tools headers: Sync arm64 kvm header with the kernel sources tools headers: Sync *xattrat syscall changes with the kernel sources tools headers: Sync uapi/asm-generic/mman.h with the kernel sources tools headers: Sync uapi/linux/fcntl.h with the kernel sources tools headers: Sync uapi/linux/mount.h with the kernel sources tools headers: Sync uapi/linux/prctl.h with the kernel sources perf tools: Fix build error on generated/fs_at_flags_array.c

 tools/arch/arm64/include/uapi/asm/kvm.h       |  6 +++++
 tools/arch/x86/include/asm/cpufeatures.h      | 11 ++++++--
 tools/arch/x86/include/uapi/asm/kvm.h         |  1 +
 tools/include/uapi/asm-generic/mman.h         |  4 +++
 tools/include/uapi/asm-generic/unistd.h       | 11 +++++++-
 tools/include/uapi/drm/drm.h                  | 17 ++++++++++++
 tools/include/uapi/linux/kvm.h                |  8 ++++++
 tools/include/uapi/linux/perf_event.h         | 11 +++++++-
 .../arch/mips/entry/syscalls/syscall_n64.tbl  |  4 +++
 .../arch/powerpc/entry/syscalls/syscall.tbl   |  4 +++
 .../perf/arch/s390/entry/syscalls/syscall.tbl |  4 +++
 .../arch/x86/entry/syscalls/syscall_32.tbl    |  4 +++
 .../arch/x86/entry/syscalls/syscall_64.tbl    |  4 +++
 tools/perf/trace/beauty/fs_at_flags.sh        |  3 ++-
 .../trace/beauty/include/uapi/linux/fcntl.h   |  5 +---
 .../trace/beauty/include/uapi/linux/mount.h   | 14 ++++++++--
 .../trace/beauty/include/uapi/linux/prctl.h   | 27 ++++++++++++++++++-
 17 files changed, 126 insertions(+), 12 deletions(-)
Signature · 1 line
2.47.0.338.g60cca15819-goog
author maintainer
#1 lore raw

PATCH 1/11 tools headers: Sync uapi/drm/drm.h with the kernel sources

To pick up the changes in this cset:

56c594d8df64e726 ("drm: add DRM_SET_CLIENT_NAME ioctl")

This addresses these perf build warnings:

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

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

Cc David Airlie <[email protected]>
Cc Simona Vetter <[email protected]>
Cc Maarten Lankhorst <[email protected]>
Cc Maxime Ripard <[email protected]>
Cc Thomas Zimmermann <[email protected]>
---
 tools/include/uapi/drm/drm.h | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
tools/include/uapi/drm/drm.h +17 -0
index 16122819edfeff87..7fba37b94401a6d5 100644
@@ -1024,6 +1024,13 @@ struct drm_crtc_queue_sequence {
 	__u64 user_data;	/* user data passed to event */
 };
 
+#define DRM_CLIENT_NAME_MAX_LEN		64
+struct drm_set_client_name {
+	__u64 name_len;
+	__u64 name;
+};
+
+
 #if defined(__cplusplus)
 }
 #endif
@@ -1288,6 +1295,16 @@ extern "C" {
  */
 #define DRM_IOCTL_MODE_CLOSEFB		DRM_IOWR(0xD0, struct drm_mode_closefb)
 
+/**
+ * DRM_IOCTL_SET_CLIENT_NAME - Attach a name to a drm_file
+ *
+ * Having a name allows for easier tracking and debugging.
+ * The length of the name (without null ending char) must be
+ * <= DRM_CLIENT_NAME_MAX_LEN.
+ * The call will fail if the name contains whitespaces or non-printable chars.
+ */
+#define DRM_IOCTL_SET_CLIENT_NAME	DRM_IOWR(0xD1, struct drm_set_client_name)
+
 /*
  * Device specific ioctls should only be in their respective headers
  * The device specific ioctl range is from 0x40 to 0x9f.
Signature · 1 line
2.47.0.338.g60cca15819-goog
author maintainer
#2 lore raw

PATCH 2/11 tools headers: Sync uapi/linux/perf_event.h with the kernel sources

In reply to Namhyung Kim

To pick up the changes in this cset:

18d92bb57c39504d ("perf/core: Add aux_pause, aux_resume, aux_start_paused")

This addresses these perf build warnings:

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.

---
 tools/include/uapi/linux/perf_event.h | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
tools/include/uapi/linux/perf_event.h +10 -1
index 4842c36fdf801996..0524d541d4e3d501 100644
@@ -511,7 +511,16 @@ struct perf_event_attr {
 	__u16	sample_max_stack;
 	__u16	__reserved_2;
 	__u32	aux_sample_size;
-	__u32	__reserved_3;
+
+	union {
+		__u32	aux_action;
+		struct {
+			__u32	aux_start_paused :  1, /* start AUX area tracing paused */
+				aux_pause        :  1, /* on overflow, pause AUX area tracing */
+				aux_resume       :  1, /* on overflow, resume AUX area tracing */
+				__reserved_3     : 29;
+		};
+	};
 
 	/*
 	 * User provided data if sigtrap=1, passed back to user via
Signature · 1 line
2.47.0.338.g60cca15819-goog
author maintainer
#3 lore raw

PATCH 3/11 tools headers: Sync uapi/linux/kvm.h with the kernel sources

In reply to Namhyung Kim

To pick up the changes in this cset:

e785dfacf7e7fe94 ("LoongArch: KVM: Add PCHPIC device support") 2e8b9df82631e714 ("LoongArch: KVM: Add EIOINTC device support") c532de5a67a70f85 ("LoongArch: KVM: Add IPI device support")

This addresses these perf build warnings:

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

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

Cc Sean Christopherson <[email protected]>
Cc Paolo Bonzini <[email protected]>
Cc Tianrui Zhao <[email protected]>
Cc Bibo Mao <[email protected]>
Cc Huacai Chen <[email protected]>
---
 tools/include/uapi/linux/kvm.h | 8 ++++++++
 1 file changed, 8 insertions(+)
tools/include/uapi/linux/kvm.h +8 -0
index 637efc05514534ca..502ea63b5d2e7371 100644
@@ -1158,7 +1158,15 @@ enum kvm_device_type {
 #define KVM_DEV_TYPE_ARM_PV_TIME	KVM_DEV_TYPE_ARM_PV_TIME
 	KVM_DEV_TYPE_RISCV_AIA,
 #define KVM_DEV_TYPE_RISCV_AIA		KVM_DEV_TYPE_RISCV_AIA
+	KVM_DEV_TYPE_LOONGARCH_IPI,
+#define KVM_DEV_TYPE_LOONGARCH_IPI	KVM_DEV_TYPE_LOONGARCH_IPI
+	KVM_DEV_TYPE_LOONGARCH_EIOINTC,
+#define KVM_DEV_TYPE_LOONGARCH_EIOINTC	KVM_DEV_TYPE_LOONGARCH_EIOINTC
+	KVM_DEV_TYPE_LOONGARCH_PCHPIC,
+#define KVM_DEV_TYPE_LOONGARCH_PCHPIC	KVM_DEV_TYPE_LOONGARCH_PCHPIC
+
 	KVM_DEV_TYPE_MAX,
+
 };
 
 struct kvm_vfio_spapr_tce {
Signature · 1 line
2.47.0.338.g60cca15819-goog
author maintainer
#4 lore raw

PATCH 4/11 tools headers: Sync x86 kvm and cpufeature headers with the kernel

In reply to Namhyung Kim

To pick up the changes in this cset:

a0423af92cb31e6f ("x86: KVM: Advertise CPUIDs for new instructions in Clearwater Forest") 0c487010cb4f79e4 ("x86/cpufeatures: Add X86_FEATURE_AMD_WORKLOAD_CLASS feature bit") 1ad4667066714369 ("x86/cpufeatures: Add X86_FEATURE_AMD_HETEROGENEOUS_CORES") 104edc6efca62838 ("x86/cpufeatures: Rename X86_FEATURE_FAST_CPPC to have AMD prefix") 3ea87dfa31a7b0bb ("x86/cpufeatures: Add a IBPB_NO_RET BUG flag") ff898623af2ed564 ("x86/cpufeatures: Define X86_FEATURE_AMD_IBPB_RET") dcb988cdac85bad1 ("KVM: x86: Quirk initialization of feature MSRs to KVM's max configuration")

This addresses these perf build warnings:

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/uapi/asm/kvm.h arch/x86/include/uapi/asm/kvm.h

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

Cc Sean Christopherson <[email protected]>
Cc Paolo Bonzini <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Dave Hansen <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
---
 tools/arch/x86/include/asm/cpufeatures.h | 11 +++++++++--
 tools/arch/x86/include/uapi/asm/kvm.h    |  1 +
 2 files changed, 10 insertions(+), 2 deletions(-)
tools/arch/x86/include/asm/cpufeatures.h +9 -2
index 23698d0f4bb47ba0..17b6590748c00cc1 100644
@@ -215,7 +215,7 @@
 #define X86_FEATURE_SPEC_STORE_BYPASS_DISABLE	( 7*32+23) /* Disable Speculative Store Bypass. */
 #define X86_FEATURE_LS_CFG_SSBD		( 7*32+24)  /* AMD SSBD implementation via LS_CFG MSR */
 #define X86_FEATURE_IBRS		( 7*32+25) /* "ibrs" Indirect Branch Restricted Speculation */
-#define X86_FEATURE_IBPB		( 7*32+26) /* "ibpb" Indirect Branch Prediction Barrier */
+#define X86_FEATURE_IBPB		( 7*32+26) /* "ibpb" Indirect Branch Prediction Barrier without a guaranteed RSB flush */
 #define X86_FEATURE_STIBP		( 7*32+27) /* "stibp" Single Thread Indirect Branch Predictors */
 #define X86_FEATURE_ZEN			( 7*32+28) /* Generic flag for all Zen and newer */
 #define X86_FEATURE_L1TF_PTEINV		( 7*32+29) /* L1TF workaround PTE inversion */
@@ -317,6 +317,9 @@
 #define X86_FEATURE_ZEN1		(11*32+31) /* CPU based on Zen1 microarchitecture */
 
 /* Intel-defined CPU features, CPUID level 0x00000007:1 (EAX), word 12 */
+#define X86_FEATURE_SHA512		(12*32+ 0) /* SHA512 instructions */
+#define X86_FEATURE_SM3			(12*32+ 1) /* SM3 instructions */
+#define X86_FEATURE_SM4			(12*32+ 2) /* SM4 instructions */
 #define X86_FEATURE_AVX_VNNI		(12*32+ 4) /* "avx_vnni" AVX VNNI instructions */
 #define X86_FEATURE_AVX512_BF16		(12*32+ 5) /* "avx512_bf16" AVX512 BFLOAT16 instructions */
 #define X86_FEATURE_CMPCCXADD           (12*32+ 7) /* CMPccXADD instructions */
@@ -348,6 +351,7 @@
 #define X86_FEATURE_CPPC		(13*32+27) /* "cppc" Collaborative Processor Performance Control */
 #define X86_FEATURE_AMD_PSFD            (13*32+28) /* Predictive Store Forwarding Disable */
 #define X86_FEATURE_BTC_NO		(13*32+29) /* Not vulnerable to Branch Type Confusion */
+#define X86_FEATURE_AMD_IBPB_RET	(13*32+30) /* IBPB clears return address predictor */
 #define X86_FEATURE_BRS			(13*32+31) /* "brs" Branch Sampling available */
 
 /* Thermal and Power Management Leaf, CPUID level 0x00000006 (EAX), word 14 */
@@ -472,7 +476,9 @@
 #define X86_FEATURE_BHI_CTRL		(21*32+ 2) /* BHI_DIS_S HW control available */
 #define X86_FEATURE_CLEAR_BHB_HW	(21*32+ 3) /* BHI_DIS_S HW control enabled */
 #define X86_FEATURE_CLEAR_BHB_LOOP_ON_VMEXIT (21*32+ 4) /* Clear branch history at vmexit using SW loop */
-#define X86_FEATURE_AMD_FAST_CPPC		(21*32 + 5) /* AMD Fast CPPC */
+#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 */
 
 /*
  * BUG word(s)
@@ -523,4 +529,5 @@
 #define X86_BUG_DIV0			X86_BUG(1*32 + 1) /* "div0" AMD DIV0 speculation bug */
 #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 */
 #endif /* _ASM_X86_CPUFEATURES_H */
tools/arch/x86/include/uapi/asm/kvm.h +1 -0
index a8debbf2f7028059..88585c1de416fa6f 100644
@@ -440,6 +440,7 @@ struct kvm_sync_regs {
 #define KVM_X86_QUIRK_FIX_HYPERCALL_INSN	(1 << 5)
 #define KVM_X86_QUIRK_MWAIT_NEVER_UD_FAULTS	(1 << 6)
 #define KVM_X86_QUIRK_SLOT_ZAP_ALL		(1 << 7)
+#define KVM_X86_QUIRK_STUFF_FEATURE_MSRS	(1 << 8)
 
 #define KVM_STATE_NESTED_FORMAT_VMX	0
 #define KVM_STATE_NESTED_FORMAT_SVM	1
Signature · 1 line
2.47.0.338.g60cca15819-goog
author maintainer
#5 lore raw

PATCH 5/11 tools headers: Sync arm64 kvm header with the kernel sources

In reply to Namhyung Kim

To pick up the changes in this cset:

97413cea1c48cc05 ("KVM: arm64: Add PSCI v1.3 SYSTEM_OFF2 function for hibernation")

This addresses these perf build warnings:

Warning: Kernel ABI header differences:
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.

---
 tools/arch/arm64/include/uapi/asm/kvm.h | 6 ++++++
 1 file changed, 6 insertions(+)
tools/arch/arm64/include/uapi/asm/kvm.h +6 -0
index 964df31da9751c96..66736ff04011e0fa 100644
@@ -484,6 +484,12 @@ enum {
  */
 #define KVM_SYSTEM_EVENT_RESET_FLAG_PSCI_RESET2	(1ULL << 0)
 
+/*
+ * Shutdown caused by a PSCI v1.3 SYSTEM_OFF2 call.
+ * Valid only when the system event has a type of KVM_SYSTEM_EVENT_SHUTDOWN.
+ */
+#define KVM_SYSTEM_EVENT_SHUTDOWN_FLAG_PSCI_OFF2	(1ULL << 0)
+
 /* run->fail_entry.hardware_entry_failure_reason codes. */
 #define KVM_EXIT_FAIL_ENTRY_CPU_UNSUPPORTED	(1ULL << 0)
 
Signature · 1 line
2.47.0.338.g60cca15819-goog
author maintainer
#6 lore raw

PATCH 6/11 tools headers: Sync *xattrat syscall changes with the kernel sources

In reply to Namhyung Kim

To pick up the changes in this cset:

6140be90ec70c39f ("fs/xattr: add *at family syscalls")

This addresses these perf build warnings:

Warning: Kernel ABI header differences:
diff -u tools/include/uapi/asm-generic/unistd.h include/uapi/asm-generic/unistd.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

The arm64 changes are not included as it requires more changes in the tools. It'll be worked for the later cycle.

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

---
 tools/include/uapi/asm-generic/unistd.h             | 11 ++++++++++-
 tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl |  4 ++++
 tools/perf/arch/powerpc/entry/syscalls/syscall.tbl  |  4 ++++
 tools/perf/arch/s390/entry/syscalls/syscall.tbl     |  4 ++++
 tools/perf/arch/x86/entry/syscalls/syscall_32.tbl   |  4 ++++
 tools/perf/arch/x86/entry/syscalls/syscall_64.tbl   |  4 ++++
 6 files changed, 30 insertions(+), 1 deletion(-)
tools/include/uapi/asm-generic/unistd.h +10 -1
index 5bf6148cac2b93e3..88dc393c2bca38c0 100644
@@ -841,8 +841,17 @@ __SYSCALL(__NR_lsm_list_modules, sys_lsm_list_modules)
 #define __NR_mseal 462
 __SYSCALL(__NR_mseal, sys_mseal)
 
+#define __NR_setxattrat 463
+__SYSCALL(__NR_setxattrat, sys_setxattrat)
+#define __NR_getxattrat 464
+__SYSCALL(__NR_getxattrat, sys_getxattrat)
+#define __NR_listxattrat 465
+__SYSCALL(__NR_listxattrat, sys_listxattrat)
+#define __NR_removexattrat 466
+__SYSCALL(__NR_removexattrat, sys_removexattrat)
+
 #undef __NR_syscalls
-#define __NR_syscalls 463
+#define __NR_syscalls 467
 
 /*
  * 32 bit systems traditionally used different
tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl +4 -0
index 1464c6be6eb3c752..c844cd5cda620b28 100644
@@ -377,3 +377,7 @@
 460	n64	lsm_set_self_attr		sys_lsm_set_self_attr
 461	n64	lsm_list_modules		sys_lsm_list_modules
 462	n64	mseal				sys_mseal
+463	n64	setxattrat			sys_setxattrat
+464	n64	getxattrat			sys_getxattrat
+465	n64	listxattrat			sys_listxattrat
+466	n64	removexattrat			sys_removexattrat
tools/perf/arch/powerpc/entry/syscalls/syscall.tbl +4 -0
index ebae8415dfbbab6f..d8b4ab78bef076bd 100644
@@ -553,3 +553,7 @@
 460	common	lsm_set_self_attr		sys_lsm_set_self_attr
 461	common	lsm_list_modules		sys_lsm_list_modules
 462	common	mseal				sys_mseal
+463	common	setxattrat			sys_setxattrat
+464	common	getxattrat			sys_getxattrat
+465	common	listxattrat			sys_listxattrat
+466	common	removexattrat			sys_removexattrat
tools/perf/arch/s390/entry/syscalls/syscall.tbl +4 -0
index 01071182763e96ff..e9115b4d8b635b84 100644
@@ -465,3 +465,7 @@
 460  common	lsm_set_self_attr	sys_lsm_set_self_attr		sys_lsm_set_self_attr
 461  common	lsm_list_modules	sys_lsm_list_modules		sys_lsm_list_modules
 462  common	mseal			sys_mseal			sys_mseal
+463  common	setxattrat		sys_setxattrat			sys_setxattrat
+464  common	getxattrat		sys_getxattrat			sys_getxattrat
+465  common	listxattrat		sys_listxattrat			sys_listxattrat
+466  common	removexattrat		sys_removexattrat		sys_removexattrat
tools/perf/arch/x86/entry/syscalls/syscall_32.tbl +4 -0
index 534c74b14fab5117..4d0fb2fba7e208ae 100644
@@ -468,3 +468,7 @@
 460	i386	lsm_set_self_attr	sys_lsm_set_self_attr
 461	i386	lsm_list_modules	sys_lsm_list_modules
 462	i386	mseal 			sys_mseal
+463	i386	setxattrat		sys_setxattrat
+464	i386	getxattrat		sys_getxattrat
+465	i386	listxattrat		sys_listxattrat
+466	i386	removexattrat		sys_removexattrat
tools/perf/arch/x86/entry/syscalls/syscall_64.tbl +4 -0
index 7093ee21c0d1c041..5eb708bff1c791de 100644
@@ -386,6 +386,10 @@
 460	common	lsm_set_self_attr	sys_lsm_set_self_attr
 461	common	lsm_list_modules	sys_lsm_list_modules
 462 	common  mseal			sys_mseal
+463	common	setxattrat		sys_setxattrat
+464	common	getxattrat		sys_getxattrat
+465	common	listxattrat		sys_listxattrat
+466	common	removexattrat		sys_removexattrat
 
 #
 # Due to a historical design error, certain syscalls are numbered differently
Signature · 1 line
2.47.0.338.g60cca15819-goog
author maintainer
#7 lore raw

PATCH 7/11 tools headers: Sync uapi/asm-generic/mman.h with the kernel sources

In reply to Namhyung Kim

To pick up the changes in this cset:

3630e82ab6bd2642 ("mman: Add map_shadow_stack() flags")

This addresses these perf build warnings:

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

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

Cc Arnd Bergmann <[email protected]>
Cc Mark Brown <[email protected]>
Cc Catalin Marinas <[email protected]>
---
 tools/include/uapi/asm-generic/mman.h | 4 ++++
 1 file changed, 4 insertions(+)
tools/include/uapi/asm-generic/mman.h +4 -0
index 406f7718f9ad074f..51d2556af54ac721 100644
@@ -19,4 +19,8 @@
 #define MCL_FUTURE	2		/* lock all future mappings */
 #define MCL_ONFAULT	4		/* lock all pages that are faulted in */
 
+#define SHADOW_STACK_SET_TOKEN (1ULL << 0)     /* Set up a restore token in the shadow stack */
+#define SHADOW_STACK_SET_MARKER (1ULL << 1)     /* Set up a top of stack marker in the shadow stack */
+
+
 #endif /* __ASM_GENERIC_MMAN_H */
Signature · 1 line
2.47.0.338.g60cca15819-goog
author maintainer
#8 lore raw

PATCH 8/11 tools headers: Sync uapi/linux/fcntl.h with the kernel sources

In reply to Namhyung Kim

To pick up the changes in this cset:

c374196b2b9f4b80 ("fs: name_to_handle_at() support for "explicit connectable" file handles") 95f567f81e43a1bc ("fs: Simplify getattr interface function checking AT_GETATTR_NOSEC flag")

This addresses these perf build warnings:

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

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

Cc Jeff Layton <[email protected]>
Cc Chuck Lever <[email protected]>
Cc Alexander Aring <[email protected]>
Cc Christian Brauner <[email protected]>
Cc Al Viro <[email protected]>
---
 tools/perf/trace/beauty/include/uapi/linux/fcntl.h | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
tools/perf/trace/beauty/include/uapi/linux/fcntl.h +1 -4
index 87e2dec79fea4ef2..6e6907e63bfc2b4d 100644
@@ -153,9 +153,6 @@
 					   object identity and may not be
 					   usable with open_by_handle_at(2). */
 #define AT_HANDLE_MNT_ID_UNIQUE	0x001	/* Return the u64 unique mount ID. */
-
-#if defined(__KERNEL__)
-#define AT_GETATTR_NOSEC	0x80000000
-#endif
+#define AT_HANDLE_CONNECTABLE	0x002	/* Request a connectable file handle */
 
 #endif /* _UAPI_LINUX_FCNTL_H */
Signature · 1 line
2.47.0.338.g60cca15819-goog
author maintainer
#9 lore raw

PATCH 9/11 tools headers: Sync uapi/linux/mount.h with the kernel sources

In reply to Namhyung Kim

To pick up the changes in this cset:

aefff51e1c2986e1 statmount: retrieve security mount options 2f4d4503e9e5ab76 statmount: add flag to retrieve unescaped options 44010543fc8bedad fs: add the ability for statmount() to report the sb_source ed9d95f691c29748 fs: add the ability for statmount() to report the fs_subtype

This addresses these perf build warnings:

Warning: Kernel ABI header differences:
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.

---
 tools/perf/trace/beauty/include/uapi/linux/mount.h | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
tools/perf/trace/beauty/include/uapi/linux/mount.h +12 -2
index 225bc366ffcbf031..c07008816acae89c 100644
@@ -154,7 +154,7 @@ struct mount_attr {
  */
 struct statmount {
 	__u32 size;		/* Total size, including strings */
-	__u32 mnt_opts;		/* [str] Mount options of the mount */
+	__u32 mnt_opts;		/* [str] Options (comma separated, escaped) */
 	__u64 mask;		/* What results were written */
 	__u32 sb_dev_major;	/* Device ID */
 	__u32 sb_dev_minor;
@@ -173,7 +173,13 @@ struct statmount {
 	__u32 mnt_root;		/* [str] Root of mount relative to root of fs */
 	__u32 mnt_point;	/* [str] Mountpoint relative to current root */
 	__u64 mnt_ns_id;	/* ID of the mount namespace */
-	__u64 __spare2[49];
+	__u32 fs_subtype;	/* [str] Subtype of fs_type (if any) */
+	__u32 sb_source;	/* [str] Source string of the mount */
+	__u32 opt_num;		/* Number of fs options */
+	__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];
 	char str[];		/* Variable size part containing strings */
 };
 
@@ -207,6 +213,10 @@ struct mnt_id_req {
 #define STATMOUNT_FS_TYPE		0x00000020U	/* Want/got fs_type */
 #define STATMOUNT_MNT_NS_ID		0x00000040U	/* Want/got mnt_ns_id */
 #define STATMOUNT_MNT_OPTS		0x00000080U	/* Want/got mnt_opts */
+#define STATMOUNT_FS_SUBTYPE		0x00000100U	/* Want/got fs_subtype */
+#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... */
 
 /*
  * Special @mnt_id values that can be passed to listmount
Signature · 1 line
2.47.0.338.g60cca15819-goog
author maintainer
#10 lore raw

PATCH 10/11 tools headers: Sync uapi/linux/prctl.h with the kernel sources

In reply to Namhyung Kim

To pick up the changes in this cset:

09d6775f503b393d riscv: Add support for userspace pointer masking 91e102e79740ae43 prctl: arch-agnostic prctl for shadow stack

This addresses these perf build warnings:

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 Mark Brown <[email protected]>
Cc Palmer Dabbelt <[email protected]>
---
 .../trace/beauty/include/uapi/linux/prctl.h   | 27 ++++++++++++++++++-
 1 file changed, 26 insertions(+), 1 deletion(-)
tools/perf/trace/beauty/include/uapi/linux/prctl.h +26 -1
index 35791791a879b288..5c6080680cb27b19 100644
@@ -230,7 +230,7 @@ struct prctl_mm_map {
 # define PR_PAC_APDBKEY			(1UL << 3)
 # define PR_PAC_APGAKEY			(1UL << 4)
 
-/* Tagged user address controls for arm64 */
+/* Tagged user address controls for arm64 and RISC-V */
 #define PR_SET_TAGGED_ADDR_CTRL		55
 #define PR_GET_TAGGED_ADDR_CTRL		56
 # define PR_TAGGED_ADDR_ENABLE		(1UL << 0)
@@ -244,6 +244,9 @@ struct prctl_mm_map {
 # define PR_MTE_TAG_MASK		(0xffffUL << PR_MTE_TAG_SHIFT)
 /* Unused; kept only for source compatibility */
 # define PR_MTE_TCF_SHIFT		1
+/* RISC-V pointer masking tag length */
+# define PR_PMLEN_SHIFT			24
+# define PR_PMLEN_MASK			(0x7fUL << PR_PMLEN_SHIFT)
 
 /* Control reclaim behavior when allocating memory */
 #define PR_SET_IO_FLUSHER		57
@@ -328,4 +331,26 @@ struct prctl_mm_map {
 # define PR_PPC_DEXCR_CTRL_CLEAR_ONEXEC	0x10 /* Clear the aspect on exec */
 # define PR_PPC_DEXCR_CTRL_MASK		0x1f
 
+/*
+ * Get the current shadow stack configuration for the current thread,
+ * this will be the value configured via PR_SET_SHADOW_STACK_STATUS.
+ */
+#define PR_GET_SHADOW_STACK_STATUS      74
+
+/*
+ * Set the current shadow stack configuration.  Enabling the shadow
+ * stack will cause a shadow stack to be allocated for the thread.
+ */
+#define PR_SET_SHADOW_STACK_STATUS      75
+# define PR_SHADOW_STACK_ENABLE         (1UL << 0)
+# define PR_SHADOW_STACK_WRITE		(1UL << 1)
+# define PR_SHADOW_STACK_PUSH		(1UL << 2)
+
+/*
+ * Prevent further changes to the specified shadow stack
+ * configuration.  All bits may be locked via this call, including
+ * undefined bits.
+ */
+#define PR_LOCK_SHADOW_STACK_STATUS      76
+
 #endif /* _LINUX_PRCTL_H */
Signature · 1 line
2.47.0.338.g60cca15819-goog
author maintainer
#11 lore raw

PATCH 11/11 perf tools: Fix build error on generated/fs_at_flags_array.c

In reply to Namhyung Kim

It should only have generic flags in the array but the recent header sync brought a new flags to fcntl.h and caused a build error. Let's update the shell script to exclude flags specific to name_to_handle_at().

CC trace/beauty/fs_at_flags.o
In file included from trace/beauty/fs_at_flags.c:21:
tools/perf/trace/beauty/generated/fs_at_flags_array.c:13:30: error: initialized field overwritten [-Werror=override-init]

     13 |         [ilog2(0x002) + 1] = "HANDLE_CONNECTABLE",
        |                              ^~~~~~~~~~~~~~~~~~~~

tools/perf/trace/beauty/generated/fs_at_flags_array.c:13:30: note: (near initialization for ‘fs_at_flags[2]’)

---
 tools/perf/trace/beauty/fs_at_flags.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/perf/trace/beauty/fs_at_flags.sh +2 -1
index e3f13f96a27c227c..fac4d0c049fcc89f 100755
@@ -13,13 +13,14 @@ printf "static const char *fs_at_flags[] = {\n"
 regex='^[[:space:]]*#[[:space:]]*define[[:space:]]+AT_([^_]+[[:alnum:]_]+)[[:space:]]+(0x[[:xdigit:]]+)[[:space:]]*.*'
 # AT_EACCESS is only meaningful to faccessat, so we will special case it there...
 # AT_STATX_SYNC_TYPE is not a bit, its a mask of AT_STATX_SYNC_AS_STAT, AT_STATX_FORCE_SYNC and AT_STATX_DONT_SYNC
-# AT_HANDLE_FID and AT_HANDLE_MNT_ID_UNIQUE are reusing values and are valid only for name_to_handle_at()
+# AT_HANDLE_FID, AT_HANDLE_MNT_ID_UNIQUE and AT_HANDLE_CONNECTABLE are reusing values and are valid only for name_to_handle_at()
 # AT_RENAME_NOREPLACE reuses 0x1 and is valid only for renameat2()
 grep -E $regex ${linux_fcntl} | \
 	grep -v AT_EACCESS | \
 	grep -v AT_STATX_SYNC_TYPE | \
 	grep -v AT_HANDLE_FID | \
 	grep -v AT_HANDLE_MNT_ID_UNIQUE | \
+	grep -v AT_HANDLE_CONNECTABLE | \
 	grep -v AT_RENAME_NOREPLACE | \
 	sed -r "s/$regex/\2 \1/g"	| \
 	xargs printf "\t[ilog2(%s) + 1] = \"%s\",\n"
Signature · 1 line
2.47.0.338.g60cca15819-goog
reviewer
#12 lore raw

Re: [PATCH 11/11] perf tools: Fix build error on generated/fs_at_flags_array.c

Quoted 4 lines · Namhyung Kim

It should only have generic flags in the array but the recent header sync brought a new flags to fcntl.h and caused a build error. Let's update the shell script to exclude flags specific to name_to_handle_at().

Quoted 8 lines

CC trace/beauty/fs_at_flags.o
In file included from trace/beauty/fs_at_flags.c:21:
tools/perf/trace/beauty/generated/fs_at_flags_array.c:13:30: error: initialized field overwritten [-Werror=override-init]

      13 |         [ilog2(0x002) + 1] = "HANDLE_CONNECTABLE",
         |                              ^~~~~~~~~~~~~~~~~~~~

tools/perf/trace/beauty/generated/fs_at_flags_array.c:13:30: note: (near initialization for ‘fs_at_flags[2]’)

Hi Namhyung,

Is it possible to fix this before the updates to keep it buildable? Maybe it's not feasible, I didn't check.

I did notice a build issue in the kvm tests after this update:

$ make O=../build/local/ summary=1 TARGETS=kvm kselftest

In file included from aarch64/aarch32_id_regs.c:14:
include/aarch64/processor.h:15:10: fatal error: asm/brk-imm.h: No such file or directory
15 | #include <asm/brk-imm.h>

But I tried the same on v6.13-rc1 and got a different error, so I don't know if it's any worse.

Thanks
James

Quoted 24 lines
---
  tools/perf/trace/beauty/fs_at_flags.sh | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
tools/perf/trace/beauty/fs_at_flags.sh +2 -1
index e3f13f96a27c227c..fac4d0c049fcc89f 100755
@@ -13,13 +13,14 @@ printf "static const char *fs_at_flags[] = {\n"
  regex='^[[:space:]]*#[[:space:]]*define[[:space:]]+AT_([^_]+[[:alnum:]_]+)[[:space:]]+(0x[[:xdigit:]]+)[[:space:]]*.*'
  # AT_EACCESS is only meaningful to faccessat, so we will special case it there...
  # AT_STATX_SYNC_TYPE is not a bit, its a mask of AT_STATX_SYNC_AS_STAT, AT_STATX_FORCE_SYNC and AT_STATX_DONT_SYNC
-# AT_HANDLE_FID and AT_HANDLE_MNT_ID_UNIQUE are reusing values and are valid only for name_to_handle_at()
+# AT_HANDLE_FID, AT_HANDLE_MNT_ID_UNIQUE and AT_HANDLE_CONNECTABLE are reusing values and are valid only for name_to_handle_at()
  # AT_RENAME_NOREPLACE reuses 0x1 and is valid only for renameat2()
  grep -E $regex ${linux_fcntl} | \
  	grep -v AT_EACCESS | \
  	grep -v AT_STATX_SYNC_TYPE | \
  	grep -v AT_HANDLE_FID | \
  	grep -v AT_HANDLE_MNT_ID_UNIQUE | \
+	grep -v AT_HANDLE_CONNECTABLE | \
  	grep -v AT_RENAME_NOREPLACE | \
  	sed -r "s/$regex/\2 \1/g"	| \
  	xargs printf "\t[ilog2(%s) + 1] = \"%s\",\n"
author maintainer
#13 lore raw

Re: [PATCH 11/11] perf tools: Fix build error on generated/fs_at_flags_array.c

Hello,

Quoted 25 lines · James Clark
Quoted 4 lines · Namhyung Kim

It should only have generic flags in the array but the recent header sync brought a new flags to fcntl.h and caused a build error. Let's update the shell script to exclude flags specific to name_to_handle_at().

Quoted 8 lines

CC trace/beauty/fs_at_flags.o
In file included from trace/beauty/fs_at_flags.c:21:
tools/perf/trace/beauty/generated/fs_at_flags_array.c:13:30: error: initialized field overwritten [-Werror=override-init]

      13 |         [ilog2(0x002) + 1] = "HANDLE_CONNECTABLE",
         |                              ^~~~~~~~~~~~~~~~~~~~

tools/perf/trace/beauty/generated/fs_at_flags_array.c:13:30: note: (near initialization for ‘fs_at_flags[2]’)

Hi Namhyung,

Is it possible to fix this before the updates to keep it buildable? Maybe it's not feasible, I didn't check.

I did notice a build issue in the kvm tests after this update:

$ make O=../build/local/ summary=1 TARGETS=kvm kselftest
Quoted 7 lines

In file included from aarch64/aarch32_id_regs.c:14:
include/aarch64/processor.h:15:10: fatal error: asm/brk-imm.h: No such file or directory
15 | #include <asm/brk-imm.h>

But I tried the same on v6.13-rc1 and got a different error, so I don't know if it's any worse.

I suspect it's an unrelated issue. This fix is about generating descriptions of the flags for perf trace beautifier.

The below is the only change I made in this series for arm64.

Thanks,
Namhyung

---8<---

tools/arch/arm64/include/uapi/asm/kvm.h +6 -0
index 964df31da9751c96..66736ff04011e0fa 100644
@@ -484,6 +484,12 @@ enum {
  */
 #define KVM_SYSTEM_EVENT_RESET_FLAG_PSCI_RESET2        (1ULL << 0)
 
+/*
+ * Shutdown caused by a PSCI v1.3 SYSTEM_OFF2 call.
+ * Valid only when the system event has a type of KVM_SYSTEM_EVENT_SHUTDOWN.
+ */
+#define KVM_SYSTEM_EVENT_SHUTDOWN_FLAG_PSCI_OFF2       (1ULL << 0)
+
 /* run->fail_entry.hardware_entry_failure_reason codes. */
 #define KVM_EXIT_FAIL_ENTRY_CPU_UNSUPPORTED    (1ULL << 0)
reviewer
#14 lore raw

Re: [PATCH 11/11] perf tools: Fix build error on generated/fs_at_flags_array.c

Quoted 36 lines · Namhyung Kim

Hello,

Quoted 25 lines · James Clark
Quoted 4 lines · Namhyung Kim

It should only have generic flags in the array but the recent header sync brought a new flags to fcntl.h and caused a build error. Let's update the shell script to exclude flags specific to name_to_handle_at().

Quoted 8 lines

CC trace/beauty/fs_at_flags.o
In file included from trace/beauty/fs_at_flags.c:21:
tools/perf/trace/beauty/generated/fs_at_flags_array.c:13:30: error: initialized field overwritten [-Werror=override-init]
13 | [ilog2(0x002) + 1] = "HANDLE_CONNECTABLE",
| ^~~~~~~~~~~~~~~~~~~~
tools/perf/trace/beauty/generated/fs_at_flags_array.c:13:30: note: (near initialization for ‘fs_at_flags[2]’)

Hi Namhyung,

Is it possible to fix this before the updates to keep it buildable? Maybe it's not feasible, I didn't check.

I did notice a build issue in the kvm tests after this update:

$ make O=../build/local/ summary=1 TARGETS=kvm kselftest
Quoted 7 lines

In file included from aarch64/aarch32_id_regs.c:14:
include/aarch64/processor.h:15:10: fatal error: asm/brk-imm.h: No such file or directory

    15 | #include <asm/brk-imm.h>

But I tried the same on v6.13-rc1 and got a different error, so I don't know if it's any worse.

Quoted 8 lines

I suspect it's an unrelated issue. This fix is about generating descriptions of the flags for perf trace beautifier.

The below is the only change I made in this series for arm64.

Thanks,
Namhyung

I'll take a look

Quoted 18 lines

---8<---

tools/arch/arm64/include/uapi/asm/kvm.h +6 -0
index 964df31da9751c96..66736ff04011e0fa 100644
@@ -484,6 +484,12 @@ enum {
   */
  #define KVM_SYSTEM_EVENT_RESET_FLAG_PSCI_RESET2        (1ULL << 0)
 
+/*
+ * Shutdown caused by a PSCI v1.3 SYSTEM_OFF2 call.
+ * Valid only when the system event has a type of KVM_SYSTEM_EVENT_SHUTDOWN.
+ */
+#define KVM_SYSTEM_EVENT_SHUTDOWN_FLAG_PSCI_OFF2       (1ULL << 0)
+
  /* run->fail_entry.hardware_entry_failure_reason codes. */
  #define KVM_EXIT_FAIL_ENTRY_CPU_UNSUPPORTED    (1ULL << 0)
reviewer
#15 lore raw

Re: [PATCH 11/11] perf tools: Fix build error on generated/fs_at_flags_array.c

Quoted 42 lines · James Clark
Quoted 39 lines · Namhyung Kim

Hello,

Quoted 25 lines · James Clark
Quoted 4 lines · Namhyung Kim

It should only have generic flags in the array but the recent header sync brought a new flags to fcntl.h and caused a build error.  Let's update the shell script to exclude flags specific to name_to_handle_at().

Quoted 8 lines

      CC      trace/beauty/fs_at_flags.o
    In file included from trace/beauty/fs_at_flags.c:21:
    tools/perf/trace/beauty/generated/fs_at_flags_array.c:13:30: error: initialized field overwritten [-Werror=override-init] 13 |         [ilog2(0x002) + 1] = "HANDLE_CONNECTABLE",
          |                              ^~~~~~~~~~~~~~~~~~~~ tools/perf/trace/beauty/generated/fs_at_flags_array.c:13:30: note: (near initialization for ‘fs_at_flags[2]’)

Hi Namhyung,

Is it possible to fix this before the updates to keep it buildable? Maybe it's not feasible, I didn't check.

I did notice a build issue in the kvm tests after this update:

$ make O=../build/local/ summary=1 TARGETS=kvm kselftest
Quoted 7 lines

In file included from aarch64/aarch32_id_regs.c:14:
include/aarch64/processor.h:15:10: fatal error: asm/brk-imm.h: No such file or directory
    15 | #include <asm/brk-imm.h>

But I tried the same on v6.13-rc1 and got a different error, so I don't know if it's any worse.

I suspect it's an unrelated issue.  This fix is about generating descriptions of the flags for perf trace beautifier.

Quoted 8 lines
Quoted 5 lines

The below is the only change I made in this series for arm64.

Thanks,
Namhyung

I'll take a look

Looked like some kind of stale build issue. A clean fixed it but I wasn't able to reproduce it.

Quoted 19 lines
Quoted 18 lines

---8<---

tools/arch/arm64/include/uapi/asm/kvm.h +3 -0
index 964df31da9751c96..66736ff04011e0fa 100644
@@ -484,6 +484,12 @@ enum {
    */
   #define KVM_SYSTEM_EVENT_RESET_FLAG_PSCI_RESET2        (1ULL << 0)
+/*
+ * Shutdown caused by a PSCI v1.3 SYSTEM_OFF2 call.
+ * Valid only when the system event has a type of 

KVM_SYSTEM_EVENT_SHUTDOWN.
+ */

tools/arch/arm64/include/uapi/asm/kvm.h +2 -0
+#define KVM_SYSTEM_EVENT_SHUTDOWN_FLAG_PSCI_OFF2       (1ULL << 0)
+

  /* run->fail_entry.hardware_entry_failure_reason codes. */ #define KVM_EXIT_FAIL_ENTRY_CPU_UNSUPPORTED    (1ULL << 0)

reviewer Reviewed-by on the v1 series
#16 lore raw
In reply to Namhyung Kim
Quoted 10 lines · Namhyung Kim

Hello,

I'll carry these changes on the perf tools tree to update perf tools to understand new syscalls and parameters. You can refer to README file in the tools/include/uapi directory why it's needed.

Thanks,
Namhyung

Quoted 32 lines

Namhyung Kim (11):
tools headers: Sync uapi/drm/drm.h with the kernel sources tools headers: Sync uapi/linux/perf_event.h with the kernel sources tools headers: Sync uapi/linux/kvm.h with the kernel sources tools headers: Sync x86 kvm and cpufeature headers with the kernel tools headers: Sync arm64 kvm header with the kernel sources tools headers: Sync *xattrat syscall changes with the kernel sources tools headers: Sync uapi/asm-generic/mman.h with the kernel sources tools headers: Sync uapi/linux/fcntl.h with the kernel sources tools headers: Sync uapi/linux/mount.h with the kernel sources tools headers: Sync uapi/linux/prctl.h with the kernel sources perf tools: Fix build error on generated/fs_at_flags_array.c

  tools/arch/arm64/include/uapi/asm/kvm.h       |  6 +++++
  tools/arch/x86/include/asm/cpufeatures.h      | 11 ++++++--
  tools/arch/x86/include/uapi/asm/kvm.h         |  1 +
  tools/include/uapi/asm-generic/mman.h         |  4 +++
  tools/include/uapi/asm-generic/unistd.h       | 11 +++++++-
  tools/include/uapi/drm/drm.h                  | 17 ++++++++++++
  tools/include/uapi/linux/kvm.h                |  8 ++++++
  tools/include/uapi/linux/perf_event.h         | 11 +++++++-
  .../arch/mips/entry/syscalls/syscall_n64.tbl  |  4 +++
  .../arch/powerpc/entry/syscalls/syscall.tbl   |  4 +++
  .../perf/arch/s390/entry/syscalls/syscall.tbl |  4 +++
  .../arch/x86/entry/syscalls/syscall_32.tbl    |  4 +++
  .../arch/x86/entry/syscalls/syscall_64.tbl    |  4 +++
  tools/perf/trace/beauty/fs_at_flags.sh        |  3 ++-
  .../trace/beauty/include/uapi/linux/fcntl.h   |  5 +---
  .../trace/beauty/include/uapi/linux/mount.h   | 14 ++++++++--
  .../trace/beauty/include/uapi/linux/prctl.h   | 27 ++++++++++++++++++-
  17 files changed, 126 insertions(+), 12 deletions(-)
author maintainer Applied
#17 lore raw
In reply to Namhyung Kim
Quoted 8 lines · Namhyung Kim

I'll carry these changes on the perf tools tree to update perf tools to understand new syscalls and parameters. You can refer to README file in the tools/include/uapi directory why it's needed.

Thanks,
Namhyung

[...]

Applied to perf-tools, thanks!

Best regards,
Namhyung