Skip to content

Commit 10e66f2

Browse files
committed
Merge tag 'perf-tools-fixes-for-v6.15-2025-04-13' of git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools
Pull perf tools fixes from Namhyung Kim: "A couple of fixes and the usual tooling header updates: - fix a build error on ARM64 when libunwind is requested - fix an infinite loop with branch stack on AMD Zen3 - sync tooling headers with the kernel source" * tag 'perf-tools-fixes-for-v6.15-2025-04-13' of git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools: perf tools: Remove evsel__handle_error_quirks() perf libunwind arm64: Fix missing close parens in an if statement tools headers: Update the arch/x86/lib/memset_64.S copy with the kernel sources tools headers: Update the x86 headers with the kernel sources tools headers: Update the linux/unaligned.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 uapi/linux/prctl.h copy with the kernel sources tools headers: Update the syscall table with the kernel sources tools headers: Update the VFS headers with the kernel sources tools headers: Update the uapi/linux/perf_event.h copy with the kernel sources tools headers: Update the socket headers with the kernel sources tools headers: Update the KVM headers with the kernel sources
2 parents 8ffd015 + 2b70702 commit 10e66f2

File tree

34 files changed

+319
-132
lines changed

34 files changed

+319
-132
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@
4343
#define KVM_COALESCED_MMIO_PAGE_OFFSET 1
4444
#define KVM_DIRTY_LOG_PAGE_OFFSET 64
4545

