From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.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 7C169388E42 for ; Tue, 7 Jul 2026 06:12:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783404731; cv=none; b=htbAvbLaWo+KnvCoCTRjlvO2eKxlNq4p0ex2z+8F74J8l6friuW+IhLubeG+stFC24mr5MBV+aFI35A13TMzVNwe+mAmM7fUjNwAHs08pszHzp95858SyJgLGKjy06RoIk1PR4YOYKfcyU46+0/K/ASbLIji9jVzX03HgQuW1mQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783404731; c=relaxed/simple; bh=Wc9YPOH3gLSEej49AwWn9+hi7hpzaEhY0b42nssqRJ8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Fl3zhQP1HAi2ibnT2Q9O/mykfeZI0Q0eWtjyXqSlMVHFdJrxJopUde+0dige3spNt5P1/D7ReIVgaPPiOZQf3A+sMc88SErift234mahoZElJAGGwWGg9L5foiK5S0qJZWvP17Ut0Ym2/lcUAMUvNbuUQdQxK7olxS5RLIzdDJ0= 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=idgrWUyR; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=N2l8fMXT; arc=none smtp.client-ip=205.220.180.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="idgrWUyR"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="N2l8fMXT" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66749Ioe2658346 for ; Tue, 7 Jul 2026 06:12:09 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= fWjDybI1o5yT4eZXIx3vUFWYnFEDkE2p45bYzyDGbmk=; b=idgrWUyRiRio27T/ K/6iOKp/cti3Q9jNmV3NfZOAADb4wksGVuiFrB7L3FU2M0pZZWx6WdXUjN7sVP+M oNzGO4RxNL36tDLHiKxUw6DWeaI2MdMjH9eNCuUu/gjt7+jhwjZ0x9heKrqtB5zJ o34yg/OB7s/9oonmpuJ96flxRDDpm68GQh68L8zXzgHb21cWoIbeHOkmvma6El+x W1DX/hsZ7CApcDTCgQxS1BDHBk85yfgrFzL5+ts14QC52Uxpe8zr6oyvaYKqhCEs m/20V5i8UJOCFt2obTbbWye4b28FAYZnvgrEFr79QHVuGtT3g3te+iIA48p/4YDp 9rfOQQ== Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4f8a3r4c35-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 07 Jul 2026 06:12:09 +0000 (GMT) Received: by mail-pf1-f200.google.com with SMTP id d2e1a72fcca58-8479b45ad08so6416889b3a.3 for ; Mon, 06 Jul 2026 23:12:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1783404728; x=1784009528; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=fWjDybI1o5yT4eZXIx3vUFWYnFEDkE2p45bYzyDGbmk=; b=N2l8fMXTWDmNHPO+HuQWwBlAK3tYarSkcsYGUsVAe+YDMoEYmoh1wPUYa4mxpUFugZ a2OBtBVcinPMNOchpEDw+MNgL1ArOqa87yf5OLZNvShQ4SbERoNOQz8zRtnqU1wNTjIX ECa8pDgR0miM979nj1Vyc571zfGtrHQfS6QVigUXp/ihueKvxZvQQOQXFcKFWHHWLqOG VAYaOrXZHLc/LzvZqpaOnA/AdT7lFdj3ATq0ZaGe/xJsdhS0ndiZQKzSPV5GqyELWwAF zCfBcSRV83a0aMtKrDcwealgkQCtZ9W1dRmn4ki0OahTIjplAt5KqVIIl6B0Wg5ozB+v 7NhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783404728; x=1784009528; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=fWjDybI1o5yT4eZXIx3vUFWYnFEDkE2p45bYzyDGbmk=; b=cYg2rLXgudfiVob8FkM45Plkl9MJCb6FkdgSRFJ9fgagf8vYXf57fKZPkahknDWPHL 4Qsd5Bx3CS9HUdM5PDblUDR0D1ZDBWdjaMuyy/SVVgLaUY2qnCm1wuXZpdt+YdfL8vAf Ce8/EkF7VaNte0WcDdW6DrtBa0Sp7dBv37M/1goUF+6ccGBUPEIbeU4fpAii0nS0Zohf yxkynMz6qrcwgzIZLWoTdmJBi9+0kuIfEwTMpGgnUwdnlKcc8fgrOqKJ4ot6ZfQgxzp4 CGaGIm2vrV61ZMhzFawyrx+B1gu7KqFzLUigPrpcyve7J8vQXiDHWOjb1u5L827gY3n2 a80A== X-Forwarded-Encrypted: i=1; AHgh+RreTzAvKEebDP7S6vY7CfKgKwqmKIPJzcQXkqQi2wyGO7lvsgfLG28IztRq8koiKkXrNWsXJPOF0pZ1Km8=@vger.kernel.org X-Gm-Message-State: AOJu0Yw4Yr4eN3hNQheGuk62iIjC//iQC8K3m4AhNYzgoqzbRAsm4Ff4 XzAW1Av0IjyjVwfa6OV6+WmIQrYvqs4K2zJ3zPZTqf490xdYtp105QnBI/UHTPJxS13R/a0xw2d ZDgklonRiqkczAulT8qQ+5TG/YFoUMfOv85KcjAgBDi4wdzW63n03nYjpcFM2HHvPn5g= X-Gm-Gg: AfdE7clCMPbszMPsr2JRK6rTW5SmB3XrJP49fIOoaUhjTphPSIVrxCMshLZowlxgMpv +x4hQ3WQK/Ce4L1wXxXihSitmd5YqJM4ZzHklACiXu3JefNAaqMw9QUQuIcCuRYdUm4S//EKP5c 4LmEyFhAOlAIM3KWcFpp5uRTt56EJBraAIQ0wjVQOrhUjUzqCqfk4lyGt0IQcc5bkDy/8k04Rvl MpxTwokMHvTmHq8ci8N9maBuN1x3woHKxzUSPKqdpveDm4GaLjB96bXSAg6B/67VqHF8E/XtF9p HOHN/+Jd27iCsX8qzpP64nNvbdJreA8FfsTe4iLAYBXoxXXW6lwquvIK9k/MHAhuIvph4T3zpJX qiBYdJq7hclfshbo6E38nsRdj1TWcwShq+mix X-Received: by 2002:a05:6a00:22c5:b0:847:9565:7a58 with SMTP id d2e1a72fcca58-84826df132amr3609190b3a.48.1783404728517; Mon, 06 Jul 2026 23:12:08 -0700 (PDT) X-Received: by 2002:a05:6a00:22c5:b0:847:9565:7a58 with SMTP id d2e1a72fcca58-84826df132amr3609148b3a.48.1783404727696; Mon, 06 Jul 2026 23:12:07 -0700 (PDT) Received: from hu-hdev-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8480da8bab0sm3299321b3a.8.2026.07.06.23.12.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jul 2026 23:12:07 -0700 (PDT) From: Harshal Dev Date: Tue, 07 Jul 2026 11:41:28 +0530 Subject: [PATCH 2/6] tee: Add kernel client object invoke helper Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260707-qcom_uefisecapp_migrate_qcomtee-v1-2-f659cbd5d04c@oss.qualcomm.com> References: <20260707-qcom_uefisecapp_migrate_qcomtee-v1-0-f659cbd5d04c@oss.qualcomm.com> In-Reply-To: <20260707-qcom_uefisecapp_migrate_qcomtee-v1-0-f659cbd5d04c@oss.qualcomm.com> To: Jens Wiklander , Sumit Garg , Amirreza Zarrabi , 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, Harshal Dev X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1783404715; l=2685; i=harshal.dev@oss.qualcomm.com; s=20251124; h=from:subject:message-id; bh=tf7n4iBWfzhqdtN6PCm26dFltLwD/+JEiJW6BobHH+w=; b=0IoQzMoBgXd3Nm4jBsZCdkfR2D05fBzDzovrQrN13cn3KEMKvPOJfN0vDgLCztUzjcFqgIhc7 lLxu+XHvEUZBlk8bJ7piE7Uf3oXHc/yGge+FWStw2kXrz9vPifX1jzq X-Developer-Key: i=harshal.dev@oss.qualcomm.com; a=ed25519; pk=SHJ8K4SglF5t7KmfMKXl6Mby40WczSeLs4Qus7yFO7c= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzA3MDA1NiBTYWx0ZWRfX8i1xYVzRS50q X2Vmm2Zszf5dgud77EsoeLAog2Z1T3rU1+/kcIeCcvaBFkt3tjp2iL5LvF7aW54LieRebvuWhIr 3rG3qeTi3SzShkU2fSDhXlWr4E+OoDwJCptt90M/QZj67kJmMI5gNf7iPOBYqaAlTL45Dg99uDu 2eE0Pq7nufmyiEHA1rPVRnGl7kg/kdEGttT37CxQncVo6z3aoyfNqdIbufI8m5ni1zs3BoMft4k BOJzaQJP7g20P6pg2brGqNaEfFrLceg57rQRbGWcisUrUsVQEjCzgZo2Xj0b9P3RlzXw30NI5ou 7+ZlZe2RBKS4yW814gKDJvUUV5e8gWbPMa4XI3H6a2iq6uxaUHpwKXzrCbyZCugGzSbGJdjEZXE x+5vRJJ4mFycXEq8TaQnc5kjrLua87G9aRb66ThwrvwlhNpFYdM1fUloHLUBkZXf6fuuviADfLr 8BmmKaZ4L72mUlK9ESQ== X-Proofpoint-Spam-Info: AW1haW4tMjYwNzA3MDA1NiBTYWx0ZWRfX2FgBmxeCcws2 qoY+O4CSaeXyURTdauxDSDBZMZOTQ1BW/w5QXxIqAOz7kZ6aK5GVIiDhy7lePtItliuWjrDwtRF bg1LlQg+/omuMIwGvQYl45m6R4PyS9A= X-Proofpoint-GUID: bdrjy8HIKGPbFWLYoPI0pJqkRSs3glbU X-Proofpoint-ORIG-GUID: bdrjy8HIKGPbFWLYoPI0pJqkRSs3glbU X-Authority-Analysis: v=2.4 cv=OKcXGyaB c=1 sm=1 tr=0 ts=6a4c98b9 cx=c_pps a=mDZGXZTwRPZaeRUbqKGCBw==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=3WHJM1ZQz_JShphwDgj5:22 a=EUspDBNiAAAA:8 a=kr-ihz5DC76VLKRVsLUA:9 a=QEXdDO2ut3YA:10 a=zc0IvFSfCIW2DFIPzwfm:22 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_01,2026-07-06_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 adultscore=0 malwarescore=0 clxscore=1015 suspectscore=0 spamscore=0 phishscore=0 priorityscore=1501 impostorscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607070056 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); + 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 -- 2.34.1