summaryrefslogtreecommitdiff
path: root/arch/x86
diff options
context:
space:
mode:
authorBorislav Petkov <borislav.petkov@amd.com>2011-12-05 14:28:37 +0100
committerBorislav Petkov <borislav.petkov@amd.com>2011-12-05 14:28:37 +0100
commitce37defc0f6673f5ca2c92ed5cfcaf290ae7dd16 (patch)
treee662613f6ef4629ec8504502a87079c9b93117da /arch/x86
parentbd399063976c6c7a09beb4730ed1d93cadbcc739 (diff)
downloadlinux-3.10-ce37defc0f6673f5ca2c92ed5cfcaf290ae7dd16.tar.gz
linux-3.10-ce37defc0f6673f5ca2c92ed5cfcaf290ae7dd16.tar.bz2
linux-3.10-ce37defc0f6673f5ca2c92ed5cfcaf290ae7dd16.zip
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>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/include/asm/msr.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/x86/include/asm/msr.h b/arch/x86/include/asm/msr.h
index 084ef95274c..95203d40ffd 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; \