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 CEDFF3ACF0C for ; Mon, 20 Jul 2026 05:55:59 +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=1784526966; cv=none; b=qlr0aGqUQAWDxhGt8+pVCDv3rUUXLOb0BbqvPlvamYVteexOvLib32kbj0rXfp4A7RZYs2KaCWpmZiQBOK0lcKaBD/hzLiqXN2WZnbRJYxU390y4fJAM2jSXgh54QvACA+f1T5wP0X0Z+l0JwKJx/WcFTlzgT0BGaqwYyxvvX3Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784526966; c=relaxed/simple; bh=nNGfVQUSU1iNKLLLhDotYQPgoa0DUotLOny8szy38+U=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Cg3KrcXi5uKaMrhO2xVUbKWkNjG9b/LBzF/IbtlbgtmFeWP35u8z6eKjMHgm2rjL616xIPtWgtmgO8QfCpL7ADzLwneTimQJWSas/Y6r6h2AGemL78oqVcF/9X5Td1WDb+Tv3HcBk0dxf0ekEyEO1IDJX616lFTd+4eIeszTZKo= 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=PNPUy/8G; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=BZwfMXOr; 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="PNPUy/8G"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="BZwfMXOr" Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66JNstf5901469 for ; Mon, 20 Jul 2026 05:55:57 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= ndWdbIk/tkNrHopztgJ4e8IGKG5hlFeD58XbJ1VwOtI=; b=PNPUy/8GuqIrlyuG My+hfYShtyW6z7MIIDQePhfVMZ96j3MGtmQL8cXjL318+4qV3ZpcH0f20Tt72EED 1mrprNz/tw8GaurKxWt1DSDgXZ+GMhFtkblJzZUX3L05Oh7iYBgsqRlrRz20y6xb CT7rZuetZHa/Dh4obwGIdCBvBflXOTC+7Ad5kUVG2IHVN3lMU89eNzYNsgORku88 LeU1KzrlARGq7diqp1BENuDcySpQ66p9q67oCGwNxQa1qkktjPUMuj08mz5aIowQ 5dUa4YlZEFR9reCf5t/fWfBcWWncLJ6LM31sBI8Y3HKxw449ph3W90Wp5lP8TWeC PjXeKw== Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fg2bnmkh1-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 20 Jul 2026 05:55:57 +0000 (GMT) Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-2cce14a21faso57937825ad.0 for ; Sun, 19 Jul 2026 22:55:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1784526957; x=1785131757; darn=vger.kernel.org; h=content-transfer-encoding:content-type: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 :content-type; bh=ndWdbIk/tkNrHopztgJ4e8IGKG5hlFeD58XbJ1VwOtI=; b=BZwfMXOr5ObNnahj7KnXzZVkb0HqYAARRX5c4CQtJT20nbSNpC7sJmVhkOVX71D0/b VjXcsCDA7dQA+tVVTwUWFdmGHJgvzumcNyhC1XtV3FUhaSV4LtTTB3UI8YGwwOaZkWO3 TyhRrxFy4bQXEVEtVYYmsIuopIeeMDTKnr13dzOW22GRXLAxJjM0nlCV88zGFDIoa4jC XT/Ery5ZlAiqdnZ6FMc/XfNTr2joO8sHkXWEa/CI618l6wOa1abfShAXcYqFcGl4r2or K2rAY3M7BoW7knQSxrlj1GOPP+xPTQ6fkHV71twViJhDzO3IcU3MfImf+a4ODInXEBGO MOQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784526957; x=1785131757; h=content-transfer-encoding:content-type: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:content-type; bh=ndWdbIk/tkNrHopztgJ4e8IGKG5hlFeD58XbJ1VwOtI=; b=Zw6/2oE+G3hG/2cGGw2U2Q4H8qmbRqin9KyXmMqG5z14IoUw7TWOUXfaExroYYc+xB 2ThoVPtsAAqzgRK7h7dPE4XvBESZkCXYN9sClLQZeWgqk16KCTcOm5OvquQmX8BAO/Xp 3PCrqiP8wJE10fPi9P5IB/gugfrSpIRCmqYPvWy/0Ml+XJDiEoXRNTyRD9DjWWx54PdX /uePKHHTd622pWi72DeA7zdUfNX18vDU9tRQ8vk4XUSUZd4/h1nMAzJwSklnGjFqXCMy Rtgga3bXxdX8PB0RnSx/1Qi/SD6JLZWDmOO9QMCHCaVvHfI6UNKjGdt9+92FEgVdUVjK rRVg== X-Forwarded-Encrypted: i=1; AHgh+Rrnsoqnn/K49kTHLOFyGANaPl07HJx0QJ3GI8NQYSyjVWYSQlxO2dybeZIG278EqngEphEGI/uaBKMGSwg=@vger.kernel.org X-Gm-Message-State: AOJu0YwHUnWfA9C9y1+44JIPfrPSEhVy2hTFGIC1g/HoC9d2nhXoz2iX iUEFOSpCGtm8g7ck/vdNdI8UtL7SiaRC48EaDntAYEXKEl0DToaAs6ruX4E7ozOGsJGT7X/P+GO fEhn/diKol2ZwT7laelIMgdWU+s3oh6PQ0lnk5UoR7a46zcwArtlt9aSg8tgWT6dnrpI= X-Gm-Gg: AfdE7ckKBBLvjdPdPwCF+v9LlqQkbuGPJgoOgQSz2efAPHqjqcBmREpBSEX19NB0tco TibCyTeLwKu4owRqIT2GFFivNKWYKtTRoOX+jZ/lZ8bfWAHYHHzpvYiHLpfWKQRavFMtHbYklHq ueJHV/vHohlb2fkTJIuLbWDT76T0SpJ3naX4A2baesrVmrSrV8db0ywTPx26Q3FkyHWF8ThZmAY L/UJnaEtH4t4nrJycPH2wDo9PO3RFQcmH540JfPs5VyWniqm0Ty2RIO7kC19YnN7ti/2CCquoS4 t/VmLLQ2RmL4qUNIcgPhdJ6qTRKymVKvmkwNV+XoNU3l3t9FFcM5ohj1XQJq5tarlV303Z+T+An 3flgbTd00crri+htkXDvP1wA6VMRcsg== X-Received: by 2002:a17:902:b082:b0:2cc:89ce:2f07 with SMTP id d9443c01a7336-2cf348444c7mr93121845ad.1.1784526956537; Sun, 19 Jul 2026 22:55:56 -0700 (PDT) X-Received: by 2002:a17:902:b082:b0:2cc:89ce:2f07 with SMTP id d9443c01a7336-2cf348444c7mr93121715ad.1.1784526956087; Sun, 19 Jul 2026 22:55:56 -0700 (PDT) Received: from [192.168.29.116] ([49.37.145.73]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2cf346daf66sm50655905ad.50.2026.07.19.22.55.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 19 Jul 2026 22:55:55 -0700 (PDT) Message-ID: <6600d003-709e-4186-98c4-a9ac263d7d6b@oss.qualcomm.com> Date: Mon, 20 Jul 2026 11:25:50 +0530 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] tee: remove dead select from kconfig To: Arnd Bergmann , Julian Braha , Amirreza Zarrabi , Bartosz Golaszewski Cc: Sumit Garg , Geert Uytterhoeven , amirreza.zarrabi@oss.qualcomm.org, op-tee@lists.trustedfirmware.org, linux-kernel@vger.kernel.org, Bjorn Andersson , Elliot Berman , jenswi@kernel.org References: <20260715092539.18384-1-julianbraha@gmail.com> Content-Language: en-US From: Harshal Dev In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzIwMDA2MyBTYWx0ZWRfX+rET4hjjHdyZ 7qjY0csv8KmsFVvOi4HyFdCzLdO08skDh4RbKW5VhrSSO53dMd2jhT2vvRx6Jc7Npo2/yJa0ZxA 2OYl0nvbYt45lfn/LtBCYkeCESfxifKC1AqfVZFoWN3fYuAF4acKC6yKDq1uL+27HZkcleZfxCm +Tbtzufv/dBO9obrQu4dvJSQOcN/4WAuv38oADd1wM23AqcJ/Wr/0vBlRY2pl8KyBus1LMdAEdF ixFu+OgyjiZg0ZsMuQPaxLbDY08CXGOIv7IbQ5iPfofBCX+a2hrge6k2dpT0Nlo7TlNTSlYrRCg 1pDaF2LSdeyfeDkt8DbLb0i3bwna/JtQuXm3y8rdl/OKG6h0n/JsArC1dwHlEORwS+Cy8baECtV TyAVm6ZG1QKQCeXhBTQ8v868NMJ2N9OMt8FTQwyENQqxc4hoNWOIx1rg+i6MCjSvPmHp/X72aNg ++JhEo/HOZ0io5PCZHA== X-Proofpoint-ORIG-GUID: SL-dkU-e5JXMMsb6_X-m868n7TCOmaCA X-Proofpoint-GUID: SL-dkU-e5JXMMsb6_X-m868n7TCOmaCA X-Proofpoint-Spam-Info: AW1haW4tMjYwNzIwMDA2MyBTYWx0ZWRfX3gPZQIrToM/s 5L6SLd/fbV10/CCeI4azEeCWvqNLU6RwSqr7N7F4D5BBVwLKxCfZdFROCosaNxLSHs9KQFlm9HC YPLE/wyyweje2iy9Vax+R+ziK3Rqylc= X-Authority-Analysis: v=2.4 cv=deOwG3Xe c=1 sm=1 tr=0 ts=6a5db86d cx=c_pps a=cmESyDAEBpBGqyK7t0alAg==:117 a=aryqaONRTh07XXH6IkyVKw==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22 a=zWqAy90xs1Rb1aWM7kAA:9 a=QEXdDO2ut3YA:10 a=1OuFwYUASf3TG4hYMiVC: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-19_08,2026-07-17_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 spamscore=0 malwarescore=0 clxscore=1015 phishscore=0 suspectscore=0 impostorscore=0 lowpriorityscore=0 adultscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607200063 Hi, On 7/15/2026 3:38 PM, Arnd Bergmann wrote: > On Wed, Jul 15, 2026, at 11:25, 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. >> >> This patch removes the select. >> >> I've compile-tested this and found that it builds fine without >> QCOM_TZMEM_MODE_SHMBRIDGE, but I don't have the hardware to runtime test. >> Please advise if it would be better to make QCOM_TZMEM_MODE_SHMBRIDGE a >> dependency. >> >> This dead select was found by kconfirm, a static analysis tool for Kconfig. > > Right, clearly something is wrong here. > >> @@ -5,7 +5,6 @@ config QCOMTEE >> depends on ARCH_QCOM || COMPILE_TEST >> depends on !CPU_BIG_ENDIAN >> select QCOM_SCM >> - select QCOM_TZMEM_MODE_SHMBRIDGE >> help > > From the implementation, my guess would be that QCOMTEE actually > requires QCOM_TZMEM_MODE_SHMBRIDGE and it only links successfully > because of the stub helpers added in 8aa1e3a6f0ff ("firmware: > qcom: tzmem: export shm_bridge create/delete"). This is correct. QCOMTEE can build without TZMEM_MODE_SHMBRIDGE, but will not work without this config. TrustZone will just refuse the memory shared without this config enabled. So it is a hard dependency. > > If that is the case, we probably need a 'depends on > QCOM_TZMEM_MODE_SHMBRIDGE' here, and can remove the stub > functions. > > It is also possible that the 'choice' itself is wrong, and > this should be detected at runtime. It is a rather odd Kconfig > option, as it sounds like only one of the two is correct on > a given hardware. The CONFIG_QCOM_TZMEM_MODE_SHMBRIDGE variant > contains runtime hardware detection, so it should actually > be safe to enable that anywhere. If this is true, we could > just turn the choice into a 'bool' symbol and remove the > generic case. > So when TZMEM_MODE_SHMBRIDGE isn't enabled, and instead TZMEM_MODE_GENERIC is used, the driver just becomes a generic memory allocator, so the clients cannot share this memory with QTEE. I couldn't find any existing clients of TZMEM that aren't using it in MODE_SHMBRIDGE, in other words it seems that we don't have any users for MODE_GENERIC. In that case, it appears to be a better choice to make this a bool. Either MODE_SHMBRIDGE or not. But since @Bartoz is the maintainer, I would let him provide his comments on this. Regards, Harshal > I've added a few more people to Cc that may know the correct > answer here. > > Arnd