summaryrefslogtreecommitdiffstats
path: root/arch/arm/kvm
diff options
context:
space:
mode:
authorChristoffer Dall <christoffer.dall@linaro.org>2017-02-01 12:51:52 +0100
committerChristoffer Dall <cdall@linaro.org>2017-04-09 07:49:39 -0700
commit3dbbdf78636e66094d82c4df496c54ff6ae46e31 (patch)
tree968dce0cdf805eda9e658abfc6186748666c5f63 /arch/arm/kvm
parentd9e1397783765a275c3a7930250dcdb7e9480d7d (diff)
downloadop-kernel-dev-3dbbdf78636e66094d82c4df496c54ff6ae46e31.zip
op-kernel-dev-3dbbdf78636e66094d82c4df496c54ff6ae46e31.tar.gz
KVM: arm/arm64: Report PMU overflow interrupts to userspace irqchip
When not using an in-kernel VGIC, but instead emulating an interrupt controller in userspace, we should report the PMU overflow status to that userspace interrupt controller using the KVM_CAP_ARM_USER_IRQ feature. Reviewed-by: Alexander Graf <agraf@suse.de> Reviewed-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Diffstat (limited to 'arch/arm/kvm')
-rw-r--r--arch/arm/kvm/arm.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
index ac6e57b..9eda293 100644
--- a/arch/arm/kvm/arm.c
+++ b/arch/arm/kvm/arm.c
@@ -635,11 +635,13 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run)
/*
* If we have a singal pending, or need to notify a userspace
- * irqchip about timer level changes, then we exit (and update
- * the timer level state in kvm_timer_update_run below).
+ * irqchip about timer or PMU level changes, then we exit (and
+ * update the timer level state in kvm_timer_update_run
+ * below).
*/
if (signal_pending(current) ||
- kvm_timer_should_notify_user(vcpu)) {
+ kvm_timer_should_notify_user(vcpu) ||
+ kvm_pmu_should_notify_user(vcpu)) {
ret = -EINTR;
run->exit_reason = KVM_EXIT_INTR;
}
@@ -712,7 +714,10 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run)
}
/* Tell userspace about in-kernel device output levels */
- kvm_timer_update_run(vcpu);
+ if (unlikely(!irqchip_in_kernel(vcpu->kvm))) {
+ kvm_timer_update_run(vcpu);
+ kvm_pmu_update_run(vcpu);
+ }
if (vcpu->sigset_active)
sigprocmask(SIG_SETMASK, &sigsaved, NULL);
OpenPOWER on IntegriCloud