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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0B23C001DB for ; Thu, 10 Aug 2023 10:35:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231336AbjHJKfR (ORCPT ); Thu, 10 Aug 2023 06:35:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230114AbjHJKfQ (ORCPT ); Thu, 10 Aug 2023 06:35:16 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B609EF2 for ; Thu, 10 Aug 2023 03:35:15 -0700 (PDT) Received: from lhrpeml500005.china.huawei.com (unknown [172.18.147.201]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4RM3B91FWcz6J6lG; Thu, 10 Aug 2023 18:31:29 +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.27; Thu, 10 Aug 2023 11:35:12 +0100 Date: Thu, 10 Aug 2023 11:35:12 +0100 From: Jonathan Cameron To: Maverickk 78 CC: Jonathan Cameron via , Subject: Re: CXL volatile memory is not listed Message-ID: <20230810113512.00000516@Huawei.com> In-Reply-To: References: 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: lhrpeml100005.china.huawei.com (7.191.160.25) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-cxl@vger.kernel.org On Wed, 9 Aug 2023 04:21:47 +0530 Maverickk 78 wrote: > Hello, > > I am running qemu-system-x86_64 > > qemu-system-x86_64 --version > QEMU emulator version 8.0.92 (v8.1.0-rc2-80-g0450cf0897) > +Cc linux-cxl as the answer is more todo with linux than qemu. > qemu-system-x86_64 \ > -m 2G,slots=4,maxmem=4G \ > -smp 4 \ > -machine type=q35,accel=kvm,cxl=on \ > -enable-kvm \ > -nographic \ > -device pxb-cxl,id=cxl.0,bus=pcie.0,bus_nr=52 \ > -device cxl-rp,id=rp0,bus=cxl.0,chassis=0,port=0,slot=0 \ > -object memory-backend-file,id=mem0,mem-path=/tmp/mem0,size=1G,share=true \ > -device cxl-type3,bus=rp0,volatile-memdev=mem0,id=cxl-mem0 \ > -M cxl-fmw.0.targets.0=cxl.0,cxl-fmw.0.size=1G There are some problems upstream at the moment (probably not cxl related but I'm digging). So today I can't boot an x86 machine. (goody) More generally for the flow that would bring the memory up as system ram you would typically need the bios to have done the CXL enumeration or a bunch of scripts in the kernel to have done it. In general it can't be fully automated, because there are policy decisions to make on things like interleaving. I'm not aware of any open source BIOSs that do it yet. So you have to rely on the same kernel paths as for persistent memory - manual configuration etc in the kernel. There is support in ndctl for those enabling flows, so I'd look there for more information Jonathan > > > I was expecting the CXL memory to be listed in "System Ram", the lsmem > shows only 2G memory which is System RAM, it's not listing the CXL > memory. > > Do I need to pass any particular parameter in the kernel command line? > > Is there any documentation available? I followed the inputs provided in > > https://lore.kernel.org/linux-mm/Y+CSOeHVLKudN0A6@kroah.com/T/ > > Is there any documentation/blog listed?