From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [PATCH] kvm-vmx: add module parameter to avoid trapping HLT instructions (v2) Date: Mon, 06 Dec 2010 08:03:30 -0600 Message-ID: <4CFCED32.3020803@codemonkey.ws> References: <1291298357-5695-1-git-send-email-aliguori@us.ibm.com> <20101202173733.GA26342@amt.cnet> <4CF7EE63.40209@codemonkey.ws> <20101202201223.GA31316@amt.cnet> <4CF806E7.1090404@codemonkey.ws> <4CF8BA34.1000508@redhat.com> <4CF9730C.7040904@codemonkey.ws> <4CF9F83C.5040807@redhat.com> <4CFA425D.3010100@codemonkey.ws> <4CFC9EC6.3010108@redhat.com> <4CFCA06B.9030406@redhat.com> <4CFCEBE9.2010107@codemonkey.ws> <4CFCECA6.3030007@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti , kvm@vger.kernel.org, Chris Wright , Srivatsa Vaddagiri To: Avi Kivity Return-path: Received: from mail-gy0-f174.google.com ([209.85.160.174]:52961 "EHLO mail-gy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751955Ab0LFODe (ORCPT ); Mon, 6 Dec 2010 09:03:34 -0500 Received: by gyb11 with SMTP id 11so5981342gyb.19 for ; Mon, 06 Dec 2010 06:03:33 -0800 (PST) In-Reply-To: <4CFCECA6.3030007@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 12/06/2010 08:01 AM, Avi Kivity wrote: > On 12/06/2010 03:58 PM, Anthony Liguori wrote: >> On 12/06/2010 02:35 AM, Avi Kivity wrote: >>> On 12/06/2010 10:28 AM, Avi Kivity wrote: >>>>> I wasn't sure about this. Don't you want EIP to point to the >>>>> beginning of the instruction such that the exception will cause >>>>> the instruction to restart? >>>> >>>> >>>> An interrupt causes the HLT to complete execution. APF completion >>>> counts as an interrupt in this case. >>>> >>> >>> btw, it's possible a VMEXIT during HLT returns RIP already advanced >>> past the HLT instruction. Please check if this is the case. >> >> It's not just possible, it appears to be exactly what happens. >> >> I guess it makes sense that RIP gets advanced before HLT begins to wait. >> > > It does. Good, it simplifies the patch. Any ideas if the unit test framework can be used to validate this? The behavior makes perfect sense but I wanted an excuse to play around with it :-) Not sure if there's a way to validate VMCS state after a hand crafted exit. Regards, Anthony Liguori