lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c9661180-dd60-4322-a8b5-2e5171bd5b3f@amd.com>
Date: Thu, 18 Dec 2025 12:07:22 +0000
From: Alejandro Lucero Palau <alucerop@....com>
To: Jonathan Cameron <jonathan.cameron@...wei.com>,
 alejandro.lucero-palau@....com
Cc: linux-cxl@...r.kernel.org, netdev@...r.kernel.org,
 dan.j.williams@...el.com, edward.cree@....com, davem@...emloft.net,
 kuba@...nel.org, pabeni@...hat.com, edumazet@...gle.com, dave.jiang@...el.com
Subject: Re: [PATCH v22 13/25] cxl: Export functions for unwinding cxl by
 accelerators


On 12/15/25 13:53, Jonathan Cameron wrote:
> On Fri, 5 Dec 2025 11:52:36 +0000
> <alejandro.lucero-palau@....com> wrote:
>
>> From: Alejandro Lucero <alucerop@....com>
>>
>> Add unregister_region() and cxl_decoder_detach() to the accelerator
>> driver API for a clean exit.
>>
>> Signed-off-by: Alejandro Lucero <alucerop@....com>
> In general seems fine but comment on type safety inline.
>
> Jonathan
>
>> ---
>>   drivers/cxl/core/core.h   | 5 -----
>>   drivers/cxl/core/region.c | 4 +++-
>>   include/cxl/cxl.h         | 9 +++++++++
>>   3 files changed, 12 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/cxl/core/core.h b/drivers/cxl/core/core.h
>> index 1c1726856139..9a6775845afe 100644
>> --- a/drivers/cxl/core/core.h
>> +++ b/drivers/cxl/core/core.h
>> @@ -15,11 +15,6 @@ extern const struct device_type cxl_pmu_type;
>>   
>>   extern struct attribute_group cxl_base_attribute_group;
>>   
>> -enum cxl_detach_mode {
>> -	DETACH_ONLY,
>> -	DETACH_INVALIDATE,
>> -};
>> -
>>   #ifdef CONFIG_CXL_REGION
>>   extern struct device_attribute dev_attr_create_pmem_region;
>>   extern struct device_attribute dev_attr_create_ram_region;
>> diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c
>> index 8166a402373e..104caa33b7bb 100644
>> --- a/drivers/cxl/core/region.c
>> +++ b/drivers/cxl/core/region.c
>> @@ -2199,6 +2199,7 @@ int cxl_decoder_detach(struct cxl_region *cxlr,
>>   	}
>>   	return 0;
>>   }
>> +EXPORT_SYMBOL_NS_GPL(cxl_decoder_detach, "CXL");
>>   
>>   static int __attach_target(struct cxl_region *cxlr,
>>   			   struct cxl_endpoint_decoder *cxled, int pos,
>> @@ -2393,7 +2394,7 @@ static struct cxl_region *to_cxl_region(struct device *dev)
>>   	return container_of(dev, struct cxl_region, dev);
>>   }
>>   
>> -static void unregister_region(void *_cxlr)
>> +void unregister_region(void *_cxlr)
>>   {
>>   	struct cxl_region *cxlr = _cxlr;
>>   	struct cxl_region_params *p = &cxlr->params;
>> @@ -2412,6 +2413,7 @@ static void unregister_region(void *_cxlr)
>>   	cxl_region_iomem_release(cxlr);
>>   	put_device(&cxlr->dev);
>>   }
>> +EXPORT_SYMBOL_NS_GPL(unregister_region, "CXL");
>>   
>>   static struct lock_class_key cxl_region_key;
>>   
>> diff --git a/include/cxl/cxl.h b/include/cxl/cxl.h
>> index f02dd817b40f..b8683c75dfde 100644
>> --- a/include/cxl/cxl.h
>> +++ b/include/cxl/cxl.h
>> @@ -255,4 +255,13 @@ struct cxl_endpoint_decoder *cxl_get_committed_decoder(struct cxl_memdev *cxlmd,
>>   						       struct cxl_region **cxlr);
>>   struct range;
>>   int cxl_get_region_range(struct cxl_region *region, struct range *range);
>> +enum cxl_detach_mode {
>> +	DETACH_ONLY,
>> +	DETACH_INVALIDATE,
>> +};
>> +
>> +int cxl_decoder_detach(struct cxl_region *cxlr,
>> +		       struct cxl_endpoint_decoder *cxled, int pos,
>> +		       enum cxl_detach_mode mode);
>> +void unregister_region(void *_cxlr);
> I'd wrap this for an exposed interface that isn't going to be used
> as a devm callback so we can make it type safe.  Maybe making the
> existing devm callback the one doing wrapping is cleanest route.


I think it is a good idea. I will think how to do it following your advice.

Thanks


>
>>   #endif /* __CXL_CXL_H__ */

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