From patchwork Mon Jan 6 18:40:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: dirk.brandewie@gmail.com X-Patchwork-Id: 3440231 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 793AD9F1C4 for ; Mon, 6 Jan 2014 18:40:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7629220172 for ; Mon, 6 Jan 2014 18:40:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 499CE20109 for ; Mon, 6 Jan 2014 18:40:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755838AbaAFSkh (ORCPT ); Mon, 6 Jan 2014 13:40:37 -0500 Received: from mail-pb0-f42.google.com ([209.85.160.42]:62946 "EHLO mail-pb0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755354AbaAFSkf (ORCPT ); Mon, 6 Jan 2014 13:40:35 -0500 Received: by mail-pb0-f42.google.com with SMTP id uo5so18954076pbc.29 for ; Mon, 06 Jan 2014 10:40:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=pkdiI8nMVoCBvzujcefQFoRM+ZB32AhMwuEKMGUW4qQ=; b=Bo5d8DwtPFu5ncaWGgzXJsLBUEvAdqxqkaP0f4cgi10yIMVFJDC+WfyyA7aWPaJIOd cfL4lpMl6umnIHIAGFbNJPpXqFJst2sUgTvI7WQp+ad6y89HVTy7HkhoklnZs0UsP2So 55KZvWVEa3E5MUqsG7mh2A01et1HxvuUB/GCyTF0cCma/bgozPQ9ZE6BxIjXZqQkxBMf efJtzCcMhSyaL5Jx15Pa7lpk5u+ILvh5rPvRkJpLjB94XMRY25G9CHzAYZAuEmHzOtNV 0UTImQ2gsMckPXRRzM7B2W/XJlXYK/MFK8bX9CyJBwKPLx9PGmrP2eOR9k6nDVAmqr1t R6PQ== X-Received: by 10.68.198.68 with SMTP id ja4mr128858670pbc.24.1389033635351; Mon, 06 Jan 2014 10:40:35 -0800 (PST) Received: from echolake.localdomain (static-50-43-35-129.bvtn.or.frontiernet.net. [50.43.35.129]) by mx.google.com with ESMTPSA id qq5sm57312613pbb.24.2014.01.06.10.40.33 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 06 Jan 2014 10:40:34 -0800 (PST) Message-ID: <52CAF8A7.6000705@gmail.com> Date: Mon, 06 Jan 2014 10:40:39 -0800 From: Dirk Brandewie User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0 MIME-Version: 1.0 To: "Rafael J. Wysocki" , Paolo Bonzini CC: Gleb Natapov , Kashyap Chamarthy , Josh Boyer , One Thousand Gnomes , Viresh Kumar , "cpufreq@vger.kernel.org" , Linux PM list , "Linux-Kernel@Vger. Kernel. Org" , "Richard W.M. Jones" Subject: Re: intel_pstate divide error with v3.13-rc4-256-gb7000ad References: <4410803.FiVxaMNxvJ@vostro.rjw.lan> <52CA9180.1020106@redhat.com> <46313552.v2plfSZzzF@vostro.rjw.lan> In-Reply-To: <46313552.v2plfSZzzF@vostro.rjw.lan> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 01/06/2014 03:37 AM, Rafael J. Wysocki wrote: > On Monday, January 06, 2014 12:20:32 PM Paolo Bonzini wrote: >> Il 04/01/2014 22:38, Rafael J. Wysocki ha scritto: >>> On Saturday, January 04, 2014 07:48:13 PM Gleb Natapov wrote: >>>> On Sat, Jan 04, 2014 at 06:38:59PM +0100, Paolo Bonzini wrote: >>>>> Il 04/01/2014 15:38, Rafael J. Wysocki ha scritto: >>>>>> Well, it's just a sanity check and it makes the problem go away for the reporter. >>>>>> >>>>>>>> Your patch is welcome but perhaps it should have a WARN_ON too. >>>>>> It has been pulled in already, so the WARN_ON() can only be added via a separate >>>>>> patch now. Would you like to prepare that patch? >>>>> >>>>> Yes, I'll add it together with the CPUID check. I'll send the patch so >>>>> that it can get into 3.14. >>>>> >>>> CPUID check, while correct, will sweep the problem under the rug. Current >>>> Linux logic should detect non working pstate in KVM. We should look into >>>> why this is not happening for nested. >>> >>> I agree. It's better not to use CPUID for that in my opinion. >> >> Among hypervisors, RHEL5's Xen is probably one of the oldest in actual >> use with new hardware and new kernels, and the CPUID bit has been fixed >> in 2011. Older versions wouldn't run new kernels due to other CPUID >> bits not being cleared properly in VMs. >> >> Is there real hardware that has the CPUID bit set and non-working >> pstate? If there's no such real hardware, CPUID is what the SDM says >> you should use to detect presence of the APERF/MPERF msrs. > > OK > >> Having extra safety checks is fine on top of what the SDM says, but IMO >> they should be WARN_ONs. Otherwise you are sweeping bugs under the rug >> just as much. > > As I said I'm not against adding WARN_ON()s there. :-) > The patch below adds a feature check for APERF/MPERF. With this patch you should NOT see "Intel P-state driver initializing." in dmesg for KVM. commit 4279f36818bd3ac42f077de114b17eb27d81d482 Author: Dirk Brandewie Date: Mon Jan 6 10:19:38 2014 -0800 intel_pstate: Add X86_FEATURE_APERFMPERF to cpu match parameters. KVM environments do not support APERF/MPERF MSRs. intel_pstate cannot operate without these registers. The previous validity checks in intel_pstate_msrs_not_valid() are insufficent in nested KVMs. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1046317 Signed-off-by: Dirk Brandewie --- drivers/cpufreq/intel_pstate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index 0f63f5d..fe91dad 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -619,7 +619,8 @@ static void intel_pstate_timer_func(unsigned long __data) } #define ICPU(model, policy) \ - { X86_VENDOR_INTEL, 6, model, X86_FEATURE_ANY, (unsigned long)&policy } + { X86_VENDOR_INTEL, 6, model, X86_FEATURE_APERFMPERF,\ + (unsigned long)&policy } static const struct x86_cpu_id intel_pstate_cpu_ids[] = { ICPU(0x2a, core_params),