Skip to content

Commit f5f2e20

Browse files
committed
Merge tag 'perf-tools-fixes-for-v6.18-1-2025-11-06' of git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools
Pull perf tools fixes from Arnaldo Carvalho de Melo: - Add James Clark as a perf tools reviewer - Handle '1' type symbols in /proc/kallsyms, related to anonymous Rust closures in the DRM panic QR encoder, caught by 'perf test' - Sync kernel header copies: MSRs, uprobe syscall, DRM_IOCTL_GEM_CHANGE_HANDLE, KVM exit reasons, etc * tag 'perf-tools-fixes-for-v6.18-1-2025-11-06' of git://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools: perf symbols: Handle '1' symbols in /proc/kallsyms tools headers asm: Sync fls headers header with the kernel sources tools headers UAPI: Sync KVM's vmx.h header with the kernel sources to handle new exit reasons tools headers svm: Sync svm headers with the kernel sources tools headers UAPI: Sync x86's asm/kvm.h with the kernel sources MAINTAINERS: Add James Clark as a perf tools reviewer tools headers UAPI: Sync linux/kvm.h with the kernel sources tools headers UAPI: Update tools's copy of drm.h to pick DRM_IOCTL_GEM_CHANGE_HANDLE tools headers x86 cpufeatures: Sync with the kernel sources tools headers x86: Sync table due to introducion of uprobe syscall tools headers: Sync uapi/linux/fcntl.h with the kernel sources tools headers: Sync uapi/linux/prctl.h with the kernel source tools headers uapi: Update fs.h with the kernel sources tools arch x86: Sync msr-index.h to pick AMD64_{PERF_CNTR_GLOBAL_STATUS_SET,SAVIC_CONTROL}, IA32_L3_QOS_{ABMC,EXT}_CFG
2 parents 225a97d + 7f17ef0 commit f5f2e20

16 files changed

Lines changed: 147 additions & 20 deletions

File tree

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20163,6 +20163,7 @@ R: Alexander Shishkin <[email protected]>
2016320163
R: Jiri Olsa <[email protected]>
2016420164
R: Ian Rogers <[email protected]>
2016520165
R: Adrian Hunter <[email protected]>
20166+
R: James Clark <[email protected]>
2016620167
2016720168
2016820169
S: Supported

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,7 @@
444444
#define X86_FEATURE_VM_PAGE_FLUSH (19*32+ 2) /* VM Page Flush MSR is supported */
445445
#define X86_FEATURE_SEV_ES (19*32+ 3) /* "sev_es" Secure Encrypted Virtualization - Encrypted State */
446446
#define X86_FEATURE_SEV_SNP (19*32+ 4) /* "sev_snp" Secure Encrypted Virtualization - Secure Nested Paging */
447+
#define X86_FEATURE_SNP_SECURE_TSC (19*32+ 8) /* SEV-SNP Secure TSC */
447448
#define X86_FEATURE_V_TSC_AUX (19*32+ 9) /* Virtual TSC_AUX */
448449
#define X86_FEATURE_SME_COHERENT (19*32+10) /* hardware-enforced cache coherency */
449450
#define X86_FEATURE_DEBUG_SWAP (19*32+14) /* "debug_swap" SEV-ES full debug state swap support */
@@ -495,6 +496,9 @@
495496
#define X86_FEATURE_TSA_SQ_NO (21*32+11) /* AMD CPU not vulnerable to TSA-SQ */
496497
#define X86_FEATURE_TSA_L1_NO (21*32+12) /* AMD CPU not vulnerable to TSA-L1 */
497498
#define X86_FEATURE_CLEAR_CPU_BUF_VM (21*32+13) /* Clear CPU buffers using VERW before VMRUN */
499+
#define X86_FEATURE_IBPB_EXIT_TO_USER (21*32+14) /* Use IBPB on exit-to-userspace, see VMSCAPE bug */
500+
#define X86_FEATURE_ABMC (21*32+15) /* Assignable Bandwidth Monitoring Counters */
501+
#define X86_FEATURE_MSR_IMM (21*32+16) /* MSR immediate form instructions */
498502

499503
/*
500504
* BUG word(s)
@@ -551,4 +555,5 @@
551555
#define X86_BUG_ITS X86_BUG( 1*32+ 7) /* "its" CPU is affected by Indirect Target Selection */
552556
#define X86_BUG_ITS_NATIVE_ONLY X86_BUG( 1*32+ 8) /* "its_native_only" CPU is affected by ITS, VMX is not affected */
553557
#define X86_BUG_TSA X86_BUG( 1*32+ 9) /* "tsa" CPU is affected by Transient Scheduler Attacks */
558+
#define X86_BUG_VMSCAPE X86_BUG( 1*32+10) /* "vmscape" CPU is affected by VMSCAPE attacks from guests */
554559
#endif /* _ASM_X86_CPUFEATURES_H */

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

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,9 +315,12 @@
315315
#define PERF_CAP_PT_IDX 16
316316

