From patchwork Thu Aug 1 03:46:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Linton X-Patchwork-Id: 170308 Delivered-To: patch@linaro.org Received: by 2002:a92:512:0:0:0:0:0 with SMTP id q18csp4837924ile; Wed, 31 Jul 2019 20:46:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqziMG1i4luDlOV8XMCHE1FeLBCZDSJE2MU3oWYYydkdKi9bfg9V8y2g4hAu+KbN5A1MlkmC X-Received: by 2002:aa7:8b10:: with SMTP id f16mr51630537pfd.44.1564631205664; Wed, 31 Jul 2019 20:46:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564631205; cv=none; d=google.com; s=arc-20160816; b=SmyGAq+oOZ0oJYgbUolmDmfjoO9OWsp+R2y44+0/4yX6hz6/WzF+jure1luzzPft0g tZqaDTo7FG/idNQaiFMPoGf5GU9a7d/ztwkrWBidviwzJEkNsBVY7xv7jsebn0vK4jms BcGFWpChUrJfPjOklQjUafXibOE6zG5S0ofp7VsEXwosUGu5S1jGQ8PuhcEe7KS6okyb 8AR42+W+7+cjcu+Uo28cNZiKH2Xq0lhDRBq5nHTT6pJz/vu4kQlnPKIH9QnuqggrZwBa AHKKCnZ13GyQ0QmxaKKBJ08RZg3CWeATpMVZMFG3I3B3kzMwA6lpYPzcj4iTOlmkhALX PhHg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=o7YcmtidsCQoep7qv5xOU12ScfxzO8HXPxAmyprhlXw=; b=BP8+M7lvehMkMcTcdpuHOSheTfyP0wHhgMQs9/wULWgRzjCrm5z/5cEqNrzMiObBL8 PaW2L6EVpF+SXgJAZmAyOptxjPFEn9rJlrz6Mqr2tyFSw4ZGWspX6pFpZ6SIzKYtcKZS GtqdPZtvOuEa73ZdY1Unv7gJO/Gj4CrWcgwgCroVE9R+7GLOUKRW0xKxfudeV4x+uaAY D5kdyHI6sd39AH6T+seNofrM62xhuTuElhTGUgDDtRxzIU+xL+TnDhPVOmcJTME7nX/W b3kGlIiKu7vNpzYbkIsi/iWS8vc2GI6VRfVgrCZckPWp6c7dx74aFQRwm0KF/2IdF4T6 lpLA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-acpi-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 u12si3000140pgb.595.2019.07.31.20.46.45; Wed, 31 Jul 2019 20:46:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-acpi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-acpi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729053AbfHADqp (ORCPT + 8 others); Wed, 31 Jul 2019 23:46:45 -0400 Received: from foss.arm.com ([217.140.110.172]:57796 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727948AbfHADqo (ORCPT ); Wed, 31 Jul 2019 23:46:44 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 30EE41596; Wed, 31 Jul 2019 20:46:44 -0700 (PDT) Received: from mammon-tx2.austin.arm.com (mammon-tx2.austin.arm.com [10.118.30.64]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 209333F575; Wed, 31 Jul 2019 20:46:44 -0700 (PDT) From: Jeremy Linton To: linux-arm-kernel@lists.infradead.org Cc: linux-acpi@vger.kernel.org, catalin.marinas@arm.com, will@kernel.org, rjw@rjwysocki.net, lenb@kernel.org, lorenzo.pieralisi@arm.com, sudeep.holla@arm.com, Jeremy Linton Subject: [PATCH v4 2/2] arm64: topology: Use PPTT to determine if PE is a thread Date: Wed, 31 Jul 2019 22:46:34 -0500 Message-Id: <20190801034634.26913-3-jeremy.linton@arm.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190801034634.26913-1-jeremy.linton@arm.com> References: <20190801034634.26913-1-jeremy.linton@arm.com> MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org ACPI 6.3 adds a thread flag to represent if a CPU/PE is actually a thread. Given that the MPIDR_MT bit may not represent this information consistently on homogeneous machines we should prefer the PPTT flag if its available. Signed-off-by: Jeremy Linton --- arch/arm64/kernel/topology.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) -- 2.21.0 Reviewed-by: Sudeep Holla diff --git a/arch/arm64/kernel/topology.c b/arch/arm64/kernel/topology.c index 0825c4a856e3..cbbedb53cf06 100644 --- a/arch/arm64/kernel/topology.c +++ b/arch/arm64/kernel/topology.c @@ -346,11 +346,9 @@ void remove_cpu_topology(unsigned int cpu) */ static int __init parse_acpi_topology(void) { - bool is_threaded; + int is_threaded; int cpu, topology_id; - is_threaded = read_cpuid_mpidr() & MPIDR_MT_BITMASK; - for_each_possible_cpu(cpu) { int i, cache_id; @@ -358,6 +356,10 @@ static int __init parse_acpi_topology(void) if (topology_id < 0) return topology_id; + is_threaded = acpi_pptt_cpu_is_thread(cpu); + if (is_threaded < 0) + is_threaded = read_cpuid_mpidr() & MPIDR_MT_BITMASK; + if (is_threaded) { cpu_topology[cpu].thread_id = topology_id; topology_id = find_acpi_cpu_topology(cpu, 1);