From patchwork Tue Jun 5 13:55:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 137752 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp992054lji; Tue, 5 Jun 2018 06:56:05 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJk4OmJM4t7K7HiEjB0M3kHLgkWU70CITAtz44x4lduKhkQMNlkAwNJb1B/ex52iYZd27FW X-Received: by 2002:a63:6807:: with SMTP id d7-v6mr2319093pgc.7.1528206965817; Tue, 05 Jun 2018 06:56:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528206965; cv=none; d=google.com; s=arc-20160816; b=MULrOoc+nJn5Il+1zg3Z66gUyLBRSqf7R79SEWeqej7UIuvPuLRHCC7l8rul2hwcB9 E/AY+E2mGoibWtqYKJcJigsWFrX23e4cppZyiKp0Kpc1a3NjTmv7t1C3G1iGch+Yuf0R tkFDqV7FOX01No/xdg/0dy/4ry6mdCyUrIu2ClsZDXZL7dXGdT8CQFmmWVFRoBnwW96e hek1AGskwAl6+0SIP3xz+S1Umxzil4cmG6GxoAWUONmY9/1aCNF85fpViAPlCWlZ/jDF T0LStBmNu8cjdlQnSziKGqc/mQRTj05RnVo6n3QScDi+pVJtX2gewl3YVoygHWa9F7n1 aFPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=PShRUOn8pY2FcIHkUOeDsbkwe5/AxLZF+iSvSkgW3yg=; b=dbDdk5BpYrSeXiV8QfkxRNgqHtjORjXfxmCHgrcl8SyTmIAdzsVdhbBpdmgKPHnfKJ b8WYJshgadiz37YT17KwiiXplF3bgxPpBPvw/jSyA4+vg5pdUVXMwkCzH25U8f9N6iRF dFSc1M5fblg3gPV4z3HctPiM3Z8bb+hJ7phoAyzg1JXcU3PehTyR8/H/omTsulLisaMI g2AXN0EFk6Hfjs9CpfbA/NHi7wnMmVkrh8PCL2/bThNwg2gNwYnuzx0oMhlsHV+Wk9UH SulzeY55UuWCYYHKxp4U56BGdaJRN/OGOey2SssR8Frj/TemSt73fj56zxIn5Mk9tyQg L42Q== ARC-Authentication-Results: i=1; mx.google.com; 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 n1-v6si48517611pld.188.2018.06.05.06.56.05; Tue, 05 Jun 2018 06:56:05 -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; 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 S1752268AbeFENzv (ORCPT + 30 others); Tue, 5 Jun 2018 09:55:51 -0400 Received: from foss.arm.com ([217.140.101.70]:56176 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752231AbeFENzr (ORCPT ); Tue, 5 Jun 2018 09:55:47 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2F2571596; Tue, 5 Jun 2018 06:55:47 -0700 (PDT) Received: from usa.arm.com (e107155-lin.cambridge.arm.com [10.1.210.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 6453E3F25D; Tue, 5 Jun 2018 06:55:45 -0700 (PDT) From: Sudeep Holla To: linux-acpi@vger.kernel.org, "Rafael J . Wysocki" , Catalin Marinas , Jeremy Linton Cc: Sudeep Holla , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Hanjun Guo , Geert Uytterhoeven , Will Deacon Subject: [PATCH 1/3] Revert "arm64: topology: divorce MC scheduling domain from core_siblings" Date: Tue, 5 Jun 2018 14:55:36 +0100 Message-Id: <1528206938-2702-1-git-send-email-sudeep.holla@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This reverts commit 37c3ec2d810f87eac73822f76b30391a83bded19. Currently on ARM64 platforms, we don't update the CPU topology masks on each hotplug operation. However, the updates to cpu_coregroup_mask done as part of ACPI PPTT support, in particular the commit being reverted makes use of cpumask_of_node which returns the cpu_oneline_mask instead of core_sibling as core_sibling masks are not updated for CPU hotplug operations and the comparision to find NUMA in package or LLC siblings fails. The original commit is technically correct and since it depends on the not yet supported feature, let's revert this for now. We can put it back once we have the support for CPU topology masks update on hotplug merged. Reported-by: Geert Uytterhoeven Cc: Catalin Marinas Cc: Will Deacon Signed-off-by: Sudeep Holla --- arch/arm64/include/asm/topology.h | 2 -- arch/arm64/kernel/topology.c | 36 +----------------------------------- 2 files changed, 1 insertion(+), 37 deletions(-) -- 2.7.4 diff --git a/arch/arm64/include/asm/topology.h b/arch/arm64/include/asm/topology.h index df48212f767b..6b10459e6905 100644 --- a/arch/arm64/include/asm/topology.h +++ b/arch/arm64/include/asm/topology.h @@ -8,10 +8,8 @@ struct cpu_topology { int thread_id; int core_id; int package_id; - int llc_id; cpumask_t thread_sibling; cpumask_t core_sibling; - cpumask_t llc_siblings; }; extern struct cpu_topology cpu_topology[NR_CPUS]; diff --git a/arch/arm64/kernel/topology.c b/arch/arm64/kernel/topology.c index 7415c166281f..047d98e68502 100644 --- a/arch/arm64/kernel/topology.c +++ b/arch/arm64/kernel/topology.c @@ -13,7 +13,6 @@ #include #include -#include #include #include #include @@ -215,19 +214,7 @@ EXPORT_SYMBOL_GPL(cpu_topology); const struct cpumask *cpu_coregroup_mask(int cpu) { - const cpumask_t *core_mask = cpumask_of_node(cpu_to_node(cpu)); - - /* Find the smaller of NUMA, core or LLC siblings */ - if (cpumask_subset(&cpu_topology[cpu].core_sibling, core_mask)) { - /* not numa in package, lets use the package siblings */ - core_mask = &cpu_topology[cpu].core_sibling; - } - if (cpu_topology[cpu].llc_id != -1) { - if (cpumask_subset(&cpu_topology[cpu].llc_siblings, core_mask)) - core_mask = &cpu_topology[cpu].llc_siblings; - } - - return core_mask; + return &cpu_topology[cpu].core_sibling; } static void update_siblings_masks(unsigned int cpuid) @@ -239,9 +226,6 @@ static void update_siblings_masks(unsigned int cpuid) for_each_possible_cpu(cpu) { cpu_topo = &cpu_topology[cpu]; - if (cpuid_topo->llc_id == cpu_topo->llc_id) - cpumask_set_cpu(cpu, &cpuid_topo->llc_siblings); - if (cpuid_topo->package_id != cpu_topo->package_id) continue; @@ -307,10 +291,6 @@ static void __init reset_cpu_topology(void) cpu_topo->core_id = 0; cpu_topo->package_id = -1; - cpu_topo->llc_id = -1; - cpumask_clear(&cpu_topo->llc_siblings); - cpumask_set_cpu(cpu, &cpu_topo->llc_siblings); - cpumask_clear(&cpu_topo->core_sibling); cpumask_set_cpu(cpu, &cpu_topo->core_sibling); cpumask_clear(&cpu_topo->thread_sibling); @@ -331,8 +311,6 @@ static int __init parse_acpi_topology(void) is_threaded = read_cpuid_mpidr() & MPIDR_MT_BITMASK; for_each_possible_cpu(cpu) { - int i, cache_id; - topology_id = find_acpi_cpu_topology(cpu, 0); if (topology_id < 0) return topology_id; @@ -347,18 +325,6 @@ static int __init parse_acpi_topology(void) } topology_id = find_acpi_cpu_topology_package(cpu); cpu_topology[cpu].package_id = topology_id; - - i = acpi_find_last_cache_level(cpu); - - if (i > 0) { - /* - * this is the only part of cpu_topology that has - * a direct relationship with the cache topology - */ - cache_id = find_acpi_cpu_cache_topology(cpu, i); - if (cache_id > 0) - cpu_topology[cpu].llc_id = cache_id; - } } return 0; From patchwork Tue Jun 5 13:55:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 137751 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp991860lji; Tue, 5 Jun 2018 06:55:55 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKI2vKCta11TnRZxO6zYNH72eMuK8fY92aNVorTo5L2MLOhHBFdw3yBmTgtS7Vntg5oVgP3 X-Received: by 2002:a62:3889:: with SMTP id f131-v6mr25772373pfa.173.1528206954862; Tue, 05 Jun 2018 06:55:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528206954; cv=none; d=google.com; s=arc-20160816; b=xVEy+ClvwD4nt9Ntg0F55zpto1NF6PclmA9F+wPcPDVdq8Z9lWAN9h2xJhAavO9+uf bwAGJNxMMNCQPQDu5pu6WyWVzqj9tuy+Lu/7SXx7PoROf1MYIjHPTVajsmnqEfYRYvcB W/E9GDuDuXkHbsXfsUrsncH6/sbDW2jGRAx1TZKKnL7PZWJA8Qw+hijVtYpVpEuoXhTG hl+p/q59/av4ye5QGj2xLENDI+fv5aCE/KI2x1VZtaZ4gzOse9wFd9Jd9U83jIglKFWf 9P7BjJt/cMYBgb2/mCejFrVOuaYZDeIpH1sLKy6UWbhHFZgyzKM6AsNW78hHkp8VjhnH hT2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=axDIYGq+/hvrCJSoZCnuU3VW5jpMlFLu3pN6yWyrazE=; b=LJcaXXShRjZ7GOKz31k/ZEThAtOZJKXB6YX9hGfZnP+xBthNc0F6MGSUlEmnyRBxX7 h9T1xKl9MfAo5dn0vOpF7RmBseaC4oFrmcE/b/3Kd3Cy+MeWCQzNs6NbasVvZTBVUu// f1ZvCNuVcVIDRTh19+7xPxAHd4+nI7xTHUDxZuc0/ajoE3wTgmQJJQguX1th75CQ0NCc QNV/SxZfRbZyKh3rUzrWIJkNCp10393aYhE98xZeK9D9J5CUMuzCigYhO6LAocR0a6mw IPR5ySOFkHnBYyBUGylaea3y1s53cQqUC7q6i4RHqC0fabXrIpYm+ZXT56d6ju4qt8Xc bc9g== ARC-Authentication-Results: i=1; mx.google.com; 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 e72-v6si21227596pfl.132.2018.06.05.06.55.54; Tue, 05 Jun 2018 06:55:54 -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; 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 S1752288AbeFENzw (ORCPT + 30 others); Tue, 5 Jun 2018 09:55:52 -0400 Received: from foss.arm.com ([217.140.101.70]:56196 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752239AbeFENzt (ORCPT ); Tue, 5 Jun 2018 09:55:49 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 13ACA15AD; Tue, 5 Jun 2018 06:55:49 -0700 (PDT) Received: from usa.arm.com (e107155-lin.cambridge.arm.com [10.1.210.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 6D1A53F25D; Tue, 5 Jun 2018 06:55:47 -0700 (PDT) From: Sudeep Holla To: linux-acpi@vger.kernel.org, "Rafael J . Wysocki" , Catalin Marinas , Jeremy Linton Cc: Sudeep Holla , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Hanjun Guo , Geert Uytterhoeven Subject: [PATCH 2/3] ACPI / PPTT: fix build when CONFIG_ACPI_PPTT is not enabled Date: Tue, 5 Jun 2018 14:55:37 +0100 Message-Id: <1528206938-2702-2-git-send-email-sudeep.holla@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1528206938-2702-1-git-send-email-sudeep.holla@arm.com> References: <1528206938-2702-1-git-send-email-sudeep.holla@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Though CONFIG_ACPI_PPTT is selected by platforms and nor user visible, it may be useful to support the build with CONFIG_ACPI_PPTT disabled. This patch adds the missing dummy/boiler plate implementation to fix the build. Cc: "Rafael J. Wysocki" Signed-off-by: Sudeep Holla --- include/linux/acpi.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) Hi Rafael, If you are fine with this, can you provide Ack, so that we route this through ARM64 tree where most of the ACPI PPTT support is present. Regards, Sudeep -- 2.7.4 diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 8f2cdb0eca71..0fa28265d095 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -1299,8 +1299,28 @@ static inline int lpit_read_residency_count_address(u64 *address) } #endif +#ifdef CONFIG_ACPI_PPTT int find_acpi_cpu_topology(unsigned int cpu, int level); int find_acpi_cpu_topology_package(unsigned int cpu); int find_acpi_cpu_cache_topology(unsigned int cpu, int level); +int acpi_find_last_cache_level(unsigned int cpu); +#else +static inline int find_acpi_cpu_topology(unsigned int cpu, int level) +{ + return -EINVAL; +} +static inline int find_acpi_cpu_topology_package(unsigned int cpu) +{ + return -EINVAL; +} +static inline int find_acpi_cpu_cache_topology(unsigned int cpu, int level) +{ + return -EINVAL; +} +static inline int acpi_find_last_cache_level(unsigned int cpu) +{ + return -EINVAL; +} +#endif #endif /*_LINUX_ACPI_H*/ From patchwork Tue Jun 5 13:55:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 137753 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp992107lji; Tue, 5 Jun 2018 06:56:09 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKJZKsvV6+FIsS2/G/Dvzi/tVkZnafnx/pOTaiwVTF5jDxKaBvi2qF5q3bKXBlGx/Hv2vAr X-Received: by 2002:a17:902:6f16:: with SMTP id w22-v6mr26028032plk.216.1528206968906; Tue, 05 Jun 2018 06:56:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528206968; cv=none; d=google.com; s=arc-20160816; b=zKQRpPno0lwK/QfKx/KCu5y5B21ckXm3zeuqdgBEOvTLZH535CpKiRCgEjonzjcV36 o53uUObKfTq9WXmbkJKVoF49q9MeFgxpxbws8bI498p/nSRS0neu+hJ7dsLZd18fM/Oo DYpMkGKY3qpKSDJbbbYs0Aqi1WpiUq7cJ98I/VpQ4e+7y4yHG1kVEC4z1mmEPdaXM6KD MYMXtfxVMAej2a3KVemQ2tq+wD1L0HstYo+s+45ScBzH8eR6k+EWt6VegIoeYEr+L6wN Z/u1/HLhmp2+g6dzAIbRggALORcQuVCC+f7sLvwFvFPPB2Y73aiwWEbVVS4/tCRv2Zho B9pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=bGiDrNddwK7J/aW+qZWkltC9FfdOIISTbrLJgX1DssA=; b=sOHxjAvwy9COznPHILWQbIAnn/TG5d4GoFEBk/64EYdHDQ9YrLwaFCgNiLLaz0/MV3 gufDnpD6uLFLrJn8RiXCmMTV3+ujb17/mC4kUBmpWWgpgc9NEsmG9e3j++0Jz4+TyblG hqiVWpckYvW7pT6XCQTq8xSDJo5htYYkJCrtPe8h23VZoAu6qe5Dkd1ze/duY7idioCm Q4QeoWnHIYytYEBJtSX+Vn/lIPwoB94yHBR4RvyymhmpEojyHXI2ZZXK+u1bvI+sl/NJ NdlJnBYAJXnbD3xmU3wv1hxBI/NP8xa/L6MkP0dcpQcMdnTIUUWEiJhWrBuNu2zD0lod ECbg== ARC-Authentication-Results: i=1; mx.google.com; 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 n1-v6si48517611pld.188.2018.06.05.06.56.08; Tue, 05 Jun 2018 06:56:08 -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; 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 S1752147AbeFEN4H (ORCPT + 30 others); Tue, 5 Jun 2018 09:56:07 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:56202 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752258AbeFENzv (ORCPT ); Tue, 5 Jun 2018 09:55:51 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 25BEF15B2; Tue, 5 Jun 2018 06:55:51 -0700 (PDT) Received: from usa.arm.com (e107155-lin.cambridge.arm.com [10.1.210.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 529D63F25D; Tue, 5 Jun 2018 06:55:49 -0700 (PDT) From: Sudeep Holla To: linux-acpi@vger.kernel.org, "Rafael J . Wysocki" , Catalin Marinas , Jeremy Linton Cc: Sudeep Holla , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Hanjun Guo , Geert Uytterhoeven , Will Deacon Subject: [PATCH 3/3] arm64: disable ACPI PPTT support temporarily Date: Tue, 5 Jun 2018 14:55:38 +0100 Message-Id: <1528206938-2702-3-git-send-email-sudeep.holla@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1528206938-2702-1-git-send-email-sudeep.holla@arm.com> References: <1528206938-2702-1-git-send-email-sudeep.holla@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently, ARM64 doesn't support updating the CPU topology masks on CPU hotplug operations. ACPI PPTT support rely on that missing feature which is technically not incorrect. Instead of reverting all the PPTT support, let's keep it simple and disable ACPI PPTT support on ARM64 for time-being until the topology updates are added for CPU hotplug operations. Cc: Catalin Marinas Cc: Will Deacon Signed-off-by: Sudeep Holla --- arch/arm64/Kconfig | 1 - 1 file changed, 1 deletion(-) -- 2.7.4 diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 9fd4a8ccce07..98a5c78a80f9 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -7,7 +7,6 @@ config ARM64 select ACPI_REDUCED_HARDWARE_ONLY if ACPI select ACPI_MCFG if ACPI select ACPI_SPCR_TABLE if ACPI - select ACPI_PPTT if ACPI select ARCH_CLOCKSOURCE_DATA select ARCH_HAS_DEBUG_VIRTUAL select ARCH_HAS_DEVMEM_IS_ALLOWED