From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 7E0103B14C8 for ; Fri, 7 Aug 2026 19:05:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786129520; cv=none; b=tw+xjT/nfAqag6Qv9e432+KJ7UR2AemdmZyBt1/Wi9kS+Wq8CLx/aYDLqJmhEKFHkvKVXF4lop8OAv6aUyqvr5XJXQj41Zab8B5LbBVDUr4x4ZkRnPRnce0KM7ZqXwIAHL/+s9HA/QFjlatOwCyWmplA4MBuE1lxLCW4pThrJ2k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786129520; c=relaxed/simple; bh=rGW2ghxHJSBOukFdza6iEefzh7vnqBDByvp5KyzDRoQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=NuySMYIwkyIPAEjLXRcNrjfLGxpIoiaiqG0xq3rQ81HmzkxGmly++ALJvSmdo+WCUUX4R1ZIhbYI7mTd7YUvaLYRjGqCKrBRWLUBzc/7bTZm+tjN0fYenBnoPvrmkfdIrLL4bOR4WiiOIY0xwi9XFHrTUcYHVlz1jALrwR5eu0k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JnMAxCq+; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JnMAxCq+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 08BA71F000E9; Fri, 7 Aug 2026 19:05:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1786129519; bh=3fSuyO8GJZ4kDdfxC451OM8OXFJyZ3cvtiX/sTHt2mc=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=JnMAxCq+dToC4REzUAPQKT6vnPPMciXJOEhYoh4pA2kecgge08K/PhhvcRE0qcuOI WQYwPmksF2lnmbd//EXz1xNKltWZ90v9L2kYJmhc8HlG0KVPzJ96OWRCZDyWnm70pR 9CgINIYc4gtDGPEQrNh+njk52FRGYkce5IZSuAoQxRwJIZPkjLELc0kWbFQ81LLIob /R0/c5M2rN3RoBat8lmmMzPI/wqoXqq+nISLkkn/zQtmHb7hF53lzvF0pe4Q0Aa4CI TdIeKtJhfekj2hra1BLhcKJSdOM3OCW60mquJbITVgF71H2LNSxmPwue1f81ylblN2 jmOCeWlDN245A== Date: Fri, 7 Aug 2026 12:05:13 -0700 From: Nathan Chancellor To: Julian Braha Cc: amirreza.zarrabi@oss.qualcomm.com, jenswi@kernel.org, sumit.garg@kernel.org, arnd@arndb.de, geert+renesas@glider.be, amirreza.zarrabi@oss.qualcomm.org, op-tee@lists.trustedfirmware.org, linux-kernel@vger.kernel.org, quic_eberman@quicinc.com, andersson@kernel.org, brgl@kernel.org, harshal.dev@oss.qualcomm.com, nsc@kernel.org, jani.nikula@linux.intel.com, kees@kernel.org Subject: Re: [PATCH v3] tee: remove TZMEM_MODE_GENERIC Message-ID: <20260807190513.GA2638974@ax162> References: <20260807175041.3299349-1-julianbraha@gmail.com> 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=us-ascii Content-Disposition: inline In-Reply-To: <20260807175041.3299349-1-julianbraha@gmail.com> On Fri, Aug 07, 2026 at 06:50:41PM +0100, Julian Braha wrote: > 'select' does not work on config options in a 'choice', so currently it is > possible to enable QCOMTEE without QCOM_TZMEM_MODE_SHMBRIDGE, even though > this is needed at runtime. > > There are no users of the generic allocator option, > QCOM_TZMEM_MODE_GENERIC, so let's remove it. Then, we can remove the > containing choice..endchoice, which allows the 'select' to work as > intended. > > Suggested-by: Arnd Bergmann > Signed-off-by: Julian Braha Reviewed-by: Nathan Chancellor One small nit below but I would only send v4 if there are other things to be addressed. A note to the maintainers: We would like to turn selecting a choice symbol into a hard error in 7.4, so please consider picking this up for 7.3-rc1. > --- > Changes since v2: > - add back stubs for when CONFIG_QCOM_TZMEM_MODE_GENERIC=n > - updated help text accordingly > > Link: > https://lore.kernel.org/all/20260729203845.387239-1-julianbraha@gmail.com/ > > Changes since v1: > - remove TZMEM_MODE_GENERIC instead of removing the dead select > > Link: > https://lore.kernel.org/all/20260715092539.18384-1-julianbraha@gmail.com/ > --- > drivers/firmware/qcom/Kconfig | 26 +++++--------------------- > drivers/firmware/qcom/qcom_tzmem.c | 4 ++-- > 2 files changed, 7 insertions(+), 23 deletions(-) > > diff --git a/drivers/firmware/qcom/Kconfig b/drivers/firmware/qcom/Kconfig > index c7f8413ab996..95b968d88dc3 100644 > --- a/drivers/firmware/qcom/Kconfig > +++ b/drivers/firmware/qcom/Kconfig > @@ -34,33 +34,17 @@ config QCOM_TZMEM > tristate > select GENERIC_ALLOCATOR > > -choice > - prompt "TrustZone interface memory allocator mode" > - depends on QCOM_TZMEM > - default QCOM_TZMEM_MODE_GENERIC > - help > - Selects the mode of the memory allocator providing memory buffers of > - suitable format for sharing with the TrustZone. If in doubt, select > - 'Generic'. > - > -config QCOM_TZMEM_MODE_GENERIC > - bool "Generic" > - help > - Use the generic allocator mode. The memory is page-aligned, non-cachable > - and physically contiguous. > - > config QCOM_TZMEM_MODE_SHMBRIDGE > - bool "SHM Bridge" > + bool "TrustZone interface memory allocator: SHM Bridge" > + depends on QCOM_TZMEM > help > - Use Qualcomm Shared Memory Bridge. The memory has the same alignment as > - in the 'Generic' allocator but is also explicitly marked as an SHM Bridge > - buffer. > + Use Qualcomm Shared Memory Bridge as memory allocator. The memory has the > + same alignment as in the 'Generic' allocator, which is used when this option > + is disabled, but is also explicitly marked as an SHM Bridge buffer. > > With this selected, all buffers passed to the TrustZone must be allocated > using the TZMem allocator or else the TrustZone will refuse to use them. > > -endchoice > - > config QCOM_QSEECOM > bool "Qualcomm QSEECOM interface driver" > depends on QCOM_SCM=y > diff --git a/drivers/firmware/qcom/qcom_tzmem.c b/drivers/firmware/qcom/qcom_tzmem.c > index 0fd9581275f1..510474902c3a 100644 > --- a/drivers/firmware/qcom/qcom_tzmem.c > +++ b/drivers/firmware/qcom/qcom_tzmem.c > @@ -50,7 +50,7 @@ static struct device *qcom_tzmem_dev; > static RADIX_TREE(qcom_tzmem_chunks, GFP_ATOMIC); > static DEFINE_SPINLOCK(qcom_tzmem_chunks_lock); > > -#if IS_ENABLED(CONFIG_QCOM_TZMEM_MODE_GENERIC) > +#ifndef CONFIG_QCOM_TZMEM_MODE_SHMBRIDGE I realize you likely did this to keep the diff small but I think negative conditional checks are harder to read than positive ones, so I would consider making this an '#ifdef' and flipping the branches. > static int qcom_tzmem_init(void) > { > @@ -67,7 +67,7 @@ static void qcom_tzmem_cleanup_area(struct qcom_tzmem_area *area) > > } > > -#elif IS_ENABLED(CONFIG_QCOM_TZMEM_MODE_SHMBRIDGE) > +#else > > #include > #include > -- > 2.55.0 > -- Cheers, Nathan