]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit - sys/x86/x86/cpu_machdep.c
Limit workaround for errata E400 to appropriate AMD cpus.
authorKonstantin Belousov <kib@FreeBSD.org>
Wed, 14 Oct 2020 22:57:50 +0000 (22:57 +0000)
committerKonstantin Belousov <kib@FreeBSD.org>
Wed, 14 Oct 2020 22:57:50 +0000 (22:57 +0000)
commitd3ba71b2b1abc77d1625d693191d7f6d2fcfc5cb
treeec13d5ab9620a46e693f310793c531da146e800f
parent6f3b523c9a576029433f8649a9b6efd2c34604f7
Limit workaround for errata E400 to appropriate AMD cpus.

From Linux sources and several datasheets I looked at, it seems that
the workaround is only needed on families 0xf and 0x10.  For instance,
Ryzens do not implement the accessed MSR at all, it is documented as
reserved.  Also, hypervisors should not allow guest to put CPU into
idle state, so activate workaround only when on bare hardware.

While there, style the code:
    move MSR defines to specialreg.h
    move identification to initcpu.c

Reported by: whu
Reviewed by: avg
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D26470
sys/amd64/amd64/initcpu.c
sys/amd64/amd64/machdep.c
sys/i386/i386/initcpu.c
sys/i386/i386/machdep.c
sys/x86/include/specialreg.h
sys/x86/include/x86_var.h
sys/x86/x86/cpu_machdep.c