Commit 7aa62645 authored by David S. Miller's avatar David S. Miller

[SPARC64]: Do not try to write to %tick or %stick on SUN4V.

Writes by privileged code are disallowed.  The hypervisor manages
the non-privileged bit.
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b5a37e96
...@@ -193,16 +193,22 @@ struct sparc64_tick_ops *tick_ops __read_mostly = &tick_operations; ...@@ -193,16 +193,22 @@ struct sparc64_tick_ops *tick_ops __read_mostly = &tick_operations;
static void stick_init_tick(unsigned long offset) static void stick_init_tick(unsigned long offset)
{ {
tick_disable_protection(); /* Writes to the %tick and %stick register are not
* allowed on sun4v. The Hypervisor controls that
/* Let the user get at STICK too. */ * bit, per-strand.
__asm__ __volatile__( */
" rd %%asr24, %%g2\n" if (tlb_type != hypervisor) {
" andn %%g2, %0, %%g2\n" tick_disable_protection();
" wr %%g2, 0, %%asr24"
: /* no outputs */ /* Let the user get at STICK too. */
: "r" (TICK_PRIV_BIT) __asm__ __volatile__(
: "g1", "g2"); " rd %%asr24, %%g2\n"
" andn %%g2, %0, %%g2\n"
" wr %%g2, 0, %%asr24"
: /* no outputs */
: "r" (TICK_PRIV_BIT)
: "g1", "g2");
}
__asm__ __volatile__( __asm__ __volatile__(
" rd %%asr24, %%g1\n" " rd %%asr24, %%g1\n"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment