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 8EC303C3449 for ; Wed, 8 Jul 2026 06:29: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=1783492197; cv=none; b=QMle8ort3E4zR2UOzzmCVdsYwFLsj8Gi3LJ7ZFMaWbruK+tBbt0SdB6KffaafCkoPmX6VDPXxVo4rmuCNBuSXMdHtrcatBK23ZGGWMgSifJVRXmIRQ0yODgmWis1BxqZpVWMvmPTXgktO5y/EBs8fBACCOdiopgSYoY+YPHJEOU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783492197; c=relaxed/simple; bh=0eFyRhU62Sp8Fxi3jAmIZTFwuMocCNKG2j2XsRE2x/g=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Wfhlu/Bc+clutBF05BzAkz8Kvtbx0Rq4TKeBeapxDaU4U1EMk0ifaE+1teXMQmxvMmiFn51TdYTgMdBZCzDmIuliJByyFVCrb3qPuFKyMcZC4baaXvy4PmNw3ZnRLf2xhQLx88tJol+ROAohfC5GCRVIx9Xjry8ibDkTbeHCedA= 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=f4F8+R0j; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=PHLBzKs+; 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="f4F8+R0j"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="PHLBzKs+" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66842lC71645120 for ; Wed, 8 Jul 2026 06:29:48 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= 1F9UyrOYpeOrWMjmcc95u8JvN4hXEK2XvrTpwrlEp2s=; b=f4F8+R0jdQPbJCLU Jo9jKtE6ZeM/krA4f8BRaa5WWv5MtwJLy9wu6XUPNDvonsTtzJ6G+CbPUIHdBS3b t47jNI+5DA0Yy3pc7pXefIaHMda8Xo8DbVbmGZFcTGDFssoDqriyCKReSZ1JcrU2 N6yLMbSAx1M1TQgoGmNt1K1NqNw7I4T5cwqpma54Lr54sgetex6P9eItNzt5TKdq HpFdPSPT29J9EipLQx4S7SYwqYWjh21PGaOTLXYDNL7tHofCBn5CdzspdmnED36v bUfSgUuJNDnSD3+6do/xiixI8DCKGCkiDjIhpVBph6ZFBDq7TieHbF88TYmKH0e8 DnHp+w== 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 4f8ye0mh58-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 08 Jul 2026 06:29:47 +0000 (GMT) Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-2c9a700dc0eso4691335ad.1 for ; Tue, 07 Jul 2026 23:29:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1783492187; x=1784096987; 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=1F9UyrOYpeOrWMjmcc95u8JvN4hXEK2XvrTpwrlEp2s=; b=PHLBzKs+iHW/s04qnc/r0pu01rHgioLogFq2b6xw3taQK+c0/02GODsTEM7l8khaV7 xjL32xkr9n3FRpHrQtIhgiTqQScoddMcX8b8zqMuIEcVkgxR/C4I14uhj+lFZiYmmDW6 W6BzyWNj2DNtL2ojqO6ZXYy/MhLvgNyBiIBK9y8jOoIBklFiLWZpxf3OLI5TYbFooUKt ZgFZ6UzL6ny0TwObudncMqnUja2Uj+ZRusKn3OJqfvuZbObySBL2SnlloqHSeA2O6VRt TJv1SeTg9RF2g/zR4Nddot8FbUMjY5B+IM0HQUinksr3w3nbFEdEI5CY1INK7TaPcq/x AKcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783492187; x=1784096987; 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=1F9UyrOYpeOrWMjmcc95u8JvN4hXEK2XvrTpwrlEp2s=; b=f+r84N547wk4+WwR5j7Er1EGjzhQD5Ar1GmnlKXEHo+YCdgZmwZo2aSqQqDXf0r8FM Q03y8T40xbur/GDvgxiqbINda6ZXjJZ1k75dKp6/HlrZg3Zt7dOmgF5q06myfYSfSPCB dfuD8l6wE2+nT4bxMnp9ufGoYcOPvrJ9Qj2SVuxlEGIop9uiUYNSUTIea3/BznUOPjoB gzayl0fsWNpHW52PRDqjN+s7TU0Hm/Pq0oUX+2GCYm6fdK3HJl8Nm6F1Wo0GXDVbx50B 99lYDSmdElUln37HJCtMvTcGivzZw5hHoBVW4h5ZnGgZUen8MbjCshL+v9HVZDZbbnEn mK+g== X-Forwarded-Encrypted: i=1; AHgh+Rrw5nAiWWRkLGOdxozTGGbEZalP7nXiQGiGKN1ohXVZ6gpv7W3ewYUEyuFKWdUUFxf+2e+RVeMA6eKUEAs=@vger.kernel.org X-Gm-Message-State: AOJu0YwqXysJkvWRyDQXPz0oIUVjGwNGuS28u+r0Dof9xSs056VuBFoz vimZKdZ3vJtMH9pHAeAj+h+oTrgUcGL3vrt7XR1+ZzAaXyC+oTXG+MO0Jl0Y6bgN+pO7wnKO+Uw QBXuWI2l3Mkrh9DIGRaAhLoQ6cn/pPeUIoSHe8bLlwLNGbUby7ryCYgMM9o/l0RTbpQ== X-Gm-Gg: AfdE7cnLjX4l9zhQCfnIcPBk6pVSeQrkT7CKSatyYP0W7CeW9M6wS0pOIO0ozyPL5IQ YzkOr0clQrv3nZtZ6oSsKjGFBR6F8DEQjsqN6Hl56sbmdhuC+8q3BoG9Ev+hJ9fj3NDyyWGsYYX kEbneGhB7HkKu2g5LoxAumv0/mbEbJjrMvg61dD1vgKijWReqNAoviU4zd1NCbi/sON/7Vu0Gd9 5bFE2w8m/sbFErO2m/+50Nqku7jxO+PgXoRye111rdIi8DGQfIxkXyqtR6ROvEB4IbRivNUHvcS DM11RSbBm8N19HnJati6y/d8MMTHuCVoTtvYhWPoxf3h289mBzh+2oFO1k0hzrmeLBTmNKO4dsg aiY3wfA2p6vTkW6V7UXb1WCH8JAg4D0H7d8N43AjLi10G X-Received: by 2002:a17:902:f791:b0:2c9:97a7:b1eb with SMTP id d9443c01a7336-2ccea59f7a1mr11657505ad.42.1783492187104; Tue, 07 Jul 2026 23:29:47 -0700 (PDT) X-Received: by 2002:a17:902:f791:b0:2c9:97a7:b1eb with SMTP id d9443c01a7336-2ccea59f7a1mr11657335ad.42.1783492186630; Tue, 07 Jul 2026 23:29:46 -0700 (PDT) Received: from [192.168.1.86] ([206.83.113.14]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ccc9d5c361sm22607485ad.80.2026.07.07.23.29.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Jul 2026 23:29:46 -0700 (PDT) Message-ID: <651db8ad-ff57-4369-8401-f51bb7ea46f5@oss.qualcomm.com> Date: Wed, 8 Jul 2026 16:29:40 +1000 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 2/6] tee: Add kernel client object invoke helper To: Harshal Dev , Jens Wiklander , Sumit Garg , Bjorn Andersson , Konrad Dybcio Cc: Basant Kumar , Apurupa Pattapu , Arun Kumar Neelakantam , op-tee@lists.trustedfirmware.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org References: <20260707-qcom_uefisecapp_migrate_qcomtee-v1-0-f659cbd5d04c@oss.qualcomm.com> <20260707-qcom_uefisecapp_migrate_qcomtee-v1-2-f659cbd5d04c@oss.qualcomm.com> Content-Language: en-US From: Amirreza Zarrabi In-Reply-To: <20260707-qcom_uefisecapp_migrate_qcomtee-v1-2-f659cbd5d04c@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-ORIG-GUID: 9GiKozkIFnXM9-7nk9yxdGvTzytOTeTL X-Proofpoint-Spam-Info: AW1haW4tMjYwNzA4MDA2MCBTYWx0ZWRfX0yVTiNN/XzSH wK9A5TmEwIQtKpHn3RpHCE64Q715AyJhnyUDSENaJwbsgPbxy2aftQv/JvVeJyyI7CKizFj/dqG D9UcDZG3i/FsoRjqXE9OPiUgiZnXqM8= X-Authority-Analysis: v=2.4 cv=SZfHsPRu c=1 sm=1 tr=0 ts=6a4dee5b cx=c_pps a=MTSHoo12Qbhz2p7MsH1ifg==:117 a=+r7WnWcjNhrw7ahDJtTqLQ==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=EUspDBNiAAAA:8 a=1yzuO3Wzu64Mvm5RHTIA:9 a=QEXdDO2ut3YA:10 a=GvdueXVYPmCkWapjIL-Q:22 X-Proofpoint-GUID: 9GiKozkIFnXM9-7nk9yxdGvTzytOTeTL X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzA4MDA2MCBTYWx0ZWRfX41A/8ZTHxHOp qTwZBU/fuGKAQrq8t6li0Ke0GEe1s9me5IiemQde5nyl8rDHm7TfwOBzy8IG7aPw52IKqhavCMx cp8XRYE4bpolXQmk+hmb4mNS3Ja9NgG3qwA4JRc1qXxPopCAKCMFvv3H0nPy9akMrOMzW5PC+bP OufIh/2w8S956XSsEDovmZNVOe9QFfj1zErGmbiDneJMkIFR51SdF1SKkTs/rsHCWrpy2xyLrwq VwOIMFszI/zwakLBgkYiihKOyqNvUwLProbGg14EezLmj+pngURd+Brjih6jHdJsuZzbMlk58Cw CRXO6RW4XpfvkciwMozbKh0PuEa/eWnZP44sEFY/MNFEopzOFPXmPe/7avj0oMslbd8PdkkdrT5 LcGukbgmFrOQ43tpPWwYULIXOL087hk/jDXjuTd7SJnhORJ1Q7GQqRxOGC4QhSS3xj/BVG3zRLV x+lRdQa3rvOdNN3D+YQ== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-07_06,2026-07-06_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 malwarescore=0 bulkscore=0 spamscore=0 adultscore=0 lowpriorityscore=0 phishscore=0 clxscore=1015 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607080060 Hi Harshal, On 7/7/2026 4:11 PM, Harshal Dev wrote: > From: Amirreza Zarrabi > > Kernel clients can open a TEE context and invoke regular TA commands > through tee_client_invoke_func(). However, there is currently no > equivalent helper for invoking TEE objects. > > Add tee_client_object_invoke_func() as a kernel client API for issuing > object invocation requests. The helper checks that the backend provides > object_invoke_func() before setting the MSB of the object-id and forwarding > the request. The MSB of the object-id informs the TEE backend that the > object is invoked from a kernel context. > > This allows TEE backends that support privileged object-based calls from > the kernel-space. > > Signed-off-by: Amirreza Zarrabi > Signed-off-by: Harshal Dev > --- > drivers/tee/tee_core.c | 13 +++++++++++++ > include/linux/tee_drv.h | 13 +++++++++++++ > 2 files changed, 26 insertions(+) > > diff --git a/drivers/tee/tee_core.c b/drivers/tee/tee_core.c > index 7f986d7fb47f..0783802fd010 100644 > --- a/drivers/tee/tee_core.c > +++ b/drivers/tee/tee_core.c > @@ -1413,6 +1413,19 @@ int tee_client_invoke_func(struct tee_context *ctx, > } > EXPORT_SYMBOL_GPL(tee_client_invoke_func); > > +int tee_client_object_invoke_func(struct tee_context *ctx, > + struct tee_ioctl_object_invoke_arg *arg, > + struct tee_param *param) > +{ > + if (!ctx->teedev->desc->ops->object_invoke_func) > + return -EINVAL; > + > + /* Indicate that this object is being invoked from a kernel context. */ > + arg->id = arg->id | BIT(63); Setting this bit is a qcomtee backend requirement and should not be exposed to the TEE subsystem. Kernel users of qcomtee_object_invoke() should use the normal object ID value. For example, access to the initial ROOT maybe represented as TEE_OBJREF_NULL | BIT_ULL(63), but the upper bit must be managed by the qcomtee backend for any return object, i.e. The backend should also set BIT_ULL(63) automatically on each returned object ID. Callers should treat the ID as opaque and must not manipulate the upper bit directly. > + return ctx->teedev->desc->ops->object_invoke_func(ctx, arg, param); > +} > +EXPORT_SYMBOL_GPL(tee_client_object_invoke_func); > + > int tee_client_cancel_req(struct tee_context *ctx, > struct tee_ioctl_cancel_arg *arg) > { > diff --git a/include/linux/tee_drv.h b/include/linux/tee_drv.h > index e561a26f537a..ca99c6b747a8 100644 > --- a/include/linux/tee_drv.h > +++ b/include/linux/tee_drv.h > @@ -283,6 +283,19 @@ int tee_client_invoke_func(struct tee_context *ctx, > struct tee_ioctl_invoke_arg *arg, > struct tee_param *param); > > +/** > + * tee_client_object_invoke_func() - Invoke a TEE object from kernel space > + * @ctx: TEE Context > + * @arg: Invoke arguments, see description of > + * struct tee_ioctl_object_invoke_arg > + * @param: Parameters for the object invocation > + * > + * Return: On success, returns 0; on failure, returns < 0. > + */ > +int tee_client_object_invoke_func(struct tee_context *ctx, > + struct tee_ioctl_object_invoke_arg *arg, > + struct tee_param *param); > + > /** > * tee_client_cancel_req() - Request cancellation of the previous open-session > * or invoke-command operations in a Trusted Application > Regards, Amir