From mboxrd@z Thu Jan 1 00:00:00 1970 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 lists.trustedfirmware.org (lists.trustedfirmware.org [18.214.241.189]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DB1F2FF885A for ; Mon, 4 May 2026 06:52:44 +0000 (UTC) Received: from lists.trustedfirmware.org (localhost [127.0.0.1]) by lists.trustedfirmware.org (Postfix) with ESMTP id 11FB444E00 for ; Mon, 4 May 2026 06:52:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lists.trustedfirmware.org; s=2024; t=1777877564; bh=eela6IqwWByFF0zNF6QNmsicVYeSk74s1XZMlJpdnBI=; h=Date:Subject:To:References:In-Reply-To:CC:List-Id:List-Archive: List-Help:List-Owner:List-Post:List-Subscribe:List-Unsubscribe: From:Reply-To:From; b=BQgpMBqhBB0IuGv/WDICDo42Rx4FzY8UoSTIWowHKF6ZTKrHvN1GlRVZn1VzO02CH 3sO7tPodnVX7+qbUusXTXWVotGWUIFAqsQLUqPSdvmgJM+toWelDqa6LbulsnxbcOd WbF2/CU0IMuDf7p/yZyAksL+DMdHtS6RmMqS4h17ugu+KKXCoI7Ciu7jWUlgJqBTY4 ob1sbxchGJv2b7gWZzjAAeYpgtLjksTFk7+umfC/QKHw9clDDh61bfsq3XW1nlxZrk yJaHVcF7gDV+WCF3T3JfUJyb6z1qzAmoIm78R7zURP0wpNU0o9TmPJx4lx4QMCpTCZ a4YdzM4b+a+kA== Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lists.trustedfirmware.org (Postfix) with ESMTPS id 2B4F9434BC for ; Mon, 4 May 2026 06:52:37 +0000 (UTC) Authentication-Results: lists.trustedfirmware.org; dkim=pass (2048-bit key; unprotected) header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=Knhz77nu; dkim=pass (2048-bit key; unprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=OZcaHTqE; dkim-atps=neutral Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6446D6hP483416 for ; Mon, 4 May 2026 06:52:36 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= pw+QGNnD2aXDEvze4NDnuqATbVP5Mz7Pd3Jir1xluBQ=; b=Knhz77nub5NVmsev r6pOeYc8F9YwhbJNYoqJK2yWTBREnLWN3p2cr8+VXj8mhmgw4TeOcwefDMnahQA2 SKMF+rn8M7u47PZKJdg0UBEeCjMF6qSygnFJF1Vpi0HNcSrEyjQYlFs/Fz+nf12B xb5xZWxcnBrqZkc2nFHolu/NdWgypSyeOGwyxWW6IpAizir5uPyfdqCAFfC4Mafd 92oByUhnGHCh9EA9I3POBhYYmxFP6HH0zAiHid5ZbHw5pnn4cIl/0p1LcszXSUaO ktFnufIUNGCY9IuhuZd5oh0/xwy4vbBEIF1FUi0AopxBjTW7jVP4UXS6I/G64iF9 uTiTcQ== 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 4dw87scrhv-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 04 May 2026 06:52:35 +0000 (GMT) Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-2b7aba0af02so37357905ad.2 for ; Sun, 03 May 2026 23:52:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1777877555; x=1778482355; darn=lists.trustedfirmware.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=pw+QGNnD2aXDEvze4NDnuqATbVP5Mz7Pd3Jir1xluBQ=; b=OZcaHTqED6t4XuB97nqgDGluj98ZzTTdhUUI7EwdOCJOZ7qbtK7759uGEVYN0UAcHG NclIMBYWZSn3gwkhIN6n8MsynP/vfsbazqhB7fb9e22K2u8kqkwdSScz3WAj5lHArbyj o+G7ygIdvktIrGeAE06u1oluGieA9WSrz7ocTlUmd9do/S6v495Ky4szD0drxTxuIPEY NkC6+BFOeDILlfl9rm4G6oMfvzpOZKzL+gnZ9WbY6gJijT7OGE5Bf0uOs1Q7OiilTMbC 14cFGfxgLxd/3wtz//WVtv14Ryc5OJaBHXvC6X+SFqK0mAn96mUG9OMjQgZTe0Sf++mm /J9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777877555; x=1778482355; 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=pw+QGNnD2aXDEvze4NDnuqATbVP5Mz7Pd3Jir1xluBQ=; b=MtIcswjVYYULh7tlq/ncH6eg1EidJ/OmuSzQV2xiElGwMOV232sFqBcfbsPkCP0yuF SyFfwDgHlcqEpQZbA8OxOWtDB00J1Y5YAxSi8eHIfv9M4/AX8y6NPMdeeyx3DQ1z0+3t dCdytI0+OWxVk1X8EhO3omTMnPyAm/W/gSS6yOeAhG8qE9usIHNa/K/dFkZp118AZle2 8FzT6rNGnMZclEI8mgzzFr6aNkJHhotTNRUb7jHitMyt4ynJCzH/SpZveQSUtS/kxEtT ror2i0NaKJhsLE+UZQgpIDGhGYSGaqUcEeBGsDSniTe6rS5H9y4nkdalWd358LnQBm9B d+dQ== X-Forwarded-Encrypted: i=1; AFNElJ+kqh7LTcaGSTGSx02CivLvWiQ7G0xnnCUC0KPq1y11YCnX/eHmmgvbqQNFzVuHE8dcOmfyzl0=@lists.trustedfirmware.org X-Gm-Message-State: AOJu0YywAw0aUuZR0mePtnNTuCAxIxKaOq9OSfQh4C/2LTyoIK592HXz xJTtmsu85Xu+9xIPqw8zTsf7sVqaP3FVebCWCNhUrmYuDQWwhw+paPUTeG+Aqp6cz3+MUz3epdz Wd4SFBUNiiaAclGneiefEQADbePIDs1XX5/NTUJBe1rr6T/e3oPQg5zx4AY6NLKgP3PYXrzQ= X-Gm-Gg: AeBDiest8lrGSULtMjp13EhL04Ixmi1XnXXZTB3OasQG7bootXnNUPGqxbvjJomJ8ZL 996b7uXz1r22a7Jj7DPZQZ7gpdcjBiaeV56dFOL84+tzeX0rUTVJJLhp7li6kx13d00PTu9w32s FQF801midwP/6k6xAqsKGrxLuuKxWF8ThIUq62yxA0YAsFexrWXjCH5v13E8oZd0j6vCFcng0dc mEGjFLI/iITc8rPiDK5JJq4Nc3asm3OprMucp7E5Wyl7+p8YA+qaiGI2fcS68YurGDq7mIjhwyg caGmieBy1dwUh4NKZlWfNd0yfa901IqnrbZyPu8p5f7kHDkZCLA8z5qnbOezyfCWS6tpbqX/LQB rZfKLt3QyNV+nCuneKH/vUgk22JC5b0w+cKm1OAhCygCSP1kyfd3s7zWMeGic8RCCCxlJqR3EMt vALHw2DphpopzkTJ3ubcdgsjysNKRQUw== X-Received: by 2002:a17:902:ce08:b0:2aa:d5e5:b136 with SMTP id d9443c01a7336-2b9f284e08dmr89328685ad.38.1777877555130; Sun, 03 May 2026 23:52:35 -0700 (PDT) X-Received: by 2002:a17:902:ce08:b0:2aa:d5e5:b136 with SMTP id d9443c01a7336-2b9f284e08dmr89328255ad.38.1777877554527; Sun, 03 May 2026 23:52:34 -0700 (PDT) Received: from [192.168.0.74] (n1-41-240-65.bla22.nsw.optusnet.com.au. [1.41.240.65]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2b9caa7e791sm93849295ad.7.2026.05.03.23.52.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 03 May 2026 23:52:33 -0700 (PDT) Message-ID: Date: Mon, 4 May 2026 16:52:24 +1000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v11 08/11] tee: add Qualcomm TEE driver To: Dmitry Baryshkov References: <20250910-qcom-tee-using-tee-ss-without-mem-obj-v11-0-520e867b3d74@oss.qualcomm.com> <20250910-qcom-tee-using-tee-ss-without-mem-obj-v11-8-520e867b3d74@oss.qualcomm.com> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-ORIG-GUID: Rdoqu0_tD7bJXZd4gst2Il-fWtOLJHA0 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTA0MDA3MiBTYWx0ZWRfX4kdxhhfIEfuu a4GzZCckJHj3fp8FUZr2nS267JYF6q3lSG5lbdZ9Fu75FUh7HrE2w1ur6eaF2hSEIAI8yLxFS1g I1JhLEIG0WupFPFbNkMQl9SVpWCkwxkUTWK0nFKt0Dwkvpj8gAfw8/5/oR6sbqGczFiEEMteVPu AXRul2V01qtf8pAYJtfgcIniMk7ABGnko6NgQcKqBP1/UK9MH8gYO/HskA8LUpvwifXCOO5TQnd 0SZ8HJ9E+P63AkkV8W1HanranWSKsIBqLbdFMf4RSQpDPLBDfZfrDUEacmgBCKqgIJM5eHP552h Es1giRiqTgtUfMgOmg9h+xWHi6tAFBwQkmOa+HVryu9ssvYSWRrIg1Fs4Qh8UxHKy5NYzsGZRem ZzTxhpOCQ6ut0QuxnknxAqP6Ymh9/A== X-Authority-Analysis: v=2.4 cv=O4IJeh9W c=1 sm=1 tr=0 ts=69f84233 cx=c_pps a=MTSHoo12Qbhz2p7MsH1ifg==:117 a=hi51d+lTLNy/RbqRqnOomQ==:17 a=IkcTkHD0fZMA:10 a=NGcC8JguVDcA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=Um2Pa8k9VHT-vaBCBUpS:22 a=NEAV23lmAAAA:8 a=KKAkSRfTAAAA:8 a=COk6AnOGAAAA:8 a=EUspDBNiAAAA:8 a=t0CO8BxZkIs7AVVQ4zsA:9 a=QEXdDO2ut3YA:10 a=GvdueXVYPmCkWapjIL-Q:22 a=cvBusfyB2V15izCimMoJ:22 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-GUID: Rdoqu0_tD7bJXZd4gst2Il-fWtOLJHA0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-05-04_02,2026-04-30_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 adultscore=0 suspectscore=0 malwarescore=0 spamscore=0 phishscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2605040072 X-Rspamd-Action: no action X-Spamd-Result: default: False [-4.00 / 15.00]; BAYES_HAM(-3.00)[99.99%]; DMARC_POLICY_ALLOW(-0.50)[qualcomm.com,reject]; R_SPF_ALLOW(-0.20)[+ip4:205.220.168.131]; R_DKIM_ALLOW(-0.20)[qualcomm.com:s=qcppdkim1,oss.qualcomm.com:s=google]; MIME_GOOD(-0.10)[text/plain]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; ASN(0.00)[asn:26211, ipnet:205.220.168.0/24, country:US]; DWL_DNSWL_BLOCKED(0.00)[qualcomm.com:dkim]; RCPT_COUNT_TWELVE(0.00)[21]; MIME_TRACE(0.00)[0:+]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; NEURAL_HAM(-0.00)[-1.000]; TO_MATCH_ENVRCPT_SOME(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[op-tee@lists.trustedfirmware.org]; DNSWL_BLOCKED(0.00)[209.85.214.198:received,205.220.168.131:from]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[qualcomm.com:+,oss.qualcomm.com:+] X-Rspamd-Server: lists.trustedfirmware.org X-Rspamd-Queue-Id: 2B4F9434BC X-Spamd-Bar: --- Message-ID-Hash: 42JR5ATZEM5QO62VALQNQ6CU7HOOLY7B X-Message-ID-Hash: 42JR5ATZEM5QO62VALQNQ6CU7HOOLY7B X-MailFrom: amirreza.zarrabi@oss.qualcomm.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-op-tee.lists.trustedfirmware.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Sumit Garg , Bjorn Andersson , Konrad Dybcio , Bartosz Golaszewski , Apurupa Pattapu , Kees Cook , "Gustavo A. R. Silva" , Sumit Semwal , =?UTF-8?Q?Christian_K=C3=B6nig?= , Harshal Dev , linux-arm-msm@vger.kernel.org, op-tee@lists.trustedfirmware.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-doc@vger.kernel.org, Neil Armstrong , Sumit Garg X-Mailman-Version: 3.3.5 Precedence: list List-Id: Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Amirreza Zarrabi via OP-TEE Reply-To: Amirreza Zarrabi Hi, On 4/28/2026 7:21 PM, Dmitry Baryshkov wrote: > On Wed, Sep 10, 2025 at 08:41:21PM -0700, Amirreza Zarrabi wrote: >> Introduce qcomtee_object, which represents an object in both QTEE and >> the kernel. QTEE clients can invoke an instance of qcomtee_object to >> access QTEE services. If this invocation produces a new object in QTEE, >> an instance of qcomtee_object will be returned. >> >> Similarly, QTEE can request services from by issuing a callback >> request, which invokes an instance of qcomtee_object. >> >> Implement initial support for exporting qcomtee_object to userspace >> and QTEE, enabling the invocation of objects hosted in QTEE and userspace >> through the TEE subsystem. >> >> Tested-by: Neil Armstrong >> Tested-by: Harshal Dev >> Acked-by: Sumit Garg >> Signed-off-by: Amirreza Zarrabi >> --- >> MAINTAINERS | 6 + >> drivers/tee/Kconfig | 1 + >> drivers/tee/Makefile | 1 + >> drivers/tee/qcomtee/Kconfig | 12 + >> drivers/tee/qcomtee/Makefile | 7 + >> drivers/tee/qcomtee/async.c | 182 +++++++ >> drivers/tee/qcomtee/call.c | 813 +++++++++++++++++++++++++++++++ >> drivers/tee/qcomtee/core.c | 906 +++++++++++++++++++++++++++++++++++ >> drivers/tee/qcomtee/qcomtee.h | 143 ++++++ >> drivers/tee/qcomtee/qcomtee_msg.h | 304 ++++++++++++ >> drivers/tee/qcomtee/qcomtee_object.h | 316 ++++++++++++ >> drivers/tee/qcomtee/shm.c | 153 ++++++ >> drivers/tee/qcomtee/user_obj.c | 692 ++++++++++++++++++++++++++ >> include/uapi/linux/tee.h | 1 + >> 14 files changed, 3537 insertions(+) >> >> + >> +static int >> +qcomtee_object_invoke_ctx_invoke(struct qcomtee_object_invoke_ctx *oic, >> + int *result, u64 *res_type) >> +{ >> + phys_addr_t out_msg_paddr; >> + phys_addr_t in_msg_paddr; >> + int ret; >> + u64 res; >> + >> + tee_shm_get_pa(oic->out_shm, 0, &out_msg_paddr); >> + tee_shm_get_pa(oic->in_shm, 0, &in_msg_paddr); >> + if (!(oic->flags & QCOMTEE_OIC_FLAG_BUSY)) >> + ret = qcom_scm_qtee_invoke_smc(in_msg_paddr, oic->in_msg.size, >> + out_msg_paddr, oic->out_msg.size, >> + &res, res_type); >> + else >> + ret = qcom_scm_qtee_callback_response(out_msg_paddr, >> + oic->out_msg.size, >> + &res, res_type); >> + >> + if (ret) >> + pr_err("QTEE returned with %d.\n", ret); >> + else >> + *result = (int)res; > > After enablign QCOMTEE driver, I observe the following error during the > bootup on RB3 Gen2: > > [ 4.720777] qcomtee: QTEE returned with -22. > [ 4.725251] qcomtee: QTEE version 0.0.0 > > We are using the RB3 Gen2, and it successfully reports 5.2.0 as the version number. However, seeing 0.0.0 is not necessarily a problem. What TZ build are you using? It's possible that the service responsible for returning the version number is not available on your device, even though the object invocation itself is supported. Are you able to make any object-invoke calls from userspace? A simple test - such as running the TA diagnostics tool - can help verify this: https://github.com/quic/quic-teec Regards, Amir >> + >> + return ret; >> +} >> + >