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: Fri, 03 Dec 2010 16:45:32 -0600 Message-ID: <4CF9730C.7040904@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> 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-yx0-f174.google.com ([209.85.213.174]:44147 "EHLO mail-yx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754040Ab0LCWpf (ORCPT ); Fri, 3 Dec 2010 17:45:35 -0500 Received: by yxt3 with SMTP id 3so4563232yxt.19 for ; Fri, 03 Dec 2010 14:45:34 -0800 (PST) In-Reply-To: <4CF8BA34.1000508@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 12/03/2010 03:36 AM, Avi Kivity wrote: > On 12/02/2010 10:51 PM, Anthony Liguori wrote: >>> VCPU in HLT state only allows injection of certain events that >>> would be delivered on HLT. #PF is not one of them. >> >> But you can't inject an exception into a guest while the VMCS is >> active, can you? > > No, but this is irrelevant. > >> So the guest takes an exit while in the hlt instruction but that's no >> different than if the guest has been interrupted because of hlt exiting. > > hlt exiting doesn't leave vcpu in the halted state (since hlt has not > been executed). So currently we never see a vcpu in halted state. Right, you mean the guest activity state being halt. My understanding is that it just needs to be cleared on exception injection. Would could clear it at every vmentry but that would introduce a vmcs_read() to the fast path which is undesirable. Regards, Anthony Liguori