From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 246C5C4332F for ; Tue, 20 Dec 2022 12:51:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233522AbiLTMvP (ORCPT ); Tue, 20 Dec 2022 07:51:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233450AbiLTMvK (ORCPT ); Tue, 20 Dec 2022 07:51:10 -0500 Received: from alexa-out-sd-01.qualcomm.com (alexa-out-sd-01.qualcomm.com [199.106.114.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 107E8116C; Tue, 20 Dec 2022 04:51:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1671540668; x=1703076668; h=message-id:date:mime-version:subject:to:references:from: in-reply-to:content-transfer-encoding; bh=Q0XwAdbmeIP2AoA5Iod6wcH+s5Pr+KDTVxXq0tU1rYA=; b=DoGykKbZ2TfvooxrCYC9RREiOH43NFWwY4DnVQ3Ep47m7AhW9CsHaPiO 30vlTRYv6bgB2dp00dvquG6dqWbRy5Ad8zk2zEyfNZaBNL35Q4YJ8WMAL iFVfwvohHD9EMpaeMkVqKtvUYOFeo5MCl71VM+zxQJIsBj7QA3DfGIyk7 8=; Received: from unknown (HELO ironmsg04-sd.qualcomm.com) ([10.53.140.144]) by alexa-out-sd-01.qualcomm.com with ESMTP; 20 Dec 2022 04:51:05 -0800 X-QCInternal: smtphost Received: from nasanex01c.na.qualcomm.com ([10.45.79.139]) by ironmsg04-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Dec 2022 04:51:04 -0800 Received: from [10.214.66.81] (10.80.80.8) by nasanex01c.na.qualcomm.com (10.45.79.139) 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 04:50:58 -0800 Message-ID: <0d683526-5707-d5b4-e96d-b2d982d4b5da@quicinc.com> Date: Tue, 20 Dec 2022 18:20:55 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.13.1 Subject: Re: [PATCH v3 1/2] remoteproc: elf_loader: Update resource table name check Content-Language: en-US To: Srinivasa Rao Mandadapu , , , , , , , , , , , , , , , , , , , , References: <1671523269-21154-1-git-send-email-quic_srivasam@quicinc.com> <1671523269-21154-2-git-send-email-quic_srivasam@quicinc.com> From: Mukesh Ojha In-Reply-To: <1671523269-21154-2-git-send-email-quic_srivasam@quicinc.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01c.na.qualcomm.com (10.45.79.139) Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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 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);