317317
#define MSR_PEBS_LD_LAT_THRESHOLD 0x000003f6
318+
319+
#define PERF_CAP_LBR_FMT 0x3f
318320
#define PERF_CAP_PEBS_TRAP BIT_ULL(6)
319321
#define PERF_CAP_ARCH_REG BIT_ULL(7)
320322
#define PERF_CAP_PEBS_FORMAT 0xf00
323+
#define PERF_CAP_FW_WRITES BIT_ULL(13)
321324
#define PERF_CAP_PEBS_BASELINE BIT_ULL(14)
322325
#define PERF_CAP_PEBS_TIMING_INFO BIT_ULL(17)
323326
#define PERF_CAP_PEBS_MASK (PERF_CAP_PEBS_TRAP | PERF_CAP_ARCH_REG | \
@@ -633,6 +636,11 @@
633636
#define MSR_AMD_PPIN 0xc00102f1
634637
#define MSR_AMD64_CPUID_FN_7 0xc0011002
635638
#define MSR_AMD64_CPUID_FN_1 0xc0011004
639+
640+
#define MSR_AMD64_CPUID_EXT_FEAT 0xc0011005
641+
#define MSR_AMD64_CPUID_EXT_FEAT_TOPOEXT_BIT 54
642+
#define MSR_AMD64_CPUID_EXT_FEAT_TOPOEXT BIT_ULL(MSR_AMD64_CPUID_EXT_FEAT_TOPOEXT_BIT)
643+
636644
#define MSR_AMD64_LS_CFG 0xc0011020
637645
#define MSR_AMD64_DC_CFG 0xc0011022
638646
#define MSR_AMD64_TW_CFG 0xc0011023
@@ -701,8 +709,15 @@
701709
#define MSR_AMD64_SNP_VMSA_REG_PROT BIT_ULL(MSR_AMD64_SNP_VMSA_REG_PROT_BIT)
702710
#define MSR_AMD64_SNP_SMT_PROT_BIT 17
703711
#define MSR_AMD64_SNP_SMT_PROT BIT_ULL(MSR_AMD64_SNP_SMT_PROT_BIT)
704-
#define MSR_AMD64_SNP_RESV_BIT 18
712+
#define MSR_AMD64_SNP_SECURE_AVIC_BIT 18
713+
#define MSR_AMD64_SNP_SECURE_AVIC BIT_ULL(MSR_AMD64_SNP_SECURE_AVIC_BIT)
714+
#define MSR_AMD64_SNP_RESV_BIT 19
705715
#define MSR_AMD64_SNP_RESERVED_MASK GENMASK_ULL(63, MSR_AMD64_SNP_RESV_BIT)
716+
#define MSR_AMD64_SAVIC_CONTROL 0xc0010138
717+
#define MSR_AMD64_SAVIC_EN_BIT 0
718+
#define MSR_AMD64_SAVIC_EN BIT_ULL(MSR_AMD64_SAVIC_EN_BIT)
719+
#define MSR_AMD64_SAVIC_ALLOWEDNMI_BIT 1
720+
#define MSR_AMD64_SAVIC_ALLOWEDNMI BIT_ULL(MSR_AMD64_SAVIC_ALLOWEDNMI_BIT)
706721
#define MSR_AMD64_RMP_BASE 0xc0010132
707722
#define MSR_AMD64_RMP_END 0xc0010133
708723
#define MSR_AMD64_RMP_CFG 0xc0010136
@@ -735,6 +750,7 @@
735750
#define MSR_AMD64_PERF_CNTR_GLOBAL_STATUS 0xc0000300
736751
#define MSR_AMD64_PERF_CNTR_GLOBAL_CTL 0xc0000301
737752
#define MSR_AMD64_PERF_CNTR_GLOBAL_STATUS_CLR 0xc0000302
753+
#define MSR_AMD64_PERF_CNTR_GLOBAL_STATUS_SET 0xc0000303
738754

739755
/* AMD Hardware Feedback Support MSRs */
740756
#define MSR_AMD_WORKLOAD_CLASS_CONFIG 0xc0000500
@@ -1225,6 +1241,8 @@
12251241
/* - AMD: */
12261242
#define MSR_IA32_MBA_BW_BASE 0xc0000200
12271243
#define MSR_IA32_SMBA_BW_BASE 0xc0000280
1244+
#define MSR_IA32_L3_QOS_ABMC_CFG 0xc00003fd
1245+
#define MSR_IA32_L3_QOS_EXT_CFG 0xc00003ff
12281246
#define MSR_IA32_EVT_CFG_BASE 0xc0000400
12291247

