Skip to content

Commit 144c79e

Browse files
committed
Merge tag 'perf-tools-fixes-for-v5.12-2020-03-07' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
Pull perf tools fixes from Arnaldo Carvalho de Melo: "Perf tool fixes: - Fix wrong skipping for per-die aggregation in 'perf stat'. - Fix race in signal handling on large core count machines, setting up signal handlers earlier. - Fix -F for branch & mem modes in 'perf report'. - Fix the condition checks for max number of NUMA nodes in 'perf bench numa'. - Fix crash in 'perf diff' error path. - Fix filtering of empty build-ids in 'perf archive'. - Ensure read cmdlines from libtraceevent are null terminated. Recent regressions: - Fix control fifo permissions in 'perf daemon'. - Fix 'perf daemon' compile error with ASAN. - Fix running 'perf daemon' test for non root user. - Fix PERF_SAMPLE_WEIGHT_STRUCT 'perf test' failure on non-x86 arches. - Fix event's PMU name parsing related to new drm/i915/gt software-gt-awake-time event. Fixes from compiler instrumentation: - Fix leaks in 'perf test' entries, found using ASAN. - Fix use-after-free when 'perf stat -r' option is used. Arch specific: - Fix bitmap for option om ARM's CS-ETM. Documentation: - Fix documentation of verbose options. Build: - Clean 'generated' directory used for creating the syscall table on x86. - Fix ccache usage in $(CC) when generating arch errno table. - Cast (struct timeval).tv_sec when printing, fixing the build with MUSL libc. - Tighten snprintf() string precision to pass gcc check on some 32-bit arches. - Update UAPI copies from the kernel sources. - Fix regression on feature detection 'make clean' target" * tag 'perf-tools-fixes-for-v5.12-2020-03-07' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: (44 commits) perf cs-etm: Fix bitmap for option perf trace: Fix race in signal handling perf map: Tighten snprintf() string precision to pass gcc check on some 32-bit arches perf report: Fix -F for branch & mem modes perf tests x86: Move insn.h include to make sure it finds stddef.h perf test: Support the ins_lat check in the X86 specific test perf test: Fix sample-parsing failure on non-x86 platforms perf archive: Fix filtering of empty build-ids perf daemon: Fix compile error with Asan perf stat: Fix use-after-free when -r option is used libperf: Add perf_evlist__reset_id_hash() perf stat: Fix wrong skipping for per-die aggregation tools headers UAPI: Sync KVM's kvm.h and vmx.h headers with the kernel sources tools headers cpufeatures: Sync with the kernel sources tools headers UAPI: Update tools' copy of linux/coresight-pmu.h tools headers: Update syscall.tbl files to support mount_setattr perf test: Fix cpu and thread map leaks in perf_time_to_tsc test perf test: Fix cpu map leaks in cpu_map_print test perf test: Fix a memory leak in thread_map_remove test perf test: Fix a thread map leak in thread_map_synthesize test ...
2 parents 3bb48a8 + 6fc5baf commit 144c79e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+517
-215
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,9 @@
179179
#define ACR_SIZE 4
180180

181181

182-
#define PTRACE_OLDSETOPTIONS 21
183-
182+
#define PTRACE_OLDSETOPTIONS 21
183+
#define PTRACE_SYSEMU 31
184+
#define PTRACE_SYSEMU_SINGLESTEP 32
184185
#ifndef __ASSEMBLY__
185186
#include <linux/stddef.h>
186187
#include <linux/types.h>

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

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
/*
1414
* Defines x86 CPU feature bits
1515
*/
16-
#define NCAPINTS 19 /* N 32-bit words worth of info */
16+
#define NCAPINTS 20 /* N 32-bit words worth of info */
1717
#define NBUGINTS 1 /* N 32-bit bug flags */
1818

