All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/6] sparc: Don't do expensive hypervisor PCR write unless
@ 2011-07-28  8:44 David Miller
  0 siblings, 0 replies; only message in thread
From: David Miller @ 2011-07-28  8:44 UTC (permalink / raw)
  To: sparclinux


The hypervisor call is only necessary if hypervisor events are
being requested.

So if we're not tracking hypervisor events, simply do a direct
register write.

Signed-off-by: David S. Miller <davem@davemloft.net>
---
 arch/sparc/kernel/pcr.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/sparc/kernel/pcr.c b/arch/sparc/kernel/pcr.c
index 8ac23e6..878c682 100644
--- a/arch/sparc/kernel/pcr.c
+++ b/arch/sparc/kernel/pcr.c
@@ -80,8 +80,11 @@ static void n2_pcr_write(u64 val)
 {
 	unsigned long ret;
 
-	ret = sun4v_niagara2_setperf(HV_N2_PERF_SPARC_CTL, val);
-	if (ret != HV_EOK)
+	if (val & PCR_N2_HTRACE) {
+		ret = sun4v_niagara2_setperf(HV_N2_PERF_SPARC_CTL, val);
+		if (ret != HV_EOK)
+			write_pcr(val);
+	} else
 		write_pcr(val);
 }
 
-- 
1.7.2.5


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-07-28  8:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-28  8:44 [PATCH 3/6] sparc: Don't do expensive hypervisor PCR write unless David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.