Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp107143rwl; Wed, 4 Jan 2023 16:04:15 -0800 (PST) X-Google-Smtp-Source: AMrXdXtNwbEat5yNGX25NmGxtSmsv20ng5rbUgFgLp2AJ0CMNIFHA7YnF0PiuwQeo4Ae/tHNCk7h X-Received: by 2002:a17:907:8c86:b0:7c1:1adc:46fd with SMTP id td6-20020a1709078c8600b007c11adc46fdmr45846918ejc.34.1672877055693; Wed, 04 Jan 2023 16:04:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672877055; cv=none; d=google.com; s=arc-20160816; b=L1jj0IFzAu7gn09r2RqXNIK5F1dn+PpWwDPAL1FN8ES2TMJtOxbM8nAIShVSoO6kEj KyqGBn6cGajQ/5RfrHMziWx5DzO7s0wR9UF7lyN/ykPJ9wOCRT5E4KCTleTv+3LTBYTF 09x4DlSRswBcX2ruzGmCwDXCRqIwMIfOzFHBTs/MmASSaDFT3j7VMCFLoLUkvOIS1cz2 C/AmSxkiFgPR2l6eTbRRcJShWluJB6c62iYH14lYdtuNEYVxjDjU05tbffnfPyIO6EJR uTAm1I19K7iC+FZFtDJgqpvGfqu2TyN3TrpYd9g+haa/GXszcVXClvnORtJFvHX902qm YjJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=q+vo9xwxFF4sNhy0dor2wwv3CWFlIdZ4y8k04+IC2tw=; b=EfwAc4CwGhP19K3/eXLLokas5sghslWtNEpqwqzIj8CP82JiWL5YQ3cBP8lzrwzSfG 3/Y0ONtEEvz662/JWQzhTrbY+F57q3Ml3k/KJbr0dSOQBu0bnQ11wo+8O8VWBbJ8r7Bo WhBGYyrklntuIIiILjVe4cR7cjhQeVwwV5RS/vwiERIi9G8uTjjK9QgkrNFx318QZ0xh Hf5WFiiLA6VD/Y5x7aApKzeUQHHW/PrsybJWJisb7y9RQQ7AkDy6+YYSxzq52dNv6VlW xMToW3lLguUIJWLFDGE1H0vp+hIVdekAyWEYrChPyUEii0JFjXwsCdRWkinhjtHx0A89 m/xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Sf+AAe62; 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=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hb39-20020a170907162700b007f38bd15f62si33142286ejc.551.2023.01.04.16.04.01; Wed, 04 Jan 2023 16:04:15 -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=@linaro.org header.s=google header.b=Sf+AAe62; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234909AbjADXZ4 (ORCPT + 56 others); Wed, 4 Jan 2023 18:25:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234738AbjADXZs (ORCPT ); Wed, 4 Jan 2023 18:25:48 -0500 Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 419491B1F6 for ; Wed, 4 Jan 2023 15:15:56 -0800 (PST) Received: by mail-pf1-x436.google.com with SMTP id k137so19249357pfd.8 for ; Wed, 04 Jan 2023 15:15:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=q+vo9xwxFF4sNhy0dor2wwv3CWFlIdZ4y8k04+IC2tw=; b=Sf+AAe62Oqq7qPWS4uxFkl3QiswCdhiAOIjEAmm1kJoWKUR+7z9fwUi4k6j/ArVuCN BIF0iEoxuYxwW2y42amlbopuTWcSgLTF7ZZZMlkUXnJhjg4n8nGLJ+2XnlSg22N7RRH7 26Hm1r9Y63G16hAe48x2LU+ySiL4YIELtFc3H6Ojl2ucar/oiF40Z89STfI4evDrOrVi z4tn0836yogPqQxVT2tEz4RJc5pVKalzScvyKVxDuAZChs1rECnkHAwWTCkK0giDHg6q NeU5Uh4e+6OxDFiolMq4cU1bq1Sd3qxBYGRTJbv15is8bzzbsiKTMGShROJ4cSs/ivUV mSOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=q+vo9xwxFF4sNhy0dor2wwv3CWFlIdZ4y8k04+IC2tw=; b=yEcl54/56QPJNxkynvkjsWViKhFPJHV9b/BvHyFQ4q1GSuwnK1jjFUrD0EOe5Ha9mC ANxLoXCRJZ+bRthhDBDd7Kig9ndi3qsA3kjk6sHBidwi08Gog46SMkQ/g5LOk8w7PWqi PvVpqsVCrInttac+YwWyIW7tJFt+o8c9E9vGksH0Cdt+lVyO6yxC4ppgZD5CM/mSwJxw URf3VfOoRrEABaRRXWfElaeZ0EEQPFB15zdZJ4Yr6rlK0By24W9EA2dAUgx60WlQvfbi hh78xYFndtg1UT0eRC3lSZJW9tvH93+7zthjL1OGExNn4UBwQrXPCN/aTcXp1nzPF/0Z XAwA== X-Gm-Message-State: AFqh2kr7e3gVduMM7QBA9caOnDFdOmtmij7faYAMnZkGE4pNcZ/CgOxG EDGkmtM39i/vYG9XlmFBLpA+ow== X-Received: by 2002:a05:6a00:2a9:b0:581:f14:fde9 with SMTP id q9-20020a056a0002a900b005810f14fde9mr32977482pfs.16.1672874155708; Wed, 04 Jan 2023 15:15:55 -0800 (PST) Received: from p14s ([2604:3d09:148c:c800:1328:ca09:d4c2:fcbc]) by smtp.gmail.com with ESMTPSA id i2-20020aa796e2000000b00581172f7456sm18492509pfq.56.2023.01.04.15.15.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Jan 2023 15:15:55 -0800 (PST) Date: Wed, 4 Jan 2023 16:15:52 -0700 From: Mathieu Poirier To: Srinivasa Rao Mandadapu Cc: linux-remoteproc@vger.kernel.org, agross@kernel.org, andersson@kernel.org, lgirdwood@gmail.com, broonie@kernel.org, robh+dt@kernel.org, quic_plai@quicinc.com, bgoswami@quicinc.com, perex@perex.cz, tiwai@suse.com, srinivas.kandagatla@linaro.org, quic_rohkumar@quicinc.com, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, swboyd@chromium.org, judyhsiao@chromium.org, devicetree@vger.kernel.org, krzysztof.kozlowski@linaro.org, corbet@lwn.net Subject: Re: [PATCH v4 1/2] remoteproc: elf_loader: Update resource table name check Message-ID: <20230104231552.GD2112402@p14s> References: <1671603033-4359-1-git-send-email-quic_srivasam@quicinc.com> <1671603033-4359-2-git-send-email-quic_srivasam@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1671603033-4359-2-git-send-email-quic_srivasam@quicinc.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 Wed, Dec 21, 2022 at 11:40:32AM +0530, 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'. > Well, they are different ELF files so it is implied the resource section may be different... And from what I see this is purely a human thing and not specifically needed by machines. I can't imagine this is a new situation and as such must ask how it was working before? > Example readelf output of DSP binary: > [60] .start.ac_bin_process PROGBITS > [61] .resource_table.ac_bin_process PROGBITS The real question is... Why is this labeled ".resource_table.ac_bin_process" rather than simply ".resource_table"? > [62] .comment.ac_bin_process PROGBITS > > Signed-off-by: Srinivasa Rao Mandadapu > Reviewed-by: Philippe Mathieu-Daud? > Reviewed-by: Mukesh Ojha > --- > 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); > -- > 2.7.4 >