summaryrefslogtreecommitdiffstats
path: root/include/kvm
diff options
context:
space:
mode:
authorChristoffer Dall <christoffer.dall@linaro.org>2016-05-18 16:26:00 +0100
committerChristoffer Dall <christoffer.dall@linaro.org>2016-05-20 15:39:41 +0200
commit41a54482c010d8806cf56e1501bb3b61fac14cf9 (patch)
treee8b452eddf3b83137d4a771e687deee289c422d5 /include/kvm
parentc8eb3f6b9bc31abc0ab3230737fde1639c8b1ea6 (diff)
downloadop-kernel-dev-41a54482c010d8806cf56e1501bb3b61fac14cf9.zip
op-kernel-dev-41a54482c010d8806cf56e1501bb3b61fac14cf9.tar.gz
KVM: arm/arm64: Move timer IRQ map to latest possible time
We are about to modify the VGIC to allocate all data structures dynamically and store mapped IRQ information on a per-IRQ struct, which is indeed allocated dynamically at init time. Therefore, we cannot record the mapped IRQ info from the timer at timer reset time like it's done now, because VCPU reset happens before timer init. A possible later time to do this is on the first run of a per VCPU, it just requires us to move the enable state to be a per-VCPU state and do the lookup of the physical IRQ number when we are about to run the VCPU. Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Diffstat (limited to 'include/kvm')
-rw-r--r--include/kvm/arm_arch_timer.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/kvm/arm_arch_timer.h b/include/kvm/arm_arch_timer.h
index a47b7de..dda39d8 100644
--- a/include/kvm/arm_arch_timer.h
+++ b/include/kvm/arm_arch_timer.h
@@ -24,9 +24,6 @@
#include <linux/workqueue.h>
struct arch_timer_kvm {
- /* Is the timer enabled */
- bool enabled;
-
/* Virtual offset */
cycle_t cntvoff;
};
@@ -55,10 +52,13 @@ struct arch_timer_cpu {
/* Active IRQ state caching */
bool active_cleared_last;
+
+ /* Is the timer enabled */
+ bool enabled;
};
int kvm_timer_hyp_init(void);
-void kvm_timer_enable(struct kvm *kvm);
+int kvm_timer_enable(struct kvm_vcpu *vcpu);
void kvm_timer_init(struct kvm *kvm);
int kvm_timer_vcpu_reset(struct kvm_vcpu *vcpu,
const struct kvm_irq_level *irq);
OpenPOWER on IntegriCloud