From patchwork Thu Feb 23 15:05:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mohammad Rafi Shaik X-Patchwork-Id: 13150502 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 70CB4C636D6 for ; Thu, 23 Feb 2023 15:07:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234938AbjBWPHR (ORCPT ); Thu, 23 Feb 2023 10:07:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234920AbjBWPHQ (ORCPT ); Thu, 23 Feb 2023 10:07:16 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C07F521F2; Thu, 23 Feb 2023 07:07:15 -0800 (PST) Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31NB47gA007103; Thu, 23 Feb 2023 15:07:01 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=qcppdkim1; bh=GDNka6M/kPLwaWkxju0tDmKqAgBvnoKPJ+TjKT+Ve4I=; b=fFAfr7fcPkBXkJn/aJw77kXO1gkAWhfZgTrox0NWcKdVnuJ+fE7Ywa6r/6Dma6Tx60jX Qsre3hae01DseHBYyr3GgdTPHwc9JIj6rawygFEgWBCAi+WpQzopphwbyCTRG5y89RWi HtmZd34F2I/2HAgqp0IWogI7+9xCCYCKzeq3Z1PZrdxjlkcpGCVFfssa3UcnOOeRDs6l L9xmBMhlvLhJVljNLMvTF0lVuqvlWGHKcTG7vVbjUCo5XAr/XkrF+XVYDpteeFDKIPL7 OYXPwHXok7hCQSVux+ze5P2uow4/CXF6cRe1g4n/GbOHJpgbMguZ/IzEjB1DnpbzqxZW aw== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3nwy9a1pj7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Feb 2023 15:07:01 +0000 Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 31NF70Ik000655 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Feb 2023 15:07:00 GMT Received: from hu-mohs-hyd.qualcomm.com (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Thu, 23 Feb 2023 07:06:53 -0800 From: Mohammad Rafi Shaik To: , , , , , , , , , , , , , , , , , , , , CC: Srinivasa Rao Mandadapu , Mohammad Rafi Shaik , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , Mukesh Ojha Subject: [PATCH v5 1/2] remoteproc: elf_loader: Update resource table name check Date: Thu, 23 Feb 2023 20:35:58 +0530 Message-ID: <20230223150559.2429562-2-quic_mohs@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230223150559.2429562-1-quic_mohs@quicinc.com> References: <20230223150559.2429562-1-quic_mohs@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: 1bhT_twODnB9QPh_CSQKbMC1Qn44TuN7 X-Proofpoint-ORIG-GUID: 1bhT_twODnB9QPh_CSQKbMC1Qn44TuN7 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.170.22 definitions=2023-02-23_09,2023-02-23_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 clxscore=1011 malwarescore=0 spamscore=0 priorityscore=1501 impostorscore=0 lowpriorityscore=0 adultscore=0 phishscore=0 mlxscore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302230123 Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org From: Srinivasa Rao Mandadapu Qualcomm DSP binary is prepared by combining different ELFs'. This patch differentiates the section header name of ELF within the same existing section headers of the same ELF. 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 Signed-off-by: Mohammad Rafi Shaik 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 5a412d7b6e0b..77330d6f43d0 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); From patchwork Thu Feb 23 15:05:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mohammad Rafi Shaik X-Patchwork-Id: 13150503 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 CDADCC636D6 for ; Thu, 23 Feb 2023 15:07:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234297AbjBWPH0 (ORCPT ); Thu, 23 Feb 2023 10:07:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234953AbjBWPHV (ORCPT ); Thu, 23 Feb 2023 10:07:21 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C149532BD; Thu, 23 Feb 2023 07:07:20 -0800 (PST) Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31NB496V015214; Thu, 23 Feb 2023 15:07:09 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=qcppdkim1; bh=sq8uvt1NViWyHNAXmly9UKKOFzxewtugXdsvilv+m0k=; b=Hw6gypJcvR3CNE+P18dn3xdf4Df792qJUgn7hvy2HKE+daDQuD1Sq76riQkuH/hHY0Gh pdo8L+grEfh9pkTshTyEXr6TPTejOUjdE9pv7qiT5OEPA6WsEeHI0xOcri+N2eMKLGnp V+Wrz51nZqvOAhL9AdLehiFQAJmzI7ObFVT+N5bOYp8tWgUVHYYkE0uE/VYgd6Rg13VK qeYATJou3JdUy0HX1aE7nImcP1SZ28JD/t/+6xfz6sr3DBmO7LKj6S7A7QVD7A4neoOB 9Tj4raPznOWxtFenTWqH+wff1Ksp2b6gp7CTnhR05ZCD6pMUBQ6uYRxW8/R8I6Eezs0Y 6w== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3nwy8m1p07-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Feb 2023 15:07:08 +0000 Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 31NF78sN021006 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Feb 2023 15:07:08 GMT Received: from hu-mohs-hyd.qualcomm.com (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Thu, 23 Feb 2023 07:07:00 -0800 From: Mohammad Rafi Shaik To: , , , , , , , , , , , , , , , , , , , , CC: Srinivasa Rao Mandadapu , Mohammad Rafi Shaik , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , Mukesh Ojha Subject: [PATCH v5 2/2] docs: remoteproc: Update section header name requirement Date: Thu, 23 Feb 2023 20:35:59 +0530 Message-ID: <20230223150559.2429562-3-quic_mohs@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230223150559.2429562-1-quic_mohs@quicinc.com> References: <20230223150559.2429562-1-quic_mohs@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: 2Kb6C0fZY61HRDvR5cEfZvUVJ2ry5Q7q X-Proofpoint-ORIG-GUID: 2Kb6C0fZY61HRDvR5cEfZvUVJ2ry5Q7q X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.170.22 definitions=2023-02-23_09,2023-02-23_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 bulkscore=0 mlxscore=0 spamscore=0 adultscore=0 lowpriorityscore=0 priorityscore=1501 impostorscore=0 suspectscore=0 malwarescore=0 mlxlogscore=978 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302230123 Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org From: Srinivasa Rao Mandadapu Add section header name requirement specification in elf segments. Signed-off-by: Srinivasa Rao Mandadapu Signed-off-by: Mohammad Rafi Shaik Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Mukesh Ojha --- Documentation/staging/remoteproc.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Documentation/staging/remoteproc.rst b/Documentation/staging/remoteproc.rst index 348ee7e508ac..0c9c10a30c3d 100644 --- a/Documentation/staging/remoteproc.rst +++ b/Documentation/staging/remoteproc.rst @@ -244,7 +244,10 @@ according to the specified device address (might be a physical address if the remote processor is accessing memory directly). In addition to the standard ELF segments, most remote processors would -also include a special section which we call "the resource table". +also include a special section which we call the "resource table". +A "resource table" section name must start with the ".resource_table" prefix, +optionally having a more descriptive string appended. For example, +".resource_table.my_rproc" is a valid section name. The resource table contains system resources that the remote processor requires before it should be powered on, such as allocation of physically