Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Xen: Devel

[PATCH RFC V6 0/5] kvm : Paravirt-spinlock support for KVM guests



Xen devel RSS feed   Index | Next | Previous | View Threaded

raghavendra.kt at linux

Apr 23, 2012, 2:59 AM

Post #1 of 1 (80 views)
[PATCH RFC V6 0/5] kvm : Paravirt-spinlock support for KVM guests

The 5-patch series to follow this email extends KVM-hypervisor and Linux guest
running on KVM-hypervisor to support pv-ticket spinlocks, based on Xen's

One hypercall is introduced in KVM hypervisor,that allows a vcpu to kick
another vcpu out of halt state.
The blocking of vcpu is done using halt() in (lock_spinning) slowpath.

Note: 1) patch is based on 3.4-rc3 + ticketlock patches in

[ The patches are targeted for 3.5 window ]

Changes in V6:
- Rebased to 3.4-rc3
- Removed debugfs changes patch which should now be in Xen/linux-next.
- Removed PV_UNHALT_MSR since currently we don't need guest communication,
and made pv_unhalt folded to GET_MP_STATE (Marcello, Avi[long back])
- Take jumplabel changes from Ingo/Jason into use (static_key_slow_inc usage)
- Added inline to spinlock_init in non PARAVIRT case
- Move arch specific code to arch/x86 and add stubs to other archs (Marcello)
- Added more comments on pv_unhalt usage etc (Marcello)

Changes in V5:
- rebased to 3.3-rc6
- added PV_UNHALT_MSR that would help in live migration (Avi)
- removed PV_LOCK_KICK vcpu request and pv_unhalt flag (re)added.
- Changed hypercall documentaion (Alex).
- mode_t changed to umode_t in debugfs.
- MSR related documentation added.
- host and guest patches not mixed. (Marcelo, Alex)
- kvm_kick_cpu now takes cpu so it can be used by flush_tlb_ipi_other
paravirtualization (Nikunj)
- coding style changes in variable declarion etc (Srikar)

Changes in V4:
- reabsed to 3.2.0 pre.
- use APIC ID for kicking the vcpu and use kvm_apic_match_dest for matching (Avi)
- fold vcpu->kicked flag into vcpu->requests (KVM_REQ_PVLOCK_KICK) and related
changes for UNHALT path to make pv ticket spinlock migration friendly(Avi, Marcello)
- Added Documentation for CPUID, Hypercall (KVM_HC_KICK_CPU)
and capabilty (KVM_CAP_PVLOCK_KICK) (Avi)
- Remove unneeded kvm_arch_vcpu_ioctl_set_mpstate call. (Marcello)
- cumulative variable type changed (int ==> u32) in add_stat (Konrad)
- remove unneeded kvm_guest_init for !CONFIG_KVM_GUEST case

Changes in V3:
- rebased to 3.2-rc1
- use halt() instead of wait for kick hypercall.
- modify kick hyper call to do wakeup halted vcpu.
- hook kvm_spinlock_init to smp_prepare_cpus call (moved the call out of head##.c).
- fix the potential race when zero_stat is read.
- export debugfs_create_32 and add documentation to API.
- use static inline and enum instead of ADDSTAT macro.
- add barrier() in after setting kick_vcpu.
- empty static inline function for kvm_spinlock_init.
- combine the patches one and two readuce overhead.
- make KVM_DEBUGFS depends on DEBUGFS.
- include debugfs header unconditionally.

Changes in V2:
- rebased patchesto -rc9
- synchronization related changes based on Jeremy's changes
(Jeremy Fitzhardinge <jeremy.fitzhardinge [at] citrix>) pointed by
Stephan Diestelhorst <stephan.diestelhorst [at] amd>
- enabling 32 bit guests
- splitted patches into two more chunks

results for PLE / non PLE machine were posted for V5 patches in

Current series is giving similar results but more formal results will
be posted in next couple of days.

Interestingly with current patchset I do not see CPU stalls observed in vanilla.

2) experiments on further optimization possibilities.
(discussed in V6 of ticketlock)
3) possible debugfs cleanups (combining common code of Xen/KVM)

Let me know if you have any sugestion/comments...
V5 kernel changes:
Qemu changes for V5:

V4 kernel changes:

Qemu changes for V4:
http://www.mail-archive.com/kvm [at] vger/msg66450.html

V3 kernel Changes:
V2 kernel changes :

Previous discussions : (posted by Srivatsa V).

Qemu patch for V3:

Srivatsa Vaddagiri (3):
Add a hypercall to KVM hypervisor to support pv-ticketlocks
Added configuration support to enable debug information for KVM Guests
pv-ticketlock support for linux guests running on KVM hypervisor

Raghavendra K T (2):
Fold pv_unhalt flag into GET_MP_STATE ioctl to aid migration
Add documentation on Hypercalls and features used for PV spinlock

Documentation/virtual/kvm/api.txt | 7 +
Documentation/virtual/kvm/cpuid.txt | 4 +
Documentation/virtual/kvm/hypercalls.txt | 59 +++++++
arch/ia64/include/asm/kvm_host.h | 3 +
arch/powerpc/include/asm/kvm_host.h | 4 +
arch/s390/include/asm/kvm_host.h | 4 +
arch/x86/Kconfig | 9 +
arch/x86/include/asm/kvm_host.h | 6 +
arch/x86/include/asm/kvm_para.h | 16 ++-
arch/x86/kernel/kvm.c | 254 ++++++++++++++++++++++++++++++
arch/x86/kvm/cpuid.c | 3 +-
arch/x86/kvm/x86.c | 46 ++++++-
include/linux/kvm.h | 1 +
include/linux/kvm_para.h | 1 +
virt/kvm/kvm_main.c | 8 +
15 files changed, 421 insertions(+), 4 deletions(-)

Xen-devel mailing list
Xen-devel [at] lists

Xen devel RSS feed   Index | Next | Previous | View Threaded

Interested in having your list archived? Contact Gossamer Threads
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.