From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 07F3EC19F32 for ; Fri, 7 Mar 2025 15:08:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 116996B0085; Fri, 7 Mar 2025 10:08:04 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0C8386B0088; Fri, 7 Mar 2025 10:08:04 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ED09A6B0089; Fri, 7 Mar 2025 10:08:03 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id CEFFA6B0085 for ; Fri, 7 Mar 2025 10:08:03 -0500 (EST) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id E07B4B78A6 for ; Fri, 7 Mar 2025 15:08:04 +0000 (UTC) X-FDA: 83195085288.24.903213A Received: from mail-qv1-f42.google.com (mail-qv1-f42.google.com [209.85.219.42]) by imf07.hostedemail.com (Postfix) with ESMTP id E279E40012 for ; Fri, 7 Mar 2025 15:08:02 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=gourry.net header.s=google header.b=s6ud0O1u; dmarc=none; spf=pass (imf07.hostedemail.com: domain of gourry@gourry.net designates 209.85.219.42 as permitted sender) smtp.mailfrom=gourry@gourry.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1741360083; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=AwqxWi0iWrXCwX2xmbnqF8uYYDlpSjPvCpbbjIDyPjI=; b=qUqZ9HKr4Q+fANQp4eiPki5riPyCjg1S9YfMZ+CIQfQw1S3r07OOqjhiOxqODJ9OZiGv2t RH0QUBYIoDimKtJQQpOtFUxyhnLahJU2lLYvwnDKIdn9IzVkL4YGSTdO82Xs5ncRJjr8O1 YlIFkR+Sn7kOkHG9Uapz4Tzm4Gppn3Y= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1741360083; a=rsa-sha256; cv=none; b=x9OWUHv5/4wiQ7EksExL43iUAJ4fxSMj4Tj6xuT+NrN3iCkU0eo2Ly5gdRaIPPD2BcjsPW Ugu1LM4XUehYA00QsC32xvUt1Al/6zoP5dmtUXBrxgK80GBxfi6dPNFGiJAKMC4KGBNKrM MaupA6exCDEh35hdzIjPF+LgYtub2yU= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=gourry.net header.s=google header.b=s6ud0O1u; dmarc=none; spf=pass (imf07.hostedemail.com: domain of gourry@gourry.net designates 209.85.219.42 as permitted sender) smtp.mailfrom=gourry@gourry.net Received: by mail-qv1-f42.google.com with SMTP id 6a1803df08f44-6e41e17645dso17540296d6.2 for ; Fri, 07 Mar 2025 07:08:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1741360081; x=1741964881; darn=kvack.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=AwqxWi0iWrXCwX2xmbnqF8uYYDlpSjPvCpbbjIDyPjI=; b=s6ud0O1ur2lThn975cCdMWZlgfM8FiBGqOze7K/QLc3Po/1lPM5lzzSwgY7AQlYOYR 6eN486rVnsb9XJ6dUnZ7oOGdEGqCCu4Lrh6A2Rg00Eqd1C4Xo89UX/lRgK9hODTBnkfo ONgTH/BGFtQ6r3SYVjaOFf9QOPKGckOqta+q2Lb+TuWbnRvUtHYmBUivJVWX6cc7MsxF ks7OzpZqm5QDyMN2Ri0W6jL9W7SXvozX157d9vUi10XzRZ0tGFs9qhCFJbjIOTv8tYeI JWTGwQsXZVPkIV38PzEierAEmt09Dg4OQX+Wmc84o5J0b6r6jylZ6Tp2tGqxzJgzX+oA 7D2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741360081; x=1741964881; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=AwqxWi0iWrXCwX2xmbnqF8uYYDlpSjPvCpbbjIDyPjI=; b=WSM/LJp+euu99+xCLkzavPloAgkkC9uVMHBfhGlrGe7QrTnnQFQ8EinvmgwRxW5FxN RiXSmDI7Ec809TvNojy7lkAWFW3mZ1ioSVtxzek+uVDNkyr0qkOxSrXVzcQxyx4bGDpy PKX2Zrjh2OJLhPUCEP+7MzOUu8FrIXLh6ckieu3EJHn6QcbO/yqstj7xffouIlHYvI66 FQQMTpfggAO7kObv0/TRBQxV+tNFti6/ZInnsMfUetQQTJdg9HmOajg8RTK8zilwQJTW jkOQ95tCJrfm5ilpS9qvru07QO5fuWtbbagbeDZePAqr8oQJ4HQDrJQtGIq/It4BmhEP PrSw== X-Forwarded-Encrypted: i=1; AJvYcCVxS8aNsde4Urx7PH/JaTmo8TNKsyDkS3lZDT+v9Xm6NXeWsNK+KqfAme0Nothcro2ywXlscJDutw==@kvack.org X-Gm-Message-State: AOJu0Yx+1nP4dFPkL7zK7eGzpaxDHqbiSxGWIdghdGy3trImhvtpfKwQ Mgc+krAC63FxcK4Zk8VZFKy9NhmDqrUS4vr9eTNwLBpyLatbzr2TLsp/s5Y80l0= X-Gm-Gg: ASbGnctETpo8nb2SfGieZnf+lvy9ufvmZpiyUd9q/ip+dHtN/z/ULYA1AMT3/HVqTDo qass3DbmR/FWE5fczl5kHvNGcqwokqjXDBpfv9ENoXF7XEeWXQqpddzT9FqeJdBQUrSnncn7hJB s6aggEPXuTI5ZY2g8JabxYnbJ+YjUZKDBr61cu3AUJY37C8VwG4T5q+qdjQPrKQbWDdj7E2Xaw/ SHs2w6sLpxLmQpaUm24FIqMU79vysvn6Qi05vxw8x3QCzaEt/GSkWsLr8VpB3ay0xaa75wj9pJa v11fhAuDWS8/SQrrmPrQpVt1ZOqwONTAtFYKwZBIh2PsrezTx7MGnPiOrclozpJNyQR8/StnkSi eO35hplk7DmLYy/KqU58IDf3GzoA= X-Google-Smtp-Source: AGHT+IHFXN/P02s1v98zyEbqxwhlOPUAeqTTE2dEMUqC5SvXHpnKWulc9lagDpP21FJm9Hmt5sZqBQ== X-Received: by 2002:a05:6214:daa:b0:6e6:646e:a0f8 with SMTP id 6a1803df08f44-6e9005f899emr45138866d6.16.1741360081484; Fri, 07 Mar 2025 07:08:01 -0800 (PST) Received: from gourry-fedora-PF4VCD3F (pool-173-79-56-208.washdc.fios.verizon.net. [173.79.56.208]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6e8f70a447asm20414876d6.54.2025.03.07.07.08.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Mar 2025 07:08:01 -0800 (PST) Date: Fri, 7 Mar 2025 10:07:58 -0500 From: Gregory Price To: "Zhijian Li (Fujitsu)" Cc: "lsf-pc@lists.linux-foundation.org" , "linux-mm@kvack.org" , "linux-cxl@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: CXL Boot to Bash - Section 2a (Drivers): CXL Decoder Programming Message-ID: References: <570b18f4-3790-4e57-8d80-a5301e5d8af2@fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <570b18f4-3790-4e57-8d80-a5301e5d8af2@fujitsu.com> X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: E279E40012 X-Stat-Signature: dujk4anwh7ra88qwiak15irxhgqx4zub X-HE-Tag: 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qRiQPtOlC8IZ8sGVLSBRNi20k+yzvO69Nq3KGLFZAL9oyKHvshlrsMKwU1FgG4Q3rJzqgPQjFY91LdPrHFeu5bzLkjKFXfxMiRazwccSaweURii/fynoKpvUrutME10g3EDaKibJR06kXrECZDu98cgPzps1TjLs3HZA8ftj4NrnZeSxUULPypR7O9+dcWkyzqgHEhcZMkLIyFzton2yFbhZ7yxDuP9nQaZ50LhPNdMAWaxO5qJyfHB8MaatPVqBp+cLagQVBI+1vNr7WeAI9aE8q/lUKy7o2cjFph/+OdshvHA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.065895, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Fri, Mar 07, 2025 at 12:57:18AM +0000, Zhijian Li (Fujitsu) wrote: > > In section 2, I referenced a simple device-to-decoder mapping: > > > > root --- decoder0.0 -- Root Port Decoder > > | | > > port1 --- decoder1.0 -- Host Bridge Decoder > > | | > > endpoint0 --- decoder2.0 -- Endpoint Decoder > > Here, I noticed something that differs slightly from my understanding: > "root --- decoder0.0 -- Root Port Decoder." > > From the perspective of the Linux Driver, decoder0.0 usually refers to > associated a CFMWs. Moreover, according to Spec r3.1 Table 8-22 CXL HDM Decoder Capability, > the CXL Root Port (also known as R in the table) is not permitted to implement > the HDM decoder. > > If I have misunderstood something, please let me know. You're indeed right that in the spec it says root ports do not have decoder capability. What we have here may be some jumbling of CXL spec languange and Linux CXL driver language. The decoder0.0 is a `root decoder`. The `root_port` is a logical construct belonging to the CXL root struct cxl_root { struct cxl_port port; <--- root_port } A root_decoder is added to the CXL drivers `root_port` when we parse the cfmws: static int __cxl_parse_cfmws(struct acpi_cedt_cfmws *cfmws, struct cxl_cfmws_context *ctx) { ... struct cxl_root_decoder *cxlrd __free(put_cxlrd) = cxl_root_decoder_alloc(root_port, ways); ... } And the `root_port` is a port with downstream ports - which are presumably the host bridges static int cxl_acpi_probe(struct platform_device *pdev) { cxl_root = devm_cxl_add_root(host, &acpi_root_ops); ^^^^^^^^ - Create "The CXL Root" root_port = &cxl_root->port; ^^^^^^^^^ - The Root's "Port" rc = bus_for_each_dev(adev->dev.bus, NULL, root_port, add_host_bridge_dport); ^^^^^^^^^ - Add host bridges "downstream" of The Root's "Port" ... ctx = (struct cxl_cfmws_context) { .dev = host, .root_port = root_port, .cxl_res = cxl_res, }; rc = acpi_table_parse_cedt(ACPI_CEDT_TYPE_CFMWS, cxl_parse_cfmws, &ctx); ^^^^^^^^^ - Add "root decoders" to The Root's "Port" } If we look at what a root decoder is defined as in cxl/cxl.h: * struct cxl_root_decoder - Static platform CXL address decoder So this is just some semantic confusion - and the reality is the driver simply refers to the first device in the fabric as "The Root", and every device has "A Port", and so the "Root Port" just means it's the Root's "Port" not a "CXL Specification Root Port". Whatever the case, from the snippets above, you can see the CFMWS adds 1 "root decoder" per CFMWS - which makes sense, as a CFMWS can describe multi-host-bridge interleave - i.e. whatever the actual root device is must be upstream of the host bridges themselves. ~Gregory