From mboxrd@z Thu Jan 1 00:00:00 1970 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [Question] About the behavior of HLT in VMX guest mode Date: Wed, 15 Mar 2017 18:32:54 +0100 Message-ID: <20170315173254.GF14081@potion> References: <58C64672.1070706@huawei.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm To: "Longpeng (Mike)" Return-path: Received: from mx1.redhat.com ([209.132.183.28]:36950 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751277AbdCORnD (ORCPT ); Wed, 15 Mar 2017 13:43:03 -0400 Content-Disposition: inline In-Reply-To: <58C64672.1070706@huawei.com> Sender: kvm-owner@vger.kernel.org List-ID: 2017-03-13 15:12+0800, Longpeng (Mike): > Hi guys, > > I'm confusing about the behavior of HLT instruction in VMX guest mode. > > I set "hlt exiting" bit to 0 in VMCS, and the vcpu didn't vmexit when execute > HLT as expected. However, I used powertop/cpupower on host to watch the pcpu's > c-states, it seems that the pcpu didn't enter C1/C1E state during this period. > > I searched the Intel spec vol-3, and only found that guest MWAIT won't entering > a low-power sleep state under certain conditions(ch 25.3), but not mentioned HLT. > > My questions are > 1) Does executing HLT instruction in guest-mode won't enter C1/C1E state ? Do you get a different result when running HLT outside VMX? > 2) If it won't, then whether it would release the hardware resources shared with > another hyper-thread ? No idea. Aren't hyperthreaded resources scheduled dynamically, so even a nop-spinning VCPU won't hinder the other hyper-thread? > Any suggestion would be greatly appreciated, thanks! Mostly just more questions, sorry ... I'd look at temperature sensors while halting inside guests on all cores to see if they really enter a power saving mode -- I expect a noticeable difference from idle=poll. :)