WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: Regression in 3.1 causes Xen to use wrong idle routine

To: Stefan Bader <stefan.bader@xxxxxxxxxxxxx>
Subject: [Xen-devel] Re: Regression in 3.1 causes Xen to use wrong idle routine
From: Len Brown <lenb@xxxxxxxxxx>
Date: Sat, 12 Nov 2011 22:46:36 -0500
Cc: "linux-acpi@xxxxxxxxxxxxxxx" <linux-acpi@xxxxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Delivery-date: Sat, 12 Nov 2011 19:47:31 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=H/gqNgKfXP04eBqrfoZULha8XJomlT6BzJ4cg7JKLKA=; b=Ey0J2gWm4T7nxQWoRRmvnzGX2CQCPb/I7HZQGFyqv/7foeKFI2WF1X7Y3E8TCiSvrR 8bn4FO8W2apES3O594Qg2oQ76UNs9ufSCZAi9WuseiRBKJq1pPzMlBIGz66llWd5EiM7 kTvGaY4s4e3GlIeUxRhOvElmEBoJuqWnoXiQ4=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4EA7DFD1.9060608@xxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <4EA7DFD1.9060608@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Wed, Oct 26, 2011 at 6:24 AM, Stefan Bader
<stefan.bader@xxxxxxxxxxxxx> wrote:
> The following commit changes calls to pm_idle into first trying
> cpuidle_call_idle() and if that returns non-zero to fall back to
> call pm_idle().
>
> commit a0bfa1373859e9d11dc92561a8667588803e42d8
> Author: Len Brown <len.brown@xxxxxxxxx>
> Date:   Fri Apr 1 19:34:59 2011 -0400
>
>    cpuidle: stop depending on pm_idle
>
> However cpuidle_call_idle() will return -ENODEV if it is supposed to be 
> disabled
> by cpuidle.off. Which then causes pm_idle() to be called.
>
> This has some bad interaction with the following change that tries to
> make use of disabling cpuidle in Xen to fall back to hlt.
>
> commit d91ee5863b71e8c90eaf6035bff3078a85e2e7b5
> Author: Len Brown <len.brown@xxxxxxxxx>
> Date:   Fri Apr 1 18:28:35 2011 -0400
>
>    cpuidle: replace xen access to x86 pm_idle and default_idle
>
> The problem I see is that select_idle_routine() is called from
> arch/x86/kernel/cpu/common.c and since Xen setup does not set pm_idle
> anymore, it can cause mwait_idle or amd_e400_idle functions to be selected.
> In testing it seem amd_e400_idle in PVM domU at least does not immediately 
> cause
> problems, but mwait_idle just causes crashes. From the reports I have
> this may be related to older hypervisors (3.1 and older) not clearing the 
> mwait
> capability. But overall there seems something wrong in the interaction.

Why is Xen advertising X86_FEATURE_MWAIT and then crashing
when the dom0 (or other guests) use what it advertises?

What versions of Xen have this bug?

> I am not really sure whether the logic of calling pm_idle() on all errors from
> cpuidle_call_idle() is already flawed or the assumption in the Xen patch about
> being able to prevent the wrong idle function by turning cpuidle off is 
> incorrect.

The patches above appear to be operating as intended.
What wasn't expected, was that some version of Xen is deployed that
advertises the MWAIT feature, but crashes when it is used.

> One quick fix could be to add some Xen case into select_idle_routine() which
> picks default_idle...

No.

Working around this Xen bug for a newly compiled Dom0 is insufficient.

All guests that also look for MWAIT support w/o asking ACPI
(ie. all versions of Linux that use intel_idle, such as the last few
Fedora's, RHEL, SLES etc.)
will trip over the same Xen bug, even if Dom0 doesn't.

Xen must not advertises MWAIT support if it doesn't have MWAIT support.

thanks,
Len Brown, Intel Open Source Technology Center

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel