From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH] kvm-vmx: add module parameter to avoid trapping HLT instructions (v2) Date: Mon, 6 Dec 2010 16:14:49 +0200 Message-ID: <20101206141449.GC15610@redhat.com> References: <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> <4CFCECEF.3090905@redhat.com> <4CFCEE48.1050206@codemonkey.ws> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Avi Kivity , Marcelo Tosatti , kvm@vger.kernel.org, Chris Wright , Srivatsa Vaddagiri To: Anthony Liguori Return-path: Received: from mx1.redhat.com ([209.132.183.28]:42383 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750893Ab0LFOOy (ORCPT ); Mon, 6 Dec 2010 09:14:54 -0500 Content-Disposition: inline In-Reply-To: <4CFCEE48.1050206@codemonkey.ws> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, Dec 06, 2010 at 08:08:08AM -0600, Anthony Liguori wrote: > On 12/06/2010 08:02 AM, Avi Kivity wrote: > >On 12/06/2010 04:01 PM, Avi Kivity wrote: > >>>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. > >> > > > >btw, this is how kvm emulates HLT - first we advance rip, then we > >sleep the vcpu. > > Yes, I assume the hardware updates RIP immediately after fetching > the instruction. That's at least how some simpler architectures I'm > aware of work. > By "simpler" you mean "saner"? x86 needs at least decode it before updating RIP :) -- Gleb.