From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1AD7C10F14 for ; Sun, 6 Oct 2019 17:44:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 80DFB214D9 for ; Sun, 6 Oct 2019 17:44:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570383862; bh=0G3/eLs3KNEDlD69COogjkS7I/Hj3IAs5lEuVqVixIg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ypVGx4eXxYmseblY8PKJT2G1ILJ3TFM/rvYeZGSRyMY/T7yL/WSRCjcryFWiWbbGH K6XGgAGziV7FBZLgVbFYtPuw2ioyIUq8fUV0lm7IlZglorufA8ItPpqijwE/TtWbNS uODo5cBeBKtaTf1S3AnjjtzTXRWxOKr0gzboR12E= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731101AbfJFRoU (ORCPT ); Sun, 6 Oct 2019 13:44:20 -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