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: <c0f95226-7a7a-470f-a64b-8b5064568e80@amd.com>
Date: Mon, 7 Apr 2025 11:53:25 +0100
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, Ben Cheatham <benjamin.cheatham@....com>
Subject: Re: [PATCH v12 07/23] cxl: support dpa initialization without a
 mailbox


On 4/4/25 17:05, Jonathan Cameron wrote:
> On Mon, 31 Mar 2025 15:45:39 +0100
> alejandro.lucero-palau@....com wrote:
>
>> From: Alejandro Lucero <alucerop@....com>
>>
>> Type3 relies on mailbox CXL_MBOX_OP_IDENTIFY command for initializing
>> memdev state params which end up being used for dma initialization.
> DMA
>

Ok


>> Allow a Type2 driver to initialize dpa simply by giving the size of its
> DPA


Ok


>> volatile and/or non-volatile hardware partitions.
>>
>> Export cxl_dpa_setup as well for initializing those added dpa partitions
>> with the proper resources.
>>
>> Signed-off-by: Alejandro Lucero <alucerop@....com>
>> Reviewed-by: Ben Cheatham <benjamin.cheatham@....com>
>> ---
>>   drivers/cxl/core/mbox.c | 17 ++++++++++++++---
>>   drivers/cxl/cxlmem.h    | 13 -------------
>>   include/cxl/cxl.h       | 14 ++++++++++++++
>>   3 files changed, 28 insertions(+), 16 deletions(-)
>>
>> diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c
>> index ab994d459f46..e4610e778723 100644
>> --- a/drivers/cxl/core/mbox.c
>> +++ b/drivers/cxl/core/mbox.c
>> @@ -1284,6 +1284,18 @@ static void add_part(struct cxl_dpa_info *info, u64 start, u64 size, enum cxl_pa
>>   	info->nr_partitions++;
>>   }
>>   
>> +void cxl_mem_dpa_init(struct cxl_dpa_info *info, u64 volatile_bytes,
>> +		      u64 persistent_bytes)
>> +{
>> +	if (!info->size)
> Why?  What is this defending against?


The new function is used by cxl_mem_dpa_fetch as well for avoiding 
duplicated code, where size is initialized before the potential 
invocation of cxl_mem_dpa_init.


But with your heads up, I think I can just set the size unconditionally 
and to change the caller in cxl_mem_dpa_fetch for setting is if such 
invocation, because partition_align_bytes != 0, does not happen.


Thanks!


>> +		info->size = volatile_bytes + persistent_bytes;
>> +
>> +	add_part(info, 0, volatile_bytes, CXL_PARTMODE_RAM);
>> +	add_part(info, volatile_bytes, persistent_bytes,
>> +		 CXL_PARTMODE_PMEM);
>> +}
>> +EXPORT_SYMBOL_NS_GPL(cxl_mem_dpa_init, "CXL");

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