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 B27E3E63F25 for ; Mon, 16 Feb 2026 06:28:41 +0000 (UTC) Received: from lists.trustedfirmware.org (localhost [127.0.0.1]) by lists.trustedfirmware.org (Postfix) with ESMTP id E449143872 for ; Mon, 16 Feb 2026 06:28:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lists.trustedfirmware.org; s=2024; t=1771223321; bh=IB6S87GqJDUeZVCDWsj9FO7zAiiLNHQjIae0NCwbIyg=; h=Date:To:Subject:References:In-Reply-To:CC:List-Id:List-Archive: List-Help:List-Owner:List-Post:List-Subscribe:List-Unsubscribe: From:Reply-To:From; b=ARIeTzKflfive48kRtIUCEo2He46apm8rAZg50FTcOWtpV+Gf1X9ihWFhI+rwLpZI OANY3Jx07QEBWxUqV/7K1YGPM1NgAuNB4WyAoch/4Hbu2I8TXupdJkKW6vXNJ8XsP/ Ip14q/tYdtQN31i3YT6ig096ftNr7oP3eJjd+9UF/KLpJSBUlwkO2+vf93jrN+28sX O+LYVFs0eh7R7noomzu24CwQMLqTeRlxLcT2oWWe3kWEoTE+r82bMWq+ewQ82PQvhi XVQkSWgZM4pHh9sGuxpavcYQyldWgMp5fGu8RRhTgKekox4o9RP9d8Vbkuwbb9gWyq wzUnf3SwkWsvQ== Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by lists.trustedfirmware.org (Postfix) with ESMTPS id 05FF143862 for ; Mon, 16 Feb 2026 06:28:21 +0000 (UTC) Authentication-Results: lists.trustedfirmware.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=Vvw7taDt; dkim-atps=neutral Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 5F801600B0; Mon, 16 Feb 2026 06:28:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 91B66C116C6; Mon, 16 Feb 2026 06:28:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771223299; bh=IB6S87GqJDUeZVCDWsj9FO7zAiiLNHQjIae0NCwbIyg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Vvw7taDtzIRHRPpyGWyElmvnZLUhQHz605cFYNwB67Xs3cPclrRcoUfPhUV/p1+75 2AWNLD7UZLuLiQIUSuQxvIIBN07fbTMo+bamb3iFjWzFTTxVEqJvv0BS72OK+GbcQa MaGe1qIKa8LJ5Xlg3GXUwsHQHvvHz3gLFQ88OoTuAKfooJgVFServunzAKdNHlYzWM gjNSCngjfv6y6QYeB0jRGpsxVo5okoCk1MOqnLIEfZGaJBN6wS60aXFqkMnkI2TKqT /mhX+mzim3N96bnOeNAhpE8lKu7P8W+vWg6Nox4X7UttTiba7Dx09uyiWlZ7yjkhB5 Euz23RmJRex/g== Date: Mon, 16 Feb 2026 11:58:10 +0530 To: Marco Felsch Subject: Re: [PATCH v2] tee: shm: fix slab page refcounting Message-ID: References: <20250325200740.3645331-1-m.felsch@pengutronix.de> <20250326110718.qzbwpmaf6xlcb4xf@pengutronix.de> <20260212125830.jfwos3flga2l5uwk@pengutronix.de> <252s4lfnujhrl3bkqm3xwatdkcdd3tfge3e6fla6f2llq4szjm@xltjvpqjgffn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <252s4lfnujhrl3bkqm3xwatdkcdd3tfge3e6fla6f2llq4szjm@xltjvpqjgffn> X-Rspamd-Action: no action X-Spamd-Result: default: False [-2.00 / 15.00]; BAYES_HAM(-3.00)[99.99%]; SUSPICIOUS_RECIPS(1.50)[]; MID_RHS_NOT_FQDN(0.50)[]; DMARC_POLICY_ALLOW(-0.50)[kernel.org,quarantine]; R_DKIM_ALLOW(-0.20)[kernel.org:s=k20201202]; R_SPF_ALLOW(-0.20)[+ip4:172.105.4.254]; MIME_GOOD(-0.10)[text/plain]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+]; RCPT_COUNT_TWELVE(0.00)[17]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; MISSING_XM_UA(0.00)[]; ASN(0.00)[asn:63949, ipnet:172.105.0.0/19, country:SG]; NEURAL_HAM(-0.00)[-0.999]; ALIAS_RESOLVED(0.00)[]; FROM_HAS_DN(0.00)[]; FREEMAIL_CC(0.00)[linaro.org,infradead.org,suse.cz,linux-foundation.org,pengutronix.de,lists.trustedfirmware.org,vger.kernel.org,st-md-mailman.stormreply.com,lists.infradead.org,gmail.com,foss.st.com,siemens.com]; DWL_DNSWL_NONE(0.00)[kernel.org:dkim]; FROM_EQ_ENVFROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[kernel.org:+] X-Rspamd-Server: lists.trustedfirmware.org X-Rspamd-Queue-Id: 05FF143862 X-Spamd-Bar: - Message-ID-Hash: IU3VEJFVN3HQFHLV2DCUVRYO7NEBXZKJ X-Message-ID-Hash: IU3VEJFVN3HQFHLV2DCUVRYO7NEBXZKJ X-MailFrom: sumit.garg@kernel.org 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: Matthew Wilcox , vbabka@suse.cz, akpm@linux-foundation.org, kernel@pengutronix.de, op-tee@lists.trustedfirmware.org, linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, mcoquelin.stm32@gmail.com, alexandre.torgue@foss.st.com, ilias.apalodimas@linaro.org, jan.kiszka@siemens.com, masahisa.kojima@linaro.org, spu@pengutronix.de 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: Sumit Garg via OP-TEE Reply-To: Sumit Garg On Fri, Feb 13, 2026 at 11:04:48PM +0100, Marco Felsch wrote: > Hi Sumit, > > On 26-02-13, Sumit Garg wrote: > > Hi Marco, > > > > On Thu, Feb 12, 2026 at 01:58:30PM +0100, Marco Felsch wrote: > > > Hi Sumit, > > > > > > TBH: I was hoping that you will take care of this since you're marked as > > > maintainer for the tee-trusted-key and we noticed the warning with 6.14 > > > and still no fix available :/ > > > > Mathew did suggested a fix long back on which everybody agreed but > > You agreed. I said that the current TEE API also allows non-slabed based > backed memory and therefore I don't wanted to send this patch approach > and instead asked you to do so since you're the maintainer and fine with > the change. > > > didn't got enough attention from you to test and report if that fixed > > Why should it get attention from us? Maybe we do have different views of > being a maintainer. It's really the basic expectation I have put here which every reporter of a bug needs to say if a suggested fix works for them or not. > > > your issue. Since you insisted further, I have created a formal fix > > Why is it our issue? It's everyones issue which uses the tee trusted-key > driver. > > > patch based on that here [1]. Care to test that? > > A colleague of mine is going to test it and will reply on the patch. > > > [1] https://lore.kernel.org/all/20260213113317.1728769-1-sumit.garg@kernel.org/ > > ... > > > > I checked the code once again and figured that we could drop/replace > > > tee_shm_register_kernel_buf() with tee_shm_alloc_kernel_buf(). I don't > > > see why a kernel driver needs to tee_shm_register_kernel_buf() in the > > > first place, maybe this is legacy. The only users of > > > tee_shm_register_kernel_buf() are trusted_tee.c and tee_stmm_efi.c. > > > > No it's not legacy but allows for efficient memory reuse within the > > kernel as to not create bounce buffers to share data with TEE. > > To be hones, there are only two driver using the API. The tee_stmm_efi > driver can do the alloc during the probe(). The trusted_tee has to use a > bounce buffer, yes but how often do you assume that (un)sealing and rng > ops have to be done during runtime? This shouldn't be a overhead at all. > > Therefore my suggestion would be still to drop the internal kernel API > and only use it for userspace pages, where it could really matter. I don't disagree with what you are saying here but we really need to promote efficient memory reuse for TEE clients. There will surely be more use-cases coming in future which can benefit from the flexibility to register buffer. One another kernel client being remoteproc subsystem which is already under review for this API. -Sumit > > Regards, > Marco > -- > #gernperDu > #CallMeByMyFirstName > > Pengutronix e.K. | | > Steuerwalder Str. 21 | https://www.pengutronix.de/ | > 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | > Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |