diff options
author | Nicholas Piggin <npiggin@gmail.com> | 2021-11-23 19:51:42 +1000 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2021-11-24 21:08:56 +1100 |
commit | 4ebbd075bcde7884e078d4360510b989f559bfec (patch) | |
tree | b4c0e43a6125510b84d4e7efcde674a527ff0ae5 /arch/powerpc/include/asm/time.h | |
parent | 5955c7469a73033f607ebd6d418058943fe13dd3 (diff) | |
download | linux-4ebbd075bcde7884e078d4360510b989f559bfec.tar.bz2 |
KVM: PPC: Book3S HV P9: Use host timer accounting to avoid decrementer read
There is no need to save away the host DEC value, as it is derived
from the host timer subsystem which maintains the next timer time,
so it can be restored from there.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20211123095231.1036501-5-npiggin@gmail.com
Diffstat (limited to 'arch/powerpc/include/asm/time.h')
-rw-r--r-- | arch/powerpc/include/asm/time.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/time.h b/arch/powerpc/include/asm/time.h index 8c2c3dd4ddba..fd09b4797fd7 100644 --- a/arch/powerpc/include/asm/time.h +++ b/arch/powerpc/include/asm/time.h @@ -111,6 +111,11 @@ static inline unsigned long test_irq_work_pending(void) DECLARE_PER_CPU(u64, decrementers_next_tb); +static inline u64 timer_get_next_tb(void) +{ + return __this_cpu_read(decrementers_next_tb); +} + /* Convert timebase ticks to nanoseconds */ unsigned long long tb_to_ns(unsigned long long tb_ticks); |