diff options
author | David S. Miller <davem@davemloft.net> | 2011-07-27 20:46:25 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-08-15 18:31:40 -0700 |
commit | ce840177aaadf72f7d0fc7619bcbc12e4e8129bf (patch) | |
tree | dc9544a4551147f0a69c12ac6e84fa740d1fd438 /arch | |
parent | 7cc3d70509d05b40ae926b8f6c886abab7ace827 (diff) |
sparc: Don't do expensive hypervisor PCR write unless necessary.
[ Upstream commit 314ff52727fe94dfbe07f3a9a489ab3ca8d8df5a ]
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'arch')
-rw-r--r-- | 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 8ac23e66008..878c6824c73 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); } |