linux/arch/mips/kvm
James Hogan f4474d50c7 KVM: MIPS/VZ: Support hardware guest timer
Transfer timer state to the VZ guest context (CP0_GTOffset & guest
CP0_Count) when entering guest mode, enabling direct guest access to it,
and transfer back to soft timer when saving guest register state.

This usually allows guest code to directly read CP0_Count (via MFC0 and
RDHWR) and read/write CP0_Compare, without trapping to the hypervisor
for it to emulate the guest timer. Writing to CP0_Count or CP0_Cause.DC
is much less common and still triggers a hypervisor GPSI exception, in
which case the timer state is transferred back to an hrtimer before
emulating the write.

We are careful to prevent small amounts of drift from building up due to
undeterministic time intervals between reading of the ktime and reading
of CP0_Count. Some drift is expected however, since the system
clocksource may use a different timer to the local CP0_Count timer used
by VZ. This is permitted to prevent guest CP0_Count from appearing to go
backwards.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Radim Krčmář" <rkrcmar@redhat.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Cc: kvm@vger.kernel.org
2017-03-28 14:53:59 +01:00
..
00README.txt
callback.c MIPS: KVM: Convert EXPORT_SYMBOL to _GPL 2016-01-24 03:13:24 +01:00
commpage.c MIPS: kvm: Audit and remove any unnecessary uses of module.h 2016-10-05 01:31:20 +02:00
commpage.h
dyntrans.c KVM: MIPS/T&E: Use lockless GVA helpers for dyntrans 2017-02-03 15:21:12 +00:00
emulate.c KVM: MIPS/VZ: Support hardware guest timer 2017-03-28 14:53:59 +01:00
entry.c KVM: MIPS/Entry: Update entry code to support VZ 2017-03-28 14:53:51 +01:00
fpu.S MIPS: KVM: Fix fpu.S misassembly with r6 2016-07-05 16:09:11 +02:00
hypcall.c KVM: MIPS: Implement HYPCALL emulation 2017-03-28 14:53:33 +01:00
interrupt.c KVM: MIPS/T&E: Implement CP0_EBase register 2017-02-03 15:21:30 +00:00
interrupt.h KVM: MIPS: Implement VZ support 2017-03-28 14:53:54 +01:00
Kconfig KVM: MIPS: Add VZ support to build system 2017-03-28 14:53:54 +01:00
Makefile KVM: MIPS: Add VZ support to build system 2017-03-28 14:53:54 +01:00
mips.c KVM: MIPS/VZ: Support hardware guest timer 2017-03-28 14:53:59 +01:00
mmu.c KVM: MIPS: Implement VZ support 2017-03-28 14:53:54 +01:00
msa.S
stats.c MIPS: KVM: Clean up kvm_exit trace event 2016-06-14 11:16:23 +02:00
tlb.c KVM: MIPS: Implement VZ support 2017-03-28 14:53:54 +01:00
trace.h KVM: MIPS/VZ: Emulate MAARs when necessary 2017-03-28 14:53:58 +01:00
trap_emul.c KVM: MIPS: Abstract guest CP0 register access for VZ 2017-03-28 14:53:50 +01:00
vz.c KVM: MIPS/VZ: Support hardware guest timer 2017-03-28 14:53:59 +01:00