Skip to content

Commit 16b3d85

Browse files
committed
Merge tag 'perf-tools-fixes-for-v6.0-2022-08-19' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
Pull perf tools fixes from Arnaldo Carvalho de Melo: - Fix alignment for cpu map masks in event encoding. - Support reading PERF_FORMAT_LOST, perf tool counterpart for a feature that was added in this merge window. - Sync perf tools copies of kernel headers: socket, msr-index, fscrypt, cpufeatures, i915_drm, kvm, vhost, perf_event. * tag 'perf-tools-fixes-for-v6.0-2022-08-19' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: perf tools: Support reading PERF_FORMAT_LOST libperf: Add a test case for read formats libperf: Handle read format in perf_evsel__read() tools headers UAPI: Sync linux/perf_event.h with the kernel sources tools headers UAPI: Sync x86's asm/kvm.h with the kernel sources tools headers UAPI: Sync KVM's vmx.h header with the kernel sources tools include UAPI: Sync linux/vhost.h with the kernel sources tools headers kvm s390: Sync headers with the kernel sources tools headers UAPI: Sync linux/kvm.h with the kernel sources tools headers UAPI: Sync drm/i915_drm.h with the kernel sources tools headers cpufeatures: Sync with the kernel sources tools headers UAPI: Sync linux/fscrypt.h with the kernel sources tools arch x86: Sync the msr-index.h copy with the kernel sources perf beauty: Update copy of linux/socket.h with the kernel sources perf cpumap: Fix alignment for masks in event encoding perf cpumap: Compute mask size in constant time perf cpumap: Synthetic events and const/static perf cpumap: Const map for max()
2 parents cc1807b + f52679b commit 16b3d85

File tree

27 files changed

+976
-235
lines changed

27 files changed

+976
-235
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ struct kvm_s390_io_adapter_req {
7474
#define KVM_S390_VM_CRYPTO 2
7575
#define KVM_S390_VM_CPU_MODEL 3
7676
#define KVM_S390_VM_MIGRATION 4
77+
#define KVM_S390_VM_CPU_TOPOLOGY 5
7778

7879
/* kvm attributes for mem_ctrl */
7980
#define KVM_S390_VM_MEM_ENABLE_CMMA 0

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@
219219
#define X86_FEATURE_IBRS ( 7*32+25) /* Indirect Branch Restricted Speculation */
220220
#define X86_FEATURE_IBPB ( 7*32+26) /* Indirect Branch Prediction Barrier */
221221
#define X86_FEATURE_STIBP ( 7*32+27) /* Single Thread Indirect Branch Predictors */
222-
#define X86_FEATURE_ZEN ( 7*32+28) /* "" CPU is AMD family 0x17 or above (Zen) */
222+
#define X86_FEATURE_ZEN (7*32+28) /* "" CPU based on Zen microarchitecture */
223223
#define X86_FEATURE_L1TF_PTEINV ( 7*32+29) /* "" L1TF workaround PTE inversion */
224224
#define X86_FEATURE_IBRS_ENHANCED ( 7*32+30) /* Enhanced IBRS */
225225
#define X86_FEATURE_MSR_IA32_FEAT_CTL ( 7*32+31) /* "" MSR IA32_FEAT_CTL configured */
@@ -303,7 +303,7 @@
303303
#define X86_FEATURE_RETHUNK (11*32+14) /* "" Use REturn THUNK */
304304
#define X86_FEATURE_UNRET (11*32+15) /* "" AMD BTB untrain return */
305305
#define X86_FEATURE_USE_IBPB_FW (11*32+16) /* "" Use IBPB during runtime firmware calls */
306-
#define X86_FEATURE_RSB_VMEXIT_LITE (11*32+17) /* "" Fill RSB on VM-Exit when EIBRS is enabled */
306+
#define X86_FEATURE_RSB_VMEXIT_LITE (11*32+17) /* "" Fill RSB on VM exit when EIBRS is enabled */
307307

308308
/* Intel-defined CPU features, CPUID level 0x00000007:1 (EAX), word 12 */
309309
#define X86_FEATURE_AVX_VNNI (12*32+ 4) /* AVX VNNI instructions */
@@ -354,6 +354,7 @@
354354
#define X86_FEATURE_AVIC (15*32+13) /* Virtual Interrupt Controller */
355355
#define X86_FEATURE_V_VMSAVE_VMLOAD (15*32+15) /* Virtual VMSAVE VMLOAD */
356356
#define X86_FEATURE_VGIF (15*32+16) /* Virtual GIF */
357+
#define X86_FEATURE_X2AVIC (15*32+18) /* Virtual x2apic */
357358
#define X86_FEATURE_V_SPEC_CTRL (15*32+20) /* Virtual SPEC_CTRL */
358359
#define X86_FEATURE_SVME_ADDR_CHK (15*32+28) /* "" SVME addr check */
359360

@@ -457,5 +458,6 @@
457458
#define X86_BUG_SRBDS X86_BUG(24) /* CPU may leak RNG bits if not mitigated */
458459
#define X86_BUG_MMIO_STALE_DATA X86_BUG(25) /* CPU is affected by Processor MMIO Stale Data vulnerabilities */
459460
#define X86_BUG_RETBLEED X86_BUG(26) /* CPU is affected by RETBleed */
461+
#define X86_BUG_EIBRS_PBRSB X86_BUG(27) /* EIBRS is vulnerable to Post Barrier RSB Predictions */
460462

461463
#endif /* _ASM_X86_CPUFEATURES_H */

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,12 @@
235235
#define PERF_CAP_PT_IDX 16
236236

237237
#define MSR_PEBS_LD_LAT_THRESHOLD 0x000003f6
238+
#define PERF_CAP_PEBS_TRAP BIT_ULL(6)
239+
#define PERF_CAP_ARCH_REG BIT_ULL(7)
240+
#define PERF_CAP_PEBS_FORMAT 0xf00
241+
#define PERF_CAP_PEBS_BASELINE BIT_ULL(14)
242+
#define PERF_CAP_PEBS_MASK (PERF_CAP_PEBS_TRAP | PERF_CAP_ARCH_REG | \
243+
PERF_CAP_PEBS_FORMAT | PERF_CAP_PEBS_BASELINE)
238244

