diff options
| author | Gleb Natapov <gleb@redhat.com> | 2013-06-27 02:50:33 -0400 |
|---|---|---|
| committer | Gleb Natapov <gleb@redhat.com> | 2013-06-27 07:20:54 -0400 |
| commit | 96f7edf9a54ca834f030ddf30f91750b3d737a03 (patch) | |
| tree | e5761ffd63f8a4c8a125953073cf0f44d09707e7 /virt | |
| parent | 24f7bb52e952912b6a936ebcdc4e744b03e9e5cf (diff) | |
| parent | 8bd4ffd6b3a98f00267051dc095076ea2ff06ea8 (diff) | |
Merge git://git.linaro.org/people/cdall/linux-kvm-arm.git tags/kvm-arm-3.11 into queue
KVM/ARM pull request for 3.11 merge window
* tag 'kvm-arm-3.11' of git://git.linaro.org/people/cdall/linux-kvm-arm.git:
ARM: kvm: don't include drivers/virtio/Kconfig
Update MAINTAINERS: KVM/ARM work now funded by Linaro
arm/kvm: Cleanup KVM_ARM_MAX_VCPUS logic
ARM: KVM: clear exclusive monitor on all exception returns
ARM: KVM: add missing dsb before invalidating Stage-2 TLBs
ARM: KVM: perform save/restore of PAR
ARM: KVM: get rid of S2_PGD_SIZE
ARM: KVM: don't special case PC when doing an MMIO
ARM: KVM: use phys_addr_t instead of unsigned long long for HYP PGDs
ARM: KVM: remove dead prototype for __kvm_tlb_flush_vmid
ARM: KVM: Don't handle PSCI calls via SMC
ARM: KVM: Allow host virt timer irq to be different from guest timer virt irq
Diffstat (limited to 'virt')
| -rw-r--r-- | virt/kvm/arm/arch_timer.c | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/virt/kvm/arm/arch_timer.c b/virt/kvm/arm/arch_timer.c index 2d00b2925780..af4583e2c185 100644 --- a/virt/kvm/arm/arch_timer.c +++ b/virt/kvm/arm/arch_timer.c | |||
| @@ -30,9 +30,7 @@ | |||
| 30 | 30 | ||
| 31 | static struct timecounter *timecounter; | 31 | static struct timecounter *timecounter; |
| 32 | static struct workqueue_struct *wqueue; | 32 | static struct workqueue_struct *wqueue; |
| 33 | static struct kvm_irq_level timer_irq = { | 33 | static unsigned int host_vtimer_irq; |
| 34 | .level = 1, | ||
| 35 | }; | ||
| 36 | 34 | ||
| 37 | static cycle_t kvm_phys_timer_read(void) | 35 | static cycle_t kvm_phys_timer_read(void) |
| 38 | { | 36 | { |
| @@ -67,8 +65,8 @@ static void kvm_timer_inject_irq(struct kvm_vcpu *vcpu) | |||
| 67 | 65 | ||
| 68 | timer->cntv_ctl |= ARCH_TIMER_CTRL_IT_MASK; | 66 | timer->cntv_ctl |= ARCH_TIMER_CTRL_IT_MASK; |
| 69 | kvm_vgic_inject_irq(vcpu->kvm, vcpu->vcpu_id, | 67 | kvm_vgic_inject_irq(vcpu->kvm, vcpu->vcpu_id, |
| 70 | vcpu->arch.timer_cpu.irq->irq, | 68 | timer->irq->irq, |
| 71 | vcpu->arch.timer_cpu.irq->level); | 69 | timer->irq->level); |
| 72 | } | 70 | } |
| 73 | 71 | ||
| 74 | static irqreturn_t kvm_arch_timer_handler(int irq, void *dev_id) | 72 | static irqreturn_t kvm_arch_timer_handler(int irq, void *dev_id) |
| @@ -156,6 +154,20 @@ void kvm_timer_sync_hwstate(struct kvm_vcpu *vcpu) | |||
| 156 | timer_arm(timer, ns); | 154 | timer_arm(timer, ns); |
| 157 | } | 155 | } |
| 158 | 156 | ||
| 157 | void kvm_timer_vcpu_reset(struct kvm_vcpu *vcpu, | ||
| 158 | const struct kvm_irq_level *irq) | ||
| 159 | { | ||
| 160 | struct arch_timer_cpu *timer = &vcpu->arch.timer_cpu; | ||
| 161 | |||
| 162 | /* | ||
| 163 | * The vcpu timer irq number cannot be determined in | ||
| 164 | * kvm_timer_vcpu_init() because it is called much before | ||
| 165 | * kvm_vcpu_set_target(). To handle this, we determine | ||
| 166 | * vcpu timer irq number when the vcpu is reset. | ||
| 167 | */ | ||
| 168 | timer->irq = irq; | ||
| 169 | } | ||
| 170 | |||
| 159 | void kvm_timer_vcpu_init(struct kvm_vcpu *vcpu) | 171 | void kvm_timer_vcpu_init(struct kvm_vcpu *vcpu) |
| 160 | { | 172 | { |
| 161 | struct arch_timer_cpu *timer = &vcpu->arch.timer_cpu; | 173 | struct arch_timer_cpu *timer = &vcpu->arch.timer_cpu; |
| @@ -163,12 +175,11 @@ void kvm_timer_vcpu_init(struct kvm_vcpu *vcpu) | |||
| 163 | INIT_WORK(&timer->expired, kvm_timer_inject_irq_work); | 175 | INIT_WORK(&timer->expired, kvm_timer_inject_irq_work); |
| 164 | hrtimer_init(&timer->timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS); | 176 | hrtimer_init(&timer->timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS); |
| 165 | timer->timer.function = kvm_timer_expire; | 177 | timer->timer.function = kvm_timer_expire; |
| 166 | timer->irq = &timer_irq; | ||
| 167 | } | 178 | } |
| 168 | 179 | ||
| 169 | static void kvm_timer_init_interrupt(void *info) | 180 | static void kvm_timer_init_interrupt(void *info) |
| 170 | { | 181 | { |
| 171 | enable_percpu_irq(timer_irq.irq, 0); | 182 | enable_percpu_irq(host_vtimer_irq, 0); |
| 172 | } | 183 | } |
| 173 | 184 | ||
| 174 | 185 | ||
| @@ -182,7 +193,7 @@ static int kvm_timer_cpu_notify(struct notifier_block *self, | |||
| 182 | break; | 193 | break; |
| 183 | case CPU_DYING: | 194 | case CPU_DYING: |
| 184 | case CPU_DYING_FROZEN: | 195 | case CPU_DYING_FROZEN: |
| 185 | disable_percpu_irq(timer_irq.irq); | 196 | disable_percpu_irq(host_vtimer_irq); |
| 186 | break; | 197 | break; |
| 187 | } | 198 | } |
| 188 | 199 | ||
| @@ -229,7 +240,7 @@ int kvm_timer_hyp_init(void) | |||
| 229 | goto out; | 240 | goto out; |
| 230 | } | 241 | } |
| 231 | 242 | ||
| 232 | timer_irq.irq = ppi; | 243 | host_vtimer_irq = ppi; |
| 233 | 244 | ||
| 234 | err = register_cpu_notifier(&kvm_timer_cpu_nb); | 245 | err = register_cpu_notifier(&kvm_timer_cpu_nb); |
| 235 | if (err) { | 246 | if (err) { |
