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 X-Spam-Level: X-Spam-Status: No, score=-2.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2DE0C2D0DC for ; Thu, 2 Jan 2020 17:24:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A7AB421734 for ; Thu, 2 Jan 2020 17:24:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="LVK/VFNl" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728101AbgABRYu (ORCPT ); Thu, 2 Jan 2020 12:24:50 -0500 Received: from lelv0142.ext.ti.com ([198.47.23.249]:38392 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727854AbgABRYt (ORCPT ); Thu, 2 Jan 2020 12:24:49 -0500 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 002HOjcV107718; Thu, 2 Jan 2020 11:24:45 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1577985885; bh=8R/7KD37mImOhVgbKAz0f8LBJAniQTDmWoNz9vkICO4=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=LVK/VFNlHysZTiwj4MxJWX7GiaY/O/2/J7bF6bJ8WCgKBkjumOrc4RwxFk8y+50Xf CLzvXJ8sLZItg0MoRrxJZf3zn7TO4AqLmdiid6SuTJcG4uSio7YX5jABLnPPUspb+Y 8PX98D9Ka2WvGBtXNsaozYjTv+eT4YofEdY63L78= Received: from DLEE104.ent.ti.com (dlee104.ent.ti.com [157.170.170.34]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 002HOjVU021141 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 2 Jan 2020 11:24:45 -0600 Received: from DLEE115.ent.ti.com (157.170.170.26) by DLEE104.ent.ti.com (157.170.170.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Thu, 2 Jan 2020 11:24:45 -0600 Received: from lelv0326.itg.ti.com (10.180.67.84) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3 via Frontend Transport; Thu, 2 Jan 2020 11:24:45 -0600 Received: from [10.250.65.50] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 002HOieR098162; Thu, 2 Jan 2020 11:24:44 -0600 Subject: Re: [PATCH v3 2/4] ARM: OMAP2+: Introduce check for OP-TEE in omap_secure_init() To: Tony Lindgren CC: Lokesh Vutla , , References: <20191230185004.32279-1-afd@ti.com> <20191230185004.32279-3-afd@ti.com> <20200102171403.GC16702@atomide.com> From: "Andrew F. Davis" Message-ID: Date: Thu, 2 Jan 2020 12:24:39 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <20200102171403.GC16702@atomide.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/2/20 12:14 PM, Tony Lindgren wrote: > * Andrew F. Davis [191231 14:16]: >> On 12/31/19 1:32 AM, Lokesh Vutla wrote: >>> This doesn't guarantee that optee driver is probed successfully or firmware >>> installed correctly. Isn't there a better way to detect? Doesn't tee core layer >>> exposes anything? >> >> We don't actually need the kernel-side OP-TEE driver at all here, we are >> making raw SMCCC calls which get handled by OP-TEE using platform >> specific code then emulates the function previously handled by ROM[0] >> and execution is returned. No driver involved for these types of calls. >> >> U-Boot will not add this node to the DT unless OP-TEE is installed >> correctly, but you are right that is no perfect guarantee. OP-TEE's >> kernel driver does do a handshake to verify it is working but this is >> not exposed outside of that driver and happens *way* too late for our >> uses here. Plus as above, we don't need the OP-TEE driver at all and we >> should boot the same without it even enabled. >> >> So my opinion is that if DT says OP-TEE is installed, but it is not, >> then that is a misconfiguration and we usually just have to trust DT for >> most things. If DT is wrong here then the only thing that happens is >> this call safely fails, a message is printed informing the user of the >> problem, and kernel keeps booting (although probably not stable given we >> need these calls for important system configuration). > > OK, please add comments to omap_optee_init_check(), it's not obvious > to anybody not dealing with optee directly. > Okay, will add this comment and the one suggested by Lokesh for v4. Andrew > Regards, > > Tony >