From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 19A843BC693; Mon, 23 Mar 2026 18:03:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.176.79.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774289025; cv=none; b=Lm3vr379aB0LzUACq8cjpdeO+Bsm+gxTkCKJ4aslrcCuoCuzOg3qhd8jXBaET7BitPISV07cLzhqK0bAqthdhDElck6RUqsAuZNqUd+EdFabU9G4jjY5SGmecP+D1FAZhM4bnO44SmjyLHFE6/mH0ko+qUi673k1JgC265dikPU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774289025; c=relaxed/simple; bh=+nCfv8QsmLNwAtl/7UmCupQ+zNAYkVPw/oedoEK48mo=; h=Date:From:To:CC:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=bUvvWB4kvbPyD3HWPD2jY5E/zyyv9LtKUXcFjGcOw8Q0aFYIyMdQsc/N9y9XHSJzfVsX8mxF0QdoSNIaBb5MQI5yRn3KOzDQT8JLLLEUtw93YPLO8u4XpUl2vEHsehHxT6+6A0FOaQqqmkROw3yGL4UCSoWPlmiDZmsM7OTS7O0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=185.176.79.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.18.224.83]) by frasgout.his.huawei.com (SkyGuard) with ESMTPS id 4ffgy612bCzHnGjB; Tue, 24 Mar 2026 02:03:10 +0800 (CST) Received: from dubpeml500005.china.huawei.com (unknown [7.214.145.207]) by mail.maildlp.com (Postfix) with ESMTPS id E110A40086; Tue, 24 Mar 2026 02:03:41 +0800 (CST) Received: from localhost (10.203.177.15) by dubpeml500005.china.huawei.com (7.214.145.207) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Mon, 23 Mar 2026 18:03:40 +0000 Date: Mon, 23 Mar 2026 18:03:39 +0000 From: Jonathan Cameron To: Smita Koralahalli CC: , , , , , Ard Biesheuvel , "Alison Schofield" , Vishal Verma , Ira Weiny , Dan Williams , Yazen Ghannam , "Dave Jiang" , Davidlohr Bueso , "Matthew Wilcox" , Jan Kara , "Rafael J . Wysocki" , Len Brown , Pavel Machek , Li Ming , Jeff Johnson , Ying Huang , Yao Xingtao , "Peter Zijlstra" , Greg Kroah-Hartman , Nathan Fontenot , Terry Bowman , Robert Richter , Benjamin Cheatham , Zhijian Li , Borislav Petkov , Tomasz Wolski Subject: Re: [PATCH v8 8/9] dax/hmem, cxl: Defer and resolve Soft Reserved ownership Message-ID: <20260323180339.0000518e@huawei.com> In-Reply-To: <20260322195343.206900-9-Smita.KoralahalliChannabasappa@amd.com> References: <20260322195343.206900-1-Smita.KoralahalliChannabasappa@amd.com> <20260322195343.206900-9-Smita.KoralahalliChannabasappa@amd.com> X-Mailer: Claws Mail 4.3.0 (GTK 3.24.42; x86_64-w64-mingw32) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: lhrpeml100010.china.huawei.com (7.191.174.197) To dubpeml500005.china.huawei.com (7.214.145.207) On Sun, 22 Mar 2026 19:53:41 +0000 Smita Koralahalli wrote: > The current probe time ownership check for Soft Reserved memory based > solely on CXL window intersection is insufficient. dax_hmem probing is not > always guaranteed to run after CXL enumeration and region assembly, which > can lead to incorrect ownership decisions before the CXL stack has > finished publishing windows and assembling committed regions. > > Introduce deferred ownership handling for Soft Reserved ranges that > intersect CXL windows. When such a range is encountered during the > initial dax_hmem probe, schedule deferred work to wait for the CXL stack > to complete enumeration and region assembly before deciding ownership. > > Once the deferred work runs, evaluate each Soft Reserved range > individually: if a CXL region fully contains the range, skip it and let > dax_cxl bind. Otherwise, register it with dax_hmem. This per-range > ownership model avoids the need for CXL region teardown and > alloc_dax_region() resource exclusion prevents double claiming. > > Introduce a boolean flag dax_hmem_initial_probe to live inside device.c > so it survives module reload. Ensure dax_cxl defers driver registration > until dax_hmem has completed ownership resolution. dax_cxl calls > dax_hmem_flush_work() before cxl_driver_register(), which both waits for > the deferred work to complete and creates a module symbol dependency that > forces dax_hmem.ko to load before dax_cxl. > > Co-developed-by: Dan Williams > Signed-off-by: Dan Williams > Signed-off-by: Smita Koralahalli Reviewed-by: Jonathan Cameron