Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3077832imu; Thu, 29 Nov 2018 15:11:51 -0800 (PST) X-Google-Smtp-Source: AFSGD/XwW4FGs86PQr3/bPquTXNSNyPumIM3hbjKc0yJaDhEIA87Y+EnRZOqUJbmZfR2ym9Xnf1g X-Received: by 2002:a17:902:714c:: with SMTP id u12mr3339175plm.234.1543533111638; Thu, 29 Nov 2018 15:11:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543533111; cv=none; d=google.com; s=arc-20160816; b=H0OOXFlu9GN7XXYZ1jtHFT80a79ic21BugmD5JsATKZvqojbj5qaOI4Erh9VMRVXmd 6859DO4QCHucfNh0BOcwHqCAxTyKGveseXgYjrHmoN3HhaMXsl3Jk56d/qpz4eR0aUq+ dJb9k5Eh8aRGTRyNDh8oeYKpkFHkkvlowGtXahcA5Jc5VyETG0dS/WXL0GT0RDrHqrA7 BlF6+nvKo5dNrZMFDh3wDA+sVAf6fKs9/GwE4GhhAwgGQ6eyjry11haYtYr4Do9gCthh Udz9om3hbIrQL/+t4whFBFfg+i0trAyJkxZADipgOOr6Q65yJ6mcyHgSs0740hTpUIRH +S2w== 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:to:from :dkim-signature; bh=20iwetj/siTbFRgWBzGRCPOwMuV6BEZOQViIUxyHfE4=; b=QO0Lc1A/WMzDG5wehsTtwYSp4IKw6RZDeZbZtaAOb4lUrs2Ndj1EdkmEkoqLXKGiaQ BGaoOBlSkK75Pq555RQpB7rkPEMiB9hmqTooxFNNpUVPsYnzeneq3V1LCu//In5PskB+ gi6Zn0lUGahv0PItXqOly3HG/sfjLupbm+fyP3ehCUChP2fu82nek6nkaAk4BxgnubcU w/w4LVdPKnKiNxr6o/gbUqWRt/eanQPaxDs9qoLttpopPxp9j9ENPlW6GxyL8/oQzykR C8ccfkuIqQak5wIPun7vuSqAvAjbVwyOc6QSVl6JMG8pCZ+ITwPibli/D5LZSeabcwTr sRjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=P71jGYZH; 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 w7si3588551ply.421.2018.11.29.15.11.37; Thu, 29 Nov 2018 15:11:51 -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=P71jGYZH; 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 S1727694AbeK3KQl (ORCPT + 99 others); Fri, 30 Nov 2018 05:16:41 -0500 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:43698 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727303AbeK3KQ0 (ORCPT ); Fri, 30 Nov 2018 05:16:26 -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=1543532958; x=1575068958; h=from:to:subject:date:message-id; bh=T4sACbZQqUFgfK2xqCQnFGi9r01TmuB0hzck2X/Um78=; b=P71jGYZHDSkS9RKhPeJCi6gZKYDH/pQW1LCC0d9P44sQxU/MHQrG13o0 wliVD6ihUBb/19xOHgxyyJK4W6fsGsEdhgdLYbuIigDd4iuDMJnDsS08H NkQQfHYYwqtdEmLVAEeG1B0JCVdrmoHYP0H6Gy9hOpFkioEpYM/zbz2LZ ck8Orjc/yzva/TmLYOYRBOmSJZycKTm831z71D62HUQ7C/fqMSlkAh/ED gPAWRLjv5VOI65Yv8Rzo9x6LkcClV4OYH/uOZLuQt5IylgTM1YXywvLIg /itw6U/2PiEroQZVfo8xPDZ0pvcr0iM9nhmUOPH23Hzdhi2nU+7xzczpg A==; X-IronPort-AV: E=Sophos;i="5.56,296,1539619200"; d="scan'208";a="97183853" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 30 Nov 2018 07:09:18 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP; 29 Nov 2018 14:52:14 -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:09:18 -0800 From: Atish Patra To: linux-kernel@vger.kernel.org, atish.patra@wdc.com Subject: [RFT PATCH 0/4] Unify CPU topology across ARM64 & RISC-V Date: Thu, 29 Nov 2018 15:09:13 -0800 Message-Id: <1543532957-22661-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 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