Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3092601imu; Thu, 29 Nov 2018 15:29:57 -0800 (PST) X-Google-Smtp-Source: AFSGD/XG30DorRswCdr3mTPkeyZd5LgERzUpKIMmqzRBaIbEbQg3dZR+brHXNpBsbbJv0dVMuBkD X-Received: by 2002:a62:68c5:: with SMTP id d188mr3489420pfc.194.1543534197876; Thu, 29 Nov 2018 15:29:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543534197; cv=none; d=google.com; s=arc-20160816; b=as+mWegw+FUOLC9WyURjI6CN/rOWJRCTBWfQsdQM1HDMARaSP6TxkD86Km1VjMwbOX xJKHtgNzGHLeLfSZpuSwC/sJdUPV4fnm2czoRlOBUfPd15vRocXMNxzIHYufhSUdeF0q AJVHmP9EucS0HVlP2dPxSEBpPgj8PAawL+1d7NSjIYuXbLjHLlq4MOu2l+xKWetI8RGL gP5Nvt7mxzg2nzpPNodFKL/x4ZBIkraRNvtGmB+BQiqs+VO1AqS2JR4n/2RzDVx4EIWD cX3cXwn1n5igTMjYdHVcvAdlr6kdHeM0CIHExlIv2Lwnls9ArtjwIrBoKXEveahzV8TI gU8A== 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=b5Ee+uZYjJA5coS7qCQDrPsH0msj7gaAlL/fDLqY4C4=; b=e735gcI7V1RRmhrIA35iv2wg7jVxStsrpjegOSwCJr2aOOeaLlULX8X/EZNe0mXty0 2A/aVzrM8AS2OSx7/DtHjLzzDmFUjVltKen+FUaVyTbZgTtBQqbMYxoI44Xi5lZWpe5n JyKg8DeGfvNGyWF9n63TouTec2ssa5sUOimxvmsuK3QZqVYDhOZYf2/LBjgKny2K7C6t SD+oSbW2YB+iqAt+iHqB5FTCVmSYpxi1nNgbDycoVUx7b+IJ4/g+wzl0lvdUBl8i4O9f U2BL6ta1XczQb3CnZxu8iWf1IT/jNqKMkTk7PHedhuNryIrfIRL+Lymg754OHEsvj47V 9FiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=oTqTKDli; 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 e6si3098508pgk.201.2018.11.29.15.29.43; Thu, 29 Nov 2018 15:29:57 -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=oTqTKDli; 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 S1726956AbeK3Kfk (ORCPT + 99 others); Fri, 30 Nov 2018 05:35:40 -0500 Received: from esa5.hgst.iphmx.com ([216.71.153.144]:50484 "EHLO esa5.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726393AbeK3Kfk (ORCPT ); Fri, 30 Nov 2018 05:35:40 -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=1543534107; x=1575070107; h=from:to:cc:subject:date:message-id; bh=L7Qnx+G1U15UoezilU3DKAcIr1VLVm+CQnW9+MoRsKs=; b=oTqTKDli1HZWr14a4gdRslqdsLY6gE2Ccnt1xO+D/28GAfOsRmca6iyt iW489Auj48ALeMXXiRvtQFKPpGHgPG8Gs0jXj/7j40LrbV+oIpfhHtxJi ilBPav86jOr3c8FjNNb0mCEzzhnegSt9DE96nDZmbA8HMrWvcoZqqeaHA CLtx1lIvFlTcNEp7h0MAu+DQ5tJubWSSaubo9LyEX9tA1kN+/F6Ir1pud PT/+8/4VDTqWaQVi67gcY9VzVdtssFExDUwsEtL3VCZegkzfdIUvktv7P ceIl9P2uomkoqPwDCGTDWMYXFTWO1z97yMXR9BybLjrWaS4Szo+F2pzHm Q==; X-IronPort-AV: E=Sophos;i="5.56,296,1539619200"; d="scan'208";a="96644301" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 30 Nov 2018 07:28:26 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP; 29 Nov 2018 15:11:23 -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; 29 Nov 2018 15:28:26 -0800 From: Atish Patra To: linux-kernel@vger.kernel.org Cc: Atish Patra , Albert Ou , Anup Patel , Ard Biesheuvel , Catalin Marinas , devicetree@vger.kernel.org, Dmitriy Cherkasov , Greg Kroah-Hartman , Ingo Molnar , Jeremy Linton , Juri Lelli , linux-arm-kernel@lists.infradead.org (moderated list:ARM64 PORT (AARCH64 ARCHITECTURE)), linux-riscv@lists.infradead.org, Mark Rutland , Morten Rasmussen , Palmer Dabbelt , "Peter Zijlstra (Intel)" , "Rafael J. Wysocki" , Rob Herring , Sudeep Holla , Thomas Gleixner , Will Deacon Subject: [RFT PATCH v1 0/4] Unify CPU topology across ARM64 & RISC-V Date: Thu, 29 Nov 2018 15:28:16 -0800 Message-Id: <1543534100-3654-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 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 & x86. The socket change[2] is also now part of this series. [1] https://lkml.org/lkml/2018/11/6/19 [2] https://lkml.org/lkml/2018/11/7/918 QEMU changes for RISC-V topology are available at https://github.com/atishp04/riscv-qemu/tree/cpu_topo Apologies for the previous patch series with incorrect title and was sent only to kernel mailing list due to a bug in my config. Please ignore that. 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. Sudeep Holla (1): Documentation: DT: arm: add support for sockets defining package boundaries .../{arm/topology.txt => cpu/cpu-topology.txt} | 133 +++++++-- arch/arm64/include/asm/topology.h | 22 -- arch/arm64/kernel/topology.c | 303 +-------------------- arch/riscv/Kconfig | 1 + arch/riscv/kernel/smpboot.c | 3 + drivers/base/arch_topology.c | 294 ++++++++++++++++++++ include/linux/arch_topology.h | 26 ++ include/linux/topology.h | 1 + 8 files changed, 435 insertions(+), 348 deletions(-) rename Documentation/devicetree/bindings/{arm/topology.txt => cpu/cpu-topology.txt} (66%) -- 2.7.4