From: tip-bot for Borislav Petkov <borislav.petkov@amd.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
tglx@linutronix.de, borislav.petkov@amd.com
Subject: [tip:x86/urgent] x86: Document rdmsr_safe restrictions
Date: Mon, 5 Dec 2011 09:40:30 -0800 [thread overview]
Message-ID: <tip-ce37defc0f6673f5ca2c92ed5cfcaf290ae7dd16@git.kernel.org> (raw)
In-Reply-To: <4ED5B70F.606@lwfinger.net>
Commit-ID: ce37defc0f6673f5ca2c92ed5cfcaf290ae7dd16
Gitweb: http://git.kernel.org/tip/ce37defc0f6673f5ca2c92ed5cfcaf290ae7dd16
Author: Borislav Petkov <borislav.petkov@amd.com>
AuthorDate: Mon, 5 Dec 2011 14:28:37 +0100
Committer: Borislav Petkov <borislav.petkov@amd.com>
CommitDate: Mon, 5 Dec 2011 14:28:37 +0100
x86: Document rdmsr_safe restrictions
Recently, I got bitten by using rdmsr_safe too early in the boot
process. Document its shortcomings for future reference.
Link: http://lkml.kernel.org/r/4ED5B70F.606@lwfinger.net
Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
---
arch/x86/include/asm/msr.h | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/arch/x86/include/asm/msr.h b/arch/x86/include/asm/msr.h
index 084ef95..95203d4 100644
--- a/arch/x86/include/asm/msr.h
+++ b/arch/x86/include/asm/msr.h
@@ -169,7 +169,14 @@ static inline int wrmsr_safe(unsigned msr, unsigned low, unsigned high)
return native_write_msr_safe(msr, low, high);
}
-/* rdmsr with exception handling */
+/*
+ * rdmsr with exception handling.
+ *
+ * Please note that the exception handling works only after we've
+ * switched to the "smart" #GP handler in trap_init() which knows about
+ * exception tables - using this macro earlier than that causes machine
+ * hangs on boxes which do not implement the @msr in the first argument.
+ */
#define rdmsr_safe(msr, p1, p2) \
({ \
int __err; \
prev parent reply other threads:[~2011-12-05 17:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-30 4:54 3.2-rc2 freezes on boot for AMD K6 - bisected to commit bcb80e53877c2045d9e52f4a71372c3fe6501f6f Larry Finger
2011-11-30 5:59 ` Srivatsa S. Bhat
2011-11-30 7:09 ` Larry Finger
2011-12-03 20:43 ` Larry Finger
2011-12-03 23:07 ` Linus Torvalds
2011-12-04 3:15 ` Larry Finger
2011-12-04 6:05 ` Bob Tracy
2011-12-04 13:09 ` Borislav Petkov
2011-12-05 7:28 ` Ingo Molnar
2011-12-05 17:40 ` tip-bot for Borislav Petkov [this message]
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=tip-ce37defc0f6673f5ca2c92ed5cfcaf290ae7dd16@git.kernel.org \
--to=borislav.petkov@amd.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox