Skip to content

RFC KVM in-kernel PM Timer implementation

Ulrich Obergfell kvm 1 version In review

Get series with b4
b4 am 901746004.680841292328577685.JavaMail.root@zmail07.collab.prod.int.phx2.redhat.com

Versions newest first

  1. v1 RFC Latest4 patches 14 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4KVM in-kernel PM Timer implementation (experimental code part 1)arch/x86/include/asm/kvm_host.h arch/x86/kvm/Makefile arch/x86/kvm/i8254.c +2 more+192 -20 replies
2/4KVM in-kernel PM Timer implementation (experimental code part 2)arch/x86/include/asm/kvm.h arch/x86/kvm/x86.c include/linux/kvm.h+36 -00 replies
3/4KVM in-kernel PM Timer implementation (experimental code part 3)hw/acpi_piix4.c kvm/include/linux/kvm.h kvm/include/x86/asm/kvm.h +6 more+145 -50 replies
4/4KVM in-kernel PM Timer implementation (experimental code part 4)qemu-kvm.c qemu-kvm.h qemu-options.hx +1 more+38 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC 0/4] KVM in-kernel PM Timer implementation

Hi,

This is an RFC through which I would like to get feedback on how the idea of in-kernel PM Timer would be received.

The current implementation of PM Timer emulation is 'heavy-weight' because the code resides in qemu userspace. Guest operating systems that use PM Timer as a clock source (for example, older versions of Linux that do not have paravirtualized clock) would benefit from an in-kernel PM Timer emulation.

Parts 1 thru 4 of this RFC contain experimental source code which I recently used to investigate the performance benefit. In a Linux guest, I was running a program that calls gettimeofday() 'n' times in a loop (the PM Timer register is read during each call). With in-kernel PM Timer, I observed a significant reduction of program execution time.

The experimental code emulates the PM Timer register in KVM kernel. All other components of ACPI PM remain in qemu userspace. Also, the 'timer carry interrupt' feature is not implemented in-kernel. If a guest operating system needs to enable the 'timer carry interrupt', the code takes care that PM Timer emulation falls back to userspace. However, I think the design of the code has sufficient flexibility, so that anyone who would want to add the 'timer carry interrupt' feature in-kernel could try to do so later on.

Please review and please comment.

Regards,

Uli Obergfell