1919
/*
@@ -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-
#define X86_FEATURE_SME_COHERENT ( 3*32+17) /* "" AMD hardware-enforced cache coherency */
99+
/* FREE! ( 3*32+17) */
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 */
@@ -201,7 +201,7 @@
201201
#define X86_FEATURE_INVPCID_SINGLE ( 7*32+ 7) /* Effectively INVPCID && CR4.PCIDE=1 */
202202
#define X86_FEATURE_HW_PSTATE ( 7*32+ 8) /* AMD HW-PState */
203203
#define X86_FEATURE_PROC_FEEDBACK ( 7*32+ 9) /* AMD ProcFeedbackInterface */
204-
#define X86_FEATURE_SME ( 7*32+10) /* AMD Secure Memory Encryption */
204+
/* FREE! ( 7*32+10) */
205205
#define X86_FEATURE_PTI ( 7*32+11) /* Kernel Page Table Isolation enabled */
206206
#define X86_FEATURE_RETPOLINE ( 7*32+12) /* "" Generic Retpoline mitigation for Spectre variant 2 */
207207
#define X86_FEATURE_RETPOLINE_AMD ( 7*32+13) /* "" AMD Retpoline mitigation for Spectre variant 2 */
@@ -211,7 +211,7 @@
211211
#define X86_FEATURE_SSBD ( 7*32+17) /* Speculative Store Bypass Disable */
212212
#define X86_FEATURE_MBA ( 7*32+18) /* Memory Bandwidth Allocation */
213213
#define X86_FEATURE_RSB_CTXSW ( 7*32+19) /* "" Fill RSB on context switches */
214-
#define X86_FEATURE_SEV ( 7*32+20) /* AMD Secure Encrypted Virtualization */
214+
/* FREE! ( 7*32+20) */
215215
#define X86_FEATURE_USE_IBPB ( 7*32+21) /* "" Indirect Branch Prediction Barrier enabled */
216216
#define X86_FEATURE_USE_IBRS_FW ( 7*32+22) /* "" Use IBRS during runtime firmware calls */
217217
#define X86_FEATURE_SPEC_STORE_BYPASS_DISABLE ( 7*32+23) /* "" Disable Speculative Store Bypass. */
@@ -236,8 +236,6 @@
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 */
240-
#define X86_FEATURE_VM_PAGE_FLUSH ( 8*32+21) /* "" VM Page Flush MSR is supported */
241239

242240
/* Intel-defined CPU features, CPUID level 0x00000007:0 (EBX), word 9 */
243241
#define X86_FEATURE_FSGSBASE ( 9*32+ 0) /* RDFSBASE, WRFSBASE, RDGSBASE, WRGSBASE instructions*/
@@ -294,6 +292,7 @@
294292
#define X86_FEATURE_PER_THREAD_MBA (11*32+ 7) /* "" Per-thread Memory Bandwidth Allocation */
295293

296294
/* Intel-defined CPU features, CPUID level 0x00000007:1 (EAX), word 12 */
295+
#define X86_FEATURE_AVX_VNNI (12*32+ 4) /* AVX VNNI instructions */
297296
#define X86_FEATURE_AVX512_BF16 (12*32+ 5) /* AVX512 BFLOAT16 instructions */
298297

299298
/* AMD-defined CPU features, CPUID level 0x80000008 (EBX), word 13 */
@@ -337,6 +336,7 @@
337336
#define X86_FEATURE_AVIC (15*32+13) /* Virtual Interrupt Controller */
338337
#define X86_FEATURE_V_VMSAVE_VMLOAD (15*32+15) /* Virtual VMSAVE VMLOAD */
339338
#define X86_FEATURE_VGIF (15*32+16) /* Virtual GIF */
339+
#define X86_FEATURE_SVME_ADDR_CHK (15*32+28) /* "" SVME addr check */
340340

341341
/* Intel-defined CPU features, CPUID level 0x00000007:0 (ECX), word 16 */
342342
#define X86_FEATURE_AVX512VBMI (16*32+ 1) /* AVX512 Vector Bit Manipulation instructions*/
@@ -385,6 +385,13 @@
385385
#define X86_FEATURE_CORE_CAPABILITIES (18*32+30) /* "" IA32_CORE_CAPABILITIES MSR */
386386
#define X86_FEATURE_SPEC_CTRL_SSBD (18*32+31) /* "" Speculative Store Bypass Disable */
387387

