From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A22BA2F6578 for ; Mon, 24 Nov 2025 11:31:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763983914; cv=none; b=tJYLhSdxrw/RGpd9wPO1q943xswAAurhRR0E5sVuoeS6S7M5PIr6jgDkgbpSlm7Nke7risDIK+Haek5OSdPUJZCQ8w/Jw3jeN5OIeP44Oi5sxGf2l8lQiApKQcyOo4lFbjYqt50jhBaIcAzNfOrmYNl9Lj08IxdHNgLKc7P1KQs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763983914; c=relaxed/simple; bh=POgvD532Psv8/4iElHJei5dmrqieujOLDI0+1ls8BCg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=TW4zUafMKwh0OVtcFun7GWRMtVwZNk1895dOFTr9NwP8LMw6+ko3UBWC+kUdjPhqSnMEmI0uFgXezZg3gTGroJh/avuT7fMRmx1urTcdKjZgHU/mPg5aUbfcgrwKkYVL/IdfoLr0qMBpZxXcrczqPYUophJ3kiaBAsc3/TdFXVI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=lKUl9il+; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=G3bJvgCJ; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject 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.b="lKUl9il+"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="G3bJvgCJ" 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 5AOB30xT3884593 for ; Mon, 24 Nov 2025 11:31:51 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= 0m+PkJu4/Z834m2Gn1mfXXSme7MGZJ5oYLAYQ+0JQ9M=; b=lKUl9il+SgN6fbEG yxuPfkhclWzryU2RWZmyLi8dEmmsE8/INCMG6ErUl32hkogt2RDaOJFN5fL2BhDb 24M35ZeM3vJCc0q8vuLVQMwJfTpwBi1zHTcOAOQMWtIxyB2mbQrZeD0G96T466f3 RX6EmUdhlBAVErxHGBOxOPyCg6yQCbM2SQLndfpMcmaJ5TUR6BnfI2U8xAFsEpsN oOSfMFofAmYRx7yNDWoz5dC5o/48ikOdtV7IeeTSLURrSggIb0pAx+lmMhwPxj6B TRfHIHzkuJViye8dM7bsdNMxlovurd4t5a8lXtDqwwdSmCh2x20iGx9cLjYgxzW3 WuIqXA== Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4amp5682kj-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 24 Nov 2025 11:31:51 +0000 (GMT) Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-8b1be0fdfe1so178884285a.2 for ; Mon, 24 Nov 2025 03:31:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1763983911; x=1764588711; darn=vger.kernel.org; h=content-transfer-encoding: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; bh=0m+PkJu4/Z834m2Gn1mfXXSme7MGZJ5oYLAYQ+0JQ9M=; b=G3bJvgCJnSAwuYp7T9NQbKW78gkYSkon3nSyD5mUfuJMp1NMNCZ6cASSOzBZqAiTMe CnKuHuukU1FLA9wmefta4+3dLpuN/Mk/yy7EGBYaqrtvxZTB0wi1dTzHFfALypDIGi/v zqFggEZAKAutSWDh5Tjoiw9V74K+eJIX7MTggLjC78wZYyvlBQjUCIwT86Wi0BIFWfTP 6td01w9KL1zacwdmVfJ2qf7f1MDz5Zh8e8IrA/+5LupJlW/6MSY6N0CktvaTWn0qZr49 4So5SbqI6gphfDVvgSAqy7Vu1qXffs/9sFYfkgz1L6YoG/vBePf9FTmFceZWZK0IUM6A DUGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763983911; x=1764588711; h=content-transfer-encoding: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; bh=0m+PkJu4/Z834m2Gn1mfXXSme7MGZJ5oYLAYQ+0JQ9M=; b=cS2jX9Avw/6oP3KPgqsenTynZmAH8dZ4hqIBCHxPdgmPmucVXwyVFwMmcYBBBQT4se 25fE+vx304Y9kYvQLXS1WnEtZBBZgKcqY/K/wYoaSMbbG77r+xyeqaEPvvaDuCiwvksI 57894tp5Kp56MOKK1NjIteXavStbQDd/XDlcsiXB8wD0Jz8fIwwg1hnekIwsorEkIz59 HLRXeaVQBQEl92JJblVMWm57+iRDy2q6T5B2TYxPhA3sNGjZSP2NkNMQbIje27rMG2bc 4BbqT5N5enHFgMdGNoKJSU3axxQUAJGYwmMzxWrRJ1Dg0Z2/KEdBJufUQTU7ZNpQ5kPk gp1w== X-Forwarded-Encrypted: i=1; AJvYcCXMigmRs50nWkjKMvN+of+1XEkGNB/Jb3gcDTDeRO/GWb4GXrjTHX/vGzmCU3tmqC8mylstKTROV1/fwIo=@vger.kernel.org X-Gm-Message-State: AOJu0YwO45guDPU4+S/ursguYkMyxKGjdIKjRJsck344EdE7gBpeug9W LvSRHtV9LIxXP6KPZY4hzStfpkBHDJJeleDqiewBM8o1gClZUWuOXDPRDQ8ZIp/ElPj8txeHl9U YrbwttwAgOCfltzGVKO8yJnQ/DWCCGVRgNwWETr4+F/2glBJbXvXTUvfkCy4APf65/bw= X-Gm-Gg: ASbGncsICv/e+T8mykUp2ywF5IgzppQmUhs0BFvidCptom68Q69gl9/eFtIhOC3AvHA nNfiqIfoEvY1sNdb6GSnyYU4Fe8leq1K0Ix37p4hn9lSIsU+rLa8g4edUXsWlQLNIJq0zQR3TOK UY0YIUlrhRj9QbxvnONqkpEbWR6MDlNW+mHpTMGRjT5WXA9FiimcvA4zPETNZPlxSopvOsVAuwr G6FYEJ5jFbU3SX4r14m83sy/HUbBD88NrBqKtC4mn2hLm53geYmTn+XkfncO7/ff/YOR7tAkfC2 of5aq2xlSQRYzgAvd0WFw7EkEm5KnT/fqL7fS3yIln80VmktwLuXRY8GRXuM1l6xvSIDiA9QKTo y7ax9XKAH+GTtziLpmaCfcBW16iQwzGXqYNlehOsgXcbDo/2q5bcWQ69slYr8LcLdKjo= X-Received: by 2002:a05:622a:284:b0:4ee:1fbe:80dd with SMTP id d75a77b69052e-4ee5b764240mr104467391cf.5.1763983910757; Mon, 24 Nov 2025 03:31:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IHZ2vguzLUn0pa+csYBEUVfXDooRIujsUhiPcLX4A8hVoX6JZU9DMDYNwgT0GK1SHuFpGTYvQ== X-Received: by 2002:a05:622a:284:b0:4ee:1fbe:80dd with SMTP id d75a77b69052e-4ee5b764240mr104467211cf.5.1763983910281; Mon, 24 Nov 2025 03:31:50 -0800 (PST) Received: from [192.168.119.202] (078088045245.garwolin.vectranet.pl. [78.88.45.245]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b7654cdabd0sm1248373166b.12.2025.11.24.03.31.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 24 Nov 2025 03:31:49 -0800 (PST) Message-ID: Date: Mon, 24 Nov 2025 12:31:47 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v8 13/14] remoteproc: qcom: pas: Enable Secure PAS support with IOMMU managed by Linux To: Mukesh Ojha , Bjorn Andersson , Mathieu Poirier , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Manivannan Sadhasivam , Konrad Dybcio Cc: linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <20251121-kvm_rproc_v8-v8-0-8e8e9fb0eca0@oss.qualcomm.com> <20251121-kvm_rproc_v8-v8-13-8e8e9fb0eca0@oss.qualcomm.com> Content-Language: en-US From: Konrad Dybcio In-Reply-To: <20251121-kvm_rproc_v8-v8-13-8e8e9fb0eca0@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-GUID: YHylEZMquXhCEMXTIT6JBzra--ruAYoY X-Proofpoint-ORIG-GUID: YHylEZMquXhCEMXTIT6JBzra--ruAYoY X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMTI0MDEwMiBTYWx0ZWRfX5A/VVeqbRW8c Xb2y2erfQ+a2TwnyaTnf8utI+AldHt3mHwSiQwHTxjkuQ+kzkjAij4FsYF7sez3A5BdMut5NqvY Uy5v/sdtgWNuYr42/Wy0J4BfGxYxNG84LWHEE7We1yqm6fh2Adst8H5WZs40rVUzKX3SaYXCBzK Sydhdo+lsOs70tKLiAbXpuexjvdosaqFS0iR6niKC5mbfRSQk6XFhD3eFz0SKQRihIAvs6YTRKi QknFxIdnzKb9MjhKClZ8kPSSwpDtLOI4bTifHXS1W3dc8xB6PxS0XKb48Cp6ef9iCkP71ROSB/I B0DgqOCn+cSpZJ33QLuB6yl25880jFgTM+P9Gzt7iAK2W0p/LN10q7tznIrFZKb3m+NbcBFM3Pa KjyhbCQGGhNiiinX0uE7gtp0dTo1EQ== X-Authority-Analysis: v=2.4 cv=dPWrWeZb c=1 sm=1 tr=0 ts=69244227 cx=c_pps a=HLyN3IcIa5EE8TELMZ618Q==:117 a=FpWmc02/iXfjRdCD7H54yg==:17 a=IkcTkHD0fZMA:10 a=6UeiqGixMTsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=BNBRsNz8S9qWWGfTIFwA:9 a=QEXdDO2ut3YA:10 a=bTQJ7kPSJx9SKPbeHEYW:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-11-24_04,2025-11-21_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 suspectscore=0 lowpriorityscore=0 priorityscore=1501 bulkscore=0 impostorscore=0 phishscore=0 malwarescore=0 clxscore=1015 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2510240001 definitions=main-2511240102 On 11/21/25 12:01 PM, Mukesh Ojha wrote: > Most Qualcomm platforms feature Gunyah hypervisor, which typically > handles IOMMU configuration. This includes mapping memory regions and > device memory resources for remote processors by intercepting > qcom_scm_pas_auth_and_reset() calls. These mappings are later removed > during teardown. Additionally, SHM bridge setup is required to enable > memory protection for both remoteproc metadata and its memory regions. > When the aforementioned hypervisor is absent, the operating system must > perform these configurations instead. > > When Linux runs as the hypervisor (@ EL2) on a SoC, it will have its > own device tree overlay file that specifies the firmware stream ID now > managed by Linux for a particular remote processor. If the iommus > property is specified in the remoteproc device tree node, it indicates > that IOMMU configuration must be handled by Linux. In this case, the > has_iommu flag is set for the remote processor, which ensures that the > resource table, carveouts, and SHM bridge are properly configured before > memory is passed to TrustZone for authentication. Otherwise, the > has_iommu flag remains unset, which indicates default behavior. > > Enables Secure PAS support for remote processors when IOMMU configuration > is managed by Linux. > > Signed-off-by: Mukesh Ojha > --- [...] > + pas->pas_ctx->has_iommu = rproc->has_iommu; > + pas->dtb_pas_ctx->has_iommu = rproc->has_iommu; Sorry if we've been there before, but I see that IOMMU-mapping happens before ctx initialization.. can we drop this parameter and just use device_iommu_mapped(ctx->dev) in qcom_scm_pas_prepare_and_auth_reset()?