Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1217589imu; Mon, 5 Nov 2018 16:14:33 -0800 (PST) X-Google-Smtp-Source: AJdET5fy59OZzAkdf4wJ5VkwugTGJVxaZWkF1k/2qdiPeuQRPOSat404Bty/+QCDNmADOEFVeKda X-Received: by 2002:a63:c341:: with SMTP id e1-v6mr21893201pgd.452.1541463273509; Mon, 05 Nov 2018 16:14:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541463273; cv=none; d=google.com; s=arc-20160816; b=U+DxBmPcQiu+Bnhh8MNONfgUZ7OAxLD3tu7xN2ugzdrVLqetGbB7f161mJ6WOkvNWh z8FBscv2BZAnd/u4l5m8s0PpwnyRH97fHu+R4hK/zPgnFn6G5UjaDOKRKjQxw3/6sVeQ jnrNMqG2y6cJ6f2r2I97D4Nr3Bu+hhNf6g0UHakVnjGFzXVHbielA20hywxdUwXBR9aH sJydPREQuNEH0SuNdL0YGVdsXI2Kv/10klW3X1g/XLKqHPgDFu8eB0FTAfRHmGpdsR8t rRInYUB3CYLUiP/wRttFZhO2ca/wKnRVomdQ9MBZVcNViNt/HkA0daSA3MZfH3pih7fq F76Q== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=jezPvKc1hJm6dDWaRWT5iq+ZLdyy4/xXH8NKjeIpf8M=; b=FLY/nP4XhyXVvfBAoV+0kRgRyvFUHIiOu24H6QklXL1A6RRo7U59Qjk1Ea6gegZ93k 1VAuLEdTW+jMGM3Mo0HNMcfMxx6/ryv94tSx4yi3wQwIteEFBRtW3yyraHNpfxcj2dCx qL9ioDHUJ1pOWZ2v3apbbUGn4OjjrrjLAkKk9AG62CnmQk0QeL52Oo1xpcG1/km95CrO Ucfwt0vfEuATOVYho0QhgB1I6UgYHoboj0QoEcijHiY0FCK9d4KU1H5LRlcdHzZqIlD6 idtAIvDK2yJQW8wjA72W4cEXqdy1VE/P9bLdm1f/DGwUNUbRtk1otoBYpGkNU8em2Fb4 w66Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=hO1CfC7N; 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 y15si14616801pgf.321.2018.11.05.16.14.17; Mon, 05 Nov 2018 16:14:33 -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=hO1CfC7N; 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 S1728970AbeKFJed (ORCPT + 99 others); Tue, 6 Nov 2018 04:34:33 -0500 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:55865 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725796AbeKFJed (ORCPT ); Tue, 6 Nov 2018 04:34:33 -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=1541463133; x=1572999133; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=8a1aL70reaGLohkAFR3PuOjUHcIqIcEdntS639e0iiE=; b=hO1CfC7NA2vmAruNVAodJ9XDPoOgYt6ogpSakrY0t47HZ4Rp8XxxclsU 72+JUlt4BjX8/AteVwWG7x8/Zx0sMVuRCt3zTu7mEVDQLBP3OMiGmsSMa d20p/rMDecCYKuBt/N40himc6s832fy5IQn0r0+W8LtMt1jcSvENZB3jx eD6gfq5KdLyZCKn1iYUhLzUh3ec9vr4odV0r71BvHCHRJkCRU+Jem17+O XOy+Q2uVvW2nS86XCVp57WWk76g8342KyplVWEyky6rAtpJiSrCmfNYVT A7yBWkLyAHKK5CDijEFsnWMly1w89IcUNoQwl35m5TDOws4dJw6ienjEU Q==; X-IronPort-AV: E=Sophos;i="5.54,469,1534780800"; d="scan'208";a="95274834" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 06 Nov 2018 08:12:12 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP; 05 Nov 2018 15:55:50 -0800 Received: from c02v91rdhtd5.sdcorp.global.sandisk.com (HELO [10.111.69.187]) ([10.111.69.187]) by uls-op-cesaip02.wdc.com with ESMTP; 05 Nov 2018 16:12:12 -0800 Subject: Re: [RFC 1/2] dt-bindings: topology: Add RISC-V cpu topology. To: Rob Herring , Palmer Dabbelt Cc: "linux-riscv@lists.infradead.org" , Anup Patel , Christoph Hellwig , Damien Le Moal , Thomas Gleixner , Mark Rutland , "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" , "alankao@andestech.com" , Zong Li References: From: Atish Patra Message-ID: <8b502dca-bf5f-50b8-e1b2-997c6e2ca260@wdc.com> Date: Mon, 5 Nov 2018 16:12:11 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/5/18 12:11 PM, Rob Herring wrote: > On Mon, Nov 5, 2018 at 1:39 PM Palmer Dabbelt wrote: >> >> On Fri, 02 Nov 2018 06:09:39 PDT (-0700), robh+dt@kernel.org wrote: >>> On Thu, Nov 1, 2018 at 6:04 PM Atish Patra wrote: >>>> >>>> Define a RISC-V cpu topology. This is based on cpu-map in ARM world. >>>> But it doesn't need a separate thread node for defining SMT systems. >>>> Multiple cpu phandle properties can be parsed to identify the sibling >>>> hardware threads. Moreover, we do not have cluster concept in RISC-V. >>>> So package is a better word choice than cluster for RISC-V. >>> >>> There was a proposal to add package info for ARM recently. Not sure >>> what happened to that, but we don't need 2 different ways. >>> >>> There's never going to be clusters for RISC-V? What prevents that? >>> Seems shortsighted to me. >>> >>>> >>>> Signed-off-by: Atish Patra >>>> --- >>>> .../devicetree/bindings/riscv/topology.txt | 154 +++++++++++++++++++++ >>>> 1 file changed, 154 insertions(+) >>>> create mode 100644 Documentation/devicetree/bindings/riscv/topology.txt >>>> >>>> diff --git a/Documentation/devicetree/bindings/riscv/topology.txt b/Documentation/devicetree/bindings/riscv/topology.txt >>>> new file mode 100644 >>>> index 00000000..96039ed3 >>>> --- /dev/null >>>> +++ b/Documentation/devicetree/bindings/riscv/topology.txt >>>> @@ -0,0 +1,154 @@ >>>> +=========================================== >>>> +RISC-V cpu topology binding description >>>> +=========================================== >>>> + >>>> +=========================================== >>>> +1 - Introduction >>>> +=========================================== >>>> + >>>> +In a RISC-V system, the hierarchy of CPUs can be defined through following nodes that >>>> +are used to describe the layout of physical CPUs in the system: >>>> + >>>> +- packages >>>> +- core >>>> + >>>> +The cpu nodes (bindings defined in [1]) represent the devices that >>>> +correspond to physical CPUs and are to be mapped to the hierarchy levels. >>>> +Simultaneous multi-threading (SMT) systems can also represent their topology >>>> +by defining multiple cpu phandles inside core node. The details are explained >>>> +in paragraph 3. >>> >>> I don't see a reason to do this differently than ARM. That said, I >>> don't think the thread part is in use on ARM, so it could possibly be >>> changed. >>> >>>> + >>>> +The remainder of this document provides the topology bindings for ARM, based >>> >>> for ARM? >>> >>>> +on the Devicetree Specification, available from: >>>> + >>>> +https://www.devicetree.org/specifications/ >>>> + >>>> +If not stated otherwise, whenever a reference to a cpu node phandle is made its >>>> +value must point to a cpu node compliant with the cpu node bindings as >>>> +documented in [1]. >>>> +A topology description containing phandles to cpu nodes that are not compliant >>>> +with bindings standardized in [1] is therefore considered invalid. >>>> + >>>> +This cpu topology binding description is mostly based on the topology defined >>>> +in ARM [2]. >>>> +=========================================== >>>> +2 - cpu-topology node >>> >>> cpu-map. Why change this? >>> >>> What I would like to see is the ARM topology binding reworked to be >>> common or some good reasons why it doesn't work for RISC-V as-is. >> >> I think it would be great if CPU topologies were not a RISC-V specific thing. >> We don't really do anything different than anyone else, so it'd be great if we >> could all share the same spec and code. Looking quickly at the ARM cpu-map >> bindings, I don't see any reason why we can't just use the same thing on RISC-V >> -- it's not quite how I'd do it, but I don't think the differences are worth >> having another implementation. Mechanically I'm not sure how to do this: >> should there just be a "Documentation/devicetree/bindings/cpu-map.txt"? > > Yes, but ".../bindings/cpu/cpu-topology.txt". > > And if we need $arch extensions, they can be moved there. (Really, I'd > like to get rid of /bindings/$arch/* except for maybe a few things.) > >> If everyone is OK with that then I vote we just go ahead and genericise the ARM >> "cpu-map" stuff for CPU topology. Sharing the implementation looks fairly >> straight-forward as well. > +1 for a common code base. I am happy to take it up if nobody else has not already started working on it. Is there a ARM hardware test farm that can be used to test such changes? Regards, Atish