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: <ff382661-4d05-4f9a-8b9e-55fa9932a22a@quicinc.com>
Date: Tue, 21 Oct 2025 13:53:10 +0530
From: Deepak Kumar Singh <quic_deesin@...cinc.com>
To: Konrad Dybcio <konrad.dybcio@....qualcomm.com>,
        Jingyi Wang
	<jingyi.wang@....qualcomm.com>,
        Bjorn Andersson <andersson@...nel.org>,
        Konrad Dybcio <konradybcio@...nel.org>
CC: <linux-arm-msm@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        Chris Lew
	<chris.lew@....qualcomm.com>
Subject: Re: [PATCH 2/2] soc: qcom: smp2p: Add support for smp2p v2



On 9/24/2025 8:27 PM, Konrad Dybcio wrote:
> On 9/24/25 6:18 AM, Jingyi Wang wrote:
>> From: Chris Lew <chris.lew@....qualcomm.com>
>>
>> Some remoteproc need smp2p v2 support, mirror the version written by the
>> remote if the remote supports v2. This is needed if the remote does not
>> have backwards compatibility with v1. And reset entry last value on SSR for
>> smp2p v2.
>>
>> Signed-off-by: Chris Lew <chris.lew@....qualcomm.com>
>> Co-developed-by: Jingyi Wang <jingyi.wang@....qualcomm.com>
>> Signed-off-by: Jingyi Wang <jingyi.wang@....qualcomm.com>
>> ---
> 
> [...]
> 
>> +static int qcom_smp2p_in_version(struct qcom_smp2p *smp2p)
>> +{
>> +	unsigned int smem_id = smp2p->smem_items[SMP2P_INBOUND];
>> +	unsigned int pid = smp2p->remote_pid;
>> +	struct smp2p_smem_item *in;
>> +	size_t size;
>> +
>> +	in = qcom_smem_get(pid, smem_id, &size);
>> +	if (IS_ERR(in))
>> +		return 0;
>> +
>> +	return in->version;
> 
> are in and out versions supposed to be out of sync in case of
> error?
> 
I think that should be ok. If we return error smp2p connection will be 
completely broken. With default version 1 partial features can be 
supported even if remote is using version 2. Some features like smp2p 
connection after subsystem restart may be affected by this.>> +}
>> +
>>   static void qcom_smp2p_start_in(struct qcom_smp2p *smp2p)
>>   {
>>   	unsigned int smem_id = smp2p->smem_items[SMP2P_INBOUND];
>> @@ -516,6 +542,7 @@ static int qcom_smp2p_alloc_outbound_item(struct qcom_smp2p *smp2p)
>>   	struct smp2p_smem_item *out;
>>   	unsigned smem_id = smp2p->smem_items[SMP2P_OUTBOUND];
>>   	unsigned pid = smp2p->remote_pid;
>> +	u8 in_version;
>>   	int ret;
>>   
>>   	ret = qcom_smem_alloc(pid, smem_id, sizeof(*out));
>> @@ -537,12 +564,14 @@ static int qcom_smp2p_alloc_outbound_item(struct qcom_smp2p *smp2p)
>>   	out->valid_entries = 0;
>>   	out->features = SMP2P_ALL_FEATURES;
>>   
>> +	in_version = qcom_smp2p_in_version(smp2p);
>> +
>>   	/*
>>   	 * Make sure the rest of the header is written before we validate the
>>   	 * item by writing a valid version number.
>>   	 */
>>   	wmb();
>> -	out->version = 1;
>> +	out->version = (in_version) ? in_version : 1;
> 
> = in_version ?: 1
> 
> Konrad
> 
We want to assign in_version when value is 1/2 and 1 if value is 0 i.e. 
error case.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