Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
* [PATCH v1 1/1] remoteproc: qcom: pas: Coredump elf class to elf64
@ 2023-03-09  0:10 Gokul krishna Krishnakumar
  2023-03-10  4:04 ` Sibi Sankar
  0 siblings, 1 reply; 3+ messages in thread
From: Gokul krishna Krishnakumar @ 2023-03-09  0:10 UTC (permalink / raw)
  To: linux-remoteproc, linux-arm-msm, linux-kernel
  Cc: Bjorn Andersson, Konrad Dybcio, Mathieu Poirier, Trilok Soni,
	Satya Durga Srinivasu Prabhala, Rajendra Nayak, Elliot Berman,
	Guru Das Srinagesh, Melody Olvera, Gokul krishna Krishnakumar

This change adds a new initialization param which modifies the elf
class accordingly. Some of the subsystem dump analysis tools need
the elf class to be elf64.

Signed-off-by: Gokul krishna Krishnakumar <quic_gokukris@quicinc.com>
---
 drivers/remoteproc/qcom_q6v5_pas.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c
index 0871108fb4dc..17ce3177be7b 100644
--- a/drivers/remoteproc/qcom_q6v5_pas.c
+++ b/drivers/remoteproc/qcom_q6v5_pas.c
@@ -39,6 +39,7 @@ struct adsp_data {
 	int pas_id;
 	int dtb_pas_id;
 	unsigned int minidump_id;
+	bool uses_elf64;
 	bool auto_boot;
 	bool decrypt_shutdown;
 
@@ -681,7 +682,10 @@ static int adsp_probe(struct platform_device *pdev)
 	}
 
 	rproc->auto_boot = desc->auto_boot;
-	rproc_coredump_set_elf_info(rproc, ELFCLASS32, EM_NONE);
+	if (desc->uses_elf64)
+		rproc_coredump_set_elf_info(rproc, ELFCLASS64, EM_NONE);
+	else
+		rproc_coredump_set_elf_info(rproc, ELFCLASS32, EM_NONE);
 
 	adsp = (struct qcom_adsp *)rproc->priv;
 	adsp->dev = &pdev->dev;
@@ -1126,6 +1130,7 @@ static const struct adsp_data sm8550_adsp_resource = {
 	.pas_id = 1,
 	.dtb_pas_id = 0x24,
 	.minidump_id = 5,
+	.uses_elf64 = true,
 	.auto_boot = true,
 	.proxy_pd_names = (char*[]){
 		"lcx",
@@ -1145,6 +1150,7 @@ static const struct adsp_data sm8550_cdsp_resource = {
 	.pas_id = 18,
 	.dtb_pas_id = 0x25,
 	.minidump_id = 7,
+	.uses_elf64 = true,
 	.auto_boot = true,
 	.proxy_pd_names = (char*[]){
 		"cx",
@@ -1165,6 +1171,7 @@ static const struct adsp_data sm8550_mpss_resource = {
 	.pas_id = 4,
 	.dtb_pas_id = 0x26,
 	.minidump_id = 3,
+	.uses_elf64 = true,
 	.auto_boot = false,
 	.decrypt_shutdown = true,
 	.proxy_pd_names = (char*[]){
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v1 1/1] remoteproc: qcom: pas: Coredump elf class to elf64
  2023-03-09  0:10 [PATCH v1 1/1] remoteproc: qcom: pas: Coredump elf class to elf64 Gokul krishna Krishnakumar
@ 2023-03-10  4:04 ` Sibi Sankar
  2023-03-10 12:16   ` Dmitry Baryshkov
  0 siblings, 1 reply; 3+ messages in thread
From: Sibi Sankar @ 2023-03-10  4:04 UTC (permalink / raw)
  To: Gokul krishna Krishnakumar, linux-remoteproc, linux-arm-msm,
	linux-kernel
  Cc: Bjorn Andersson, Konrad Dybcio, Mathieu Poirier, Trilok Soni,
	Satya Durga Srinivasu Prabhala, Rajendra Nayak, Elliot Berman,
	Guru Das Srinagesh, Melody Olvera

Hey Gokul,

Thanks for the patch.

On 3/9/23 05:40, Gokul krishna Krishnakumar wrote:
> This change adds a new initialization param which modifies the elf
> class accordingly. Some of the subsystem dump analysis tools need
> the elf class to be elf64.
> 

https://lore.kernel.org/lkml/8dea333d-544d-7c07-d560-a1a9c3a38ddc@quicinc.com/

This patch was already sent upstream a while back ^^. IIRC the firmware
certainly aren't 64 bit elfs and dump analysis tools don't really care 
as long the coredump contains section headers.

- Sibi

> Signed-off-by: Gokul krishna Krishnakumar <quic_gokukris@quicinc.com>
> ---
>   drivers/remoteproc/qcom_q6v5_pas.c | 9 ++++++++-
>   1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c
> index 0871108fb4dc..17ce3177be7b 100644
> --- a/drivers/remoteproc/qcom_q6v5_pas.c
> +++ b/drivers/remoteproc/qcom_q6v5_pas.c
> @@ -39,6 +39,7 @@ struct adsp_data {
>   	int pas_id;
>   	int dtb_pas_id;
>   	unsigned int minidump_id;
> +	bool uses_elf64;
>   	bool auto_boot;
>   	bool decrypt_shutdown;
>   
> @@ -681,7 +682,10 @@ static int adsp_probe(struct platform_device *pdev)
>   	}
>   
>   	rproc->auto_boot = desc->auto_boot;
> -	rproc_coredump_set_elf_info(rproc, ELFCLASS32, EM_NONE);
> +	if (desc->uses_elf64)
> +		rproc_coredump_set_elf_info(rproc, ELFCLASS64, EM_NONE);
> +	else
> +		rproc_coredump_set_elf_info(rproc, ELFCLASS32, EM_NONE);
>   
>   	adsp = (struct qcom_adsp *)rproc->priv;
>   	adsp->dev = &pdev->dev;
> @@ -1126,6 +1130,7 @@ static const struct adsp_data sm8550_adsp_resource = {
>   	.pas_id = 1,
>   	.dtb_pas_id = 0x24,
>   	.minidump_id = 5,
> +	.uses_elf64 = true,
>   	.auto_boot = true,
>   	.proxy_pd_names = (char*[]){
>   		"lcx",
> @@ -1145,6 +1150,7 @@ static const struct adsp_data sm8550_cdsp_resource = {
>   	.pas_id = 18,
>   	.dtb_pas_id = 0x25,
>   	.minidump_id = 7,
> +	.uses_elf64 = true,
>   	.auto_boot = true,
>   	.proxy_pd_names = (char*[]){
>   		"cx",
> @@ -1165,6 +1171,7 @@ static const struct adsp_data sm8550_mpss_resource = {
>   	.pas_id = 4,
>   	.dtb_pas_id = 0x26,
>   	.minidump_id = 3,
> +	.uses_elf64 = true,
>   	.auto_boot = false,
>   	.decrypt_shutdown = true,
>   	.proxy_pd_names = (char*[]){

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1 1/1] remoteproc: qcom: pas: Coredump elf class to elf64
  2023-03-10  4:04 ` Sibi Sankar
