Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4202117pxj; Tue, 11 May 2021 23:38:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXeTXNsHQoLagKXF3/1R8ifus13zhL/5E2m/uJKXPkDjGZAGaPCndAvQ7ku2zE0VoBA87t X-Received: by 2002:a17:906:374b:: with SMTP id e11mr36130144ejc.328.1620801491464; Tue, 11 May 2021 23:38:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620801491; cv=none; d=google.com; s=arc-20160816; b=DvublhyZFtl26pxQUr3WVwqZdMORAoUaKu70nmmkawqv4PIGaJsj/PdRSZPq7mQedz jiOYZDnE1MCSpTfvI59prQKaoQHeQPCv0gtPTVtqt9mEkrhL26rhfV1s6fIeLqC+cQ2Q 4MT8NvBdQr61sZzTr4dyF299gVjWMB+968z9wCxAbIB7cgQuD+ksDhEO/wA9ApOi/OOe 3PdyiwMfr2XcYhGUxtnakx4NfaYOX3qi35xJYl2AuUpHvx3OUtzy/2jtUVXa0E/xPhgm PWxJfuPQnofaXQCP3/M7OE4aiTe5cArwCdNAkKIQmnqWxOH4rLV+VgfW27QGfzs7mbuv 0LXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=nevGWaMjb5PeAfV1/F7svJNtl2lKO/LKnPavtCONiAI=; b=cWMWzEUObhzHYsywaUmwR8F+qUcELHxOseMS6NIaO+4bYOggpCyQsyocHTdt/+KjSZ S0zTArX4I8Ge+mIA3rmc59Udw2lQ8NAxW5OubW2wF6yQ2kSzveNtQovUL9h5dgpN2TDm DcwgCYwQJO+APPkXNbyMmcYOg5EY/zWpUvyrL8y61JzTHDH9JELJ9JQVq6hmyFAn9EWZ /8eBz3femGpCtE+UBbHDDdRgH/o4juDklc7vffVAqY/eBDpXeGlPeKcxYavLWW6JHIVU W8GG8cdjxSMtH3kisQ0QyU7cecVxqeDNnbB8bZy+MmCUc45m1IHjf7sgVuVe8cGvBXiJ SkeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=HPpOr4WJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ga2si6009483ejb.249.2021.05.11.23.37.47; Tue, 11 May 2021 23:38:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=HPpOr4WJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229776AbhELGhj (ORCPT + 99 others); Wed, 12 May 2021 02:37:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229626AbhELGhf (ORCPT ); Wed, 12 May 2021 02:37:35 -0400 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A279C06175F for ; Tue, 11 May 2021 23:36:27 -0700 (PDT) Received: by mail-ej1-x62f.google.com with SMTP id j10so6255101ejb.3 for ; Tue, 11 May 2021 23:36:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=nevGWaMjb5PeAfV1/F7svJNtl2lKO/LKnPavtCONiAI=; b=HPpOr4WJvmIPXKYS68buFhoAp5Li17j7jKX7/p4MM8Jdc8zp3Afy+9QrHlxyMLkqIl W0fRFCLAdUeZBL3gi7PbgBPQ2F0hcFhKcEsEbfTfQvBERFdKM/18nGInFsl/X0bSoMrR nR9pIlJU1StFIq8JAetJztmRo3A6V63sHQnOOaWpliocMXgE0ELlocl9ycD4j9pn7JFr 3n0uEjA7UdCX+6oI3KKWzREefFEM0X5ZRtOwXAlMHKHKa1Cb2PUkuaNhhHeMUmQctqYU ZdY5BRWrjlO0ZlELbBdtQu9YnCkrzUMTOZOQtTedilA/k5K62kSLy1DVIUepVg5shp51 ItYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=nevGWaMjb5PeAfV1/F7svJNtl2lKO/LKnPavtCONiAI=; b=SHdStRwyVNiy9C6bEaGayHvrVlZm9OWHwjJKBdDunM5yH0TtAcc7RH04eiL1qUnyk7 eYw4o9mkpHBFtnQ8f1/OL55ZjRpCX+3vQ5Q51czpW0sPZiTuOc+imRn0r+V4JHIC6s3S uRDJJqlW47lAbwcFqjL8eG0SttOMFaMcyMlrUfzwql6nC5njb5uZCunY8iVbZFF8cJ1D wuViB4zV2I5FVPDD/xIEmeDFUnFQE27RXjP1gjWmP1cFyPUcMHSaSqkjQGri+udN60gc f/VnDo12N8EePizq4rhwzWyX+tH1BsQvjbUpruoUxvdhfBxF/jpxGXFkyiP3ImoRNgwp S6bA== X-Gm-Message-State: AOAM532CihGxXCdEkpSQ9HZclUwRCl5RUKwpDiOS8RYUph54CoW6uXF9 /JcVg/DpRnBVpbk12Qwxl/dZJnhMMVV5Pg1VZ2r3Yg== X-Received: by 2002:a17:906:bc8e:: with SMTP id lv14mr35741607ejb.418.1620801386118; Tue, 11 May 2021 23:36:26 -0700 (PDT) MIME-Version: 1.0 References: <162042787450.1202325.5718541949681409566.stgit@dwillia2-desk3.amr.corp.intel.com> <162042791852.1202325.8197739881935753009.stgit@dwillia2-desk3.amr.corp.intel.com> <20210510162121.000042be@Huawei.com> In-Reply-To: <20210510162121.000042be@Huawei.com> From: Dan Williams Date: Tue, 11 May 2021 23:36:15 -0700 Message-ID: Subject: Re: [PATCH 7/8] cxl/port: Introduce cxl_port objects To: Jonathan Cameron Cc: linux-cxl@vger.kernel.org, Linux PCI , Linux Kernel Mailing List , Linux ACPI Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 10, 2021 at 8:23 AM Jonathan Cameron wrote: > > On Fri, 7 May 2021 15:51:58 -0700 > Dan Williams wrote: > > > Once the cxl_root is established then other ports in the hierarchy can > > be attached. The cxl_port object, unlike cxl_root that is associated > > with host bridges, is associated with PCIe Root Ports or PCIe Switch > > Ports. Add cxl_port instances for all PCIe Root Ports in an ACPI0016 > > host bridge. The cxl_port instances for PCIe Switch Ports are not > > included here as those are to be modeled as another service device > > registered on the pcie_port_bus_type. > > > > A sample sysfs topology for a single-host-bridge with > > single-PCIe/CXL-port follows: > > > > /sys/bus/cxl/devices/root0 > > =E2=94=9C=E2=94=80=E2=94=80 address_space0 > > =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 devtype > > =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 end > > =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 start > > =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 supports_ram > > =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 supports_type2 > > =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 supports_type3 > > =E2=94=82 =E2=94=94=E2=94=80=E2=94=80 uevent > > =E2=94=9C=E2=94=80=E2=94=80 address_space1 > > =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 devtype > > =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 end > > =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 start > > =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 supports_pmem > > =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 supports_type2 > > =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 supports_type3 > > =E2=94=82 =E2=94=94=E2=94=80=E2=94=80 uevent > > =E2=94=9C=E2=94=80=E2=94=80 devtype > > =E2=94=9C=E2=94=80=E2=94=80 port1 > > =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 devtype > > =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 host -> ../../../../LNXSYSTM:00= /LNXSYBUS:00/ACPI0016:00 > > =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 port2 > > =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 devtype > > =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 host -> ../../../..= /../pci0000:34/0000:34:00.0 > > =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 subsystem -> ../../= ../../../../bus/cxl > > =E2=94=82 =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 target_id > > =E2=94=82 =E2=94=82 =E2=94=94=E2=94=80=E2=94=80 uevent > > =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 subsystem -> ../../../../../bus= /cxl > > =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 target_id > > =E2=94=82 =E2=94=94=E2=94=80=E2=94=80 uevent > > =E2=94=9C=E2=94=80=E2=94=80 subsystem -> ../../../../bus/cxl > > =E2=94=9C=E2=94=80=E2=94=80 target_id > > =E2=94=94=E2=94=80=E2=94=80 uevent > > > > In this listing the system-wide-singleton root0 has 2 address spaces, 1 > > PMEM and 1 RAM. Those address spaces are accessed through port1 which > > represents the upstream port of an ACPI0016 host-bridge. A > > multi-host-bridge system would have other ports as peers to port1 to > > additionally decode root level address spaces. Port2 in this diagram > > represents the single downstream port of the host-bridge. Were it to be > > a multi-ported-host-bridge there would be peers / siblings of port2 wit= h > > port1 as their common ancestor. > > I guess it would be a pain to emulate a system that actually had > multiple ports at the last level. Pity as would have made your > explanation here a little easier to follow. > A pain in QEMU, but maybe not with a mocked implementation similar to what gets injected for the nvdimm "nfit_test". I'll take a look. > > The rationale for this port hierarchy is to be able to walk the HDM > > decoder register sets that each port implements. Additionally it > > provides a representation of host-bridge interleave which will be > > necessary for follow-on work that adds CXL region devices. > > > > The details in the /sys/bus/cxl hierarchy that are not suitable to be > > represented in the /sys/bus/pci hierarchy are: > > - memory address spaces that are interleaved across host bridges > > - common sub-device functionality represented by CXL component + device > > registers (enumerated via DVSEC or platform firmware (ACPI CEDT)). > > I'm sold :) Thanks for the vote of confidence. It sounded like Bjorn was sold too at the end of our last thread... I'll Cc him on this patch directly in the resend. > > > > > Signed-off-by: Dan Williams > > Reviewed-by: Jonathan Cameron Thanks for the review Jonathan, appreciate it.