All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mathieu Poirier <mathieu.poirier@linaro.org>
To: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>
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
Date: Wed, 4 Jan 2023 16:15:52 -0700	[thread overview]
Message-ID: <20230104231552.GD2112402@p14s> (raw)
In-Reply-To: <1671603033-4359-2-git-send-email-quic_srivasam@quicinc.com>

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 <quic_srivasam@quicinc.com>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Reviewed-by: Mukesh Ojha <quic_mojha@quicinc.com>
> ---
>  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
> 

  reply	other threads:[~2023-01-04 23:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-21  6:10 [PATCH v4 0/2] Update section header name check Srinivasa Rao Mandadapu
2022-12-21  6:10 ` [PATCH v4 1/2] remoteproc: elf_loader: Update resource table " Srinivasa Rao Mandadapu
2023-01-04 23:15   ` Mathieu Poirier [this message]
2022-12-21  6:10 ` [PATCH v4 2/2] docs: remoteproc: Update section header name requirement Srinivasa Rao Mandadapu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230104231552.GD2112402@p14s \
    --to=mathieu.poirier@linaro.org \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=bgoswami@quicinc.com \
    --cc=broonie@kernel.org \
    --cc=corbet@lwn.net \
    --cc=devicetree@vger.kernel.org \
    --cc=judyhsiao@chromium.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=quic_plai@quicinc.com \
    --cc=quic_rohkumar@quicinc.com \
    --cc=quic_srivasam@quicinc.com \
    --cc=robh+dt@kernel.org \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=swboyd@chromium.org \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.