Commit 10e66f29 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'perf-tools-fixes-for-v6.15-2025-04-13' of...

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
parents 8ffd015d 2b707029
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -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)
+1 −23
Original line number Diff line number Diff line
/* 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>
+20 −8
Original line number Diff line number Diff line
@@ -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 */
+19 −12
Original line number Diff line number Diff line
@@ -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 */
+4 −0
Original line number Diff line number Diff line
@@ -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 */
Loading