12301248
/* AMD-V MSRs */

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

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@
3535
#define MC_VECTOR 18
3636
#define XM_VECTOR 19
3737
#define VE_VECTOR 20
38+
#define CP_VECTOR 21
39+
40+
#define HV_VECTOR 28
41+
#define VC_VECTOR 29
42+
#define SX_VECTOR 30
3843

3944
/* Select x86 specific features in <linux/kvm.h> */
4045
#define __KVM_HAVE_PIT
@@ -411,6 +416,35 @@ struct kvm_xcrs {
411416
__u64 padding[16];
412417
};
413418

419+
#define KVM_X86_REG_TYPE_MSR 2
420+
#define KVM_X86_REG_TYPE_KVM 3
421+
422+
#define KVM_X86_KVM_REG_SIZE(reg) \
423+
({ \
424+
reg == KVM_REG_GUEST_SSP ? KVM_REG_SIZE_U64 : 0; \
425+
})
426+
427+
#define KVM_X86_REG_TYPE_SIZE(type, reg) \
428+
({ \
429+
__u64 type_size = (__u64)type << 32; \
430+
\
431+
type_size |= type == KVM_X86_REG_TYPE_MSR ? KVM_REG_SIZE_U64 : \
432+
type == KVM_X86_REG_TYPE_KVM ? KVM_X86_KVM_REG_SIZE(reg) : \
433+
0; \
434+
type_size; \
435+
})
436+
437+
#define KVM_X86_REG_ID(type, index) \
438+
(KVM_REG_X86 | KVM_X86_REG_TYPE_SIZE(type, index) | index)
439+
440+
#define KVM_X86_REG_MSR(index) \
441+
KVM_X86_REG_ID(KVM_X86_REG_TYPE_MSR, index)
442+
#define KVM_X86_REG_KVM(index) \
443+
KVM_X86_REG_ID(KVM_X86_REG_TYPE_KVM, index)
444+
445+
/* KVM-defined registers starting from 0 */
446+
#define KVM_REG_GUEST_SSP 0
447+
414448
#define KVM_SYNC_X86_REGS (1UL << 0)
415449
#define KVM_SYNC_X86_SREGS (1UL << 1)
416450
#define KVM_SYNC_X86_EVENTS (1UL << 2)

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@
118118
#define SVM_VMGEXIT_AP_CREATE 1
119119
#define SVM_VMGEXIT_AP_DESTROY 2
120120
#define SVM_VMGEXIT_SNP_RUN_VMPL 0x80000018
121+
#define SVM_VMGEXIT_SAVIC 0x8000001a
122+
#define SVM_VMGEXIT_SAVIC_REGISTER_GPA 0
123+
#define SVM_VMGEXIT_SAVIC_UNREGISTER_GPA 1
124+
#define SVM_VMGEXIT_SAVIC_SELF_GPA ~0ULL
121125
#define SVM_VMGEXIT_HV_FEATURES 0x8000fffd
122126
#define SVM_VMGEXIT_TERM_REQUEST 0x8000fffe
123127
#define SVM_VMGEXIT_TERM_REASON(reason_set, reason_code) \

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@
9494
#define EXIT_REASON_BUS_LOCK 74
9595
#define EXIT_REASON_NOTIFY 75
9696
#define EXIT_REASON_TDCALL 77
97+
#define EXIT_REASON_MSR_READ_IMM 84
98+
#define EXIT_REASON_MSR_WRITE_IMM 85
9799

98100
#define VMX_EXIT_REASONS \
99101
{ EXIT_REASON_EXCEPTION_NMI, "EXCEPTION_NMI" }, \
@@ -158,7 +160,9 @@
158160
{ EXIT_REASON_TPAUSE, "TPAUSE" }, \
159161
{ EXIT_REASON_BUS_LOCK, "BUS_LOCK" }, \
160162
{ EXIT_REASON_NOTIFY, "NOTIFY" }, \
161-
{ EXIT_REASON_TDCALL, "TDCALL" }
163+
{ EXIT_REASON_TDCALL, "TDCALL" }, \
164+
{ EXIT_REASON_MSR_READ_IMM, "MSR_READ_IMM" }, \
165+
{ EXIT_REASON_MSR_WRITE_IMM, "MSR_WRITE_IMM" }
162166

163167
#define VMX_EXIT_REASON_FLAGS \
164168
{ VMX_EXIT_REASONS_FAILED_VMENTRY, "FAILED_VMENTRY" }

