linux-stable/Documentation
Tom Lendacky 9272c25734 x86/CPU/AMD: Clear RDRAND CPUID bit on AMD family 15h/16h
[ Upstream commit c49a0a8013 ]

There have been reports of RDRAND issues after resuming from suspend on
some AMD family 15h and family 16h systems. This issue stems from a BIOS
not performing the proper steps during resume to ensure RDRAND continues
to function properly.

RDRAND support is indicated by CPUID Fn00000001_ECX[30]. This bit can be
reset by clearing MSR C001_1004[62]. Any software that checks for RDRAND
support using CPUID, including the kernel, will believe that RDRAND is
not supported.

Update the CPU initialization to clear the RDRAND CPUID bit for any family
15h and 16h processor that supports RDRAND. If it is known that the family
15h or family 16h system does not have an RDRAND resume issue or that the
system will not be placed in suspend, the "rdrand=force" kernel parameter
can be used to stop the clearing of the RDRAND CPUID bit.

Additionally, update the suspend and resume path to save and restore the
MSR C001_1004 value to ensure that the RDRAND CPUID setting remains in
place after resuming from suspend.

Note, that clearing the RDRAND CPUID bit does not prevent a processor
that normally supports the RDRAND instruction from executing it. So any
code that determined the support based on family and model won't #UD.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Chen Yu <yu.c.chen@intel.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: "linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>
Cc: "linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>
Cc: Nathan Chancellor <natechancellor@gmail.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: <stable@vger.kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "x86@kernel.org" <x86@kernel.org>
Link: https://lkml.kernel.org/r/7543af91666f491547bd86cebb1e17c66824ab9f.1566229943.git.thomas.lendacky@amd.com
[sl: adjust context in docs]
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-09-06 10:19:41 +02:00
..
80211 docs-rst: sphinxify 802.11 documentation 2016-10-11 16:19:17 -06:00
ABI Documentation: Add MDS vulnerability documentation 2019-05-14 19:19:41 +02:00
accounting tools: move accounting tool from Documentation 2016-09-23 13:07:15 -06:00
acpi Merge branches 'acpi-button', 'acpi-battery' and 'acpi-doc' 2016-10-02 01:40:20 +02:00
aoe
arm ARM: 8833/1: Ensure that NEON code always compiles with Clang 2019-04-05 22:29:11 +02:00
arm64 arm64: Add work around for Arm Cortex-A55 Erratum 1024718 2018-05-16 10:08:42 +02:00
auxdisplay samples: move auxdisplay example code from Documentation 2016-09-23 11:52:32 -06:00
backlight
blackfin samples: move blackfin gptimers-example from Documentation 2016-10-10 07:12:02 -06:00
block block: remove remnant refs to hardsect 2016-09-14 08:44:57 -06:00
blockdev
bus-devices
cdrom
cgroup-v1
cma
connector
console
cpu-freq cpufreq-stats: Minor documentation fix 2016-09-08 23:05:07 +02:00
cpuidle
cris
crypto
dev-tools mm: kmemleak: avoid using __va() on addresses that don't have a lowmem mapping 2016-10-11 15:06:33 -07:00
development-process docs-rst: add inter-document cross references 2016-09-21 15:43:09 -06:00
device-mapper dm thin: fix documentation relative to low water mark threshold 2018-05-30 07:50:20 +02:00
devicetree arm64: dts: marvell: Fix A37xx UART0 register size 2019-08-04 09:33:44 +02:00
dmaengine
DocBook A single commit converting the mac80211 DocBook template over to Sphinx. 2016-10-14 14:11:22 -07:00
driver-api docs: Don't format internal MPT docs 2016-09-06 09:15:48 -06:00
driver-model power supply and reset changes for the v4.9 series 2016-10-06 18:21:15 -07:00
early-userspace
EDID
extcon
fault-injection
fb
features Documentation: MIPS supports HAVE_REGS_AND_STACK_ACCESS_API 2016-10-13 17:19:19 +02:00
filesystems mm, proc: be more verbose about unstable VMA flags in /proc/<pid>/smaps 2019-01-26 09:38:36 +01:00
firmware_class
fmc
fpga
frv
gpio gpio/board.txt: point to gpiod_set_value 2016-10-20 14:14:11 +02:00
gpu Merge tag 'drm-for-v4.9' of git://people.freedesktop.org/~airlied/linux 2016-10-11 18:12:22 -07:00
hid
hw-vuln Documentation: Correct the possible MDS sysfs values 2019-05-14 19:19:42 +02:00
hwmon hwmon: (ina2xx) fix sysfs shunt resistor read access 2018-10-03 17:01:52 -07:00
i2c i2c: Documentation: i2c-topology: fix minor whitespace nit 2016-11-10 21:18:56 +01:00
ia64 selftests: move ia64 tests from Documentation/ia64 2016-09-20 09:58:12 -06:00
ide
iio iio: Documentation: Correct the path used to create triggers. 2016-10-01 00:49:58 -06:00
infiniband IB/hfi1: Document new sysfs entries for hfi1 driver 2016-10-02 08:42:19 -04:00
input Input: ALPS - add V8 protocol documentation 2016-10-04 11:47:02 -07:00
ioctl doc: ioctl: Add some clarifications to botching-up-ioctls 2016-09-06 06:00:22 -06:00
isdn
ja_JP
kbuild Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild 2016-10-14 14:26:58 -07:00
kdump Documentation: kdump: Add description of enable multi-cpus support 2016-09-20 18:02:54 -06:00
ko_KR
laptops tools: move laptops dslm tool from Documentation 2016-09-23 13:07:21 -06:00
leds Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds 2016-10-04 10:25:53 -07:00
livepatch
locking locking/lglock: Remove lglock implementation 2016-09-22 15:25:56 +02:00
m68k
media videodev2.h: go back to limited range Y'CbCr for SRGB and, ADOBERGB 2017-02-23 17:44:37 +01:00
memory-devices
metag
mic samples: move mic/mpssd example code from Documentation 2016-09-20 12:38:48 -06:00
mips
misc-devices samples: move misc-devices/mei example code from Documentation 2016-09-23 11:51:43 -06:00
mmc
mn10300
mtd
namespaces
netlabel
networking tcp: add tcp_min_snd_mss sysctl 2019-06-17 19:53:33 +02:00
nfc
nios2
nvdimm
nvmem
parisc
PCI PCI changes for the v4.9 merge window: 2016-10-07 11:46:37 -07:00
pcmcia tools: move pcmcia crc32hash tool from Documentation 2016-09-23 13:07:27 -06:00
perf perf: xgene: Add APM X-Gene SoC Performance Monitoring Unit driver 2016-09-15 11:20:55 -07:00
phy
platform
power power supply and reset changes for the v4.9 series 2016-10-06 18:21:15 -07:00
powerpc powerpc updates for 4.9 2016-10-07 20:19:31 -07:00
pps
prctl selftests: move prctl tests from Documentation/prctl 2016-09-20 09:09:09 -06:00
pti
ptp selftests: move ptp tests from Documentation/ptp 2016-09-20 09:54:38 -06:00
rapidio
RCU kthread: kthread worker API cleanup 2016-10-11 15:06:33 -07:00
s390
scheduler sched/deadline: Document behavior of sched_yield() 2016-09-10 11:17:41 +02:00
scsi scsi: g_NCR5380: Stop using scsi_module.c 2016-09-29 21:52:43 -04:00
security
serial
sh
sound
sphinx docs: sphinx-extensions: make rstFlatTable work with docutils 0.13 2017-01-09 08:32:18 +01:00
sphinx-static This is the documentation update pull for the 4.9 merge window. 2016-10-04 13:54:07 -07:00
spi Doc: update 00-INDEX files to reflect the runnable code move 2016-10-10 07:12:09 -06:00
sysctl bpf: add bpf_jit_limit knob to restrict unpriv allocations 2019-08-25 10:51:41 +02:00
target
thermal thermal: Add support for hardware-tracked trip points 2016-09-27 14:02:16 +08:00
timers Doc: update 00-INDEX files to reflect the runnable code move 2016-10-10 07:12:09 -06:00
tpm
trace This release cycle is rather small. Just a few fixes to tracing. 2016-10-06 11:48:41 -07:00
usb USB: core: Fix bug caused by duplicate interface PM usage counter 2019-05-08 07:19:08 +02:00
virtual KVM: Reject device ioctls from processes other than the VM's creator 2019-04-03 06:24:19 +02:00
vm
w1
watchdog linux-kselftest-4.9-rc1-update 2016-10-14 15:17:12 -07:00
wimax
x86 x86/speculation/mds: Improve CPU buffer clear documentation 2019-05-21 18:48:56 +02:00
xtensa
zh_CN
.gitignore
00-INDEX Doc: update 00-INDEX files to reflect the runnable code move 2016-10-10 07:12:09 -06:00
adding-syscalls.txt
applying-patches.txt docs: Clean up bare :: lines 2016-09-20 18:46:36 -06:00
assoc_array.txt
atomic_ops.txt
bad_memory.txt
basic_profiling.txt
bcache.txt
binfmt_misc.txt
braille-console.txt
bt8xxgpio.txt
btmrvl.txt
BUG-HUNTING
bus-virt-phys-mapping.txt
cachetlb.txt
cgroup-v2.txt
Changes kbuild: verify that $DEPMOD is installed 2018-08-17 20:59:29 +02:00
circular-buffers.txt
clk.txt
CodeOfConflict URL changed for Linux Foundation TAB 2016-10-01 00:57:13 -06:00
CodingStyle docs: Remove space-before-label guidance from CodingStyle 2016-09-21 15:53:31 -06:00
conf.py docs: Fix conf.py for Sphinx 2.0 2019-06-11 12:22:43 +02:00
cpu-hotplug.txt
cpu-load.txt
cputopology.txt
crc32.txt
dcdbas.txt
debugging-modules.txt
debugging-via-ohci1394.txt
dell_rbu.txt
devices.txt
digsig.txt
DMA-API-HOWTO.txt Documentation: DMA-API-HOWTO: Fix a typo 2016-09-20 17:58:46 -06:00
DMA-API.txt dma-mapping: add dma_{map,unmap}_resource 2016-09-26 22:16:41 +05:30
DMA-attributes.txt dma-mapping: introduce the DMA_ATTR_NO_WARN attribute 2016-10-11 15:06:32 -07:00
dma-buf-sharing.txt
DMA-ISA-LPC.txt
docutils.conf
dontdiff
dynamic-debug-howto.txt
edac.txt
efi-stub.txt
eisa.txt
email-clients.txt Documentation/email-clients.txt: convert it to ReST markup 2016-09-21 15:41:50 -06:00
flexible-arrays.txt
futex-requeue-pi.txt
gcc-plugins.txt
highuid.txt
HOWTO docs: Clean up bare :: lines 2016-09-20 18:46:36 -06:00
hw_random.txt
hwspinlock.txt
index.rst Documentation: Move L1TF to separate directory 2019-05-14 19:19:41 +02:00
init.txt
initrd.txt
Intel-IOMMU.txt
intel_txt.txt
io-mapping.txt
io_ordering.txt
iostats.txt
IPMI.txt
IRQ-affinity.txt
IRQ-domain.txt
IRQ.txt
irqflags-tracing.txt
isa.txt
isapnp.txt
java.txt
kernel-doc-nano-HOWTO.txt
kernel-docs.txt Documentation/kernel-docs.txt: reorder based on timestamp 2016-09-20 18:54:42 -06:00
kernel-documentation.rst This is the documentation update pull for the 4.9 merge window. 2016-10-04 13:54:07 -07:00
kernel-parameters.txt x86/CPU/AMD: Clear RDRAND CPUID bit on AMD family 15h/16h 2019-09-06 10:19:41 +02:00
kernel-per-CPU-kthreads.txt
kobject.txt
kprobes.txt
kref.txt
kselftest.txt kselftest: kselftest documentation improvement 2016-09-20 08:58:27 -06:00
ldm.txt
local_ops.txt
lockup-watchdogs.txt
logo.gif
logo.txt
lzo.txt
magic-number.txt
mailbox.txt
Makefile samples: move blackfin gptimers-example from Documentation 2016-10-10 07:12:02 -06:00
Makefile.sphinx
ManagementStyle Documentation/HOWTO: add cross-references to other documents 2016-09-20 18:41:04 -06:00
md-cluster.txt
md.txt
memory-barriers.txt
memory-hotplug.txt
men-chameleon-bus.txt
module-signing.txt
mono.txt
nommu-mmap.txt
ntb.txt
numastat.txt
oops-tracing.txt
padata.txt
parport-lowlevel.txt
parport.txt
percpu-rw-semaphore.txt
phy.txt
pi-futex.txt
pinctrl.txt
pnp.txt
preempt-locking.txt
printk-formats.txt lib/vsprintf: Remove atomic-unsafe support for %pCr 2018-07-03 11:23:06 +02:00
pwm.txt
ramoops.txt
rbtree.txt
remoteproc.txt remoteproc: Split driver and consumer dereferencing 2016-10-02 22:50:21 -07:00
rfkill.txt
robust-futex-ABI.txt
robust-futexes.txt
rpmsg.txt
rtc.txt
SAK.txt
SecurityBugs Documentation/HOWTO: add cross-references to other documents 2016-09-20 18:41:04 -06:00
serial-console.txt
sgi-ioc4.txt
siphash.txt siphash: implement HalfSipHash1-3 for hash tables 2019-08-25 10:51:42 +02:00
SM501.txt
smsc_ece1099.txt
spec_ctrl.txt x86/speculation: Add prctl() control for indirect branch speculation 2019-05-14 19:19:39 +02:00
speculation.txt Documentation: Document array_index_nospec 2018-02-13 12:35:59 +01:00
stable_api_nonsense.txt Documentation/HOWTO: add cross-references to other documents 2016-09-20 18:41:04 -06:00
stable_kernel_rules.txt Documentation: stable-kernel-rules: fix stable-tag format 2017-04-12 12:41:15 +02:00
static-keys.txt jump_labels: Allow array initialisers 2016-09-07 09:41:11 +01:00
SubmitChecklist docs-rst: add inter-document cross references 2016-09-21 15:43:09 -06:00
SubmittingDrivers docs-rst: add inter-document cross references 2016-09-21 15:43:09 -06:00
SubmittingPatches docs-rst: add inter-document cross references 2016-09-21 15:43:09 -06:00
svga.txt
sync_file.txt
sysfs-rules.txt
sysrq.txt
this_cpu_ops.txt
unaligned-memory-access.txt
unicode.txt
unshare.txt
vfio.txt
VGA-softcursor.txt
video-output.txt
vme_api.txt
volatile-considered-harmful.txt
workqueue.txt
xillybus.txt
xz.txt
zorro.txt