Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp3387581ybp; Sun, 6 Oct 2019 10:49:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqxujJel8RJnUeGzdYd/yyPL7stRmKGH2OthpzadvmM9iTv+C48pCmzCGwWXzA9ZKRRWe+eK X-Received: by 2002:a50:ab0f:: with SMTP id s15mr25422221edc.119.1570384160179; Sun, 06 Oct 2019 10:49:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570384160; cv=none; d=google.com; s=arc-20160816; b=m6pcyDy/iYmJgk4vQYwSDnYbrCpRaVncJXwNNJpIfNLd3aVQ5q2Z/ApUPjy9o88LJT 3ozJTbDpJTHehZHD/DsUWJx9/vsIn+NWtA4Wb0vkVMz8prBVNlYeslSwfbMeHsEjIQrF oR3yM5G33zq2mgsOSLTWO7mDSOxGL4UipM6HhRKS7xojhNSmaeeGMNITcFE8/vRIULHe xmnt+DmvT2FFRru9NQLOX2uEiBqp63Z0rA/Gl27UGbEIu3c3qL645qDR7b9WXfGzEg9R TM7ThnvXo9yXO6Y3MHKLiqgJZao/kmkxPpJCv5mPVghTaY0Wv7J/8ou+/AbVjwb5J8VW 1U1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=zQguH4lQh7QLk70xDt0Qf3lOdff/4l9xZ3DdtBlm+pk=; b=yXgnPI4rE8KFnYHiqHyJvPR24Wky0J97acsSlboJgKAIo5k0nIqt7Pb9kSSBuef2zO V1OkCBIV7XzPomwGJ/on2F6Bz+V05ESWtelhGYbi+1RkQW5yOn7dk04Sq+ngB0jIdrrg yiQbicMMZJk/PM32Leh48rZddHrkf4ThIADKwY/Npgbl3u8cDh1hR7HuEJ01VWT1VO50 CLIXNMQ82WATvUzhJK2S7FvMeVuJrJssCaKt8x8632ONo0+aq4T2MRr+PuYlpoz5b7/M 6oQU76gsabtqq0PYJXWUaCoadt6legBM8AQnKMSp2aYb9Hlf14MCMOIwrSVX1iDbD6/V YXSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="osNR05/E"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id oy5si5999251ejb.170.2019.10.06.10.48.56; Sun, 06 Oct 2019 10:49:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="osNR05/E"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730717AbfJFRoS (ORCPT + 99 others); Sun, 6 Oct 2019 13:44:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:44374 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731630AbfJFRoN (ORCPT ); Sun, 6 Oct 2019 13:44:13 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 647BC2087E; Sun, 6 Oct 2019 17:44:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570383851; bh=0G3/eLs3KNEDlD69COogjkS7I/Hj3IAs5lEuVqVixIg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=osNR05/Evrbl8AUHJV3NvB0bbfZdUbA0f884MndNCr5GTlwzSKGjqdauRnKUepBmL flyCTiNNwQxkXJ4veBqbVFQ52gKXJm8HZYsdA5Upows4r6hqjbJeAn0ntdSzzE9V53 OBKBqVjfNMfguhSt/8R4ORvcrJZxqQOgw9lmWTVk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Youquan Song , Srinivas Pandruvada , Andy Shevchenko , Sasha Levin Subject: [PATCH 5.3 118/166] tools/power/x86/intel-speed-select: Fix high priority core mask over count Date: Sun, 6 Oct 2019 19:21:24 +0200 Message-Id: <20191006171223.241909827@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191006171212.850660298@linuxfoundation.org> References: <20191006171212.850660298@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Youquan Song [ Upstream commit 44460efe44e05eae2f21e57d06d542bbbb792e65 ] If the CPU package has the less logical CPU than topo_max_cpus, but un-present CPU's punit_cpu_core will be initiated to 0 and they will be count to core 0 Like below, there are only 10 high priority cores (20 logical CPUs) in the CPU package, but it count to 27 logic CPUs. ./intel-speed-select base-freq info -l 0 | grep mask high-priority-cpu-mask:7f000179,f000179f With the fix patch: ./intel-speed-select base-freq info -l 0 high-priority-cpu-mask:00000179,f000179f Signed-off-by: Youquan Song Signed-off-by: Srinivas Pandruvada Signed-off-by: Andy Shevchenko Signed-off-by: Sasha Levin --- tools/power/x86/intel-speed-select/isst-config.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/power/x86/intel-speed-select/isst-config.c b/tools/power/x86/intel-speed-select/isst-config.c index 6a10dea01eefc..696586407e83b 100644 --- a/tools/power/x86/intel-speed-select/isst-config.c +++ b/tools/power/x86/intel-speed-select/isst-config.c @@ -402,6 +402,9 @@ void set_cpu_mask_from_punit_coremask(int cpu, unsigned long long core_mask, int j; for (j = 0; j < topo_max_cpus; ++j) { + if (!CPU_ISSET_S(j, present_cpumask_size, present_cpumask)) + continue; + if (cpu_map[j].pkg_id == pkg_id && cpu_map[j].die_id == die_id && cpu_map[j].punit_cpu_core == i) { -- 2.20.1