[3.19.y-ckt stable] Patch "KVM: Provide function for VCPU lookup by id" has been added to staging queue

Kamal Mostafa kamal at canonical.com
Tue Dec 15 21:24:18 UTC 2015


This is a note to let you know that I have just added a patch titled

    KVM: Provide function for VCPU lookup by id

to the linux-3.19.y-queue branch of the 3.19.y-ckt extended stable tree 
which can be found at:

    http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-3.19.y-queue

This patch is scheduled to be released in version 3.19.8-ckt12.

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.19.y-ckt tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Kamal

------

>From 78418ec18f00f6addae53d096ae3f287fa91d66c Mon Sep 17 00:00:00 2001
From: David Hildenbrand <dahi at linux.vnet.ibm.com>
Date: Thu, 5 Nov 2015 09:03:50 +0100
Subject: KVM: Provide function for VCPU lookup by id

commit db27a7a37aa0b1f8b373f8b0fb72a2ccaafb85b7 upstream.

Let's provide a function to lookup a VCPU by id.

Reviewed-by: Christian Borntraeger <borntraeger at de.ibm.com>
Reviewed-by: Dominik Dingel <dingel at linux.vnet.ibm.com>
Signed-off-by: David Hildenbrand <dahi at linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger at de.ibm.com>
[split patch from refactoring patch]
[ kamal: 3.19-stable prereq for
  b85de33 KVM: s390: avoid memory overwrites on emergency signal injection ]
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
---
 include/linux/kvm_host.h | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 26f1060..c3aa8f4 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -438,6 +438,17 @@ static inline struct kvm_vcpu *kvm_get_vcpu(struct kvm *kvm, int i)
 	     (vcpup = kvm_get_vcpu(kvm, idx)) != NULL; \
 	     idx++)

+static inline struct kvm_vcpu *kvm_get_vcpu_by_id(struct kvm *kvm, int id)
+{
+	struct kvm_vcpu *vcpu;
+	int i;
+
+	kvm_for_each_vcpu(i, vcpu, kvm)
+		if (vcpu->vcpu_id == id)
+			return vcpu;
+	return NULL;
+}
+
 #define kvm_for_each_memslot(memslot, slots)	\
 	for (memslot = &slots->memslots[0];	\
 	      memslot < slots->memslots + KVM_MEM_SLOTS_NUM && memslot->npages;\
--
1.9.1





More information about the kernel-team mailing list