Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp201856imu; Thu, 8 Nov 2018 17:51:35 -0800 (PST) X-Google-Smtp-Source: AJdET5eX+Pz69cDjwaGVmLfE/Sq9CDK9INmVhAuRMewA65XXpgFBjNFDgKPe/rrzELONQKjwjDWW X-Received: by 2002:a17:902:a717:: with SMTP id w23-v6mr6884240plq.24.1541728295023; Thu, 08 Nov 2018 17:51:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541728294; cv=none; d=google.com; s=arc-20160816; b=BoNB/w1+cwLCgbtk6OF88071ps/HJ1ywyUGMCzqlZHjxFruv9M71tSUw6DtM2ZcAIh mRADnQfugJillIn56XkdeXXmbhQsYiYVEfZil/5Zh+13tC5jwwWPi4vUHe1dhxZDPZuV 0IHJekRfvX4OKAZMe0qpCSnV78Ai8cZxTBWm3Fg2FScZEjnYozb/5fXmhpjx67DZqeuZ R47D3ZS0uqzkc3AeqJtSjAMArLjsnflVYITn7WKmcNlNcCyY7UT2qmjYWUiyJt2jTFyq /8Kr0mUOrRooR7UTK2+uuN6R2h9mM7FI6VeKXzhFdHp+sZSXTF+H2DXpSKXTOnVK+9jg n6zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=3gO6i754AHIiEy311pHr+AmmiKPxyBupSir5I8iCPH4=; b=ws+QlZ+6QZUxKCib73rU6sut7cf20rp32FrGqFJEC53Mr6Iiy0V3XoOQ593kd9+yZF +wPWeQAj8KL/nFghHPcqd4ddSh+IMJm7+xUAgkSal0cKQACxqlRwlFJTBzO14EvVLVZo CyQ8FUO8ghQByjjIiao2A+Q2DsLrmsXa0mxM0G3vn0DMNdlFmF7Rvz8dLYAZljVMUKdX U1/6fzH4entTaewAjBKbzEo+WZPakEJ/M/XG7lzILfaS86ZGIueH6uc6oQ7BpurUIUCL IwsQ1yrn7Sk3+nRjDDdXHBZX35W7wiropT+aQJvK9D/OBMdEFJgFjy6cn2a/xLmclvRF hDig== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=eG2dsFtz; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f69-v6si5550724pgc.304.2018.11.08.17.51.19; Thu, 08 Nov 2018 17:51:34 -0800 (PST) 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=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=eG2dsFtz; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727789AbeKIL2b (ORCPT + 99 others); Fri, 9 Nov 2018 06:28:31 -0500 Received: from esa3.hgst.iphmx.com ([216.71.153.141]:29613 "EHLO esa3.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727336AbeKIL2b (ORCPT ); Fri, 9 Nov 2018 06:28:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1541728211; x=1573264211; h=from:to:cc:subject:date:message-id; bh=VF4xDTCd1cf9MNbFtsKdQRmCcMT129PQWO/5Qc0m0p0=; b=eG2dsFtzQb245LzBDSGS/1qlO0crxTf2RaVBcRKcm/UmLzpAuorDWgDQ Cj9FdBEzZfOlLnjG0/3t+z+HXq/4KSItnG4tGo08jCq4RbcaeInZ8daft Cnagu/HmyYUhX9L69bt0GgjaybEuGpiKRpg1licxu3yvqzWbTB1WBdSO6 YdpnBrWeNc6N3VY7VGK/eztcDdo87axG0M/WOFKzYWDZ+hN64x5HzKHmp r7HTln17sU5AaxvDo1gRsNXcKVB588n/iMyMSK68TmxQjqChYK9slkGJX pkGeVjsm+Z4jiYbmLf73Xo8KHzlYjyt5rdbszbZlT6v5Wursn+T+ilx4J A==; X-IronPort-AV: E=Sophos;i="5.54,481,1534780800"; d="scan'208";a="98624911" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 09 Nov 2018 09:50:11 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 08 Nov 2018 17:33:44 -0800 Received: from jedi-01.sdcorp.global.sandisk.com (HELO jedi-01.int.fusionio.com) ([10.11.143.218]) by uls-op-cesaip02.wdc.com with ESMTP; 08 Nov 2018 17:50:10 -0800 From: Atish Patra To: linux-kernel@vger.kernel.org Cc: linux-riscv@lists.infradead.org, anup@brainfault.org, Damien.LeMoal@wdc.com, atish.patra@wdc.com, linux-arm-kernel@lists.infradead.org, mark.rutland@arm.com, robh+dt@kernel.org, sudeep.holla@arm.com, palmer@sifive.com, devicetree@vger.kernel.org, juri.lelli@arm.com, mick@ics.forth.gr, jeremy.linton@arm.com Subject: [RFC 0/3] Unify CPU topology across ARM64 & RISC-V Date: Thu, 8 Nov 2018 17:50:06 -0800 Message-Id: <1541728209-3224-1-git-send-email-atish.patra@wdc.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The cpu-map DT entry in ARM64 can describe the CPU topology in much better way compared to other existing approaches. RISC-V can easily adopt this binding to represent it's own CPU topology. Thus, both cpu-map DT binding and topology parsing code can be moved to a common location so that RISC-V or any other architecture can leverage that. The relevant discussion regarding unifying cpu topology can be found in [1]. arch_topology seems to be a perfect place to move the common code. I have not introduced any functional changes in the moved to code. The only downside in this approach is that the capacity code will be executed for RISC-V as well. But, it will exit immediately after not able to find the appropriate DT node. If the overhead is considered too much, we can always compile out capacity related functions under a different config for the architectures that do not support them. The patches have been tested for RISC-V and compile tested for ARM64. The socket changes[2] can be merged on top of this series or vice versa. [1] https://lkml.org/lkml/2018/11/6/19 [2] https://lkml.org/lkml/2018/11/7/918 Atish Patra (3): dt-binding: cpu-topology: Move cpu-map to a common binding. cpu-topology: Move cpu topology code to common code. RISC-V: Parse cpu topology during boot. Documentation/devicetree/bindings/arm/topology.txt | 475 ------------------- .../devicetree/bindings/cpu/cpu-topology.txt | 526 +++++++++++++++++++++ arch/arm64/include/asm/topology.h | 23 +- arch/arm64/kernel/topology.c | 305 +----------- arch/riscv/Kconfig | 1 + arch/riscv/kernel/smpboot.c | 6 +- drivers/base/arch_topology.c | 303 ++++++++++++ include/linux/arch_topology.h | 23 + include/linux/topology.h | 1 + 9 files changed, 864 insertions(+), 799 deletions(-) delete mode 100644 Documentation/devicetree/bindings/arm/topology.txt create mode 100644 Documentation/devicetree/bindings/cpu/cpu-topology.txt -- 2.7.4