Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2417478rwd; Wed, 14 Jun 2023 02:29:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4uEmV5Crukm/3PzDUcbw3w7cEL/GQeJkLYl9FtoTS7ibY5gjqTuZdL8Sflq7IMgOQjehiz X-Received: by 2002:a17:907:7e9a:b0:977:d468:827 with SMTP id qb26-20020a1709077e9a00b00977d4680827mr1049857ejc.17.1686734949375; Wed, 14 Jun 2023 02:29:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686734949; cv=none; d=google.com; s=arc-20160816; b=bXdufZ3eAN8K7I/A1YGI3BAcuH/lrw8MqepiDI7uXW9Ux/dKwJwjaRcSKLeQcIyhTF baa5tm1n92t2ykM05NfENMl3Dpzrc2UtMc9ti1Bpftvn48Fyd/GvVJvWFw/dQnLWGhJP /M3z5JVtZHeRu4i2+hQY45cTNML8eeuPyqcrNYCBdxj3xZ9isnwBmCbVlZbmm3ZTY/c/ rf2VncfyOXK9ckn1HeRH96mqJ4HEzt1MvAechsnIetT0VYEFXoWU8Rkw01oPtwrPUyQf kR9cWwy6D4cAsU1yxhuJVXHfjJdQYzHQ2Um0CfJ1MgE7Y+SIRDW7BIRmrNDdSNQMQiTB ttBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=CyT2S0X8Hp/kr6d414UdulJJMfsGS2AdEWbMFlDuVFo=; b=lAZLzXjrKjfhfp9wFlLqAaZzu/i4ABJTq+0HFs+11uSxD0RE3iKltS54G3i1xJIGev mN7yCASw/1lv2OSUbJtb5mXlxosGFMz/YtBQtJf/2uO8OZeathP7OvwbqX76FsCwrExA Csb9GQeJ0Xd4iSwzQ8zVh5+6CHRATfZMfdneiiNQosHKyFFCh7Udq9nolshKkTlnYTYt 76QAytmG2xzFdb2s/DWFGGfAKRfPwk7zPwPPi42SHoVy+HzmSyBbbAxxYXKAd+ccCA4t ZcDHormWDkBflPArCsgn2qwkk1Qmm/zhZAaxy5ySNgBMYIdLm6LSBH+dB75fYNm32nku xmzQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kq4-20020a170906abc400b009537bb2188fsi7965995ejb.693.2023.06.14.02.28.36; Wed, 14 Jun 2023 02:29:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243755AbjFNJK6 (ORCPT + 99 others); Wed, 14 Jun 2023 05:10:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243726AbjFNJK5 (ORCPT ); Wed, 14 Jun 2023 05:10:57 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A435810D5; Wed, 14 Jun 2023 02:10:55 -0700 (PDT) Received: from lhrpeml500005.china.huawei.com (unknown [172.18.147.226]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Qh04g3LXWz6H7tc; Wed, 14 Jun 2023 17:10:11 +0800 (CST) Received: from localhost (10.202.227.76) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Wed, 14 Jun 2023 10:10:52 +0100 Date: Wed, 14 Jun 2023 10:10:51 +0100 From: Jonathan Cameron To: Peter Zijlstra CC: , "Rafael J. Wysocki" , "Len Brown" , Dan Williams , "Thomas Gleixner" , Ingo Molnar , "Borislav Petkov" , Dave Hansen , "H. Peter Anvin" , Andy Lutomirski , Andrew Morton , Dave Jiang , "Mike Rapoport" , , , , Subject: Re: [PATCH v2 0/2] CXL: Apply SRAT defined PXM to entire CFMWS window Message-ID: <20230614101051.00006602@Huawei.com> In-Reply-To: <20230614083240.GC1639749@hirez.programming.kicks-ass.net> References: <20230614083240.GC1639749@hirez.programming.kicks-ass.net> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.202.227.76] X-ClientProxiedBy: lhrpeml100003.china.huawei.com (7.191.160.210) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 14 Jun 2023 10:32:40 +0200 Peter Zijlstra wrote: > On Tue, Jun 13, 2023 at 09:35:23PM -0700, alison.schofield@intel.com wrote: > > The CXL subsystem requires the creation of NUMA nodes for CFMWS > > The thing is CXL some persistent memory thing, right? But what is this > CFMWS thing? I don't think I've ever seen that particular combination of > letters together. > Hi Peter, To save time before the US based folk wake up. Both persistent and volatile memory found on CXL devices (mostly volatile on early devices). CXL Fixed Memory Window (structure) (CFMWS - defined in 9.17.1.3 of CXL r3.0 - via an ACPI table (CEDT). CFMWS, as a term, is sometimes abused in the kernel (and here) for the window rather than the structure describing the window (the S on the end). CFMWS - A region of Host Physical Address (HPA) Space which routes accesses to CXL Host bridges. A CFMWS describes interleaving as well (so multiple target host bridges). If multiple interleave setups are available, then you'll see multiple CFMWS entries - so different statically regions of HPA can route to same host bridges with different interleave setups (decoding via the configurable part to hit different actual memory on the downstream devices). Where accesses are routed after that depends on the configurable parts of the CXL topology (Host-Managed Device Memory (HDM) decoders in host bridges, switches etc). Note that a CFMWS address may route to nowhere if downstream devices aren't available / configured yet. CFMWS is the CXL specification avoiding defining interfaces for controlling the host address space to CXL host bridge mapping as those vary so much across host implementations + not always configurable at runtime anyway. Also includes a bunch of other details about the region (too many details perhaps!) Who does the configuration (BIOS / kernel) varies across implementations and we have OS managed hotplug so the OS always has to do some of it (personally I prefer the kernel doing everything :) It's made messier by CXL 1.1 hosts where a lot less was discoverable so generally the BIOS has to do the heavy lifting. For CXL 2.0 onwards the OS 'might' do everything except whatever is needed on the host to configure the CXL Fixed Memory Windows it is advertising. Note there is no requirement that the access characteristics of memory mapped into a given CFMWS should be remotely consistent across the whole window - some of the window may route through switches, and to directly connected devices. That's a simplifying assumption made today as we don't yet know the full scope of what people are building. Hope that helps (rather than causing confusion!) Jonathan