Skip to content

Commit

Permalink
chmc: Mark %ver register inline asm with __volatile__
Browse files Browse the repository at this point in the history
Otherwise GCC can try to do the register read before the guarding test
on us3mc_platform() being true.

If that happens we can take an exception, because %ver register reads
are not allowed in privileged more on hypervisor platforms.

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Oct 13, 2008
1 parent 82960b8 commit 615c913
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/sparc64/kernel/chmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ static int __init us3mc_init(void)
if (!us3mc_platform())
return -ENODEV;

__asm__ ("rdpr %%ver, %0" : "=r" (ver));
__asm__ __volatile__("rdpr %%ver, %0" : "=r" (ver));
if ((ver >> 32UL) == __JALAPENO_ID ||
(ver >> 32UL) == __SERRANO_ID) {
mc_type = MC_TYPE_JBUS;
Expand Down

0 comments on commit 615c913

Please sign in to comment.