public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@qumranet.com>
To: Marcelo Tosatti <marcelo@kvack.org>
Cc: kvm-devel <kvm-devel@lists.sourceforge.net>,
	Alexander Graf <alex@csgraf.de>, Andi Kleen <andi@firstfloor.org>
Subject: Re: [RFC] fix VMX TSC synchronicity
Date: Sun, 04 May 2008 18:40:42 +0300	[thread overview]
Message-ID: <481DD8FA.5000606@qumranet.com> (raw)
In-Reply-To: <20080117184349.GA17843@dmt>

[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

  parent reply	other threads:[~2008-05-04 15:40 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-11 20:49 [RFC] fix VMX TSC synchronicity Marcelo Tosatti
2008-01-13 12:19 ` Avi Kivity
     [not found]   ` <478A01D1.7000402-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2008-01-14 16:06     ` Marcelo Tosatti
2008-01-14 20:46       ` Marcelo Tosatti
2008-01-15 14:59         ` Avi Kivity
2008-01-15 14:33       ` Avi Kivity
     [not found]         ` <478CC448.1030901-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2008-01-15 14:50           ` Alexander Graf
     [not found]             ` <478CC819.3040106-r27SGEef+tmzQB+pC5nmwQ@public.gmane.org>
2008-01-15 15:09               ` Avi Kivity
     [not found]                 ` <478CCCA9.2080300-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2008-01-15 16:42                   ` Alexander Graf
     [not found]                     ` <478CE277.9010109-r27SGEef+tmzQB+pC5nmwQ@public.gmane.org>
2008-01-15 17:46                       ` Avi Kivity
     [not found]                         ` <478CF186.5030304-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2008-01-15 18:29                           ` Amit Shah
2008-01-16  5:51                   ` Andi Kleen
     [not found]                     ` <p73ir1ul3ls.fsf-KvMlXPVkKihbpigZmTR7Iw@public.gmane.org>
2008-01-16  8:46                       ` Avi Kivity
     [not found]                         ` <478DC453.1000404-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2008-01-16 13:34                           ` Andi Kleen
     [not found]                             ` <478E08E5.2030507@qumranet.com>
     [not found]                               ` <478E08E5.2030507-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2008-01-16 13:54                                 ` Andi Kleen
     [not found]                                   ` <20080116135415.GA14664-qrUzlfsMFqo/4alezvVtWx2eb7JE58TQ@public.gmane.org>
2008-01-16 13:56                                     ` Avi Kivity
2008-01-17 18:43                                     ` Marcelo Tosatti
2008-01-17 18:56                                       ` Andi Kleen
2008-01-20 14:59                                       ` Avi Kivity
2008-05-04 15:40                                       ` Avi Kivity [this message]
2008-05-06 13:55                                         ` Avi Kivity
  -- strict thread matches above, loose matches on Subject: below --
2008-01-12  3:11 Will Trives
2008-01-12 12:28 ` Marcelo Tosatti
2008-01-12 13:48   ` Will Trives
2008-01-12 20:51     ` Avi Kivity

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=481DD8FA.5000606@qumranet.com \
    --to=avi@qumranet.com \
    --cc=alex@csgraf.de \
    --cc=andi@firstfloor.org \
    --cc=kvm-devel@lists.sourceforge.net \
    --cc=marcelo@kvack.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox