Skip to content

Commit 4ef8451

Browse files
committed
Merge tag 'perf-tools-for-v5.10-2020-11-03' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
Pull perf tools fixes from Arnaldo Carvalho de Melo: "Only fixes and a sync of the headers so that the perf build is silent: - Fix visibility attribute in python module init code with newer gcc - Fix DRAM_BW_Use 0 issue for CLX/SKX in intel JSON vendor event files - Fix the build on new fedora by removing LTO compiler options when building perl support - Remove broken __no_tail_call attribute - Fix segfault when trying to trace events by cgroup - Fix crash with non-jited BPF progs - Increase buffer size in TUI browser, fixing format truncation - Fix printing of build-id for objects lacking one - Fix byte swapping for ino_generation field in MMAP2 perf.data records - Fix byte swapping for CGROUP perf.data records, for cross arch analysis of perf.data files - Fix the fast path of feature detection - Update kernel header copies" * tag 'perf-tools-for-v5.10-2020-11-03' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: (23 commits) tools feature: Fixup fast path feature detection perf tools: Add missing swap for cgroup events perf tools: Add missing swap for ino_generation perf tools: Initialize output buffer in build_id__sprintf perf hists browser: Increase size of 'buf' in perf_evsel__hists_browse() tools include UAPI: Update linux/mount.h copy tools headers UAPI: Update tools's copy of linux/perf_event.h tools kvm headers: Update KVM headers from the kernel sources tools UAPI: Update copy of linux/mman.h from the kernel sources tools arch x86: Sync the msr-index.h copy with the kernel sources tools x86 headers: Update required-features.h header from the kernel tools x86 headers: Update cpufeatures.h headers copies tools headers UAPI: Update fscrypt.h copy tools headers UAPI: Sync drm/i915_drm.h with the kernel sources tools headers UAPI: Sync prctl.h with the kernel sources perf scripting python: Avoid declaring function pointers with a visibility attribute perf tools: Remove broken __no_tail_call attribute perf vendor events: Fix DRAM_BW_Use 0 issue for CLX/SKX perf trace: Fix segfault when trying to trace events by cgroup perf tools: Fix crash with non-jited bpf progs ...
2 parents e6b0bd6 + 5d020cb commit 4ef8451

35 files changed

Lines changed: 257 additions & 52 deletions