239245
#define MSR_IA32_RTIT_CTL 0x00000570
240246
#define RTIT_CTL_TRACEEN BIT(0)
@@ -392,6 +398,7 @@
392398
#define MSR_TURBO_ACTIVATION_RATIO 0x0000064C
393399

394400
#define MSR_PLATFORM_ENERGY_STATUS 0x0000064D
401+
#define MSR_SECONDARY_TURBO_RATIO_LIMIT 0x00000650
395402

396403
#define MSR_PKG_WEIGHTED_CORE_C0_RES 0x00000658
397404
#define MSR_PKG_ANY_CORE_C0_RES 0x00000659
@@ -1022,6 +1029,7 @@
10221029
#define MSR_IA32_VMX_TRUE_EXIT_CTLS 0x0000048f
10231030
#define MSR_IA32_VMX_TRUE_ENTRY_CTLS 0x00000490
10241031
#define MSR_IA32_VMX_VMFUNC 0x00000491
1032+
#define MSR_IA32_VMX_PROCBASED_CTLS3 0x00000492
10251033

10261034
/* VMX_BASIC bits and bitmasks */
10271035
#define VMX_BASIC_VMCS_SIZE_SHIFT 32

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,8 @@ struct kvm_pit_state {
306306
struct kvm_pit_channel_state channels[3];
307307
};
308308

309-
#define KVM_PIT_FLAGS_HPET_LEGACY 0x00000001
309+
#define KVM_PIT_FLAGS_HPET_LEGACY 0x00000001
310+
#define KVM_PIT_FLAGS_SPEAKER_DATA_ON 0x00000002
310311

311312
struct kvm_pit_state2 {
312313
struct kvm_pit_channel_state channels[3];
@@ -325,6 +326,7 @@ struct kvm_reinject_control {
325326
#define KVM_VCPUEVENT_VALID_SHADOW 0x00000004
326327
#define KVM_VCPUEVENT_VALID_SMM 0x00000008
327328
#define KVM_VCPUEVENT_VALID_PAYLOAD 0x00000010
329+
#define KVM_VCPUEVENT_VALID_TRIPLE_FAULT 0x00000020
328330

329331
/* Interrupt shadow states */
330332
#define KVM_X86_SHADOW_INT_MOV_SS 0x01
@@ -359,7 +361,10 @@ struct kvm_vcpu_events {
359361
__u8 smm_inside_nmi;
360362
__u8 latched_init;
361363
} smi;
362-
__u8 reserved[27];
364+
struct {
365+
__u8 pending;
366+
} triple_fault;
367+
__u8 reserved[26];
363368
__u8 exception_has_payload;
364369
__u64 exception_payload;
365370
};
@@ -434,6 +439,7 @@ struct kvm_sync_regs {
434439
#define KVM_X86_QUIRK_OUT_7E_INC_RIP (1 << 3)
435440
#define KVM_X86_QUIRK_MISC_ENABLE_NO_MWAIT (1 << 4)
436441
#define KVM_X86_QUIRK_FIX_HYPERCALL_INSN (1 << 5)
442+
#define KVM_X86_QUIRK_MWAIT_NEVER_UD_FAULTS (1 << 6)
437443

438444
#define KVM_STATE_NESTED_FORMAT_VMX 0
439445
#define KVM_STATE_NESTED_FORMAT_SVM 1

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@
9191
#define EXIT_REASON_UMWAIT 67
9292
#define EXIT_REASON_TPAUSE 68
9393
#define EXIT_REASON_BUS_LOCK 74
94+
#define EXIT_REASON_NOTIFY 75
9495

9596
#define VMX_EXIT_REASONS \
9697
{ EXIT_REASON_EXCEPTION_NMI, "EXCEPTION_NMI" }, \
@@ -153,7 +154,8 @@
153154
{ EXIT_REASON_XRSTORS, "XRSTORS" }, \
154155
{ EXIT_REASON_UMWAIT, "UMWAIT" }, \
155156
{ EXIT_REASON_TPAUSE, "TPAUSE" }, \
156-
{ EXIT_REASON_BUS_LOCK, "BUS_LOCK" }
157+
{ EXIT_REASON_BUS_LOCK, "BUS_LOCK" }, \
158+
{ EXIT_REASON_NOTIFY, "NOTIFY" }
157159

158160
#define VMX_EXIT_REASON_FLAGS \
159161
{ VMX_EXIT_REASONS_FAILED_VMENTRY, "FAILED_VMENTRY" }

0 commit comments

Comments
 (0)