KVM: PPC: Use exported tb_to_ns() function in decrementer emulation
authorPaul Mackerras <paulus@ozlabs.org>
Sat, 20 Oct 2018 09:54:55 +0000 (20:54 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 26 Oct 2018 10:58:58 +0000 (21:58 +1100)
commitc43befca86ae35cc82bd889484bd179bff27b6c6
tree6d7fbe589a4e02747707b49dc081984f9e1106f4
parent772b039fd9a7e12d5fc80e6f649341934ad51fbe
KVM: PPC: Use exported tb_to_ns() function in decrementer emulation

This changes the KVM code that emulates the decrementer function to do
the conversion of decrementer values to time intervals in nanoseconds
by calling the tb_to_ns() function exported by the powerpc timer code,
in preference to open-coded arithmetic using values from the
decrementer_clockevent struct.  Similarly, the HV-KVM code that did
the same conversion using arithmetic on tb_ticks_per_sec also now
uses tb_to_ns().

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kvm/book3s_hv.c
arch/powerpc/kvm/emulate.c