From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] kvm-vmx: add module parameter to avoid trapping HLT instructions (v2) Date: Mon, 06 Dec 2010 10:32:17 +0200 Message-ID: <4CFC9F91.4030407@redhat.com> References: <1291298357-5695-1-git-send-email-aliguori@us.ibm.com> <20101202173733.GA26342@amt.cnet> <4CF97258.9010808@codemonkey.ws> <4CF9F8E2.4030602@redhat.com> <4CFA46C3.5000805@codemonkey.ws> 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: Anthony Liguori Return-path: Received: from mx1.redhat.com ([209.132.183.28]:1045 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751833Ab0LFIcZ (ORCPT ); Mon, 6 Dec 2010 03:32:25 -0500 In-Reply-To: <4CFA46C3.5000805@codemonkey.ws> Sender: kvm-owner@vger.kernel.org List-ID: On 12/04/2010 03:48 PM, Anthony Liguori wrote: >> No, an interrupt causes the HLT to be executed, and rip advanced past >> it. You need to preserve this (both for interrupts and for the apf >> completion exception). > > > Yeah, I see in the architecture manual it specifically calls out the > rip advancing after NMI. It doesn't say anything about debug > exceptions though. Instruction breakpoints are triggered before HLT executes; and HLT can't trigger data breakpoints. > It's not clear to me if some exceptions cause hlt to be skipped and > others not. Faults take place before HLT is executed (and thus don't advance RIP). Interrupts take place during HLT execution and cause it to complete. > > But then again, skipping hlt seems to be the most conservative thing > to do for all exceptions because it's always going to be run in a loop. There's no "all exceptions" here. Only interrupts can happen, and the APF completion, which is wired to a fault vector, but we must treat it as an interrupt. -- error compiling committee.c: too many arguments to function