summaryrefslogtreecommitdiffstats
path: root/virt
diff options
context:
space:
mode:
authorChristoffer Dall <christoffer.dall@linaro.org>2015-08-27 10:41:15 -0400
committerChristoffer Dall <christoffer.dall@linaro.org>2015-10-22 17:01:41 -0400
commit3217f7c25bca66eed9b07f0b8bfd1937169b0736 (patch)
tree560fff562044ed7bed3f3ee0e1d1ce91e708d180 /virt
parent0d997491f814c87310a6ad7be30a9049c7150489 (diff)
KVM: Add kvm_arch_vcpu_{un}blocking callbacks
Some times it is useful for architecture implementations of KVM to know when the VCPU thread is about to block or when it comes back from blocking (arm/arm64 needs to know this to properly implement timers, for example). Therefore provide a generic architecture callback function in line with what we do elsewhere for KVM generic-arch interactions. Reviewed-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Diffstat (limited to 'virt')
-rw-r--r--virt/kvm/kvm_main.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 8db1d9361993..7873d6daccb1 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -2018,6 +2018,8 @@ void kvm_vcpu_block(struct kvm_vcpu *vcpu)
2018 } while (single_task_running() && ktime_before(cur, stop)); 2018 } while (single_task_running() && ktime_before(cur, stop));
2019 } 2019 }
2020 2020
2021 kvm_arch_vcpu_blocking(vcpu);
2022
2021 for (;;) { 2023 for (;;) {
2022 prepare_to_wait(&vcpu->wq, &wait, TASK_INTERRUPTIBLE); 2024 prepare_to_wait(&vcpu->wq, &wait, TASK_INTERRUPTIBLE);
2023 2025
@@ -2031,6 +2033,7 @@ void kvm_vcpu_block(struct kvm_vcpu *vcpu)
2031 finish_wait(&vcpu->wq, &wait); 2033 finish_wait(&vcpu->wq, &wait);
2032 cur = ktime_get(); 2034 cur = ktime_get();
2033 2035
2036 kvm_arch_vcpu_unblocking(vcpu);
2034out: 2037out:
2035 block_ns = ktime_to_ns(cur) - ktime_to_ns(start); 2038 block_ns = ktime_to_ns(cur) - ktime_to_ns(start);
2036 2039