From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeremy Fitzhardinge Subject: Re: [PATCH RFC V4 4/5] kvm : pv-ticketlocks support for linux guests running on KVM hypervisor Date: Thu, 19 Jan 2012 08:52:15 +1100 Message-ID: <4F173F0F.5020604@goop.org> References: <20120114182501.8604.68416.sendpatchset@oc5400248562.ibm.com> <20120114182645.8604.68884.sendpatchset@oc5400248562.ibm.com> <20120117110210.GA17420@amt.cnet> <20120117113312.GB30398@linux.vnet.ibm.com> <4F1621B2.3020203@goop.org> <20120118135445.GB25711@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: X86 , linux-doc@vger.kernel.org, Peter Zijlstra , Jan Kiszka , Virtualization , Paul Mackerras , "H. Peter Anvin" , Stefano Stabellini , Xen , Dave Jiang , KVM , Glauber Costa , Raghavendra K T , Ingo Molnar , Avi Kivity , Rik van Riel , Konrad Rzeszutek Wilk , Greg Kroah-Hartman , Sasha Levin , Sedat Dilek , Thomas Gleixner , LKML , Dave Hansen , Suzuki Poulose < To: Srivatsa Vaddagiri Return-path: In-Reply-To: <20120118135445.GB25711@linux.vnet.ibm.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org List-Id: kvm.vger.kernel.org On 01/19/2012 12:54 AM, Srivatsa Vaddagiri wrote: > >> That logic relies on the "kick" being level triggered, so that "kick" >> before "block" will cause the block to fall out immediately. If you're >> using "hlt" as the block and it has the usual edge-triggered behaviour, >> what stops a "kick-before-hlt" from losing the kick? > Hmm ..'hlt' should result in a check for kick request (in hypervisor > context) before vcpu is put to sleep. IOW vcpu1 that is attempting to kick vcpu0 > will set a 'somebody_tried_kicking_vcpu0' flag, which hypervisor should check > before it puts vcpu0 to sleep because of trapped 'hlt' instruction. > > Won't that trap the 'kick-before-hlt' case? What am I missing here? Nothing, that sounds fine. It wasn't clear to me that your kick operation left persistent state, and so has a level-triggered effect on hlt. J From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeremy Fitzhardinge Subject: Re: [PATCH RFC V4 4/5] kvm : pv-ticketlocks support for linux guests running on KVM hypervisor Date: Thu, 19 Jan 2012 08:52:15 +1100 Message-ID: <4F173F0F.5020604@goop.org> References: <20120114182501.8604.68416.sendpatchset@oc5400248562.ibm.com> <20120114182645.8604.68884.sendpatchset@oc5400248562.ibm.com> <20120117110210.GA17420@amt.cnet> <20120117113312.GB30398@linux.vnet.ibm.com> <4F1621B2.3020203@goop.org> <20120118135445.GB25711@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20120118135445.GB25711@linux.vnet.ibm.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org To: Srivatsa Vaddagiri Cc: X86 , linux-doc@vger.kernel.org, Peter Zijlstra , Jan Kiszka , Virtualization , Paul Mackerras , "H. Peter Anvin" , Stefano Stabellini , Xen , Dave Jiang , KVM , Glauber Costa , Raghavendra K T , Ingo Molnar , Avi Kivity , Rik van Riel , Konrad Rzeszutek Wilk , Greg Kroah-Hartman , Sasha Levin , Sedat Dilek , Thomas Gleixner , LKML , Dave Hansen List-Id: virtualization@lists.linuxfoundation.org On 01/19/2012 12:54 AM, Srivatsa Vaddagiri wrote: > >> That logic relies on the "kick" being level triggered, so that "kick" >> before "block" will cause the block to fall out immediately. If you're >> using "hlt" as the block and it has the usual edge-triggered behaviour, >> what stops a "kick-before-hlt" from losing the kick? > Hmm ..'hlt' should result in a check for kick request (in hypervisor > context) before vcpu is put to sleep. IOW vcpu1 that is attempting to kick vcpu0 > will set a 'somebody_tried_kicking_vcpu0' flag, which hypervisor should check > before it puts vcpu0 to sleep because of trapped 'hlt' instruction. > > Won't that trap the 'kick-before-hlt' case? What am I missing here? Nothing, that sounds fine. It wasn't clear to me that your kick operation left persistent state, and so has a level-triggered effect on hlt. J