@ 2023-03-10 12:16   ` Dmitry Baryshkov
  0 siblings, 0 replies; 3+ messages in thread
From: Dmitry Baryshkov @ 2023-03-10 12:16 UTC (permalink / raw)
  To: Sibi Sankar, Gokul krishna Krishnakumar, linux-remoteproc,
	linux-arm-msm, linux-kernel
  Cc: Bjorn Andersson, Konrad Dybcio, Mathieu Poirier, Trilok Soni,
	Satya Durga Srinivasu Prabhala, Rajendra Nayak, Elliot Berman,
	Guru Das Srinagesh, Melody Olvera

On 10/03/2023 06:04, Sibi Sankar wrote:
> Hey Gokul,
> 
> Thanks for the patch.
> 
> On 3/9/23 05:40, Gokul krishna Krishnakumar wrote:
>> This change adds a new initialization param which modifies the elf
>> class accordingly. Some of the subsystem dump analysis tools need
>> the elf class to be elf64.
>>
> 
> https://lore.kernel.org/lkml/8dea333d-544d-7c07-d560-a1a9c3a38ddc@quicinc.com/
> 
> This patch was already sent upstream a while back ^^. IIRC the firmware
> certainly aren't 64 bit elfs and dump analysis tools don't really care 
> as long the coredump contains section headers.

I think that if we want to change the coredump ELF class, we should 
match the class of the loaded firmware file. Same applies to the ELF 
machine (EM_NONE).

-- 
With best wishes
Dmitry


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-03-10 12:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-09  0:10 [PATCH v1 1/1] remoteproc: qcom: pas: Coredump elf class to elf64 Gokul krishna Krishnakumar
2023-03-10  4:04 ` Sibi Sankar
2023-03-10 12:16   ` Dmitry Baryshkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox