Skip to content

Commit 314ff52

Browse files
committed
sparc: Don't do expensive hypervisor PCR write unless necessary.
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>
1 parent 15e3608 commit 314ff52

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎arch/sparc/kernel/pcr.c‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,11 @@ static void n2_pcr_write(u64 val)
8080
{
8181
unsigned long ret;
8282

83-
ret = sun4v_niagara2_setperf(HV_N2_PERF_SPARC_CTL, val);
84-
if (ret != HV_EOK)
83+
if (val & PCR_N2_HTRACE) {
84+
ret = sun4v_niagara2_setperf(HV_N2_PERF_SPARC_CTL, val);
85+
if (ret != HV_EOK)
86+
write_pcr(val);
87+
} else
8588
write_pcr(val);
8689
}
8790

0 commit comments

Comments
 (0)