All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joerg Roedel <joro@8bytes.org>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: Anthony Liguori <aliguori@us.ibm.com>,
	kvm@vger.kernel.org, Avi Kivity <avi@redhat.com>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	Chris Wright <chrisw@sous-sol.org>,
	Srivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>
Subject: Re: [PATCH] kvm-vmx: add module parameter to avoid trapping HLT instructions (v3)
Date: Sat, 4 Dec 2010 09:53:47 +0100	[thread overview]
Message-ID: <20101204085347.GB29502@8bytes.org> (raw)
In-Reply-To: <4CF97F5E.3000704@codemonkey.ws>

On Fri, Dec 03, 2010 at 05:38:06PM -0600, Anthony Liguori wrote:
> On 12/03/2010 05:32 PM, Joerg Roedel wrote:
>> On Fri, Dec 03, 2010 at 04:39:22PM -0600, Anthony Liguori wrote:
>>    
>>> +	if (yield_on_hlt)
>>> +		min |= CPU_BASED_HLT_EXITING;
>>>      
>> This approach won't work out on AMD because in HLT the CPU may enter
>> C1e. In C1e the local apic timer interupt is not delivered anymore and
>> when this is the current timer in use the cpu may miss timer ticks or
>> never comes out of HLT again. The guest has no chance to work around
>> this as the Linux idle routine does.
>>    
>
> And this doesn't break old software on bare metal?

Yes it does. In fact, this behavior is documented as Erratum 400 for AMD
CPUs. Linux has a workaround for it for quite some time. You can have a
look at the c1e_idle routine for details.
C1e can also be disabled by the OS. But there are BIOSes which re-enable
it in SMI. So there is the chance that it gets re-enabled whithout an
vmexit.

	Joerg


      reply	other threads:[~2010-12-04  8:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-03 22:39 [PATCH] kvm-vmx: add module parameter to avoid trapping HLT instructions (v3) Anthony Liguori
2010-12-03 23:32 ` Joerg Roedel
2010-12-03 23:38   ` Anthony Liguori
2010-12-04  8:53     ` Joerg Roedel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101204085347.GB29502@8bytes.org \
    --to=joro@8bytes.org \
    --cc=aliguori@us.ibm.com \
    --cc=anthony@codemonkey.ws \
    --cc=avi@redhat.com \
    --cc=chrisw@sous-sol.org \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=vatsa@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.