KVM: PPC: booke: Improve timer register emulation
authorScott Wood <scottwood@freescale.com>
Thu, 17 Nov 2011 12:39:59 +0000 (12:39 +0000)
committerAvi Kivity <avi@redhat.com>
Mon, 5 Mar 2012 12:52:27 +0000 (14:52 +0200)
commitdfd4d47e9a71c5a35eb67a44cd311efbe1846b7e
tree1115128a884dabf7d853466b82c553561e4f7b27
parentb59049720dd95021dfe0d9f4e1fa9458a67cfe29
KVM: PPC: booke: Improve timer register emulation

Decrementers are now properly driven by TCR/TSR, and the guest
has full read/write access to these registers.

The decrementer keeps ticking (and setting the TSR bit) regardless of
whether the interrupts are enabled with TCR.

The decrementer stops at zero, rather than going negative.

Decrementers (and FITs, once implemented) are delivered as
level-triggered interrupts -- dequeued when the TSR bit is cleared, not
on delivery.

Signed-off-by: Liu Yu <yu.liu@freescale.com>
[scottwood@freescale.com: significant changes]
Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/powerpc/include/asm/kvm_host.h
arch/powerpc/include/asm/kvm_ppc.h
arch/powerpc/kvm/book3s.c
arch/powerpc/kvm/booke.c
arch/powerpc/kvm/booke.h
arch/powerpc/kvm/booke_emulate.c
arch/powerpc/kvm/emulate.c
arch/powerpc/kvm/powerpc.c