From patchwork Sun Jan 15 11:51:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raghavendra K T X-Patchwork-Id: 136203 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A4279B6F6F for ; Mon, 16 Jan 2012 05:57:04 +1100 (EST) Received: from localhost ([::1]:50038 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RmVGI-0006Ep-Pw for incoming@patchwork.ozlabs.org; Sun, 15 Jan 2012 13:57:02 -0500 Received: from eggs.gnu.org ([140.186.70.92]:58806) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RmOck-0000Di-Mj for qemu-devel@nongnu.org; Sun, 15 Jan 2012 06:51:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RmOcj-0002H7-9L for qemu-devel@nongnu.org; Sun, 15 Jan 2012 06:51:46 -0500 Received: from e28smtp02.in.ibm.com ([122.248.162.2]:60889) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RmOci-0002GV-Lx for qemu-devel@nongnu.org; Sun, 15 Jan 2012 06:51:45 -0500 Received: from /spool/local by e28smtp02.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 15 Jan 2012 17:21:36 +0530 Received: from d28relay03.in.ibm.com (9.184.220.60) by e28smtp02.in.ibm.com (192.168.1.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sun, 15 Jan 2012 17:21:28 +0530 Received: from d28av01.in.ibm.com (d28av01.in.ibm.com [9.184.220.63]) by d28relay03.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q0FBpQuI2637892 for ; Sun, 15 Jan 2012 17:21:28 +0530 Received: from d28av01.in.ibm.com (loopback [127.0.0.1]) by d28av01.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q0FBpQ3p005447 for ; Sun, 15 Jan 2012 17:21:26 +0530 Received: from oc5400248562.ibm.com ([9.79.194.223]) by d28av01.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q0FBpNgb005432; Sun, 15 Jan 2012 17:21:25 +0530 From: Raghavendra K T To: Anthony Liguori , Alexander Graf , Qemu-devel , KVM , Marcelo Tosatti , Avi Kivity , Jan Kiszka Date: Sun, 15 Jan 2012 17:21:27 +0530 Message-Id: <20120115115126.13397.49750.sendpatchset@oc5400248562.ibm.com> x-cbid: 12011511-5816-0000-0000-000000DD260F X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 122.248.162.2 X-Mailman-Approved-At: Sun, 15 Jan 2012 13:56:57 -0500 Cc: Raghavendra K T , Suzuki Poulose , Srivatsa Vaddagiri Subject: [Qemu-devel] [PATCH V2 1/1] QEMU kvm/i386 : Adding PVLOCK_KICK capability support in i386 target. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Raghavendra K T 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 Signed-off-by: Raghavendra K T --- 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 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 } };