From patchwork Fri Jun 14 22:31:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Linton X-Patchwork-Id: 166933 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp34227ilk; Fri, 14 Jun 2019 15:32:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqwtJPi+vWo6goERsaFfAQ3xmlEo2rFkTkVFf4m+Puily9lQqXeKGtkv73xNY4dQmqUCOoPQ X-Received: by 2002:a63:dd53:: with SMTP id g19mr27904668pgj.3.1560551534122; Fri, 14 Jun 2019 15:32:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560551534; cv=none; d=google.com; s=arc-20160816; b=p6Qm73XGwNX99RipRx4qKBUXArP2bmxIGmZYXbKxyQtxCq9mHUtsyqHdxdrSYPBc0o NJcSs500PRwsu9lG+1+qJY9ZO4zpmbQYHPb1yDGTBgpH8nLmkMuUwQ3L71xp++zE+IAI 1Scl1bkzHHSVT29+n8zxF01Bhwnat9dXEFuXfP6DDO05QuSw0Xcg40Dz5/0fLV1xw9GJ GDtPaVKSiEYoWFRj6c7neKJTZpGkenrgllKm05bgUpd3uvr840Cu33TUS1rDjp2JJUX9 zBi0Lgi2w5hhvZoariWwrru2GRi/jm027f2AHTVYIgdeXZKOlTFRjWr/3hS4sQsYVWVQ W9CQ== 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=SBG0tYuTi04IGz6GIXALsaa2gGpHXzXhoCwxtleKxllQZG2Sq/J5FNKoZwOZSeoos5 R0XtxdZ7yU+aNL6FMAU3dL3W76FNROBx6PQrtJKL+CDJedSdWRN0mDUEqptLWWSbJ+iI V+tbQ/6IhvLqyZyRZepms1ovSjLZ/RoGAosdbWsTymu/W/LS0rOZr3rCC6W036CjFOaE x6yi+tnSQptFdTMyyFtV+2DK4jN5jUzbBNFaGqK8zDLuu84T1VhpUieUoESpLyXjmbrh UZNlmKC3DfNGLriaxmq5QWo2/H9nhZ80GopY/NMqF8sr4gMenIgk/72NOgEJIYye8PdK q/sw== 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 o20si3202634pjp.48.2019.06.14.15.32.13; Fri, 14 Jun 2019 15:32:14 -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 S1726369AbfFNWcN (ORCPT + 8 others); Fri, 14 Jun 2019 18:32:13 -0400 Received: from foss.arm.com ([217.140.110.172]:43074 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726346AbfFNWcM (ORCPT ); Fri, 14 Jun 2019 18:32:12 -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 3B845346; Fri, 14 Jun 2019 15:32:12 -0700 (PDT) Received: from mammon-tx2.austin.arm.com (mammon-tx2.austin.arm.com [10.118.30.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 2BA2C3F694; Fri, 14 Jun 2019 15:32:12 -0700 (PDT) From: Jeremy Linton To: linux-arm-kernel@lists.infradead.org Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, catalin.marinas@arm.com, will.deacon@arm.com, rjw@rjwysocki.net, sudeep.holla@arm.com, lenb@kernel.org, Jeremy Linton Subject: [PATCH v2 2/2] arm64: topology: Use PPTT to determine if PE is a thread Date: Fri, 14 Jun 2019 17:31:58 -0500 Message-Id: <20190614223158.49575-3-jeremy.linton@arm.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190614223158.49575-1-jeremy.linton@arm.com> References: <20190614223158.49575-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 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);