Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp5182275rwj; Tue, 20 Dec 2022 22:12:03 -0800 (PST) X-Google-Smtp-Source: AMrXdXvEGxEifWWrP1WT+LDSWjLRAaNhRGr4OMsTk/HIljJaCaCWfDFwHB/EfMtGcIgqpn3oG4MR X-Received: by 2002:a17:907:170c:b0:7c1:2478:a4d8 with SMTP id le12-20020a170907170c00b007c12478a4d8mr300843ejc.54.1671603123697; Tue, 20 Dec 2022 22:12:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671603123; cv=none; d=google.com; s=arc-20160816; b=fWpRlwWKESPaofgjNdurY2YFDLmJvvd8Ee5Ibcihd0XlecYJk0f4fZ/xeFvvYL+vQm TgCaOP4KZFKonmJHLzH929hm03XxbZR9c+Yd+9t1MBRHY422FBq9GIfCiIE0EhRIIzUK ERNFb3Twq+hpcy7vaidqiPHdbKYj+rOgiDW00ecMUE1LqZfeBpoclKlU2oDL0zgmr2A8 97vvULVgZ/AucHOLCAMJ5GLY7Umsjlh1zfHqpVnREoUUZe/vTKozTX6h/BkyX0Vdu1JT DA678IIqEs4AtQCYwurWMr86kwKP8SgO4NMJU2aMY3cAZztK0QeHaTmW6LzhYhc3GzGY BE4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:dkim-signature; bh=2+wlnUDmpXmr22tEs76QyJbJB6YDA1VcuJOtP00XjZE=; b=zMYs2Uz6+oIVtAeoFZk8h/4LHA3g9PMiJ23SECdveY22DF0BpzotLnJVzc3FVoEA1I PVFPH264SKzhKl+rX9D3UUs8wD4A0xFx4Y06k85SToQ4E5UzIPX7/lNCZnA903Zv2Q/5 006Dv6p9UL9AFN0A4kKBWsnUIxbdpyyQYfy99BoPbk0HxHQ1gs08tq0lA3RsJjq3fqln NhMahlTeGCm93XyPqFbDcaUo7oAgimuCKm0Mr33hcgxEuJO/15t3viRnuQu/W6D7WC34 rCQPGnQQOQT7PHv+R/6NR8VReM5AKEuXOZTdKW19de0BJgRm9BYQsFQYTbeXsh549GtT f2CQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=D1TZk6Wg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h17-20020a1709063c1100b007c0fd176698si11083988ejg.772.2022.12.20.22.11.46; Tue, 20 Dec 2022 22:12:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=D1TZk6Wg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229597AbiLUFzk (ORCPT + 69 others); Wed, 21 Dec 2022 00:55:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233820AbiLUFze (ORCPT ); Wed, 21 Dec 2022 00:55:34 -0500 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 764531DA6F; Tue, 20 Dec 2022 21:55:33 -0800 (PST) Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BL3u1Y0008754; Wed, 21 Dec 2022 05:54:51 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : to : references : from : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=2+wlnUDmpXmr22tEs76QyJbJB6YDA1VcuJOtP00XjZE=; b=D1TZk6Wge5RaM49p2e4DXPI7rNsIArBfrSed0MNdmkDgjpqD2YVEon9GFS1BBsCjvW0M 5iSAxGP7jN1rhPnOBQtYe7f3UFcXbDBVekQfjEM2Ft79xwPaBSstjiDmeeXZ3ArTR57y yf+m3p9DVU/5JcFy/ety/QBBG6WAkCIcBfSlkK80uU644a4JCxiy6onno5VwHYlPmi0G O5QXJwR7sqYTlx0QwP+Uyb4n3FNonHf6TkBu5rOlB72mxlakZAClMwmC7D58oMHczVED Jch8NqJyj606Jhx2CtZm50AhM3kDevmk6BacAQxmdDPazw97nhknNda40PL68hBgMibX HA== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3mkd379vbp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 21 Dec 2022 05:54:51 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 2BL5soEG005960 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 21 Dec 2022 05:54:50 GMT Received: from [10.216.2.240] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Tue, 20 Dec 2022 21:54:43 -0800 Message-ID: Date: Wed, 21 Dec 2022 11:24:40 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v3 1/2] remoteproc: elf_loader: Update resource table name check Content-Language: en-US To: Mukesh Ojha , , , , , , , , , , , , , , , , , , , , References: <1671523269-21154-1-git-send-email-quic_srivasam@quicinc.com> <1671523269-21154-2-git-send-email-quic_srivasam@quicinc.com> <0d683526-5707-d5b4-e96d-b2d982d4b5da@quicinc.com> From: Srinivasa Rao Mandadapu Organization: Qualcomm In-Reply-To: <0d683526-5707-d5b4-e96d-b2d982d4b5da@quicinc.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: HKnq-NSCI6R5HIlgieDBV5ikftIZ5vUk X-Proofpoint-ORIG-GUID: HKnq-NSCI6R5HIlgieDBV5ikftIZ5vUk X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-21_01,2022-12-20_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 priorityscore=1501 lowpriorityscore=0 phishscore=0 malwarescore=0 bulkscore=0 clxscore=1015 impostorscore=0 spamscore=0 adultscore=0 mlxscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212210041 X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/20/2022 6:20 PM, Mukesh Ojha wrote: Thanks for your time Mukesh!!! > Hi, > > On 12/20/2022 1:31 PM, Srinivasa Rao Mandadapu wrote: >> Update the way of checking resource table name with prefix >> substring search instead of complete string search. >> In general Qualcomm DSP binary is prepared by combining different ELFs', >> hence section header name (e.g. .resource_table), appended with ELF name >> to differentiate with same section(e.g. >> resource_table.ac_bin_process) of >> different ELFs'. >> Example readelf output of DSP binary: >>      [60] .start.ac_bin_process PROGBITS >>      [61] .resource_table.ac_bin_process PROGBITS >>      [62] .comment.ac_bin_process PROGBITS >> > > Could we rephrase above like below ? It could be also taken why > applying the patch. > > Update the way of checking resource table name with prefix substring > search instead of complete string search. > > In general, Qualcomm DSP binary is prepared by combining different > ELF's. Hence, section header name (e.g. .resource_table), appended > with ELF name to differentiate with same section(e.g. > resource_table.ac_bin_process) of different ELFs'. > > Example readelf output of DSP binary: >       [60] .start.ac_bin_process PROGBITS >       [61] .resource_table.ac_bin_process PROGBITS >       [62] .comment.ac_bin_process PROGBITS > Okay. will change accordingly. > > Signed-off-by: Srinivasa Rao Mandadapu > > Otherwise, LGTM. > Reviewed-by: Mukesh Ojha > > -Mukesh >> --- >>   drivers/remoteproc/remoteproc_elf_loader.c | 2 +- >>   1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/remoteproc/remoteproc_elf_loader.c >> b/drivers/remoteproc/remoteproc_elf_loader.c >> index 5a412d7..77330d6 100644 >> --- a/drivers/remoteproc/remoteproc_elf_loader.c >> +++ b/drivers/remoteproc/remoteproc_elf_loader.c >> @@ -272,7 +272,7 @@ find_table(struct device *dev, const struct >> firmware *fw) >>           u64 offset = elf_shdr_get_sh_offset(class, shdr); >>           u32 name = elf_shdr_get_sh_name(class, shdr); >>   -        if (strcmp(name_table + name, ".resource_table")) >> +        if (!strstarts(name_table + name, ".resource_table")) >>               continue; >>             table = (struct resource_table *)(elf_data + offset);