Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp17653871ybl; Thu, 2 Jan 2020 09:26:17 -0800 (PST) X-Google-Smtp-Source: APXvYqxh7uztccnQ/3Pj0/aeqg53nyBpru/HDQ6Ry5PdnKe16jLNM3h/jdb8qC85MibdjFYvCrA4 X-Received: by 2002:a9d:133:: with SMTP id 48mr90214387otu.15.1577985977261; Thu, 02 Jan 2020 09:26:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577985977; cv=none; d=google.com; s=arc-20160816; b=jeGpfvAzGvl5gclZWh4YLPrw+3d4SkthiUuZ83tvJVfj6tAs+x0WvwbayeAGZVjvv8 ONKsIHbGJ5ZWWqMjRrMJ2ztx1IHvynUVtIJF6+9rRJXgGz7KzkFs6vYtEYjs0D/QXOKa F4sASjPr9M5CpZjuYfKaNtySgnzKsw+GpxNjJ7RO1sQJdH4dc1EdjM9XLHgtzGpZMTCZ +X90RA98VobqAc2WXzFxDTr+9Z4ecLW+/pyCtnkw/86C/6OuLPTL5ljEAK0ho88OGkYg iQ9OI8M7unlGliE7soZjl/G9i+sFg0KZFuMWVptd9NMykyuj36hgaImnd4GPWeUH6z5C /YDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=8R/7KD37mImOhVgbKAz0f8LBJAniQTDmWoNz9vkICO4=; b=bURMGDenKGX+b/anXkJjw93X9nr2zObtWVysAHD+uocEiodHJsKhgOToZ6to7Wer73 OnwUXrfNMCq4ZjghrryMB7022AOG9I5vXYiz3ossdfYue/TWcCO9zqub6S5ovfl+IZ+4 DZwiSBaSr1PcFWfhlEe4MNvCwAaUl+5JAEExIHQ5I7/ilRaxJ6cI2UW+OY0UVFmxN/US v7zAZc85EZGDj+ajoQRd7HwzwOS0HZYUpkuqBE04Gm3Ihtzo3fAQJeTiXbIo8VG809lA 981sZYreOFdCwR4/zF2/Iiz0ufRC3KiDcVWm85QCJUfQCfJhDljWjYWZii4k14tUyd4Y euJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="LVK/VFNl"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m25si28774906otn.208.2020.01.02.09.26.05; Thu, 02 Jan 2020 09:26:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="LVK/VFNl"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728091AbgABRYu (ORCPT + 99 others); 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 >