388+
/* AMD-defined memory encryption features, CPUID level 0x8000001f (EAX), word 19 */
389+
#define X86_FEATURE_SME (19*32+ 0) /* AMD Secure Memory Encryption */
390+
#define X86_FEATURE_SEV (19*32+ 1) /* AMD Secure Encrypted Virtualization */
391+
#define X86_FEATURE_VM_PAGE_FLUSH (19*32+ 2) /* "" VM Page Flush MSR is supported */
392+
#define X86_FEATURE_SEV_ES (19*32+ 3) /* AMD Secure Encrypted Virtualization - Encrypted State */
393+
#define X86_FEATURE_SME_COHERENT (19*32+10) /* "" AMD hardware-enforced cache coherency */
394+
388395
/*
389396
* BUG word(s)
390397
*/

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ struct kvm_ioapic_state {
112112
#define KVM_NR_IRQCHIPS 3
113113

114114
#define KVM_RUN_X86_SMM (1 << 0)
115+
#define KVM_RUN_X86_BUS_LOCK (1 << 1)
115116

116117
/* for KVM_GET_REGS and KVM_SET_REGS */
117118
struct kvm_regs {

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
#define EXIT_REASON_XRSTORS 64
9090
#define EXIT_REASON_UMWAIT 67
9191
#define EXIT_REASON_TPAUSE 68
92+
#define EXIT_REASON_BUS_LOCK 74
9293

9394
#define VMX_EXIT_REASONS \
9495
{ EXIT_REASON_EXCEPTION_NMI, "EXCEPTION_NMI" }, \
@@ -150,7 +151,8 @@
150151
{ EXIT_REASON_XSAVES, "XSAVES" }, \
151152
{ EXIT_REASON_XRSTORS, "XRSTORS" }, \
152153
{ EXIT_REASON_UMWAIT, "UMWAIT" }, \
153-
{ EXIT_REASON_TPAUSE, "TPAUSE" }
154+
{ EXIT_REASON_TPAUSE, "TPAUSE" }, \
155+
{ EXIT_REASON_BUS_LOCK, "BUS_LOCK" }
154156

155157
#define VMX_EXIT_REASON_FLAGS \
156158
{ VMX_EXIT_REASONS_FAILED_VMENTRY, "FAILED_VMENTRY" }

tools/build/Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,18 @@ build := -f $(srctree)/tools/build/Makefile.build dir=. obj
3030

3131
all: $(OUTPUT)fixdep
3232

33+
# Make sure there's anything to clean,
34+
# feature contains check for existing OUTPUT
35+
TMP_O := $(if $(OUTPUT),$(OUTPUT)/feature,./)
36+
3337
clean:
3438
$(call QUIET_CLEAN, fixdep)
3539
$(Q)find $(if $(OUTPUT),$(OUTPUT),.) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete
3640
$(Q)rm -f $(OUTPUT)fixdep
3741
$(call QUIET_CLEAN, feature-detect)
38-
$(Q)$(MAKE) -C feature/ clean >/dev/null
42+
ifneq ($(wildcard $(TMP_O)),)
43+
$(Q)$(MAKE) -C feature OUTPUT=$(TMP_O) clean >/dev/null
44+
endif
3945

4046
$(OUTPUT)fixdep-in.o: FORCE
4147
$(Q)$(MAKE) $(build)=fixdep

tools/include/linux/coresight-pmu.h

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,27 @@
1010
#define CORESIGHT_ETM_PMU_NAME "cs_etm"
1111
#define CORESIGHT_ETM_PMU_SEED 0x10
1212

13-
/* ETMv3.5/PTM's ETMCR config bit */
14-
#define ETM_OPT_CYCACC 12
15-
#define ETM_OPT_CTXTID 14
16-
#define ETM_OPT_TS 28
17-
#define ETM_OPT_RETSTK 29
13+
/*
14+
* Below are the definition of bit offsets for perf option, and works as
15+
* arbitrary values for all ETM versions.
16+
*
17+
* Most of them are orignally from ETMv3.5/PTM's ETMCR config, therefore,
18+
* ETMv3.5/PTM doesn't define ETMCR config bits with prefix "ETM3_" and
19+
* directly use below macros as config bits.
20+
*/
21+
#define ETM_OPT_CYCACC 12
22+
#define ETM_OPT_CTXTID 14
23+
#define ETM_OPT_CTXTID2 15
24+
#define ETM_OPT_TS 28
25+
#define ETM_OPT_RETSTK 29
1826

1927
/* ETMv4 CONFIGR programming bits for the ETM OPTs */
2028
#define ETM4_CFG_BIT_CYCACC 4
2129
#define ETM4_CFG_BIT_CTXTID 6
30+
#define ETM4_CFG_BIT_VMID 7
2231
#define ETM4_CFG_BIT_TS 11
2332
#define ETM4_CFG_BIT_RETSTK 12
33+
#define ETM4_CFG_BIT_VMID_OPT 15
2434

2535
static inline int coresight_get_trace_id(int cpu)
2636
{

0 commit comments

Comments
 (0)