linux/arch/x86/kernel
Kan Liang 878068ea27 perf/x86: Support outputting XMM registers
Starting from Icelake, XMM registers can be collected in PEBS record.
But current code only output the pt_regs.

Add a new struct x86_perf_regs for both pt_regs and xmm_regs. The
xmm_regs will be used later to keep a pointer to PEBS record which has
XMM information.

XMM registers are 128 bit. To simplify the code, they are handled like
two different registers, which means setting two bits in the register
bitmap. This also allows only sampling the lower 64bit bits in XMM.

The index of XMM registers starts from 32. There are 16 XMM registers.
So all reserved space for regs are used. Remove REG_RESERVED.

Add PERF_REG_X86_XMM_MAX, which stands for the max number of all x86
regs including both GPRs and XMM.

Add REG_NOSUPPORT for 32bit to exclude unsupported registers.

Previous platforms can not collect XMM information in PEBS record.
Adding pebs_no_xmm_regs to indicate the unsupported platforms.

The common code still validates the supported registers. However, it
cannot check model specific registers, e.g. XMM. Add extra check in
x86_pmu_hw_config() to reject invalid config of regs_user and regs_intr.
The regs_user never supports XMM collection.
The regs_intr only supports XMM collection when sampling PEBS event on
icelake and later platforms.

Originally-by: Andi Kleen <ak@linux.intel.com>
Suggested-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Cc: acme@kernel.org
Cc: jolsa@kernel.org
Link: https://lkml.kernel.org/r/20190402194509.2832-3-kan.liang@linux.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2019-04-16 12:19:36 +02:00
..
acpi treewide: add checks for the return value of memblock_alloc*() 2019-03-12 10:04:02 -07:00
apic treewide: add checks for the return value of memblock_alloc*() 2019-03-12 10:04:02 -07:00
cpu x86/resctrl: Fix typos in the mba_sc mount option 2019-04-01 18:45:27 +02:00
fpu x86/fpu: Move init_xstate_size() to __init section 2019-02-08 14:32:34 +01:00
kprobes x86/kprobes: Prohibit probing on IRQ handlers directly 2019-02-13 08:16:39 +01:00
.gitignore
alternative.c Merge branch 'x86-alternatives-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2019-03-06 08:45:46 -08:00
amd_gart_64.c x86/amd_gart: fix unmapping of non-GART mappings 2019-01-05 08:27:32 +01:00
amd_nb.c
apb_timer.c
aperture_64.c x86/gart: Exclude GART aperture from kcore 2019-03-23 12:11:49 +01:00
apm_32.c
asm-offsets.c
asm-offsets_32.c
asm-offsets_64.c
audit_64.c
bootflag.c
check.c
cpuid.c
crash.c x86/kexec: Fix a kexec_file_load() failure 2019-01-15 12:12:50 +01:00
crash_dump_32.c
crash_dump_64.c
devicetree.c
doublefault.c
dumpstack.c
dumpstack_32.c
dumpstack_64.c
e820.c Merge branch 'akpm' (patches from Andrew) 2019-03-12 10:39:53 -07:00
early-quirks.c
early_printk.c efi/x86: Convert x86 EFI earlyprintk into generic earlycon implementation 2019-02-04 08:27:30 +01:00
ebda.c
eisa.c
espfix_64.c
ftrace.c The biggest change for this release is in the histogram code. 2019-03-11 17:01:32 -07:00
ftrace_32.S
ftrace_64.S
head32.c
head64.c
head_32.S
head_64.S
hpet.c x86/hpet: Prevent potential NULL pointer dereference 2019-03-21 12:24:38 +01:00
hw_breakpoint.c x86/hw_breakpoints: Make default case in hw_breakpoint_arch_parse() return an error 2019-03-22 17:08:17 +01:00
i8237.c
i8253.c
i8259.c
idt.c
ima_arch.c
io_delay.c
ioport.c
irq.c
irq_32.c
irq_64.c
irq_work.c
irqflags.S
irqinit.c
itmt.c
jailhouse.c
jump_label.c jump_label: move 'asm goto' support test to Kconfig 2019-01-06 09:46:51 +09:00
kdebugfs.c
kexec-bzimage64.c Merge branch 'next-integrity' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security 2019-03-10 17:32:04 -07:00
kgdb.c x86/kernel: Mark expected switch-case fall-throughs 2019-01-26 11:19:13 +01:00
ksysfs.c
kvm.c KVM: x86: WARN_ONCE if sending a PV IPI returns a fatal error 2019-01-25 19:11:33 +01:00
kvmclock.c x86: kvmguest: use TSC clocksource if invariant TSC is exposed 2019-02-20 22:48:52 +01:00
ldt.c
livepatch.c
machine_kexec_32.c
machine_kexec_64.c x86/kdump: Export the SME mask to vmcoreinfo 2019-01-11 16:09:25 +01:00
Makefile jump_label: move 'asm goto' support test to Kconfig 2019-01-06 09:46:51 +09:00
mmconf-fam10h_64.c
module.c
mpparse.c x86/mm: Don't leak kernel addresses 2019-03-19 12:10:56 +01:00
msr.c
nmi.c
nmi_selftest.c
paravirt-spinlocks.c
paravirt.c
paravirt_patch_32.c
paravirt_patch_64.c
pci-calgary_64.c
pci-dma.c
pci-iommu_table.c
pci-swiotlb.c
pcspeaker.c
perf_regs.c perf/x86: Support outputting XMM registers 2019-04-16 12:19:36 +02:00
platform-quirks.c
pmem.c
probe_roms.c
process.c x86/speculation: Add PR_SPEC_DISABLE_NOEXEC 2019-01-29 22:11:49 +01:00
process.h
process_32.c Merge branch 'x86-fpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2018-12-26 17:37:51 -08:00
process_64.c Merge branch 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2018-12-26 18:08:18 -08:00
ptrace.c
pvclock.c
quirks.c
reboot.c
reboot_fixups_32.c
relocate_kernel_32.S
relocate_kernel_64.S
resource.c
rtc.c
setup.c Merge branch 'mount.part1' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2019-01-05 13:25:58 -08:00
setup_percpu.c memblock: drop memblock_alloc_*_nopanic() variants 2019-03-12 10:04:02 -07:00
signal.c Remove 'type' argument from access_ok() function 2019-01-03 18:57:57 -08:00
signal_compat.c
smp.c
smpboot.c Merge branch 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2019-03-07 16:36:57 -08:00
stacktrace.c Remove 'type' argument from access_ok() function 2019-01-03 18:57:57 -08:00
step.c
sys_x86_64.c
sysfb.c
sysfb_efi.c
sysfb_simplefb.c
tboot.c
tce_64.c
time.c
tls.c
tls.h
topology.c
trace_clock.c
tracepoint.c
traps.c Merge branch 'x86-fpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2019-03-07 17:09:28 -08:00
tsc.c
tsc_msr.c
tsc_sync.c
umip.c
unwind_frame.c x86/unwind: Handle NULL pointer calls better in frame unwinder 2019-03-06 23:03:26 +01:00
unwind_guess.c
unwind_orc.c x86/unwind: Add hardcoded ORC entry for NULL 2019-03-06 23:03:26 +01:00
uprobes.c x86/kernel: Mark expected switch-case fall-throughs 2019-01-26 11:19:13 +01:00
verify_cpu.S
vm86_32.c Remove 'type' argument from access_ok() function 2019-01-03 18:57:57 -08:00
vmlinux.lds.S x86/build: Use the single-argument OUTPUT_FORMAT() linker script command 2019-01-16 12:21:53 +01:00
vsmp_64.c
x86_init.c