Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp4030282rwj; Tue, 20 Dec 2022 05:19:30 -0800 (PST) X-Google-Smtp-Source: AA0mqf5DTUXBuL7yqXp34mu6QsUa9L7dHGRnB6BWqy21qQrrNEpi+19FdRIMcqBgH6pZjJw/KOHy X-Received: by 2002:a17:90a:f689:b0:219:1b52:859a with SMTP id cl9-20020a17090af68900b002191b52859amr47926286pjb.10.1671542370293; Tue, 20 Dec 2022 05:19:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671542370; cv=none; d=google.com; s=arc-20160816; b=PKRMMo+z8dApMIbdORvKOdGIg3VTsZbkqNsJooYeXvSguNy6fPVmDSc4xhj+lg9SLG 6hi26W/vPpZdl8Gdo7REE7M7VIv93nqKRSdxq/NlDMub2+ohox50RtCpG1xxWUdBoRRz zTsPgG8YTJqsfniU4J7eizwWsvcYq/Zb+ithZNBrX76vz+d0Isqb/w1DBYjmvFx9/V4x Shvt7Ts90oeA5R9syNUxqSvh1d60g1IQiAGM+JHdzHAv8Tn4hQjkVcZv9ktGNUHj52t7 M/vsEN6EYUBusKm/iebHjdgpRJ0EQBWPE88iHTadDjM+gOce0noCSDKxRYWjyIr7gQwR 3BLg== 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:from :references:to:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=Q0XwAdbmeIP2AoA5Iod6wcH+s5Pr+KDTVxXq0tU1rYA=; b=OTbzb9k1YD0zX1EH2p7Ks2Oop0X6ElfBzOlal45elSoRWlpB4dREryaQUmhVIICLGu 8Ki3W18lLeYNG0jbha9WwCkOmwkdmVix60yGQIY7EzsdmFRn3/zQMQfmkt8WdW7db0nT yUqCNVLne6iuUJuBqYwbKerrQcsRWVojEpkROmDxFzDbi++43/GsokrEDHnmf+t/XdCD NLpinValPNm73MQt5jgGegM9C1IKay0/gfJLJ6phblZoYcIMJ4fpTQpv+Vt9WQa1vS8l Ct9ii4vRkVtWvyl4X/Ri7Q3e2SSWbNJUAUSUv2+sEblq+BM2yJp5q/Z1khbUXhslasKa 5XEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=DoGykKbZ; 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 pc5-20020a17090b3b8500b00213dc988b24si14338153pjb.13.2022.12.20.05.19.20; Tue, 20 Dec 2022 05:19:30 -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=qcdkim header.b=DoGykKbZ; 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 S233349AbiLTMvS (ORCPT + 70 others); Tue, 20 Dec 2022 07:51:18 -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) X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, 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 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);