From patchwork Tue May 17 11:34:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prarit Bhargava X-Patchwork-Id: 9111621 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0851EBF29F for ; Tue, 17 May 2016 11:34:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 39911201BB for ; Tue, 17 May 2016 11:34:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4154720166 for ; Tue, 17 May 2016 11:34:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752285AbcEQLee (ORCPT ); Tue, 17 May 2016 07:34:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44347 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752241AbcEQLed (ORCPT ); Tue, 17 May 2016 07:34:33 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DB9F61555F; Tue, 17 May 2016 11:34:18 +0000 (UTC) Received: from praritdesktop.bos.redhat.com (prarit-guest.khw.lab.eng.bos.redhat.com [10.16.186.145]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u4HBYH94014463; Tue, 17 May 2016 07:34:17 -0400 From: Prarit Bhargava To: linux-kernel@vger.kernel.org Cc: Prarit Bhargava , Srinivas Pandruvada , Jacob Jun Pan , "Rafael J. Wysocki" , linux-pm@vger.kernel.org Subject: [PATCH] powercap/rapl: Do not load in virtualized environments Date: Tue, 17 May 2016 07:34:05 -0400 Message-Id: <1463484845-9839-1-git-send-email-prarit@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 17 May 2016 11:34:19 +0000 (UTC) Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 intel_rapl is currently not supported in virtualized environments. When booting the warning message intel_rapl: no valid rapl domains found in package 0 is output for every virtual core. This patch stops the driver from being loaded in virtual boots. Cc: Srinivas Pandruvada Cc: Jacob Jun Pan Cc: "Rafael J. Wysocki" Cc: linux-pm@vger.kernel.org Signed-off-by: Prarit Bhargava --- drivers/powercap/intel_rapl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/powercap/intel_rapl.c b/drivers/powercap/intel_rapl.c index f2201d42a9cd..bebfbe8acccd 100644 --- a/drivers/powercap/intel_rapl.c +++ b/drivers/powercap/intel_rapl.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -1600,6 +1601,10 @@ static int __init rapl_init(void) return -ENODEV; } + /* Intel RAPL is not supported on virtualized environments */ + if (x86_hyper) + return -ENODEV; + rapl_defaults = (struct rapl_defaults *)id->driver_data; cpu_notifier_register_begin();