From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=205.220.180.131 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796263675; b=FnjjLUOaV7SzkiugkahQkippS7fv7OEiWJf/AvDP9L7VgNiYwYNW0jiLN6dZHmRxiMu8 BlQz+D/o7dV6VKTMixyiGIaoCqRe/rxxTf6dDLRW0IOHUkVQV3Sb+3H66+abFQw57dcmA k/eDbnP7u4sD86DRkWhSz3ZEk6oC/Aea9GybOi3tYkLgfhUp2GFqZqF4hqTeBZS99OCon Wi0584wwEzl0yJs8iV3SOO1kV4QRsWu0vQj+n+gMJtSWYUPG9JvIqeM6WZuRJcLvPWD5q +D9ZlFcNy3VQaPA+SgNnAdBO3W7hiseLdTUzi4riYn+DrTeIBtcp4V4Rd2X+/Lv52hA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796263675; 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-Info:X-Proofpoint-GUID: X-Authority-Analysis:X-Proofpoint-ORIG-GUID: X-Proofpoint-Spam-Details-Enc:X-Proofpoint-Virus-Version: X-Proofpoint-Spam-Details; bh=EWBIAVzV/2KPnzj7qPNlisHwYif3sz/VcOkCzYsR088=; b=gNrSGFpC+0JN4XlsJslpdB3douH7nVlzt5dgJTG841/OJq5GzDCJxHMoZvT1X4601V9G HSevhjkr/1RoepAyl2OR9GSbbsUtofUwDJjSAAr+LhCOtJG04EtWYdpRdK6fnMX2xReOH Sefa5OZbyEWWZ0bLNm0rJz2KfKcPQ+hTiSBEPC6xy0s26YtR4vBzkbRQ9cwkqHeVag5At QA09x9E9t3yY4Lab4ANDXUqhL8GciUFqJDZLav8TpHrSUhd8G4Uhd7UUlHMwQHc01FX9P mP4KOIWkDzjmHFIdoXaCHAqCeCo205ncTkePe5TPhlFGkf9n2Fowv303SlcJns5RPcg== 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=n0FZbDO9; dkim=pass header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=M5IOkQ61; arc=none smtp.remote-ip=205.220.180.131 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.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 9477F606A32F for ; Thu, 3 Dec 2026 02:07:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 9477F606A32F 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=n0FZbDO9; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=M5IOkQ61 Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6B306LGY1791649 for ; Thu, 3 Dec 2026 02:07: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= EWBIAVzV/2KPnzj7qPNlisHwYif3sz/VcOkCzYsR088=; b=n0FZbDO9FP2xoi6T 04hTlzC+6Jc3w+zfXEqWxKT9ZXmSmm2nSw343ij9+uKg6HfgCbQzq625Zr2e+G+q b/3NeXv/M2IR96/DG1j0CEJoj4qe+OFksOk/uZrTluejTc0TY8T9f4Cw55EQJneP UqvK8IbfWfOFsjMnbLYxChaJysRwstgqt6HHsBaimZJyLhGPb5AXNGpAA1+kraJ7 xq+PQYBaNtBBCqKJYcNuWuMPiZ0MhU71KHa2rOQYtdiNkV0oKAoMBLArLLKPZRMh ItAcv/ykW6eep0iOFAIfCRso3n/drf9RH6C/2SbrdTwZ3NcCnRxq4pPjI+erszH8 pOMNbQ== Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com [209.85.216.69]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4jamypamx5-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 03 Dec 2026 02:07:53 +0000 (GMT) Received: by mail-pj1-f69.google.com with SMTP id 98e67ed59e1d1-3b44bcdb096so10729098a91.2 for ; Wed, 02 Dec 2026 18:07:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1796263672; x=1796868472; 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=EWBIAVzV/2KPnzj7qPNlisHwYif3sz/VcOkCzYsR088=; b=M5IOkQ614ESRXGllrov/coZbUp21AAMEM702G4COgyE8VRNFc5QAEOImIFLPuW8dc+ UcA5KzfaZwKCDh9eTa45UQzQFariWbPZ2pOzWuqOm+oSAgnrc/LCHz6P4+4aY64vSyGv qYmNwZrpZG04KohT40Lmp8zFvzisBTQOe8Sql35r2CRneVb8qxOLY9IlxmJnZZ2GXzsm +AGduYF4KYaxTo7UuiT5Ar/uw86VRU+WHo1IiyyNFoAcS1I2+o0VtB4aPobaaCibrmMM jQ1EWerssbzR4W6tgKGzNjLm9fv6B/2PU4l56yKQAHVI47s/7vtzmKmR8qDGHcTD5yuV bf7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796263672; x=1796868472; 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=EWBIAVzV/2KPnzj7qPNlisHwYif3sz/VcOkCzYsR088=; b=TD/Bnie4PqEItOvyy/VJOzV9uZntiL3oigtQOyGCKJDo6Q6fcKCywKE6dNMWqo03Cw XpsgPwW2wPDTxBobLZL1oGFOXuZFirRjVeppLoBzeAz0QJPRnkIHo1V1QgSC/XKiIRTv jIssjjtmeIgLLawcI5wrp1R/UdraOtLZvHM8fS62JsKO1PcrO1WFqy1IMqOCzDjGv6Jk ma8GRt8lJw8LtcKhVBwCpbCZZvKz8Bw0PmJ2N/IghBcEliz97ACBPicR2f3+NRc8+vcX sJjXjsSpcr3596+pFg6JBFwCzJl788vqw/aXdJjKGEwwRi2g0SnD2G0e0/l7kijF8dZb LuGw== X-Forwarded-Encrypted: i=1; AL+hErEwJ1prD6nQuvOKE8QJ2e0nrg2+/bJZMEl6NvhVKWdNR7u3tqfN0lWNLQ12wbkLvUtbnlYvBf2mBrODors=@vger.kernel.org X-Gm-Message-State: APuU4Z9xC7BCcd3C8GZNOUbTNYEvPdl55l49Kp6/YTsLm7/t8Jn+ZcHH 5scIleMfRjhEKnz67R1HsG5MURD52GRQFuC2NxL6VTYMn6Pkuw5s524fhBqnNq0baCPc8XZPdj5 QGj+N+HE7APpcnjdpEr6DBMaVBAGT6Dy5M2haAyO+mLfU8t8UiI1WA7/i3KPPQt8aY24= X-Gm-Gg: AZFdTZdvnuP0x+5JaxK2xMyh3QUbk2smZcgJ9NTZg/ucvfuHcWSfEQin0+ntDDXSKZ6 9D9EQIg/oeU+eYf7JhwGyZ9owUrcnpO4gHKKaJppuxHvPcXmgUNDfPZ8L1Mt3gIp4kSKgZBOXq2 6e2CX5/KMPMaHAm3uPxSScgtksdplEdgoQVHPT2P9ZHiLILrD4vQ9ZiPsSBVAqVTY5WdgFihZqK zN3dVMbjZzirHEWQGtfdKTJRxIykhzDbONu1+EQk+m72b+lr+CD3RxQaI9XVr2HD0Qa4jPtAo34 l7p3WbQKB6qCrou1bH4/NHrHdW/xkXWzIOfXeAjlj6m11Jw70n3CkFq0TuIloSBAqilGkgGix+r qP/4ldJjFOBjJ5YAaGxa6i+HzUNWVT/FWSIoffdqFeGpSUGrMAPKrFgp8Z4vTS39meQ6Sgc1wj2 WH X-Received: by 2002:a17:90b:3d4d:b0:3b1:7329:a121 with SMTP id 98e67ed59e1d1-3b41c8d49abmr44324395a91.12.1796263672235; Wed, 02 Dec 2026 18:07:52 -0800 (PST) X-Received: by 2002:a17:90b:3d4d:b0:3b1:7329:a121 with SMTP id 98e67ed59e1d1-3b41c8d49abmr44324362a91.12.1796263671534; Wed, 02 Dec 2026 18:07:51 -0800 (PST) Received: from [10.219.56.59] ([202.46.23.19]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3b5c7d10d11sm1702642a91.6.2026.12.02.18.07.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Dec 2026 18:07:41 -0800 (PST) Message-ID: <01fb2c07-331b-4124-a600-530d942a535b@oss.qualcomm.com> Date: Thu, 3 Dec 2026 07:37:37 +0530 X-Mailing-List: linux-kernel@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 v4] misc: fastrpc: map ADSP remote heap into remoteproc IOMMU domain To: Anandu Krishnan E , Srinivas Kandagatla , Arnd Bergmann , Greg Kroah-Hartman Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, quic_bkumar@quicinc.com, quic_chennak@quicinc.com, amahesh@qti.qualcomm.com, Tyler Baker References: <20261201-fastrpc-kvm-iommu-v4-b4-v4-1-b83c79d2c541@oss.qualcomm.com> Content-Language: en-US From: Ekansh Gupta In-Reply-To: <20261201-fastrpc-kvm-iommu-v4-b4-v4-1-b83c79d2c541@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Info: AW1haW4tMjYxMjAzMDAwOCBTYWx0ZWRfX6vnQ4Va5u82H d/bAScLQr86bnbOdgW45Vu8zcaTTCOZnoTDMq9UYUfVOUriiflGnVyVdFgZ7Ig+vfE732354d7K XYQ7oINxqTGRj6iMoSZO0JP3BtCUr5A= X-Proofpoint-GUID: LjcTS_UVRSrIoZudrdYe-c_HMuDcmHO_ X-Authority-Analysis: v=2.4 cv=U/8Hnuru c=1 sm=1 tr=0 ts=6b10cef9 cx=c_pps a=vVfyC5vLCtgYJKYeQD43oA==:117 a=j4ogTh8yFefVWWEFDRgCtg==:17 a=IkcTkHD0fZMA:10 a=pUM-KoujPXoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=EUspDBNiAAAA:8 a=Ks1o0rA-DlUU8ldYIXYA:9 a=QEXdDO2ut3YA:10 a=rl5im9kqc5Lf4LNbBjHf:22 X-Proofpoint-ORIG-GUID: LjcTS_UVRSrIoZudrdYe-c_HMuDcmHO_ X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjAzMDAwOCBTYWx0ZWRfX6i+t0tdPDHHh 3DOVcnip5l7Z10RCRVFYg4FD/fuHq/99uM6IPxOwKLKhG9ma02Hc/5JA7YkMT985ultiiPvCkID C1ObtK4XmN+1QaCwbF4Rv3mAMb8pHb5GsxINhdhOqWs0XU3qjJH8zlenGPqylse/izAmvIiLaKx ap8eFrPw/WxA3Dt1zMgwu5KeQrE00WIgQI9kUHXD/YHdHWPM+PFw72o5buJE+2He1d8vMhDNAgM HjViOvUFsXplgQt3UxFM87FjuHumfMUsWHfFqg0zkniTlNaiQiRLjrDuhq37hD80YQGF9xn4zSI 7sG2x+TOIW5gOnOTEFgg/YPBA0oHIylkYbDCBovsKxdS+KpT5ALwlRMHi0+V1SLt8jhFMWdD2yZ Rv0gps63dM0Ss7TbffALfwoJaAIAaE4kbNHZz5Debifpmg9sdgVh76F1L8oJwdnJ4HH4U6z5UCK +IvFBVFlGnk0fiwPzlA== 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_07,2026-12-02_07,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 priorityscore=1501 adultscore=0 spamscore=0 phishscore=0 clxscore=1015 malwarescore=0 bulkscore=0 lowpriorityscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2612030008 On 01-12-2026 19:40, Anandu Krishnan E wrote: > On Qualcomm platforms without Gunyah/QHEE, the kernel runs at EL2 > without a separate hypervisor to manage inter-VM memory access > control. In this configuration the remoteproc is assigned its own > IOMMU domain, and any memory carveout the DSP must access requires > an explicit mapping into that domain before the DSP can reach it. > > The existing code calls qcom_scm_assign_mem() to transfer ownership > of the ADSP remote heap carveout from HLOS to the DSP VM. This SCM > call is only meaningful when a separate hypervisor (e.g. Gunyah) is > present to enforce inter-VM memory access control. On platforms > without such a hypervisor, the carveout must instead be mapped into > the remoteproc's IOMMU domain via an identity mapping (IOVA == PA) > using iommu_map(). Without this mapping the DSP triggers an SMMU > translation fault when accessing the remote heap during audio PD > static process creation. > > Detect whether the remoteproc has an IOMMU by checking for the > "iommus" property on the remoteproc DT node and store the result in > a new use_iommu_map flag in fastrpc_channel_ctx. When the flag is > set, map the carveout into the remoteproc's IOMMU domain instead of > calling qcom_scm_assign_mem(). Introduce fastrpc_remote_heap_map() > and fastrpc_remote_heap_unmap() helpers to encapsulate the IOMMU > domain lookup and map/unmap operations, and a shared > fastrpc_remote_heap_release() helper that tears the mapping (or SCM > assignment) back down, used both from fastrpc_rpmsg_remove() and > from fastrpc_rpmsg_probe()'s error path. > > Tested-by: Tyler Baker # Eliza EVK, EL2 > Signed-off-by: Anandu Krishnan E Reviewed-by: Ekansh Gupta