Skip to content

Commit 8040dc4

Browse files
committed
Merge tag 'perf-tools-fixes-for-v7.0-1-2026-03-13' of git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools
Pull perf tools fixes from Arnaldo Carvalho de Melo: - Fix stale build ID in module MMAP2 records in events synthesized for pre-existing processes - Fix rust cross compilation - hashmap__new() error pointer return handling fixes - Fix off-by-one bug in outside of functions check on the disasm code - Update header copies of kernel headers, including prctl.h, mount.h, fs.h, irq_vectors.h, perf_event.h, gfp_types.h, kvm.h, cpufeatures.h msr-index.h, also the syscall tables files that introduced the 'rseq_slice_yield' syscall - Finish removal of ETM_OPT_* on the ARM coresight support, needed to sync the coresight-pmu.h header with the kernel sources - Make in-target rule robust against too long argument error * tag 'perf-tools-fixes-for-v7.0-1-2026-03-13' of git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools: (22 commits) perf synthetic-events: Fix stale build ID in module MMAP2 records perf annotate loongarch: Fix off-by-one bug in outside check perf ftrace: Fix hashmap__new() error checking perf annotate: Fix hashmap__new() error checking perf cs-etm: Sync coresight-pmu.h header with the kernel sources perf cs-etm: Finish removal of ETM_OPT_* tools headers UAPI: Update tools' copy of linux/coresight-pmu.h tools headers: Update the syscall tables and unistd.h, to support the new 'rseq_slice_yield' syscall perf disasm: Fix off-by-one bug in outside check tools arch x86: Sync msr-index.h to pick MSR_{OMR_[0-3],CORE_PERF_GLOBAL_STATUS_SET} tools headers UAPI: Sync x86's asm/kvm.h with the kernel sources tools headers x86 cpufeatures: Sync with the kernel sources tools headers UAPI: Sync linux/kvm.h with the kernel sources tools headers: Update the linux/gfp_types.h copy with the kernel sources perf beauty: Update the linux/perf_event.h copy with the kernel sources perf beauty: Update the arch/x86/include/asm/irq_vectors.h copy with the kernel sources perf beauty: Sync UAPI linux/fs.h with kernel sources perf beauty: Sync linux/mount.h copy with the kernel sources tools build: Fix rust cross compilation perf build: Prevent "argument list too long" error ...
2 parents 8d99688 + 35b16a7 commit 8040dc4

37 files changed

Lines changed: 584 additions & 550 deletions

File tree