46-
#define KVM_REG_SIZE(id) \
47-
(1U << (((id) & KVM_REG_SIZE_MASK) >> KVM_REG_SIZE_SHIFT))
48-
4946
struct kvm_regs {
5047
struct user_pt_regs regs; /* sp = sp_el0 */
5148

@@ -108,6 +105,7 @@ struct kvm_regs {
108105
#define KVM_ARM_VCPU_PTRAUTH_ADDRESS 5 /* VCPU uses address authentication */
109106
#define KVM_ARM_VCPU_PTRAUTH_GENERIC 6 /* VCPU uses generic authentication */
110107
#define KVM_ARM_VCPU_HAS_EL2 7 /* Support nested virtualization */
108+
#define KVM_ARM_VCPU_HAS_EL2_E2H0 8 /* Limit NV support to E2H RES0 */
111109

112110
struct kvm_vcpu_init {
113111
__u32 target;
@@ -418,6 +416,7 @@ enum {
418416
#define KVM_DEV_ARM_VGIC_GRP_CPU_SYSREGS 6
419417
#define KVM_DEV_ARM_VGIC_GRP_LEVEL_INFO 7
420418
#define KVM_DEV_ARM_VGIC_GRP_ITS_REGS 8
419+
#define KVM_DEV_ARM_VGIC_GRP_MAINT_IRQ 9
421420
#define KVM_DEV_ARM_VGIC_LINE_LEVEL_INFO_SHIFT 10
422421
#define KVM_DEV_ARM_VGIC_LINE_LEVEL_INFO_MASK \
423422
(0x3fffffULL << KVM_DEV_ARM_VGIC_LINE_LEVEL_INFO_SHIFT)
Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,2 @@
11
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2-
/*
3-
* Copyright (C) 2012 ARM Ltd.
4-
*
5-
* This program is free software; you can redistribute it and/or modify
6-
* it under the terms of the GNU General Public License version 2 as
7-
* published by the Free Software Foundation.
8-
*
9-
* This program is distributed in the hope that it will be useful,
10-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12-
* GNU General Public License for more details.
13-
*
14-
* You should have received a copy of the GNU General Public License
15-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16-
*/
17-
18-
#define __ARCH_WANT_RENAMEAT
19-
#define __ARCH_WANT_NEW_STAT
20-
#define __ARCH_WANT_SET_GET_RLIMIT
21-
#define __ARCH_WANT_TIME32_SYSCALLS
22-
#define __ARCH_WANT_MEMFD_SECRET
23-
24-
#include <asm-generic/unistd.h>
2+
#include <asm/unistd_64.h>

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

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@
7575
#define X86_FEATURE_CENTAUR_MCR ( 3*32+ 3) /* "centaur_mcr" Centaur MCRs (= MTRRs) */
7676
#define X86_FEATURE_K8 ( 3*32+ 4) /* Opteron, Athlon64 */
7777
#define X86_FEATURE_ZEN5 ( 3*32+ 5) /* CPU based on Zen5 microarchitecture */
78-
#define X86_FEATURE_P3 ( 3*32+ 6) /* P3 */
79-
#define X86_FEATURE_P4 ( 3*32+ 7) /* P4 */
78+
/* Free ( 3*32+ 6) */
79+
/* Free ( 3*32+ 7) */
8080
#define X86_FEATURE_CONSTANT_TSC ( 3*32+ 8) /* "constant_tsc" TSC ticks at a constant rate */
8181
#define X86_FEATURE_UP ( 3*32+ 9) /* "up" SMP kernel running on UP */
8282
#define X86_FEATURE_ART ( 3*32+10) /* "art" Always running timer (ART) */
@@ -329,6 +329,7 @@
329329
#define X86_FEATURE_CLZERO (13*32+ 0) /* "clzero" CLZERO instruction */
330330
#define X86_FEATURE_IRPERF (13*32+ 1) /* "irperf" Instructions Retired Count */
331331
#define X86_FEATURE_XSAVEERPTR (13*32+ 2) /* "xsaveerptr" Always save/restore FP error pointers */
332+
#define X86_FEATURE_INVLPGB (13*32+ 3) /* INVLPGB and TLBSYNC instructions supported */
332333
#define X86_FEATURE_RDPRU (13*32+ 4) /* "rdpru" Read processor register at user level */
333334
#define X86_FEATURE_WBNOINVD (13*32+ 9) /* "wbnoinvd" WBNOINVD instruction */
334335
#define X86_FEATURE_AMD_IBPB (13*32+12) /* Indirect Branch Prediction Barrier */
@@ -377,6 +378,7 @@
377378
#define X86_FEATURE_V_SPEC_CTRL (15*32+20) /* "v_spec_ctrl" Virtual SPEC_CTRL */
378379
#define X86_FEATURE_VNMI (15*32+25) /* "vnmi" Virtual NMI */
379380
#define X86_FEATURE_SVME_ADDR_CHK (15*32+28) /* SVME addr check */
381+
#define X86_FEATURE_IDLE_HLT (15*32+30) /* IDLE HLT intercept */
380382

381383
/* Intel-defined CPU features, CPUID level 0x00000007:0 (ECX), word 16 */
382384
#define X86_FEATURE_AVX512VBMI (16*32+ 1) /* "avx512vbmi" AVX512 Vector Bit Manipulation instructions*/
@@ -434,15 +436,18 @@
434436
#define X86_FEATURE_SPEC_CTRL_SSBD (18*32+31) /* Speculative Store Bypass Disable */
435437

436438
/* AMD-defined memory encryption features, CPUID level 0x8000001f (EAX), word 19 */
437-
#define X86_FEATURE_SME (19*32+ 0) /* "sme" AMD Secure Memory Encryption */
438-
#define X86_FEATURE_SEV (19*32+ 1) /* "sev" AMD Secure Encrypted Virtualization */
439+
#define X86_FEATURE_SME (19*32+ 0) /* "sme" Secure Memory Encryption */
440+
#define X86_FEATURE_SEV (19*32+ 1) /* "sev" Secure Encrypted Virtualization */
439441
#define X86_FEATURE_VM_PAGE_FLUSH (19*32+ 2) /* VM Page Flush MSR is supported */
440-
#define X86_FEATURE_SEV_ES (19*32+ 3) /* "sev_es" AMD Secure Encrypted Virtualization - Encrypted State */
441-
#define X86_FEATURE_SEV_SNP (19*32+ 4) /* "sev_snp" AMD Secure Encrypted Virtualization - Secure Nested Paging */
442+
#define X86_FEATURE_SEV_ES (19*32+ 3) /* "sev_es" Secure Encrypted Virtualization - Encrypted State */
443+
#define X86_FEATURE_SEV_SNP (19*32+ 4) /* "sev_snp" Secure Encrypted Virtualization - Secure Nested Paging */
442444
#define X86_FEATURE_V_TSC_AUX (19*32+ 9) /* Virtual TSC_AUX */
443-
#define X86_FEATURE_SME_COHERENT (19*32+10) /* AMD hardware-enforced cache coherency */
444-
#define X86_FEATURE_DEBUG_SWAP (19*32+14) /* "debug_swap" AMD SEV-ES full debug state swap support */
445+
#define X86_FEATURE_SME_COHERENT (19*32+10) /* hardware-enforced cache coherency */
446+
#define X86_FEATURE_DEBUG_SWAP (19*32+14) /* "debug_swap" SEV-ES full debug state swap support */
447+
#define X86_FEATURE_RMPREAD (19*32+21) /* RMPREAD instruction */
448+
#define X86_FEATURE_SEGMENTED_RMP (19*32+23) /* Segmented RMP support */
445449
#define X86_FEATURE_SVSM (19*32+28) /* "svsm" SVSM present */
450+
#define X86_FEATURE_HV_INUSE_WR_ALLOWED (19*32+30) /* Allow Write to in-use hypervisor-owned pages */
446451

447452
/* AMD-defined Extended Feature 2 EAX, CPUID level 0x80000021 (EAX), word 20 */
448453
#define X86_FEATURE_NO_NESTED_DATA_BP (20*32+ 0) /* No Nested Data Breakpoints */
@@ -455,6 +460,11 @@
455460
#define X86_FEATURE_SBPB (20*32+27) /* Selective Branch Prediction Barrier */
456461
#define X86_FEATURE_IBPB_BRTYPE (20*32+28) /* MSR_PRED_CMD[IBPB] flushes all branch type predictions */
457462
#define X86_FEATURE_SRSO_NO (20*32+29) /* CPU is not affected by SRSO */
463+
#define X86_FEATURE_SRSO_USER_KERNEL_NO (20*32+30) /* CPU is not affected by SRSO across user/kernel boundaries */
464+
#define X86_FEATURE_SRSO_BP_SPEC_REDUCE (20*32+31) /*
465+
* BP_CFG[BpSpecReduce] can be used to mitigate SRSO for VMs.
466+
* (SRSO_MSR_FIX in the official doc).
467+
*/
458468

459469
/*
460470
* Extended auxiliary flags: Linux defined - for features scattered in various
@@ -470,6 +480,7 @@
470480
#define X86_FEATURE_AMD_FAST_CPPC (21*32 + 5) /* Fast CPPC */
471481
#define X86_FEATURE_AMD_HETEROGENEOUS_CORES (21*32 + 6) /* Heterogeneous Core Topology */
472482
#define X86_FEATURE_AMD_WORKLOAD_CLASS (21*32 + 7) /* Workload Classification */
483+
#define X86_FEATURE_PREFER_YMM (21*32 + 8) /* Avoid ZMM registers due to downclocking */
473484

474485
/*
475486
* BUG word(s)
@@ -521,4 +532,5 @@
521532
#define X86_BUG_RFDS X86_BUG(1*32 + 2) /* "rfds" CPU is vulnerable to Register File Data Sampling */
522533
#define X86_BUG_BHI X86_BUG(1*32 + 3) /* "bhi" CPU is affected by Branch History Injection */
523534
#define X86_BUG_IBPB_NO_RET X86_BUG(1*32 + 4) /* "ibpb_no_ret" IBPB omits return target predictions */
535+
#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 */
524536
#endif /* _ASM_X86_CPUFEATURES_H */

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

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,8 @@
397397
#define MSR_IA32_PASID_VALID BIT_ULL(31)
398398

399399
/* DEBUGCTLMSR bits (others vary by model): */
400-
#define DEBUGCTLMSR_LBR (1UL << 0) /* last branch recording */
400+
#define DEBUGCTLMSR_LBR_BIT 0 /* last branch recording */
401+
#define DEBUGCTLMSR_LBR (1UL << DEBUGCTLMSR_LBR_BIT)
401402
#define DEBUGCTLMSR_BTF_SHIFT 1
402403
#define DEBUGCTLMSR_BTF (1UL << 1) /* single-step on branches */
403404
#define DEBUGCTLMSR_BUS_LOCK_DETECT (1UL << 2)
@@ -610,6 +611,7 @@
610611
#define MSR_AMD_PERF_CTL 0xc0010062
611612
#define MSR_AMD_PERF_STATUS 0xc0010063
612613
#define MSR_AMD_PSTATE_DEF_BASE 0xc0010064
614+
#define MSR_AMD64_GUEST_TSC_FREQ 0xc0010134
613615
#define MSR_AMD64_OSVW_ID_LENGTH 0xc0010140
614616
#define MSR_AMD64_OSVW_STATUS 0xc0010141
615617
#define MSR_AMD_PPIN_CTL 0xc00102f0
@@ -646,6 +648,7 @@
646648
#define MSR_AMD64_IBS_REG_COUNT_MAX 8 /* includes MSR_AMD64_IBSBRTARGET */
647649
#define MSR_AMD64_SVM_AVIC_DOORBELL 0xc001011b
648650
#define MSR_AMD64_VM_PAGE_FLUSH 0xc001011e
651+
#define MSR_AMD64_VIRT_SPEC_CTRL 0xc001011f
649652
#define MSR_AMD64_SEV_ES_GHCB 0xc0010130
650653
#define MSR_AMD64_SEV 0xc0010131
651654
#define MSR_AMD64_SEV_ENABLED_BIT 0
@@ -684,11 +687,12 @@
684687
#define MSR_AMD64_SNP_SMT_PROT BIT_ULL(MSR_AMD64_SNP_SMT_PROT_BIT)
685688
#define MSR_AMD64_SNP_RESV_BIT 18
686689
#define MSR_AMD64_SNP_RESERVED_MASK GENMASK_ULL(63, MSR_AMD64_SNP_RESV_BIT)
687-
688-
#define MSR_AMD64_VIRT_SPEC_CTRL 0xc001011f
689-
690690
#define MSR_AMD64_RMP_BASE 0xc0010132
691691
#define MSR_AMD64_RMP_END 0xc0010133
692+
#define MSR_AMD64_RMP_CFG 0xc0010136
693+
#define MSR_AMD64_SEG_RMP_ENABLED_BIT 0
694+
#define MSR_AMD64_SEG_RMP_ENABLED BIT_ULL(MSR_AMD64_SEG_RMP_ENABLED_BIT)
695+
#define MSR_AMD64_RMP_SEGMENT_SHIFT(x) (((x) & GENMASK_ULL(13, 8)) >> 8)
692696

693697
#define MSR_SVSM_CAA 0xc001f000
694698

@@ -699,15 +703,17 @@
699703
#define MSR_AMD_CPPC_REQ 0xc00102b3
700704
#define MSR_AMD_CPPC_STATUS 0xc00102b4
701705

702-
#define AMD_CPPC_LOWEST_PERF(x) (((x) >> 0) & 0xff)
703-
#define AMD_CPPC_LOWNONLIN_PERF(x) (((x) >> 8) & 0xff)
704-
#define AMD_CPPC_NOMINAL_PERF(x) (((x) >> 16) & 0xff)
705-
#define AMD_CPPC_HIGHEST_PERF(x) (((x) >> 24) & 0xff)
706+
/* Masks for use with MSR_AMD_CPPC_CAP1 */
707+
#define AMD_CPPC_LOWEST_PERF_MASK GENMASK(7, 0)
708+
#define AMD_CPPC_LOWNONLIN_PERF_MASK GENMASK(15, 8)
709+
#define AMD_CPPC_NOMINAL_PERF_MASK GENMASK(23, 16)
710+
#define AMD_CPPC_HIGHEST_PERF_MASK GENMASK(31, 24)
706711

707-
#define AMD_CPPC_MAX_PERF(x) (((x) & 0xff) << 0)
708-
#define AMD_CPPC_MIN_PERF(x) (((x) & 0xff) << 8)
709-
#define AMD_CPPC_DES_PERF(x) (((x) & 0xff) << 16)
710-
#define AMD_CPPC_ENERGY_PERF_PREF(x) (((x) & 0xff) << 24)
712+
/* Masks for use with MSR_AMD_CPPC_REQ */
713+
#define AMD_CPPC_MAX_PERF_MASK GENMASK(7, 0)
714+
#define AMD_CPPC_MIN_PERF_MASK GENMASK(15, 8)
715+
#define AMD_CPPC_DES_PERF_MASK GENMASK(23, 16)
716+
#define AMD_CPPC_EPP_PERF_MASK GENMASK(31, 24)
711717

712718
/* AMD Performance Counter Global Status and Control MSRs */
713719
#define MSR_AMD64_PERF_CNTR_GLOBAL_STATUS 0xc0000300
@@ -719,6 +725,7 @@
719725

720726
/* Zen4 */
721727
#define MSR_ZEN4_BP_CFG 0xc001102e
728+
#define MSR_ZEN4_BP_CFG_BP_SPEC_REDUCE_BIT 4
722729
#define MSR_ZEN4_BP_CFG_SHARED_BTB_FIX_BIT 5
723730

724731
/* Fam 19h MSRs */

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,9 @@ struct kvm_x86_mce {
559559
#define KVM_XEN_HVM_CONFIG_PVCLOCK_TSC_UNSTABLE (1 << 7)
560560
#define KVM_XEN_HVM_CONFIG_SHARED_INFO_HVA (1 << 8)
561561

562+
#define KVM_XEN_MSR_MIN_INDEX 0x40000000u
563+
#define KVM_XEN_MSR_MAX_INDEX 0x4fffffffu
564+
562565
struct kvm_xen_hvm_config {
563566
__u32 flags;
564567
__u32 msr;
@@ -925,5 +928,6 @@ struct kvm_hyperv_eventfd {
925928
#define KVM_X86_SEV_VM 2
926929
#define KVM_X86_SEV_ES_VM 3
927930
#define KVM_X86_SNP_VM 4
931+
#define KVM_X86_TDX_VM 5
928932

929933
#endif /* _ASM_X86_KVM_H */

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
#define SVM_EXIT_CR14_WRITE_TRAP 0x09e
9696
#define SVM_EXIT_CR15_WRITE_TRAP 0x09f
9797
#define SVM_EXIT_INVPCID 0x0a2
98+
#define SVM_EXIT_IDLE_HLT 0x0a6
9899
#define SVM_EXIT_NPF 0x400
99100
#define SVM_EXIT_AVIC_INCOMPLETE_IPI 0x401
100101
#define SVM_EXIT_AVIC_UNACCELERATED_ACCESS 0x402
@@ -224,6 +225,7 @@
224225
{ SVM_EXIT_CR4_WRITE_TRAP, "write_cr4_trap" }, \
225226
{ SVM_EXIT_CR8_WRITE_TRAP, "write_cr8_trap" }, \
226227
{ SVM_EXIT_INVPCID, "invpcid" }, \
228+
{ SVM_EXIT_IDLE_HLT, "idle-halt" }, \
227229
{ SVM_EXIT_NPF, "npf" }, \
228230
{ SVM_EXIT_AVIC_INCOMPLETE_IPI, "avic_incomplete_ipi" }, \
229231
{ SVM_EXIT_AVIC_UNACCELERATED_ACCESS, "avic_unaccelerated_access" }, \

tools/arch/x86/lib/memset_64.S

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include <linux/export.h>
55
#include <linux/linkage.h>
6+
#include <linux/cfi_types.h>
67
#include <asm/cpufeatures.h>
78
#include <asm/alternative.h>
89

@@ -28,7 +29,7 @@
2829
* only for the return value that is the same as the source input,
2930
* which the compiler could/should do much better anyway.
3031
*/
31-
SYM_FUNC_START(__memset)
32+
SYM_TYPED_FUNC_START(__memset)
3233
ALTERNATIVE "jmp memset_orig", "", X86_FEATURE_FSRS
3334

3435
movq %rdi,%r9

tools/include/linux/cfi_types.h

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
/*
3+
* Clang Control Flow Integrity (CFI) type definitions.
4+
*/
5+
#ifndef _LINUX_CFI_TYPES_H
6+
#define _LINUX_CFI_TYPES_H
7+
8+
#ifdef __ASSEMBLY__
9+
#include <linux/linkage.h>
10+
11+
#ifdef CONFIG_CFI_CLANG
12+
/*
13+
* Use the __kcfi_typeid_<function> type identifier symbol to
14+
* annotate indirectly called assembly functions. The compiler emits
15+
* these symbols for all address-taken function declarations in C
16+
* code.
17+
*/
18+
#ifndef __CFI_TYPE
19+
#define __CFI_TYPE(name) \
20+
.4byte __kcfi_typeid_##name
21+
#endif
22+
23+
#define SYM_TYPED_ENTRY(name, linkage, align...) \
24+
linkage(name) ASM_NL \
25+
align ASM_NL \
26+
__CFI_TYPE(name) ASM_NL \
27+
name:
28+
29+
#define SYM_TYPED_START(name, linkage, align...) \
30+
SYM_TYPED_ENTRY(name, linkage, align)
31+
32+
#else /* CONFIG_CFI_CLANG */
33+
34+
#define SYM_TYPED_START(name, linkage, align...) \
35+
SYM_START(name, linkage, align)
36+
37+
#endif /* CONFIG_CFI_CLANG */
38+
39+
#ifndef SYM_TYPED_FUNC_START
40+
#define SYM_TYPED_FUNC_START(name) \
41+
SYM_TYPED_START(name, SYM_L_GLOBAL, SYM_A_ALIGN)
42+
#endif
43+
44+
#endif /* __ASSEMBLY__ */
45+
#endif /* _LINUX_CFI_TYPES_H */

tools/include/uapi/asm-generic/mman-common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
/* compatibility flags */
8686
#define MAP_FILE 0
8787

88+
#define PKEY_UNRESTRICTED 0x0
8889
#define PKEY_DISABLE_ACCESS 0x1
8990
#define PKEY_DISABLE_WRITE 0x2
9091
#define PKEY_ACCESS_MASK (PKEY_DISABLE_ACCESS |\

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -849,9 +849,11 @@ __SYSCALL(__NR_getxattrat, sys_getxattrat)
849849
__SYSCALL(__NR_listxattrat, sys_listxattrat)
850850
#define __NR_removexattrat 466
851851
__SYSCALL(__NR_removexattrat, sys_removexattrat)
852+
#define __NR_open_tree_attr 467
853+
__SYSCALL(__NR_open_tree_attr, sys_open_tree_attr)
852854

853855
#undef __NR_syscalls
854-
#define __NR_syscalls 467
856+
#define __NR_syscalls 468
855857

856858
/*
857859
* 32 bit systems traditionally used different

0 commit comments

Comments
 (0)