Skip to content

Commit

Permalink
[SPARC64]: Do not try to write to %tick or %stick on SUN4V.
Browse files Browse the repository at this point in the history
Writes by privileged code are disallowed.  The hypervisor manages
the non-privileged bit.

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Mar 20, 2006
1 parent b5a37e9 commit 7aa6264
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions arch/sparc64/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,16 +193,22 @@ struct sparc64_tick_ops *tick_ops __read_mostly = &tick_operations;

static void stick_init_tick(unsigned long offset)
{
tick_disable_protection();

/* Let the user get at STICK too. */
__asm__ __volatile__(
" rd %%asr24, %%g2\n"
" andn %%g2, %0, %%g2\n"
" wr %%g2, 0, %%asr24"
: /* no outputs */
: "r" (TICK_PRIV_BIT)
: "g1", "g2");
/* Writes to the %tick and %stick register are not
* allowed on sun4v. The Hypervisor controls that
* bit, per-strand.
*/
if (tlb_type != hypervisor) {
tick_disable_protection();

/* Let the user get at STICK too. */
__asm__ __volatile__(
" rd %%asr24, %%g2\n"
" andn %%g2, %0, %%g2\n"
" wr %%g2, 0, %%asr24"
: /* no outputs */
: "r" (TICK_PRIV_BIT)
: "g1", "g2");
}

__asm__ __volatile__(
" rd %%asr24, %%g1\n"
Expand Down

0 comments on commit 7aa6264

Please sign in to comment.