Skip to content

Commit

Permalink
x86: Document rdmsr_safe restrictions
Browse files Browse the repository at this point in the history
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/[email protected]
Signed-off-by: Borislav Petkov <[email protected]>
  • Loading branch information
Borislav Petkov committed Dec 5, 2011
1 parent bd39906 commit ce37def
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion arch/x86/include/asm/msr.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; \
Expand Down

0 comments on commit ce37def

Please sign in to comment.