From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=205.220.168.131 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796205474; b=zU3e4Crp7LprYxE7qNRPst09V58eETh5K7OFudLM7GgMbXeieuQgg1HhQ5GpI5B/e/yb glgaxl3WE8Xg0tsax7ZyNx/N3IR83LcVVeG6K6zuXA1VTs6ryw/M+V4UR/Nlwpt0iWLjj RhxEyv5rMum8AP4A1YtrWM3UhNF8EDq//6doyVzNCP8OEf0SAKb/2fFYbEzHCFTBGiDTc JnYFPBI9I0om+DyZgiQgEqEVt6z/dGfB20q3bHVvSqOSn6rdIlHswU27f+ENF31Zkj4JK hC/J7v/hUNAVltweQM2StJR0V4WRUlCBtXzoD9XqWZ+aH4BIcj8Sj+0XnHFFwCcS6wQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796205474; h=DMARC-Filter:Received:DKIM-Signature:Received:Received: DKIM-Signature:X-Google-DKIM-Signature:X-Forwarded-Encrypted: X-Gm-Message-State:X-Gm-Gg:X-Received:X-Received:Received:Message-ID: Date:MIME-Version:User-Agent:Subject:To:Cc:References: Content-Language:From:In-Reply-To:Content-Type: Content-Transfer-Encoding:X-Proofpoint-Spam-Details-Enc: X-Proofpoint-ORIG-GUID:X-Proofpoint-Spam-Info:X-Proofpoint-GUID: X-Authority-Analysis:X-Proofpoint-Virus-Version: X-Proofpoint-Spam-Details; bh=PNoeJaozSokhamviWUox89gQmhIMNBmMdshVm1xuzug=; b=SDZVw5DWyDlAozFep3EJ5hHrGkgWGQE4MKGbDCQj5N5TEBLbWkbuftgFFLoi3MudA53e TC697NTOgQtFMefqNnq+GshpryW20OgteROe6fcg98O4y59hXzzEpUstJ0ElxF188tnkr QZOz/NLvsWQrITPz20rZLCzCvG0U8EJaPpUaME4KqEHMKqrJzwVM7AvKB8B5HTH5Rocsv BXKCaw68P36EpZpma1a2bLxvR1g0P1qN5jqh7kPlG8jXCus4i6nKOws2V7qw9IZ1yNmDD 2NcnAxT4+BMK4ngKZ/wrHPfsu9vdN7R3kS+BltKN+FH6ejEz714UFKZOeLTaYE4REUw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=E+de8K2Z; dkim=pass header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=Lx+eC7ND; arc=none smtp.remote-ip=205.220.168.131 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3EB9B606A32F for ; Wed, 2 Dec 2026 09:57:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3EB9B606A32F Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=E+de8K2Z; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=Lx+eC7ND Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6B26pTaP4111442 for ; Wed, 2 Dec 2026 09:57:53 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= PNoeJaozSokhamviWUox89gQmhIMNBmMdshVm1xuzug=; b=E+de8K2Znybn7CNF fUWZvT7krp5ViSc4tNYSamH/JBosuweKzkLkKzfLfY03xYGYaf3grvoXdUP879B7 MGoiU3SIIgY8aDnyKTydR79+oM6577gL/ImdjOksqVMnTWbhiE2zvG4eAaeaY/m1 bpOlCZvKHJqDfVhWUH3ZGkcJ45lTJQrd+XuRVMaSJxckE2NIsDUXsnacMGy0irgX 63NGIVm1tWV6fEDyTYvy71F6Q+6FaMkCxRihGMX8AgjGrtyREJF+WRHT0qno+Fnq aBhdiAFyBC5xVx6d9kl5kQZxx5MNbM2VyFEzmr7w7E4DYmsyTKAf7lyJdwljcacg 7t368g== Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4ja29vkpgn-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 02 Dec 2026 09:57:53 +0000 (GMT) Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-2f1426c0ee8so44275365ad.2 for ; Wed, 02 Dec 2026 01:57:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1796205473; x=1796810273; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=PNoeJaozSokhamviWUox89gQmhIMNBmMdshVm1xuzug=; b=Lx+eC7NDj/ZStrf/PGzf7FrMvWg9m80jT/qeSHqtxI0rmo83mXKw7aqlu1J/lJjl2g dCUpAf9sEbthKJbOq9lBRU0hW0Dt+jJt0Pq2uYa+jsXPHh/En6eFhrE9QGtKUWmjRlMr IMpm5cQrXA5boZ9dBEznWq0WZMrfroMTMjlNY5siWowgOmgE3sGT8c/sogMLWA70dyl5 vtNWSkHfSRmvW1u+/e2HKYstXACfXFPpqg1BpJa01UA0BF+vVv3VVu4tW761/bF7vDF4 ngwb/qEkS+g5U05xzzQ5A4/c2Bv5OFoOeXBdelXZ6DQJonbEPltDRSf/FY/h/Ls1cwi9 ywbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796205473; x=1796810273; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=PNoeJaozSokhamviWUox89gQmhIMNBmMdshVm1xuzug=; b=fOgiv7MvmdHhtw6WA2Hb2Qj3sX3rK2LGlctQNMTjWoNlVn/oWyHQCNsB3chjGi14ZM t6c9esPfQcP4y20GnaW7vcGl5A0bLnd+oyEHZdaluo7l3ExtHn651LkEzcBNm9x0oH/h ylm4v9M1RtkB28a4v2dmV5slZsoHKOrEsMdw3HzjtO9X0CFsXs1IysQVVs2DhIMBYkQ2 Uxjz+urf5VAu/bq+GJgtjKrLEfYdNai2XT64pF6B5vpLzYa58wkIbE3DvrTEdHzDy/NE pBhAVAMmoyf9yX0fY6mAc8ONW4b4Pzy2miaoO1w+I6BFs+gHCFdNavMRXHOEya0SCK8M mptw== X-Forwarded-Encrypted: i=1; AL+hErE5ZbXOoJf6QrFGPGMtu14KrcaB8x6t+Hl1dsQOpzNCCXpLwmLSVkOs/aXeCHcDPYPiVrOmDznDkz2J@vger.kernel.org X-Gm-Message-State: APuU4Z+3uwb1KfWVEWbrGkCALhgcXCJ4LcDnfcEx/Gmqfv21382q86Zd KAn9ye078JwZMZJYDJUqwLg2E8ZmSTm5dQeI4bcV8xS9mM62slR5oPDrHiqf+QfwgWGq3LDeI5N Cmdu/QMdXQp6D975AB6GOi0zcFbOovx3Aik5ejHeUTskG+ZbQSgGjqRy3I0++xcSd X-Gm-Gg: AZFdTZd7htWIHHFPgs2114pEFvJgqNWSCQSfrpiRy2X6hPye5fWWisjVVCBosMv9u4o nYfmDruFSYB4tcUW2cumXZCgRQ9H723YgAl5RK4VkcMPju648sJKAsaqoepAjZK14dszKcQCNsn C/OJC/wdkqLpAWgL+bifLQRCerV0UzWli21t8LD5GZcpiImo3OZIAA2O0W/hSQYKV8Km2ftTqcd kHSBa+mYATHjQFyc2brz1Zsj8ghAw8OaDkp/5UcdB1hq42LdS5Cf9TpIIX4HgGzBJkW8hJ/tWzw k34d00ve1mZCse4ghIERjRe/Q4PBK2UfXlj+oBby+zXb9L/XmADTWL2B/Q6j8GD26U6FzCmGrFZ rN8Fs5yIdtay3uz3pEtbQSKZXkIRHHyl9133ldQclG2mFr7Pyp7FGYYywCdrSkvq0cnlihhSeDF CkVTE= X-Received: by 2002:a17:902:e5c5:b0:2f0:345a:25ab with SMTP id d9443c01a7336-2f03f18dbf9mr426211035ad.59.1796205472688; Wed, 02 Dec 2026 01:57:52 -0800 (PST) X-Received: by 2002:a17:902:e5c5:b0:2f0:345a:25ab with SMTP id d9443c01a7336-2f03f18dbf9mr426210755ad.59.1796205472206; Wed, 02 Dec 2026 01:57:52 -0800 (PST) Received: from [10.218.0.115] ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2f03f0dc0ebsm194169615ad.33.2026.12.02.01.57.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Dec 2026 01:57:51 -0800 (PST) Message-ID: Date: Wed, 2 Dec 2026 15:27:46 +0530 X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH RFC 2/2] remoteproc: qcom_q6v5_pas: map SOCCP carveout privileged-only To: Shawn Guo Cc: Bjorn Andersson , Mathieu Poirier , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jingyi Wang , linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Bibek Kumar Patro References: <20261113-nord_embedded_el2-v1-0-48f717e97066@oss.qualcomm.com> <20261113-nord_embedded_el2-v1-2-48f717e97066@oss.qualcomm.com> Content-Language: en-US From: Anurag Pateriya In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjAyMDAzOSBTYWx0ZWRfX4Z+nt8+vGi9K o7CkrgB6Wj+S3JtEjcQT/IJujyEhcLAhKUR4gxok//Fw3+++rhx5qe9nrIeSsXclqCGZdimL5zG ffyQ5oceDk0+mE4bYjaLuK/XN5nB9etfggK8Sw5g22qf0bFbV3wTPtNp3sb5qDyY5tMLvXQIeEu UrJqID7Hy9LB8fPoKb3hlnwKPFPHtD0GZa75dzRr83087fSO5+MbBb+x05p7tq5vy2hTR1XQIiy Bu6guV5BIaTwBdgBgffF1lOqMIRSlvaxMwy6+1Mq9PJzbSGgQtIuTnS70YhnzFmD7CbP4eZHX0F KD6toM4Aa0XybmamnH/s8Z59j9pbup7YGAsPNV04PEdyDmu9vdwvqtiKYOfHQlM/w3nu2VnoItC TE9kaRedb0a5I3PmB5/sfxG2VtTH9w8Rdgx/H6xNkQodVZzxD/RY5/a0SfDSAASh+oUMvDEkPEt pbZnFMQxrwU5Kkf+8tQ== X-Proofpoint-ORIG-GUID: I4SLZlOP-kKm80l0lzOkYf1f6QePBtm_ X-Proofpoint-Spam-Info: AW1haW4tMjYxMjAyMDAzOSBTYWx0ZWRfX9nPqvV6BPfcB ctkffnXQYi4pD0zuah2WBQVZWP+iJAc1jpUEL+NQ0IK8R2+oSKxD0Vg3saMRHjEy6UItQqJIWfW f6K6oyAjgDkX+k83NE6aEHbHbJRbL9o= X-Proofpoint-GUID: I4SLZlOP-kKm80l0lzOkYf1f6QePBtm_ X-Authority-Analysis: v=2.4 cv=JvFkP84C c=1 sm=1 tr=0 ts=6b0feba1 cx=c_pps a=MTSHoo12Qbhz2p7MsH1ifg==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=pUM-KoujPXoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22 a=EUspDBNiAAAA:8 a=s56EoA9XyD98DdRESF8A:9 a=QEXdDO2ut3YA:10 a=GvdueXVYPmCkWapjIL-Q:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-12-02_02,2026-12-01_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 clxscore=1015 adultscore=0 priorityscore=1501 spamscore=0 lowpriorityscore=0 malwarescore=0 phishscore=0 impostorscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2612020039 On 11/14/2026 9:58 AM, Shawn Guo wrote: > On Fri, Nov 13, 2026 at 05:54:13PM +0530, Anurag Pateriya wrote: >> From: Bibek Kumar Patro >> >> SOCCP is a RISC-V core whose instruction fetches go through the >> SMMU in privilege mode >> >> The memory region is mapped with IOMMU_READ | IOMMU_WRITE, which results >> in permission fault when SOCCP fetches instruction, append IOMMU_PRIV to >> mapping to allow it to fetch instructions. > > This says what fails and what makes it go away, but not why. A reader > can't tell from this why an RW mapping is fine for a data access but > faults on an instruction fetch, or why IOMMU_PRIV fixes it. > > As I understand it, the chain is: > > - Without IOMMU_PRIV, io-pgtable-arm sets AP[1] in the stage-1 PTE, > so the carveout ends up AP[2:1] = 0b01, i.e. writable at the > unprivileged level. > > - In the VMSAv8-64 stage-1 permission model, memory writable at the > unprivileged level is implicitly privileged-execute-never, > regardless of PXN. > > - SoCCP fetches arrive as privileged instruction transactions, so > the first fetch takes a stage-1 permission fault (FSR.PF, > FSYNR0.IND=1). > > - IOMMU_PRIV clears AP[1] (AP[2:1] = 0b00, privileged RW only), > which removes the implicit PXN. > > Something along these lines: > > On Nord, when Linux runs at EL2 it owns the SoCCP stream and the > remoteproc core maps the firmware carveout through a stage-1 SMMU > context bank. qcom_pas_map_carveout() uses IOMMU_READ | IOMMU_WRITE > without IOMMU_PRIV, so io-pgtable-arm builds stage-1 PTEs with > AP[2:1] = 0b01: read/write at both privileged and unprivileged > level. > > SoCCP is a RISC-V core whose instruction fetches reach the SMMU as > privileged transactions. In the VMSAv8-64 stage-1 permission model, > memory that is writable at the unprivileged level is implicitly > privileged-execute-never, regardless of the PXN bit in the PTE. The > first SoCCP instruction fetch after PAS authentication therefore > takes a stage-1 permission fault (FSR.PF, FSYNR0.IND=1). > > Map the SoCCP carveout with IOMMU_PRIV, so the stage-1 PTEs are > privileged read/write only (AP[2:1] = 0b00). This removes the > implicit privileged-execute-never and lets SoCCP fetch from the > carveout. > > Other PIL subsystems (e.g. Hexagon Q6) are not affected as their > instruction fetches do not go through the SMMU in privileged mode. > > Another nit: please use SoCCP (instead of SOCCP) everywhere, e.g. patch > subject, for sake of consistency. > > Shawn Thanks for the review comments. I will add this in next version. Anurag Pateriya