File tree

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

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,21 @@ struct kvm_sync_regs {
159159
struct kvm_arch_memory_slot {
160160
};
161161

162+
/*
163+
* PMU filter structure. Describe a range of events with a particular
164+
* action. To be used with KVM_ARM_VCPU_PMU_V3_FILTER.
165+
*/
166+
struct kvm_pmu_event_filter {
167+
__u16 base_event;
168+
__u16 nevents;
169+
170+
#define KVM_PMU_EVENT_ALLOW 0
171+
#define KVM_PMU_EVENT_DENY 1
172+
173+
__u8 action;
174+
__u8 pad[3];
175+
};
176+
162177
/* for KVM_GET/SET_VCPU_EVENTS */
163178
struct kvm_vcpu_events {
164179
struct {
@@ -242,6 +257,15 @@ struct kvm_vcpu_events {
242257
#define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_1_NOT_AVAIL 0
243258
#define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_1_AVAIL 1
244259
#define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_1_NOT_REQUIRED 2
260+
261+
/*
262+
* Only two states can be presented by the host kernel:
263+
* - NOT_REQUIRED: the guest doesn't need to do anything
264+
* - NOT_AVAIL: the guest isn't mitigated (it can still use SSBS if available)
265+
*
266+
* All the other values are deprecated. The host still accepts all
267+
* values (they are ABI), but will narrow them to the above two.
268+
*/
245269
#define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2 KVM_REG_ARM_FW_REG(2)
246270
#define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_NOT_AVAIL 0
247271
#define KVM_REG_ARM_SMCCC_ARCH_WORKAROUND_2_UNKNOWN 1
@@ -329,6 +353,7 @@ struct kvm_vcpu_events {
329353
#define KVM_ARM_VCPU_PMU_V3_CTRL 0
330354
#define KVM_ARM_VCPU_PMU_V3_IRQ 0
331355
#define KVM_ARM_VCPU_PMU_V3_INIT 1
356+
#define KVM_ARM_VCPU_PMU_V3_FILTER 2
332357
#define KVM_ARM_VCPU_TIMER_CTRL 1
333358
#define KVM_ARM_VCPU_TIMER_IRQ_VTIMER 0
334359
#define KVM_ARM_VCPU_TIMER_IRQ_PTIMER 1

tools/arch/s390/include/uapi/asm/sie.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
{ 0x13, "SIGP conditional emergency signal" }, \
3030
{ 0x15, "SIGP sense running" }, \
3131
{ 0x16, "SIGP set multithreading"}, \
32-
{ 0x17, "SIGP store additional status ait address"}
32+
{ 0x17, "SIGP store additional status at address"}
3333

3434
#define icpt_prog_codes \
3535
{ 0x0001, "Prog Operation" }, \

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
#define X86_FEATURE_SYSCALL32 ( 3*32+14) /* "" syscall in IA32 userspace */
9797
#define X86_FEATURE_SYSENTER32 ( 3*32+15) /* "" sysenter in IA32 userspace */
9898
#define X86_FEATURE_REP_GOOD ( 3*32+16) /* REP microcode works well */
99-
/* free ( 3*32+17) */
99+
#define X86_FEATURE_SME_COHERENT ( 3*32+17) /* "" AMD hardware-enforced cache coherency */
100100
#define X86_FEATURE_LFENCE_RDTSC ( 3*32+18) /* "" LFENCE synchronizes RDTSC */
101101
#define X86_FEATURE_ACC_POWER ( 3*32+19) /* AMD Accumulated Power Mechanism */
102102
#define X86_FEATURE_NOPL ( 3*32+20) /* The NOPL (0F 1F) instructions */
@@ -236,6 +236,7 @@
236236
#define X86_FEATURE_EPT_AD ( 8*32+17) /* Intel Extended Page Table access-dirty bit */
237237
#define X86_FEATURE_VMCALL ( 8*32+18) /* "" Hypervisor supports the VMCALL instruction */
238238
#define X86_FEATURE_VMW_VMMCALL ( 8*32+19) /* "" VMware prefers VMMCALL hypercall instruction */
239+
#define X86_FEATURE_SEV_ES ( 8*32+20) /* AMD Secure Encrypted Virtualization - Encrypted State */
239240

240241
/* Intel-defined CPU features, CPUID level 0x00000007:0 (EBX), word 9 */
241242
#define X86_FEATURE_FSGSBASE ( 9*32+ 0) /* RDFSBASE, WRFSBASE, RDGSBASE, WRGSBASE instructions*/
@@ -288,6 +289,7 @@
288289
#define X86_FEATURE_FENCE_SWAPGS_USER (11*32+ 4) /* "" LFENCE in user entry SWAPGS path */
289290
#define X86_FEATURE_FENCE_SWAPGS_KERNEL (11*32+ 5) /* "" LFENCE in kernel entry SWAPGS path */
290291
#define X86_FEATURE_SPLIT_LOCK_DETECT (11*32+ 6) /* #AC for split lock */
292+
#define X86_FEATURE_PER_THREAD_MBA (11*32+ 7) /* "" Per-thread Memory Bandwidth Allocation */
291293

292294
/* Intel-defined CPU features, CPUID level 0x00000007:1 (EAX), word 12 */
293295
#define X86_FEATURE_AVX512_BF16 (12*32+ 5) /* AVX512 BFLOAT16 instructions */
@@ -353,6 +355,7 @@
353355
#define X86_FEATURE_CLDEMOTE (16*32+25) /* CLDEMOTE instruction */
354356
#define X86_FEATURE_MOVDIRI (16*32+27) /* MOVDIRI instruction */
355357
#define X86_FEATURE_MOVDIR64B (16*32+28) /* MOVDIR64B instruction */
358+
#define X86_FEATURE_ENQCMD (16*32+29) /* ENQCMD and ENQCMDS instructions */
356359

357360
/* AMD-defined CPU features, CPUID level 0x80000007 (EBX), word 17 */
358361
#define X86_FEATURE_OVERFLOW_RECOV (17*32+ 0) /* MCA overflow recovery support */
@@ -368,6 +371,7 @@
368371
#define X86_FEATURE_MD_CLEAR (18*32+10) /* VERW clears CPU buffers */
369372
#define X86_FEATURE_TSX_FORCE_ABORT (18*32+13) /* "" TSX_FORCE_ABORT */
370373
#define X86_FEATURE_SERIALIZE (18*32+14) /* SERIALIZE instruction */
374+
#define X86_FEATURE_TSXLDTRK (18*32+16) /* TSX Suspend Load Address Tracking */
371375
#define X86_FEATURE_PCONFIG (18*32+18) /* Intel PCONFIG */
372376
#define X86_FEATURE_ARCH_LBR (18*32+19) /* Intel ARCH LBR */
373377
#define X86_FEATURE_SPEC_CTRL (18*32+26) /* "" Speculation Control (IBRS + IBPB) */

tools/arch/x86/include/asm/disabled-features.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@
5656
# define DISABLE_PTI (1 << (X86_FEATURE_PTI & 31))
5757
#endif
5858

59+
#ifdef CONFIG_IOMMU_SUPPORT
60+
# define DISABLE_ENQCMD 0
61+
#else
62+
# define DISABLE_ENQCMD (1 << (X86_FEATURE_ENQCMD & 31))
63+
#endif
64+
5965
/*
6066
* Make sure to add features to the correct mask
6167
*/
@@ -75,7 +81,8 @@
7581
#define DISABLED_MASK13 0
7682
#define DISABLED_MASK14 0
7783
#define DISABLED_MASK15 0
78-
#define DISABLED_MASK16 (DISABLE_PKU|DISABLE_OSPKE|DISABLE_LA57|DISABLE_UMIP)
84+
#define DISABLED_MASK16 (DISABLE_PKU|DISABLE_OSPKE|DISABLE_LA57|DISABLE_UMIP| \
85+
DISABLE_ENQCMD)
7986
#define DISABLED_MASK17 0
8087
#define DISABLED_MASK18 0
8188
#define DISABLED_MASK_CHECK BUILD_BUG_ON_ZERO(NCAPINTS != 19)

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,9 @@
257257
#define MSR_IA32_LASTINTFROMIP 0x000001dd
258258
#define MSR_IA32_LASTINTTOIP 0x000001de
259259

260+
#define MSR_IA32_PASID 0x00000d93
261+
#define MSR_IA32_PASID_VALID BIT_ULL(31)
262+
260263
/* DEBUGCTLMSR bits (others vary by model): */
261264
#define DEBUGCTLMSR_LBR (1UL << 0) /* last branch recording */
262265
#define DEBUGCTLMSR_BTF_SHIFT 1
@@ -464,11 +467,15 @@
464467
#define MSR_AMD64_IBSOP_REG_MASK ((1UL<<MSR_AMD64_IBSOP_REG_COUNT)-1)
465468
#define MSR_AMD64_IBSCTL 0xc001103a
466469
#define MSR_AMD64_IBSBRTARGET 0xc001103b
470+
#define MSR_AMD64_ICIBSEXTDCTL 0xc001103c
467471
#define MSR_AMD64_IBSOPDATA4 0xc001103d
468472
#define MSR_AMD64_IBS_REG_COUNT_MAX 8 /* includes MSR_AMD64_IBSBRTARGET */
473+
#define MSR_AMD64_SEV_ES_GHCB 0xc0010130
469474
#define MSR_AMD64_SEV 0xc0010131
470475
#define MSR_AMD64_SEV_ENABLED_BIT 0
476+
#define MSR_AMD64_SEV_ES_ENABLED_BIT 1
471477
#define MSR_AMD64_SEV_ENABLED BIT_ULL(MSR_AMD64_SEV_ENABLED_BIT)
478+
#define MSR_AMD64_SEV_ES_ENABLED BIT_ULL(MSR_AMD64_SEV_ES_ENABLED_BIT)
472479

473480
#define MSR_AMD64_VIRT_SPEC_CTRL 0xc001011f
474481

@@ -857,11 +864,14 @@
857864
#define MSR_CORE_PERF_FIXED_CTR0 0x00000309
858865
#define MSR_CORE_PERF_FIXED_CTR1 0x0000030a
859866
#define MSR_CORE_PERF_FIXED_CTR2 0x0000030b
867+
#define MSR_CORE_PERF_FIXED_CTR3 0x0000030c
860868
#define MSR_CORE_PERF_FIXED_CTR_CTRL 0x0000038d
861869
#define MSR_CORE_PERF_GLOBAL_STATUS 0x0000038e
862870
#define MSR_CORE_PERF_GLOBAL_CTRL 0x0000038f
863871
#define MSR_CORE_PERF_GLOBAL_OVF_CTRL 0x00000390
864872

873+
#define MSR_PERF_METRICS 0x00000329
874+
865875
/* PERF_GLOBAL_OVF_CTL bits */
866876
#define MSR_CORE_PERF_GLOBAL_OVF_CTRL_TRACE_TOPA_PMI_BIT 55
867877
#define MSR_CORE_PERF_GLOBAL_OVF_CTRL_TRACE_TOPA_PMI (1ULL << MSR_CORE_PERF_GLOBAL_OVF_CTRL_TRACE_TOPA_PMI_BIT)

tools/arch/x86/include/asm/required-features.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
#endif
5555

5656
#ifdef CONFIG_X86_64
57-
#ifdef CONFIG_PARAVIRT
57+
#ifdef CONFIG_PARAVIRT_XXL
5858
/* Paravirtualized systems may not have PSE or PGE available */
5959
#define NEED_PSE 0
6060
#define NEED_PGE 0

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,26 @@ struct kvm_msr_list {
192192
__u32 indices[0];
193193
};
194194

195+
/* Maximum size of any access bitmap in bytes */
196+
#define KVM_MSR_FILTER_MAX_BITMAP_SIZE 0x600
197+
198+
/* for KVM_X86_SET_MSR_FILTER */
199+
struct kvm_msr_filter_range {
200+
#define KVM_MSR_FILTER_READ (1 << 0)
201+
#define KVM_MSR_FILTER_WRITE (1 << 1)
202+
__u32 flags;
203+
__u32 nmsrs; /* number of msrs in bitmap */
204+
__u32 base; /* MSR index the bitmap starts at */
205+
__u8 *bitmap; /* a 1 bit allows the operations in flags, 0 denies */
206+
};
207+
208+
#define KVM_MSR_FILTER_MAX_RANGES 16
209+
struct kvm_msr_filter {
210+
#define KVM_MSR_FILTER_DEFAULT_ALLOW (0 << 0)
211+
#define KVM_MSR_FILTER_DEFAULT_DENY (1 << 0)
212+
__u32 flags;
213+
struct kvm_msr_filter_range ranges[KVM_MSR_FILTER_MAX_RANGES];
214+
};
195215

196216
struct kvm_cpuid_entry {
197217
__u32 function;

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#define SVM_EXIT_WRITE_DR6 0x036
3030
#define SVM_EXIT_WRITE_DR7 0x037
3131
#define SVM_EXIT_EXCP_BASE 0x040
32+
#define SVM_EXIT_LAST_EXCP 0x05f
3233
#define SVM_EXIT_INTR 0x060
3334
#define SVM_EXIT_NMI 0x061
3435
#define SVM_EXIT_SMI 0x062
@@ -76,10 +77,21 @@
7677
#define SVM_EXIT_MWAIT_COND 0x08c
7778
#define SVM_EXIT_XSETBV 0x08d
7879
#define SVM_EXIT_RDPRU 0x08e
80+
#define SVM_EXIT_INVPCID 0x0a2
7981
#define SVM_EXIT_NPF 0x400
8082
#define SVM_EXIT_AVIC_INCOMPLETE_IPI 0x401
8183
#define SVM_EXIT_AVIC_UNACCELERATED_ACCESS 0x402
8284

85+
/* SEV-ES software-defined VMGEXIT events */
86+
#define SVM_VMGEXIT_MMIO_READ 0x80000001
87+
#define SVM_VMGEXIT_MMIO_WRITE 0x80000002
88+
#define SVM_VMGEXIT_NMI_COMPLETE 0x80000003
89+
#define SVM_VMGEXIT_AP_HLT_LOOP 0x80000004
90+
#define SVM_VMGEXIT_AP_JUMP_TABLE 0x80000005
91+
#define SVM_VMGEXIT_SET_AP_JUMP_TABLE 0
92+
#define SVM_VMGEXIT_GET_AP_JUMP_TABLE 1
93+
#define SVM_VMGEXIT_UNSUPPORTED_EVENT 0x8000ffff
94+
8395
#define SVM_EXIT_ERR -1
8496

8597
#define SVM_EXIT_REASONS \
@@ -171,6 +183,7 @@
171183
{ SVM_EXIT_MONITOR, "monitor" }, \
172184
{ SVM_EXIT_MWAIT, "mwait" }, \
173185
{ SVM_EXIT_XSETBV, "xsetbv" }, \
186+
{ SVM_EXIT_INVPCID, "invpcid" }, \
174187
{ SVM_EXIT_NPF, "npf" }, \
175188
{ SVM_EXIT_AVIC_INCOMPLETE_IPI, "avic_incomplete_ipi" }, \
176189
{ SVM_EXIT_AVIC_UNACCELERATED_ACCESS, "avic_unaccelerated_access" }, \

tools/build/feature/test-all.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ int main(int argc, char *argv[])
185185
main_test_libperl();
186186
main_test_hello();
187187
main_test_libelf();
188-
main_test_libelf_mmap();
189188
main_test_get_current_dir_name();
190189
main_test_gettid();
191190
main_test_glibc();

tools/include/linux/compiler-gcc.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,6 @@
2727
#define __pure __attribute__((pure))
2828
#endif
2929
#define noinline __attribute__((noinline))
30-
#ifdef __has_attribute
31-
#if __has_attribute(disable_tail_calls)
32-
#define __no_tail_call __attribute__((disable_tail_calls))
33-
#endif
34-
#endif
35-
#ifndef __no_tail_call
36-
#if GCC_VERSION > 40201
37-
#define __no_tail_call __attribute__((optimize("no-optimize-sibling-calls")))
38-
#else
39-
#define __no_tail_call
40-
#endif
41-
#endif
4230
#ifndef __packed
4331
#define __packed __attribute__((packed))
4432
#endif

0 commit comments

Comments
 (0)