linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org
Cc: linux-tip-commits@vger.kernel.org,
	"x86@kernel.org" <x86@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	stable@vger.kernel.org, "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Pavel Machek <pavel@ucw.cz>, Paolo Bonzini <pbonzini@redhat.com>,
	Nathan Chancellor <natechancellor@gmail.com>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	Kees Cook <keescook@chromium.org>,
	Juergen Gross <jgross@suse.com>,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	Jonathan Corbet <corbet@lwn.net>, Ingo Molnar <mingo@redhat.com>,
	"H. Peter Anvin" <hpa@zytor.com>, Chen Yu <yu.c.chen@intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Borislav Petkov <bp@suse.de>,
	Tom Lendacky <thomas.lendacky@amd.com>
Subject: Re: [tip: x86/urgent] x86/CPU/AMD: Clear RDRAND CPUID bit on AMD family 15h/16h
Date: Sat, 24 Aug 2019 09:50:28 -0400	[thread overview]
Message-ID: <20190824135028.GJ1581@sasha-vm> (raw)
In-Reply-To: <156652264945.9541.4969272027980914591.tip-bot2@tip-bot2>

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@amd.com>
>AuthorDate:    Mon, 19 Aug 2019 15:52:35
>Committer:     Borislav Petkov <bp@suse.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@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
>---
> 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

  reply	other threads:[~2019-08-24 16:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-19 15:52 [PATCH v2] " Lendacky, Thomas
2019-08-23  1:10 ` [tip: x86/urgent] " tip-bot2 for Tom Lendacky
2019-08-24 13:50   ` Sasha Levin [this message]
2019-08-24 19:13     ` Borislav Petkov
2019-08-24 18:19   ` Pavel Machek
2019-08-24 21:35     ` H. Peter Anvin
2019-10-08 21:20       ` Pavel Machek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190824135028.GJ1581@sasha-vm \
    --to=sashal@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=andrew.cooper3@citrix.com \
    --cc=bp@suse.de \
    --cc=corbet@lwn.net \
    --cc=hpa@zytor.com \
    --cc=jgross@suse.com \
    --cc=jpoimboe@redhat.com \
    --cc=keescook@chromium.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=natechancellor@gmail.com \
    --cc=pavel@ucw.cz \
    --cc=pbonzini@redhat.com \
    --cc=rjw@rjwysocki.net \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=thomas.lendacky@amd.com \
    --cc=x86@kernel.org \
    --cc=yu.c.chen@intel.com \
    --subject='Re: [tip: x86/urgent] x86/CPU/AMD: Clear RDRAND CPUID bit on AMD family 15h/16h' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).