[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190824135028.GJ1581@sasha-vm>
Date: Sat, 24 Aug 2019 09:50:28 -0400
From: Sasha Levin <sashal@...nel.org>
To: linux-kernel@...r.kernel.org
Cc: linux-tip-commits@...r.kernel.org,
"x86@...nel.org" <x86@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>, stable@...r.kernel.org,
"Rafael J. Wysocki" <rjw@...ysocki.net>,
Pavel Machek <pavel@....cz>,
Paolo Bonzini <pbonzini@...hat.com>,
Nathan Chancellor <natechancellor@...il.com>,
"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
"linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
Kees Cook <keescook@...omium.org>,
Juergen Gross <jgross@...e.com>,
Josh Poimboeuf <jpoimboe@...hat.com>,
Jonathan Corbet <corbet@....net>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>, Chen Yu <yu.c.chen@...el.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Andrew Cooper <andrew.cooper3@...rix.com>,
Borislav Petkov <bp@...e.de>,
Tom Lendacky <thomas.lendacky@....com>
Subject: Re: [tip: x86/urgent] x86/CPU/AMD: Clear RDRAND CPUID bit on AMD
family 15h/16h
On Fri, Aug 23, 2019 at 01:10:49AM -0000, tip-bot2 for Tom Lendacky wrote:
>The following commit has been merged into the x86/urgent branch of tip:
>
>Commit-ID: c49a0a80137c7ca7d6ced4c812c9e07a949f6f24
>Gitweb: https://git.kernel.org/tip/c49a0a80137c7ca7d6ced4c812c9e07a949f6f24
>Author: Tom Lendacky <thomas.lendacky@....com>
>AuthorDate: Mon, 19 Aug 2019 15:52:35
>Committer: Borislav Petkov <bp@...e.de>
>CommitterDate: Mon, 19 Aug 2019 19:42:52 +02:00
>
>x86/CPU/AMD: Clear RDRAND CPUID bit on AMD family 15h/16h
>
>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@....com>
>Signed-off-by: Borislav Petkov <bp@...e.de>
>Cc: Andrew Cooper <andrew.cooper3@...rix.com>
>Cc: Andrew Morton <akpm@...ux-foundation.org>
>Cc: Chen Yu <yu.c.chen@...el.com>
>Cc: "H. Peter Anvin" <hpa@...or.com>
>Cc: Ingo Molnar <mingo@...hat.com>
>Cc: Jonathan Corbet <corbet@....net>
>Cc: Josh Poimboeuf <jpoimboe@...hat.com>
>Cc: Juergen Gross <jgross@...e.com>
>Cc: Kees Cook <keescook@...omium.org>
>Cc: "linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>
>Cc: "linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>
>Cc: Nathan Chancellor <natechancellor@...il.com>
>Cc: Paolo Bonzini <pbonzini@...hat.com>
>Cc: Pavel Machek <pavel@....cz>
>Cc: "Rafael J. Wysocki" <rjw@...ysocki.net>
>Cc: <stable@...r.kernel.org>
>Cc: Thomas Gleixner <tglx@...utronix.de>
>Cc: "x86@...nel.org" <x86@...nel.org>
>Link: https://lkml.kernel.org/r/7543af91666f491547bd86cebb1e17c66824ab9f.1566229943.git.thomas.lendacky@amd.com
>---
> Documentation/admin-guide/kernel-parameters.txt | 7 +-
> arch/x86/include/asm/msr-index.h | 1 +-
> arch/x86/kernel/cpu/amd.c | 66 +------------
> arch/x86/power/cpu.c | 86 ++--------------
> 4 files changed, 13 insertions(+), 147 deletions(-)
>
>diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
>index 4c19719..47d981a 100644
>--- a/Documentation/admin-guide/kernel-parameters.txt
>+++ b/Documentation/admin-guide/kernel-parameters.txt
>@@ -4090,13 +4090,6 @@
> Run specified binary instead of /init from the ramdisk,
> used for early userspace startup. See initrd.
>
>- rdrand= [X86]
>- force - Override the decision by the kernel to hide the
>- advertisement of RDRAND support (this affects
>- certain AMD processors because of buggy BIOS
>- support, specifically around the suspend/resume
>- path).
>-
Why is this being removed (along with supporting code)?
--
Thanks,
Sasha
Powered by blists - more mailing lists