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: 32729 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp18231wrn; Tue, 13 Dec 2022 01:51:34 -0800 (PST) X-Google-Smtp-Source: AA0mqf4Igv6NIz5xO4HSmC8aZdgYvHRmvjG7GELrF6K34fS7ex8lNjwKf5NnCuk5wrGqUhRQWa+n X-Received: by 2002:a05:6a00:4510:b0:578:2e3b:4728 with SMTP id cw16-20020a056a00451000b005782e3b4728mr12429592pfb.33.1670925094066; Tue, 13 Dec 2022 01:51:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670925094; cv=none; d=google.com; s=arc-20160816; b=N9bnVp3/ikcmN2mPEaHpz94tTi2YiAa24AEmU0EwsQUQL3S3RVAmb3txDBMXPG7mtY oi5HzidCfqQAK4tcbGo4mDRN6dDp5q8FnxkM1ug4QVNJr2sWKSmgzwXaDVM9saoxsSoJ py6r5kdR9U0x1xr2dd8OINf1pQrcbgWZWKZgrYkC99hyuR1I+Q8MwVtiuv7NqiUZR8Mg NWghqhF9eMLXRblT/xw+zUxheJuE77yuzILM6CTahfhF73HfHiqIWiKAJgcAIgSn1GGH 5MEv8Ez95FTXDTsg6qFq5uDW5VyI40T/+wVF6dohHVVekXAIAUfsEqrjhJ2TU0uTN4Xn eT3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=nTEtA1oF+7UcA8vVWVXKD+WqiYQqfYi5wKfiUtlDrNs=; b=isFt36vFfnKtnZCj6VR17a/TMwSCRPjBpJ6m09mJlWrbwTHX6M1fkexXgpZHTpGymk iSsXk28PnIA800D1v5p7YmLMeG1v42oS81cwkFfTlFdq5WWh/nW75FJlMv98/S481eeB b5X0CCT9ODJgdMxjjdCaBFTXI5lu4cZa1qokLcNTLrqQxajT0qoFFd0wrcnJxOudgVWh ddHw7rTfWKSw/LZjgcLScR3+qnk6iiJNei3NOomAfWnU0pDK2be/6CC9ZCUQtC5xUPXq OSSRilIIWGsPtJbAknVWx55F5ECXTD6NPNn1IkJ+vOH53NfNaN7knXUt1PtxcdMHJ9nJ aFug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=LJsUZxxB; 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=quicinc.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bn23-20020a056a00325700b005771c7ccd95si11383680pfb.53.2022.12.13.01.51.19; Tue, 13 Dec 2022 01:51:34 -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=@quicinc.com header.s=qcppdkim1 header.b=LJsUZxxB; 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=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234745AbiLMJuD (ORCPT + 99 others); Tue, 13 Dec 2022 04:50:03 -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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752091951671109193?= X-GMAIL-MSGID: =?utf-8?q?1752091951671109193?= 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: 32730 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp18457wrn; Tue, 13 Dec 2022 01:52:16 -0800 (PST) X-Google-Smtp-Source: AA0mqf4IP0zQ9ILzUERtP7Es2OBUWmaCEgv6pRCh2DZWDSfnG5S+iF33+lbOS6YPAZz97jdCs+Tm X-Received: by 2002:a05:6a20:7d89:b0:a3:6ceb:7ce8 with SMTP id v9-20020a056a207d8900b000a36ceb7ce8mr33335223pzj.13.1670925136558; Tue, 13 Dec 2022 01:52:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670925136; cv=none; d=google.com; s=arc-20160816; b=OwkoN68B9NcEpfSaR6m2EPQNPWhREJCDeARZ8Q+XbTxKhDJEZV78PaF7y5qCGwcpjN ZiFwVS7KKCy2rOf/NjpAyKkpzLe/tV6Hz0EdBlWUnBQR4EZYcs0akCHE2AqS0+a1Cwon n9G2WOb1ISiRlG9W6Cqk7LgwRwFOYZY9aTNfkaqQsTV/f0NlEF4AAdHYQNIqdmgRT4P+ /yVCQJdg0/QLJd1xi2pajAXs9/uOg4dYHLw6S/bZKUGkllvHfnM1XyWWTFw/j9aD93Yv x3b2oBGOYQMc9l4vameoOW8JQdWyxSpgcMZx0IeZmCG0aaBJTgqd4j36a/IGc2R9o+8E xI+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=WrklWuF+aB1VX6PUMihXwQAJi2MdBml231PZGx5ug5M=; b=RMkb6tIloXk6zLZavow+/JPn3iPUIZikfrk8ZaZyBEQefNjhNzyRdU18VPd7Fua5Kf HfuTIoy47k9uNhkiwFTsIaXI5DaonZXCkYvroour7WFdRg0sane8JcUR+kag8nKWJLfj iVxjn5CAYnMt66wNu1fwc8qSqz7mokPi5U4rEwAJ3GvEb8goEFsMxgb4jpiOkO9e3J8L q9wBBBMrEhyR11og5dBVlFAG/vAOvTQPNoUFBvKgyJ6jFO+UUXJs9UB1Tox34nV44VfR D7yDjHj/jP8f+4q8v+DL5zqCsidr3LmdfnaMu+TyBeEhFbii67H/RZJOXDlD3cmHQvIC ZL4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="ULfIClm/"; 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=quicinc.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s15-20020a17090302cf00b001782ecb617dsi12298449plk.412.2022.12.13.01.52.03; Tue, 13 Dec 2022 01:52:16 -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=@quicinc.com header.s=qcppdkim1 header.b="ULfIClm/"; 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=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235002AbiLMJuM (ORCPT + 99 others); Tue, 13 Dec 2022 04:50:12 -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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752091996117228348?= X-GMAIL-MSGID: =?utf-8?q?1752091996117228348?= 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