tools/arch/x86/include/asm/amd/ibs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ union ibs_op_data3 {
110110
__u64 ld_op:1, /* 0: load op */
111111
st_op:1, /* 1: store op */
112112
dc_l1tlb_miss:1, /* 2: data cache L1TLB miss */
113-
dc_l2tlb_miss:1, /* 3: data cache L2TLB hit in 2M page */
113+
dc_l2tlb_miss:1, /* 3: data cache L2TLB miss in 2M page */
114114
dc_l1tlb_hit_2m:1, /* 4: data cache L1TLB hit in 2M page */
115115
dc_l1tlb_hit_1g:1, /* 5: data cache L1TLB hit in 1G page */
116116
dc_l2tlb_hit_2m:1, /* 6: data cache L2TLB hit in 2M page */

tools/arch/x86/include/asm/cpufeatures.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
#define X86_FEATURE_PEBS ( 3*32+12) /* "pebs" Precise-Event Based Sampling */
8585
#define X86_FEATURE_BTS ( 3*32+13) /* "bts" Branch Trace Store */
8686
#define X86_FEATURE_SYSCALL32 ( 3*32+14) /* syscall in IA32 userspace */
87-
#define X86_FEATURE_SYSENTER32 ( 3*32+15) /* sysenter in IA32 userspace */
87+
#define X86_FEATURE_SYSFAST32 ( 3*32+15) /* sysenter/syscall in IA32 userspace */
8888
#define X86_FEATURE_REP_GOOD ( 3*32+16) /* "rep_good" REP microcode works well */
8989
#define X86_FEATURE_AMD_LBR_V2 ( 3*32+17) /* "amd_lbr_v2" AMD Last Branch Record Extension Version 2 */
9090
#define X86_FEATURE_CLEAR_CPU_BUF ( 3*32+18) /* Clear CPU buffers using VERW */
@@ -326,6 +326,7 @@
326326
#define X86_FEATURE_AMX_FP16 (12*32+21) /* AMX fp16 Support */
327327
#define X86_FEATURE_AVX_IFMA (12*32+23) /* Support for VPMADD52[H,L]UQ */
328328
#define X86_FEATURE_LAM (12*32+26) /* "lam" Linear Address Masking */
329+
#define X86_FEATURE_MOVRS (12*32+31) /* MOVRS instructions */
329330

330331
/* AMD-defined CPU features, CPUID level 0x80000008 (EBX), word 13 */
331332
#define X86_FEATURE_CLZERO (13*32+ 0) /* "clzero" CLZERO instruction */
@@ -472,6 +473,7 @@
472473
#define X86_FEATURE_GP_ON_USER_CPUID (20*32+17) /* User CPUID faulting */
473474

474475
#define X86_FEATURE_PREFETCHI (20*32+20) /* Prefetch Data/Instruction to Cache Level */
476+
#define X86_FEATURE_ERAPS (20*32+24) /* Enhanced Return Address Predictor Security */
475477
#define X86_FEATURE_SBPB (20*32+27) /* Selective Branch Prediction Barrier */
476478
#define X86_FEATURE_IBPB_BRTYPE (20*32+28) /* MSR_PRED_CMD[IBPB] flushes all branch type predictions */
477479
#define X86_FEATURE_SRSO_NO (20*32+29) /* CPU is not affected by SRSO */

tools/arch/x86/include/asm/msr-index.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,11 @@
263263
#define MSR_SNOOP_RSP_0 0x00001328
264264
#define MSR_SNOOP_RSP_1 0x00001329
265265

266+
#define MSR_OMR_0 0x000003e0
267+
#define MSR_OMR_1 0x000003e1
268+
#define MSR_OMR_2 0x000003e2
269+
#define MSR_OMR_3 0x000003e3
270+
266271
#define MSR_LBR_SELECT 0x000001c8
267272
#define MSR_LBR_TOS 0x000001c9
268273

@@ -1219,6 +1224,7 @@
12191224
#define MSR_CORE_PERF_GLOBAL_STATUS 0x0000038e
12201225
#define MSR_CORE_PERF_GLOBAL_CTRL 0x0000038f
12211226
#define MSR_CORE_PERF_GLOBAL_OVF_CTRL 0x00000390
1227+
#define MSR_CORE_PERF_GLOBAL_STATUS_SET 0x00000391
12221228

12231229
#define MSR_PERF_METRICS 0x00000329
12241230

tools/arch/x86/include/uapi/asm/kvm.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,7 @@ struct kvm_sync_regs {
503503
#define KVM_X86_GRP_SEV 1
504504
# define KVM_X86_SEV_VMSA_FEATURES 0
505505
# define KVM_X86_SNP_POLICY_BITS 1
506+
# define KVM_X86_SEV_SNP_REQ_CERTS 2
506507

507508
struct kvm_vmx_nested_state_data {
508509
__u8 vmcs12[KVM_STATE_NESTED_VMX_VMCS_SIZE];
@@ -743,6 +744,7 @@ enum sev_cmd_id {
743744
KVM_SEV_SNP_LAUNCH_START = 100,
744745
KVM_SEV_SNP_LAUNCH_UPDATE,
745746
KVM_SEV_SNP_LAUNCH_FINISH,
747+
KVM_SEV_SNP_ENABLE_REQ_CERTS,
746748

747749
KVM_SEV_NR_MAX,
748750
};
@@ -914,8 +916,10 @@ struct kvm_sev_snp_launch_finish {
914916
__u64 pad1[4];
915917
};
916918

917-
#define KVM_X2APIC_API_USE_32BIT_IDS (1ULL << 0)
918-
#define KVM_X2APIC_API_DISABLE_BROADCAST_QUIRK (1ULL << 1)
919+
#define KVM_X2APIC_API_USE_32BIT_IDS _BITULL(0)
920+
#define KVM_X2APIC_API_DISABLE_BROADCAST_QUIRK _BITULL(1)
921+
#define KVM_X2APIC_ENABLE_SUPPRESS_EOI_BROADCAST _BITULL(2)
922+
#define KVM_X2APIC_DISABLE_SUPPRESS_EOI_BROADCAST _BITULL(3)
919923

920924
struct kvm_hyperv_eventfd {
921925
__u32 conn_id;

tools/build/Build.include

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,15 @@ c_flags_2 = $(filter-out $(CFLAGS_REMOVE_$(basetarget).o), $(c_flags_1))
9898
c_flags = $(filter-out $(CFLAGS_REMOVE_$(obj)), $(c_flags_2))
9999
cxx_flags = -Wp,-MD,$(depfile) -Wp,-MT,$@ $(CXXFLAGS) -D"BUILD_STR(s)=\#s" $(CXXFLAGS_$(basetarget).o) $(CXXFLAGS_$(obj))
100100

101+
###
102+
# Rust flags to be used on rule definition, includes:
103+
# - global $(RUST_FLAGS)
104+
# - per target Rust flags
105+
# - per object Rust flags
106+
rust_flags_1 = $(RUST_FLAGS) $(RUST_FLAGS_$(basetarget).o) $(RUST_FLAGS_$(obj))
107+
rust_flags_2 = $(filter-out $(RUST_FLAGS_REMOVE_$(basetarget).o), $(rust_flags_1))
108+
rust_flags = $(filter-out $(RUST_FLAGS_REMOVE_$(obj)), $(rust_flags_2))
109+
101110
###
102111
## HOSTCC C flags
103112

tools/build/Makefile.build

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,13 @@ quiet_cmd_gen = GEN $@
7070
# If there's nothing to link, create empty $@ object.
7171
quiet_cmd_ld_multi = LD $@
7272
cmd_ld_multi = $(if $(strip $(obj-y)),\
73-
$(LD) -r -o $@ $(filter $(obj-y),$^),rm -f $@; $(AR) rcs $@)
73+
printf "$(objprefix)%s " $(patsubst $(objprefix)%,%,$(filter $(obj-y),$^)) | \
74+
xargs $(LD) -r -o $@,rm -f $@; $(AR) rcs $@)
7475

7576
quiet_cmd_host_ld_multi = HOSTLD $@
7677
cmd_host_ld_multi = $(if $(strip $(obj-y)),\
77-
$(HOSTLD) -r -o $@ $(filter $(obj-y),$^),rm -f $@; $(HOSTAR) rcs $@)
78+
printf "$(objprefix)%s " $(patsubst $(objprefix)%,%,$(filter $(obj-y),$^)) | \
79+
xargs $(HOSTLD) -r -o $@,rm -f $@; $(HOSTAR) rcs $@)
7880

7981
rust_common_cmd = \
8082
$(RUSTC) $(rust_flags) \

tools/include/linux/coresight-pmu.h

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -21,30 +21,6 @@
2121
*/
2222
#define CORESIGHT_LEGACY_CPU_TRACE_ID(cpu) (0x10 + (cpu * 2))
2323

24-
/*
25-
* Below are the definition of bit offsets for perf option, and works as
26-
* arbitrary values for all ETM versions.
27-
*
28-
* Most of them are orignally from ETMv3.5/PTM's ETMCR config, therefore,
29-
* ETMv3.5/PTM doesn't define ETMCR config bits with prefix "ETM3_" and
30-
* directly use below macros as config bits.
31-
*/
32-
#define ETM_OPT_BRANCH_BROADCAST 8
33-
#define ETM_OPT_CYCACC 12
34-
#define ETM_OPT_CTXTID 14
35-
#define ETM_OPT_CTXTID2 15
36-
#define ETM_OPT_TS 28
37-
#define ETM_OPT_RETSTK 29
38-
39-
/* ETMv4 CONFIGR programming bits for the ETM OPTs */
40-
#define ETM4_CFG_BIT_BB 3
41-
#define ETM4_CFG_BIT_CYCACC 4
42-
#define ETM4_CFG_BIT_CTXTID 6
43-
#define ETM4_CFG_BIT_VMID 7
44-
#define ETM4_CFG_BIT_TS 11
45-
#define ETM4_CFG_BIT_RETSTK 12
46-
#define ETM4_CFG_BIT_VMID_OPT 15
47-
4824
/*
4925
* Interpretation of the PERF_RECORD_AUX_OUTPUT_HW_ID payload.
5026
* Used to associate a CPU with the CoreSight Trace ID.

tools/include/linux/gfp_types.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ enum {
139139
* %__GFP_ACCOUNT causes the allocation to be accounted to kmemcg.
140140
*
141141
* %__GFP_NO_OBJ_EXT causes slab allocation to have no object extension.
142+
* mark_obj_codetag_empty() should be called upon freeing for objects allocated
143+
* with this flag to indicate that their NULL tags are expected and normal.
142144
*/
143145
#define __GFP_RECLAIMABLE ((__force gfp_t)___GFP_RECLAIMABLE)
144146
#define __GFP_WRITE ((__force gfp_t)___GFP_WRITE)
@@ -309,8 +311,10 @@ enum {
309311
*
310312
* %GFP_ATOMIC users can not sleep and need the allocation to succeed. A lower
311313
* watermark is applied to allow access to "atomic reserves".
312-
* The current implementation doesn't support NMI and few other strict
313-
* non-preemptive contexts (e.g. raw_spin_lock). The same applies to %GFP_NOWAIT.
314+
* The current implementation doesn't support NMI, nor contexts that disable
315+
* preemption under PREEMPT_RT. This includes raw_spin_lock() and plain
316+
* preempt_disable() - see "Memory allocation" in
317+
* Documentation/core-api/real-time/differences.rst for more info.
314318
*
315319
* %GFP_KERNEL is typical for kernel-internal allocations. The caller requires
316320
* %ZONE_NORMAL or a lower zone for direct access but can direct reclaim.
@@ -321,6 +325,7 @@ enum {
321325
* %GFP_NOWAIT is for kernel allocations that should not stall for direct
322326
* reclaim, start physical IO or use any filesystem callback. It is very
323327
* likely to fail to allocate memory, even for very small allocations.
328+
* The same restrictions on calling contexts apply as for %GFP_ATOMIC.
324329
*
325330
* %GFP_NOIO will use direct reclaim to discard clean pages or slab pages
326331
* that do not require the starting of any physical IO.

tools/include/uapi/asm-generic/unistd.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,8 +860,11 @@ __SYSCALL(__NR_file_setattr, sys_file_setattr)
860860
#define __NR_listns 470
861861
__SYSCALL(__NR_listns, sys_listns)
862862

863+
#define __NR_rseq_slice_yield 471
864+
__SYSCALL(__NR_rseq_slice_yield, sys_rseq_slice_yield)
865+
863866
#undef __NR_syscalls
864-
#define __NR_syscalls 471
867+
#define __NR_syscalls 472
865868

866869
/*
867870
* 32 bit systems traditionally used different

tools/include/uapi/linux/kvm.h

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,12 @@ struct kvm_xen_exit {
135135
} u;
136136
};
137137

138+
struct kvm_exit_snp_req_certs {
139+
__u64 gpa;
140+
__u64 npages;
141+
__u64 ret;
142+
};
143+
138144
#define KVM_S390_GET_SKEYS_NONE 1
139145
#define KVM_S390_SKEYS_MAX 1048576
140146

@@ -180,6 +186,8 @@ struct kvm_xen_exit {
180186
#define KVM_EXIT_MEMORY_FAULT 39
181187
#define KVM_EXIT_TDX 40
182188
#define KVM_EXIT_ARM_SEA 41
189+
#define KVM_EXIT_ARM_LDST64B 42
190+
#define KVM_EXIT_SNP_REQ_CERTS 43
183191

184192
/* For KVM_EXIT_INTERNAL_ERROR */
185193
/* Emulate instruction failed. */
@@ -402,7 +410,7 @@ struct kvm_run {
402410
} eoi;
403411
/* KVM_EXIT_HYPERV */
404412
struct kvm_hyperv_exit hyperv;
405-
/* KVM_EXIT_ARM_NISV */
413+
/* KVM_EXIT_ARM_NISV / KVM_EXIT_ARM_LDST64B */
406414
struct {
407415
__u64 esr_iss;
408416
__u64 fault_ipa;
@@ -482,6 +490,8 @@ struct kvm_run {
482490
__u64 gva;
483491
__u64 gpa;
484492
} arm_sea;
493+
/* KVM_EXIT_SNP_REQ_CERTS */
494+
struct kvm_exit_snp_req_certs snp_req_certs;
485495
/* Fix the size of the union. */
486496
char padding[256];
487497
};
@@ -974,6 +984,7 @@ struct kvm_enable_cap {
974984
#define KVM_CAP_GUEST_MEMFD_FLAGS 244
975985
#define KVM_CAP_ARM_SEA_TO_USER 245
976986
#define KVM_CAP_S390_USER_OPEREXEC 246
987+
#define KVM_CAP_S390_KEYOP 247
977988

978989
struct kvm_irq_routing_irqchip {
979990
__u32 irqchip;
@@ -1219,6 +1230,16 @@ struct kvm_vfio_spapr_tce {
12191230
__s32 tablefd;
12201231
};
12211232

1233+
#define KVM_S390_KEYOP_ISKE 0x01
1234+
#define KVM_S390_KEYOP_RRBE 0x02
1235+
#define KVM_S390_KEYOP_SSKE 0x03
1236+
struct kvm_s390_keyop {
1237+
__u64 guest_addr;
1238+
__u8 key;
1239+
__u8 operation;
1240+
__u8 pad[6];
1241+
};
1242+
12221243
/*
12231244
* KVM_CREATE_VCPU receives as a parameter the vcpu slot, and returns
12241245
* a vcpu fd.
@@ -1238,6 +1259,7 @@ struct kvm_vfio_spapr_tce {
12381259
#define KVM_S390_UCAS_MAP _IOW(KVMIO, 0x50, struct kvm_s390_ucas_mapping)
12391260
#define KVM_S390_UCAS_UNMAP _IOW(KVMIO, 0x51, struct kvm_s390_ucas_mapping)
12401261
#define KVM_S390_VCPU_FAULT _IOW(KVMIO, 0x52, unsigned long)
1262+
#define KVM_S390_KEYOP _IOWR(KVMIO, 0x53, struct kvm_s390_keyop)
12411263

12421264
/* Device model IOC */
12431265
#define KVM_CREATE_IRQCHIP _IO(KVMIO, 0x60)

0 commit comments

Comments
 (0)