From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [RFC] fix VMX TSC synchronicity Date: Sun, 04 May 2008 18:40:42 +0300 Message-ID: <481DD8FA.5000606@qumranet.com> References: <478A01D1.7000402@qumranet.com> <20080114160647.GA15919@dmt> <478CC448.1030901@qumranet.com> <478CC819.3040106@csgraf.de> <478CCCA9.2080300@qumranet.com> <478DC453.1000404@qumranet.com> <20080116133454.GA14481@one.firstfloor.org> <478E08E5.2030507@qumranet.com> <20080116135415.GA14664@one.firstfloor.org> <20080117184349.GA17843@dmt> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel , Alexander Graf , Andi Kleen To: Marcelo Tosatti Return-path: In-Reply-To: <20080117184349.GA17843@dmt> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces@lists.sourceforge.net Errors-To: kvm-devel-bounces@lists.sourceforge.net List-Id: kvm.vger.kernel.org [Resurrecting post from the dead] Marcelo Tosatti wrote: > Forcing clustered APIC mode works only on SMP, and there were high CPU > consumption on Windows SMP guests due to C3 state being reported (fixed > in kvm-30 something). > > So perhaps: > - Faking clustered APIC on SMP > - Faking C3 on UP > > And turning of the TSC bit (for 32-bit guests). > > Is the way to go? > > Avi, do you understand why C3 was causing the Windows SMP problems ? > > It's probably inb()ing on the port in a loop. It's not SMP causing the problems, but the ACPI HAL. I'll check this. > /* Common C-state entry for C2, C3, .. */ > static void acpi_cstate_enter(struct acpi_processor_cx *cstate) > { > if (cstate->space_id == ACPI_CSTATE_FFH) { > /* Call into architectural FFH based C-state */ > acpi_processor_ffh_cstate_enter(cstate); > } else { > int unused; > /* IO port based C-state */ > inb(cstate->address); > /* Dummy wait op - must do something useless after P_LVL2 read > because chipsets cannot guarantee that STPCLK# signal > gets asserted in time to freeze execution properly. */ > unused = inl(acpi_gbl_FADT.xpm_timer_block.address); > } > } > > Clearly that inb() won't actually idle under QEMU. So the question is, > if C3 stated is reported, that port read should be emulated... But how? > We can add now use the KVM_SET_MPSTATE ioctl to halt the vcpu if we see the port read. Since not all hosts support setting mpstate, the bios should only report C3 if the host supports it. -- error compiling committee.c: too many arguments to function ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone