linux-stable/arch
Frank van der Linden 746b9c0c3e x86/CPU/AMD: Don't force the CPB cap when running under a hypervisor
[ Upstream commit 2ac44ab608 ]

For F17h AMD CPUs, the CPB capability ('Core Performance Boost') is forcibly set,
because some versions of that chip incorrectly report that they do not have it.

However, a hypervisor may filter out the CPB capability, for good
reasons. For example, KVM currently does not emulate setting the CPB
bit in MSR_K7_HWCR, and unchecked MSR access errors will be thrown
when trying to set it as a guest:

	unchecked MSR access error: WRMSR to 0xc0010015 (tried to write 0x0000000001000011) at rIP: 0xffffffff890638f4 (native_write_msr+0x4/0x20)

	Call Trace:
	boost_set_msr+0x50/0x80 [acpi_cpufreq]
	cpuhp_invoke_callback+0x86/0x560
	sort_range+0x20/0x20
	cpuhp_thread_fun+0xb0/0x110
	smpboot_thread_fn+0xef/0x160
	kthread+0x113/0x130
	kthread_create_worker_on_cpu+0x70/0x70
	ret_from_fork+0x35/0x40

To avoid this issue, don't forcibly set the CPB capability for a CPU
when running under a hypervisor.

Signed-off-by: Frank van der Linden <fllinden@amazon.com>
Acked-by: Borislav Petkov <bp@suse.de>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: bp@alien8.de
Cc: jiaxun.yang@flygoat.com
Fixes: 0237199186 ("x86/CPU/AMD: Set the CPB bit unconditionally on F17h")
Link: http://lkml.kernel.org/r/20190522221745.GA15789@dev-dsk-fllinden-2c-c1893d73.us-west-2.amazon.com
[ Minor edits to the changelog. ]
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-06-22 08:16:16 +02:00
..
alpha alpha: Fix Eiger NR_IRQS to 128 2019-02-20 10:20:53 +01:00
arc arc: hsdk_defconfig: Enable CONFIG_BLK_DEV_RAM 2019-04-20 09:14:59 +02:00
arm ARM: exynos: Fix undefined instruction during Exynos5422 resume 2019-06-15 11:54:59 +02:00
arm64 arm64/mm: Inhibit huge-vmap with ptdump 2019-06-19 08:20:57 +02:00
blackfin
c6x
cris bug.h: work around GCC PR82365 in BUG() 2018-05-30 07:52:00 +02:00
frv
h8300 h8300: use cc-cross-prefix instead of hardcoding h8300-unknown-linux- 2019-04-05 22:31:25 +02:00
hexagon hexagon: modify ffs() and fls() to return int 2018-10-10 08:54:25 +02:00
ia64 ia64/err-inject: Use get_user_pages_fast() 2018-05-30 07:52:11 +02:00
m32r
m68k m68k: Add -ffreestanding to CFLAGS 2019-03-23 14:35:21 +01:00
metag
microblaze microblaze: Fix simpleImage format generation 2018-08-03 07:50:40 +02:00
mips Revert "MIPS: perf: ath79: Fix perfcount IRQ assignment" 2019-06-11 12:21:49 +02:00
mn10300
nios2
openrisc openrisc: entry: Fix delay slot exception detection 2018-08-24 13:09:11 +02:00
parisc parisc: Rename LEVEL to PA_ASM_LEVEL to avoid name clash with DRBD code 2019-05-25 18:25:18 +02:00
powerpc powerpc/powernv: Return for invalid IMC domain 2019-06-22 08:16:16 +02:00
s390 KVM: s390: fix memory slot handling for KVM_SET_USER_MEMORY_REGION 2019-06-19 08:20:58 +02:00
score
sh sh: fix multiple function definition build errors 2019-05-08 07:20:51 +02:00
sparc sparc64: Fix regression in non-hypervisor TLB flush xcall 2019-06-09 09:18:13 +02:00
tile
um uml: fix a boot splat wrt use of cpu_all_mask 2019-06-15 11:54:53 +02:00
unicore32
x86 x86/CPU/AMD: Don't force the CPB cap when running under a hypervisor 2019-06-22 08:16:16 +02:00
xtensa xtensa: xtfpga.dtsi: fix dtc warnings about SPI 2019-05-16 19:42:30 +02:00
.gitignore
Kconfig compiler.h: Allow arch-specific asm/compiler.h 2018-11-04 14:52:46 +01:00