From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EBD6B1A9F91 for ; Fri, 7 Aug 2026 17:51:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786125063; cv=none; b=jvt4wQQ2u3rgAp0U0f+TOnoDOoqC6C8OP4ljDZ5prRCicuQi1z4Sr+4WZ2CsK6d2URbspJooBMGbZIKWDKO1bW7qvr4efuEnBzFobWNotdtMARWO4f0SQo6JidCClX4tasB/pf6MmEdG+/GVxpr01ZcJTWDv8OnsbqZJXofb+Jc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786125063; c=relaxed/simple; bh=KbCZVGxpxZB11ATUidCKGDLhTXSyhwXMpDfLSNjeksQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=hvrLB+ImSN537cKJ7wWUg14jLZmCdv6wB9KuS92hYUdkkSp4e2UQ9+EGrrAH7LN4hbaxEgovZPmXyw9NfuQBh/Zciif35oISaxcBqLL6rLcIEAwJwtACi3+g+J7ZT0hfFK8C1O6IIGbenJLjh0okhrZLGrxgVv1NVJH8FhS0GGQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=VzPnWaDa; arc=none smtp.client-ip=209.85.221.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VzPnWaDa" Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-476a130c138so3181358f8f.0 for ; Fri, 07 Aug 2026 10:51:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786125060; x=1786729860; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:from:to:cc:subject:date:message-id:reply-to :content-type; bh=kmhy6Tcc7C5YHQJuzsd/r0Pq9Doq6mlOSeIDrzdteII=; b=VzPnWaDaVNFzaNwlsI7Gfqd5h851Nb3AnD1SupCgNZpbAcq4lH2RW6YFfo8otymzEY jQcEsbjsTwzZn2YQ68lsAOr14AvHfI/TpMBhGWZhfkR09aKWSGOcZ0PV965Aig6fsKy5 SNZoSBX84GMnzYyLISBUMfwGLyJyTTlF/65Lg9uohaLZwdFPboWc4/PtBOIxBBJBFPHH rOmCNLvwtkrC3FgQn5q/3Lbk7oYNl5psPbQ8ZY/pOgg9CwoJYMmQ4AjMNNtL+6Klxn/h rmBgjQmBB5R3FQc4ZFBM1Gh6deCX9JTdMf7PiNWFXEvzcXLQdXGwkTFWCtVIKYEN+DGn G/rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786125060; x=1786729860; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=kmhy6Tcc7C5YHQJuzsd/r0Pq9Doq6mlOSeIDrzdteII=; b=gGI1HQst3N2AgVRDUEt+Wi9PFEpT/s8zTR1jGDO+SYHmD5Dtp1FZ+t1+h4LsRNsAzv U/b3bqux3B2Xz/sfGpEzGskjnoCIYypMLS2HV2Qyba/vW7IqxmK+R8GbGXbqYJcbrNCM 8CZTjl61Sfyi86SyneV98GOuIdP6uGQO75G03COCs1PGD1R4+KALbEmmYqFd95NMWU76 qIm+D3i+w9ogz59rQs6JLZ9ISFSg3jF7cTleMydyRybV8T4tx4IIvQEH8323rZ7N+vIt QiyAtiG3wfLfrl/Y2qyobf7snYpsFyReQsnCUe3/sUIlTQff8sPNL37G32AU4R5VIurV 6ipw== X-Forwarded-Encrypted: i=1; AHgh+Rq3tB05P6Iz2YxolqzM7QDtRKFtnQJN6PXX7mTCMiLpDaIQHH9I538YpGIHrGKe/7nLUUCqB9UdZKf6x00=@vger.kernel.org X-Gm-Message-State: AOJu0Yxxg5whrCE4OW7aI1uPbN9SjXlHl4QI/srGBJakIvWayWRr7Zpb IGTjXR/ckZTd9hMSxHxcjvBNr+DCeQwTgKesS2/2tkJyusQTyogqzKKb X-Gm-Gg: AR+sD13GxVqhIvcvzC5/IOZXoJsjc6itQvrEj6X2PXI7UMV5P7manurqhjg5cnnjR70 4LHUX1pYXSj+FxcC96bRh70vYcwFfMWqJGJv9MGcidfIpjwa93SpTinWcIQRGYYExgm5/95ldec NNzhZpglnmzDv0D88MOPng7tOPyDWJeckB/u1dqu/hvA3kvsEOEVTp8T36Bm7PTEonk7jPDz7v+ HU8fqmrjut3QOke/3e1ejR1++cTqd12QHdKcgPp+v4MgncCho1Ms0EfkzEwRiKUAmAbR2zn1qlS jNojsZfjkIfk4ZAiiAk39Oja60eT1qoWn1iluj6TefdFThVHxm8ux9fScA70PEEO6qEQ81lu+eU WyjJ8Ng/ryeigptDZNVIXGbivuHK7D8BI7MJECbPPhbNhhvrjweQqrDyJiMq1R4yXNkNcHPEXiJ 6Co3/Ew9/nsLjkUQcvJOJT7A7EDaaJ1A6wfATr592if4WN9Dd7mbjnOMNpEKzqtgEsiwoKq1p4e 9VmWH8uK+Wa+9lRuE4xxYxxNi84joKr4wK/XRWFGVx6R6C+6tN4 X-Received: by 2002:a05:6000:4212:b0:47f:81a9:3f36 with SMTP id ffacd0b85a97d-47ffd924dffmr15543175f8f.18.1786125059910; Fri, 07 Aug 2026 10:50:59 -0700 (PDT) Received: from nixos-office (195-23-151-163.net.novis.pt. [195.23.151.163]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-480021e8cd0sm7901243f8f.17.2026.08.07.10.50.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Aug 2026 10:50:59 -0700 (PDT) Sender: Julian Braha From: Julian Braha To: amirreza.zarrabi@oss.qualcomm.com, jenswi@kernel.org Cc: 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, nathan@kernel.org, nsc@kernel.org, jani.nikula@linux.intel.com, kees@kernel.org, Julian Braha Subject: [PATCH v3] tee: remove TZMEM_MODE_GENERIC Date: Fri, 7 Aug 2026 18:50:41 +0100 Message-ID: <20260807175041.3299349-1-julianbraha@gmail.com> X-Mailer: git-send-email 2.55.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit '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 --- 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 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