Patchwork [V2,1/1] QEMU kvm/i386 : Adding PVLOCK_KICK capability support in i386 target.

login
register
mail settings
Submitter Raghavendra K T
Date Jan. 15, 2012, 11:51 a.m.
Message ID <20120115115126.13397.49750.sendpatchset@oc5400248562.ibm.com>
Download mbox | patch
Permalink /patch/136203/
State New
Headers show

Comments

Raghavendra K T - Jan. 15, 2012, 11:51 a.m.
From: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>

The patch, extends KVM-hypervisor and Linux guest running on
KVM-hypervisor to support pv-ticket spinlocks.

PV ticket spinlock helps to solve Lock Holder Preemption problem discussed in
http://www.amd64.org/fileadmin/user_upload/pub/LHP-commented_slides.pdf.

When spinlock is contended,a guest vcpu relinqueshes cpu by halt().
Correspondingly, One hypercall is introduced in KVM hypervisor,that allows
a vcpu to kick the halted vcpu to continue with execution.

Note:
Below patch should be applied only after corresponding
linux-header changes taken into qemu via scripts/update-linux-headers.sh script.

TODO: There was a discussion on changing cpuid stuff, paravirt and non-paravirt
stuff to address backward compatibility/feature support with Avi and Jan.
But it is not addressed yet.

Changes in V2:
 Drop the syncing kernel header changes. (Alex) 
 rename KICK_VCPU --> PVLOCK_KICK.

Change log:
 Extend the KVM Hypervisor to enable PVLOCK_KICK feature that allows
a vcpu to kick the halted vcpu to continue with execution in PV ticket
spinlock.

Signed-off-by: Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>
Signed-off-by: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
---
The corresponding kernel patch is available in the thread
 https://lkml.org/lkml/2012/1/14/66

older kernel patch:
 https://lkml.org/lkml/2011/11/30/62
older qemu-patch:
 http://lists.gnu.org/archive/html/qemu-devel/2011-12/msg00397.html

Patch

diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index 04e65c5..14de1c0 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -97,6 +97,7 @@  struct kvm_para_features {
     { KVM_CAP_NOP_IO_DELAY, KVM_FEATURE_NOP_IO_DELAY },
     { KVM_CAP_PV_MMU, KVM_FEATURE_MMU_OP },
     { KVM_CAP_ASYNC_PF, KVM_FEATURE_ASYNC_PF },
+    { KVM_CAP_PVLOCK_KICK, KVM_FEATURE_PVLOCK_KICK },
     { -1, -1 }
 };