From patchwork Tue Dec 13 09:48:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivasa Rao Mandadapu X-Patchwork-Id: 13071873 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 A24D1C10F31 for ; Tue, 13 Dec 2022 09:50:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234720AbiLMJuA (ORCPT ); Tue, 13 Dec 2022 04:50:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234524AbiLMJt5 (ORCPT ); Tue, 13 Dec 2022 04:49:57 -0500 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CA3CF5D; Tue, 13 Dec 2022 01:49:57 -0800 (PST) Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BD7xMuh032620; Tue, 13 Dec 2022 09:49:16 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; s=qcppdkim1; bh=nTEtA1oF+7UcA8vVWVXKD+WqiYQqfYi5wKfiUtlDrNs=; b=LJsUZxxBFbff5n3lQxKqeuY49jkQ+E4BAwTwrIULWHZRGH/rD2WHhNprtrJWSwmKEKEV VjpGcRQGCIh6+7FATlg7zPZaZpJgEzcuo+BdEkWS2OeWQ2QljnIq6BGaI7tfsx3gouk2 /BXl4YPXLJLQwp6+Dc9WnTv+UeVdOPKnGrPN6i/bXUcn6Gj/+xZYU3qA84nffpnZXSSZ xKMyKii4KCGurl28Q63Pv3KFuwAOAlL7/wns4rJli/T+cJIlyNjEySqnNo4cvWJgvbV+ rnoqN6Yp2pyN5VfJE04162YdAfqHpT1ohTYc2UFydjQBofkxcesCyF/nM2ji3XjbSG1H Vg== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3mej4w8mbe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 Dec 2022 09:49:16 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 2BD9nFtS003960 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 Dec 2022 09:49:15 GMT Received: from hu-srivasam-hyd.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Tue, 13 Dec 2022 01:49:09 -0800 From: Srinivasa Rao Mandadapu To: , , , , , , , , , , , , , , , , , , , CC: Srinivasa Rao Mandadapu Subject: [PATCH v2 1/2] remoteproc: elf_loader: Update resource table name check Date: Tue, 13 Dec 2022 15:18:48 +0530 Message-ID: <1670924929-26507-2-git-send-email-quic_srivasam@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1670924929-26507-1-git-send-email-quic_srivasam@quicinc.com> References: <1670924929-26507-1-git-send-email-quic_srivasam@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: 0EKxPu2rAw2DXGn5eSiAi1pIyXb9c_80 X-Proofpoint-GUID: 0EKxPu2rAw2DXGn5eSiAi1pIyXb9c_80 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-13_03,2022-12-12_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 bulkscore=0 clxscore=1015 adultscore=0 priorityscore=1501 phishscore=0 impostorscore=0 lowpriorityscore=0 mlxlogscore=999 suspectscore=0 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2212130087 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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 of different elfs. Signed-off-by: Srinivasa Rao Mandadapu --- Changes since v1: -- Update the commit message. -- Use strstarts instead of strstr. 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); From patchwork Tue Dec 13 09:48:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivasa Rao Mandadapu X-Patchwork-Id: 13071874 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 89AFEC4332F for ; Tue, 13 Dec 2022 09:50:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234989AbiLMJuL (ORCPT ); Tue, 13 Dec 2022 04:50:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234897AbiLMJuF (ORCPT ); Tue, 13 Dec 2022 04:50:05 -0500 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27244F5D; Tue, 13 Dec 2022 01:50:04 -0800 (PST) Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BD7U8NS008201; Tue, 13 Dec 2022 09:49:23 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; s=qcppdkim1; bh=WrklWuF+aB1VX6PUMihXwQAJi2MdBml231PZGx5ug5M=; b=ULfIClm/P2TLKehI1K965MnlZv4mjyFRpUPBYuVMMhUW8KotScYgwSebI60fsNPurbrm kRRlJvKBs6K0x+fvzsBOfgz8EYFP7OfhsDqqicJ88JNSAUBAOkA3e7WdUhlD74/fLeK/ GSP29ekpBeVgAoPYmKkT5O8gE5X9fnljlclXjHBVc1l32pO+nVpS70GCL47f8XryJFPv KmWX6y4dKQ3MwEf6xX2NhQ+OLehIPUsdbpMuGPxR2eufFHhBthqC9ZG6yshZEysOMgk2 lXF+QV1U5ZOAEXbu+hOm89ktranL33N0azfAf5GC8o/0tr2ATOaNwDLr7mD2Fr8Nsvxg 0A== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3meh1pgutf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 Dec 2022 09:49:22 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 2BD9nL9R004454 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 Dec 2022 09:49:21 GMT Received: from hu-srivasam-hyd.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Tue, 13 Dec 2022 01:49:15 -0800 From: Srinivasa Rao Mandadapu To: , , , , , , , , , , , , , , , , , , , CC: Srinivasa Rao Mandadapu Subject: [PATCH v2 2/2] docs: remoteproc: Update section header name requirement Date: Tue, 13 Dec 2022 15:18:49 +0530 Message-ID: <1670924929-26507-3-git-send-email-quic_srivasam@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1670924929-26507-1-git-send-email-quic_srivasam@quicinc.com> References: <1670924929-26507-1-git-send-email-quic_srivasam@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: cnBhuEDuNYBftybO7lliTweOHQI4G4ko X-Proofpoint-GUID: cnBhuEDuNYBftybO7lliTweOHQI4G4ko X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-13_03,2022-12-12_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 suspectscore=0 adultscore=0 impostorscore=0 mlxscore=0 malwarescore=0 spamscore=0 priorityscore=1501 phishscore=0 bulkscore=0 mlxlogscore=982 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2212130087 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add section header name requirement specification in elf segments. Signed-off-by: Srinivasa Rao Mandadapu --- Documentation/staging/remoteproc.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/staging/remoteproc.rst b/Documentation/staging/remoteproc.rst index 348ee7e..3125030 100644 --- a/Documentation/staging/remoteproc.rst +++ b/Documentation/staging/remoteproc.rst @@ -245,6 +245,8 @@ 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". +This resource table section name may have anything appended after it, +but it must start with ".resource_table" The resource table contains system resources that the remote processor requires before it should be powered on, such as allocation of physically