tools/include/asm-generic/bitops/__fls.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
* Undefined if no set bit exists, so code should check against 0 first.
1212
*/
13-
static __always_inline unsigned int generic___fls(unsigned long word)
13+
static __always_inline __attribute_const__ unsigned int generic___fls(unsigned long word)
1414
{
1515
unsigned int num = BITS_PER_LONG - 1;
1616

tools/include/asm-generic/bitops/fls.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32.
1111
*/
1212

13-
static __always_inline int generic_fls(unsigned int x)
13+
static __always_inline __attribute_const__ int generic_fls(unsigned int x)
1414
{
1515
int r = 32;
1616

tools/include/asm-generic/bitops/fls64.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616
* at position 64.
1717
*/
1818
#if BITS_PER_LONG == 32
19-
static __always_inline int fls64(__u64 x)
19+
static __always_inline __attribute_const__ int fls64(__u64 x)
2020
{
2121
__u32 h = x >> 32;
2222
if (h)
2323
return fls(h) + 32;
2424
return fls(x);
2525
}
2626
#elif BITS_PER_LONG == 64
27-
static __always_inline int fls64(__u64 x)
27+
static __always_inline __attribute_const__ int fls64(__u64 x)
2828
{
2929
if (x == 0)
3030
return 0;

tools/include/uapi/drm/drm.h

Lines changed: 51 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -597,34 +597,65 @@ struct drm_set_version {
597597
int drm_dd_minor;
598598
};
599599

600-
/* DRM_IOCTL_GEM_CLOSE ioctl argument type */
600+
/**
601+
* struct drm_gem_close - Argument for &DRM_IOCTL_GEM_CLOSE ioctl.
602+
* @handle: Handle of the object to be closed.
603+
* @pad: Padding.
604+
*
605+
* Releases the handle to an mm object.
606+
*/
601607
struct drm_gem_close {
602-
/** Handle of the object to be closed. */
603608
__u32 handle;
604609
__u32 pad;
605610
};
606611

607-
/* DRM_IOCTL_GEM_FLINK ioctl argument type */
612+
/**
613+
* struct drm_gem_flink - Argument for &DRM_IOCTL_GEM_FLINK ioctl.
614+
* @handle: Handle for the object being named.
615+
* @name: Returned global name.
616+
*
617+
* Create a global name for an object, returning the name.
618+
*
619+
* Note that the name does not hold a reference; when the object
620+
* is freed, the name goes away.
621+
*/
608622
struct drm_gem_flink {
609-
/** Handle for the object being named */
610623
__u32 handle;
611-
612-
/** Returned global name */
613624
__u32 name;
614625
};
615626

616-
/* DRM_IOCTL_GEM_OPEN ioctl argument type */
627+
/**
628+
* struct drm_gem_open - Argument for &DRM_IOCTL_GEM_OPEN ioctl.
629+
* @name: Name of object being opened.
630+
* @handle: Returned handle for the object.
631+
* @size: Returned size of the object
632+
*
633+
* Open an object using the global name, returning a handle and the size.
634+
*
635+
* This handle (of course) holds a reference to the object, so the object
636+
* will not go away until the handle is deleted.
637+
*/
617638
struct drm_gem_open {
618-
/** Name of object being opened */
619639
__u32 name;
620-
621-
/** Returned handle for the object */
622640
__u32 handle;
623-
624-
/** Returned size of the object */
625641
__u64 size;
626642
};
627643

644+
/**
645+
* struct drm_gem_change_handle - Argument for &DRM_IOCTL_GEM_CHANGE_HANDLE ioctl.
646+
* @handle: The handle of a gem object.
647+
* @new_handle: An available gem handle.
648+
*
649+
* This ioctl changes the handle of a GEM object to the specified one.
650+
* The new handle must be unused. On success the old handle is closed
651+
* and all further IOCTL should refer to the new handle only.
652+
* Calls to DRM_IOCTL_PRIME_FD_TO_HANDLE will return the new handle.
653+
*/
654+
struct drm_gem_change_handle {
655+
__u32 handle;
656+
__u32 new_handle;
657+
};
658+
628659
/**
629660
* DRM_CAP_DUMB_BUFFER
630661
*
@@ -1309,6 +1340,14 @@ extern "C" {
13091340
*/
13101341
#define DRM_IOCTL_SET_CLIENT_NAME DRM_IOWR(0xD1, struct drm_set_client_name)
13111342

1343+
/**
1344+
* DRM_IOCTL_GEM_CHANGE_HANDLE - Move an object to a different handle
1345+
*
1346+
* Some applications (notably CRIU) need objects to have specific gem handles.
1347+
* This ioctl changes the object at one gem handle to use a new gem handle.
1348+
*/
1349+
#define DRM_IOCTL_GEM_CHANGE_HANDLE DRM_IOWR(0xD2, struct drm_gem_change_handle)
1350+
13121351
/*
13131352
* Device specific ioctls should only be in their respective headers
13141353
* The device specific ioctl range is from 0x40 to 0x9f.

0 commit comments

Comments
 (0)