summaryrefslogtreecommitdiffstats
path: root/virt/kvm
diff options
context:
space:
mode:
authorFeng Wu2015-09-18 16:29:55 +0200
committerPaolo Bonzini2015-10-01 15:06:53 +0200
commitbf9f6ac8d74969690df1485b33b7c238ca9f2269 (patch)
treecfaa21f2831d959dca9bdb4c4ad9e329fec4d5e8 /virt/kvm
parentKVM: Update Posted-Interrupts Descriptor when vCPU is preempted (diff)
downloadkernel-qcow2-linux-bf9f6ac8d74969690df1485b33b7c238ca9f2269.tar.gz
kernel-qcow2-linux-bf9f6ac8d74969690df1485b33b7c238ca9f2269.tar.xz
kernel-qcow2-linux-bf9f6ac8d74969690df1485b33b7c238ca9f2269.zip
KVM: Update Posted-Interrupts Descriptor when vCPU is blocked
This patch updates the Posted-Interrupts Descriptor when vCPU is blocked. pre-block: - Add the vCPU to the blocked per-CPU list - Set 'NV' to POSTED_INTR_WAKEUP_VECTOR post-block: - Remove the vCPU from the per-CPU list Signed-off-by: Feng Wu <feng.wu@intel.com> [Concentrate invocation of pre/post-block hooks to vcpu_block. - Paolo] Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'virt/kvm')
-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 afd7ae6aec65..a75502c93c3e 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -230,6 +230,9 @@ int kvm_vcpu_init(struct kvm_vcpu *vcpu, struct kvm *kvm, unsigned id)
init_waitqueue_head(&vcpu->wq);
kvm_async_pf_vcpu_init(vcpu);
+ vcpu->pre_pcpu = -1;
+ INIT_LIST_HEAD(&vcpu->blocked_vcpu_list);
+
page = alloc_page(GFP_KERNEL | __GFP_ZERO);
if (!page) {
r = -ENOMEM;