Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp684891ybt; Wed, 24 Jun 2020 08:46:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJySyBv7LdMuyBscYwTAmaU16gixN5B31Z/E0A77467n/cU3F7zU7AoKRKjUAe8z/kPbWPZM X-Received: by 2002:a05:6402:144a:: with SMTP id d10mr6205849edx.35.1593013573187; Wed, 24 Jun 2020 08:46:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593013573; cv=none; d=google.com; s=arc-20160816; b=OR0+jGPoRjrjtv7joet41dNj5hA0jzLezPA17LlXc4bCW2tYLP3VUWB+FjpO22tZ6R aS8dkLVjG3DkEPJx+GSvlVGtJ+41zwM1HQ88EZu6HAzNC1qh2mrDTFrPurj8rIC8vTIc uzqlkUfDIFUF8j5L9Q2USOQ4jNnPXKie6BW+YCipgNbkB1N7lYZFDpU0Diy//deYmTVY p57wvRZ35BcOwwq5bxw2ajHszuspbngIw48ypcdAvFv7z2VWIkRpiosF8HKRkQxwpC9p BdkCBI4ATwHknh1yd5HKsjFcwm+MLcHnuzqhBo78xZ8t09v3Cf1Nlv9mnl5aTok6kzNs UPgg== 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=RdI5M2Ilrl2+vmVMHIIBNrAs2nh4Sr2me7AQbdHn46E=; b=0IhL6lB3HWVdfq9X0zgkvf8jwmiwdzyzzks+4IXxrYjGTlUoHNgVKzqpcNCH0OZLO1 55ujUayYNVsp3Ki7CvVLrEI0gnfDT6IRuxNaEFzAirilFYEeXb12RSIsAYR7StphL8d6 aleiLBfLC1NtS176wvuQ+XCP2BEUW0KBDJdvWPirC8WSjxsknFk58vUWx4V4rJ9beLf2 N5pbqtcPp+vxs2+ZAMs6w+f3hHnIQdKyBJzFXyWybhaKuddTuy+iAKwILlETD/L/0+RN eXVuYMtvasVtLAtWtHkJHjFBRmdPm0r7L72WNWYsO+sgjmbUX+BfQMOEE9YhZfhiC8pv Ou+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@forissier-org.20150623.gappssmtp.com header.s=20150623 header.b=xd3x1HFC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i12si1386682edj.491.2020.06.24.08.45.49; Wed, 24 Jun 2020 08:46:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@forissier-org.20150623.gappssmtp.com header.s=20150623 header.b=xd3x1HFC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404429AbgFXPot (ORCPT + 99 others); Wed, 24 Jun 2020 11:44:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404187AbgFXPot (ORCPT ); Wed, 24 Jun 2020 11:44:49 -0400 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D80E5C061573 for ; Wed, 24 Jun 2020 08:44:48 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id f18so2983757wml.3 for ; Wed, 24 Jun 2020 08:44:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=forissier-org.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=RdI5M2Ilrl2+vmVMHIIBNrAs2nh4Sr2me7AQbdHn46E=; b=xd3x1HFCw2Tw5G4YgrI4TEYRwKzSJNBM6wmdSVA59txdEtkxfpSh5Ae8sTkuZv4W29 S0A2N+Or30SSf0tpzHGNDqoHW9UdEiI2cTJN+lJUH+s4joj1eMlVveNe2kM5G62ZUJFa lyb33MpXtlCg3IO5J280SNnMcWaTuVokSgsxZ2KDfdWMHhT0sbpTdMV2MQGhQIKZJ2K7 rKgfM9909WBaJESSWPDW3XGocUYN2QZPW6legItJmQvjK9f/rqDrUdI4uOEYRHsFmpCE FtfAVUBj3Qpn9SiLDy3nDKQkaaZ92bVzSRyfanSydG8rjZbp5EeTZEklrcrzGVNgqFdp swFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=RdI5M2Ilrl2+vmVMHIIBNrAs2nh4Sr2me7AQbdHn46E=; b=slvCLEODLB45eswktn6tuus/dwyNikz0cx3tKAA7ZWHdQBJWlDM12YJ7Gpwahh8dx8 xWKG4tfcFYCKz0wTXoqPC0FUZIk8OR74MFpj6WRqaeaal7NYFM2yPpyuVVEFqKuqym0w vKcqBSY41tEI57MOlbSSLThAgksCzxzav06ROyLoi4N+YUZIyDDs8UYA+ZawF9aohZEU OedRjcT1RrtLttIupjszlMDD7FJhGp15cYkXAi4LeQ7QUrMFiQ/7xuhqN/d+QSMqI4W8 pQuNWyGF12Qboa/DI6MDEkiMzTdX6HcSpCD5OGbTZ/tf/iTu3tPuk2Ye503Sq7Vxhvzv voMg== X-Gm-Message-State: AOAM532lapxKDXA5vHcOtr+wKdyn/FG+09v9BlbsujqdkGnVGMnW+CZ7 L334IJd/93VwuRWDU0VR73BQuw== X-Received: by 2002:a1c:9d56:: with SMTP id g83mr15935541wme.130.1593013487525; Wed, 24 Jun 2020 08:44:47 -0700 (PDT) Received: from ?IPv6:2a01:e0a:3cb:7bb0:bd12:acc9:5374:bd9b? ([2a01:e0a:3cb:7bb0:bd12:acc9:5374:bd9b]) by smtp.gmail.com with ESMTPSA id n189sm8495216wmb.43.2020.06.24.08.44.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 24 Jun 2020 08:44:46 -0700 (PDT) Subject: Re: [Tee-dev] [PATCHv8 1/3] optee: use uuid for sysfs driver entry To: James Bottomley , Sumit Garg Cc: Maxim Uvarov , Greg Kroah-Hartman , Linux Kernel Mailing List , Jarkko Sakkinen , Arnd Bergmann , "tee-dev @ lists . linaro . org" , Jason Gunthorpe , linux-integrity@vger.kernel.org, peterhuewe@gmx.de References: <20200604175851.758-1-maxim.uvarov@linaro.org> <20200604175851.758-2-maxim.uvarov@linaro.org> <1592507935.15159.5.camel@HansenPartnership.com> <1592578844.4369.5.camel@HansenPartnership.com> <1593012069.28403.11.camel@HansenPartnership.com> From: Jerome Forissier Message-ID: <3aa8705a-0342-25ea-00c4-d5370d91ddb4@forissier.org> Date: Wed, 24 Jun 2020 17:44:45 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <1593012069.28403.11.camel@HansenPartnership.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/24/20 5:21 PM, James Bottomley wrote: > On Wed, 2020-06-24 at 16:17 +0530, Sumit Garg wrote: >> Apologies for delay in my reply as I was busy with some other stuff. >> >> On Fri, 19 Jun 2020 at 20:30, James Bottomley >> wrote: > [...] >>> it's about consistency with what the kernel types mean. When some >>> checker detects your using little endian operations on a big endian >>> structure (like in the prink for instance) they're going to keep >>> emailing you about it. >> >> As mentioned above, using different terminology is meant to cause >> more confusion than just difference in endianness which is manageable >> inside TEE. >> >> And I think it's safe to say that the kernel implements UUID in big >> endian format and thus uses %pUb whereas OP-TEE implements UUID in >> little endian format and thus uses %pUl. > > So what I think you're saying is that if we still had uuid_be and > uuid_le you'd use uuid_le, because that's exactly the structure > described in the docs. But because we renamed > > uuid_be -> uuid_t > uuid_le -> guid_t > > You can't use guid_t as a kernel type because it has the wrong name? Let me try to clear the confusion that I introduce myself I believe :-/ IMO: - optee_register_device(const uuid_t *device_uuid) *is* the correct prototype. - device_uuid is *guaranteed* to be BE because OP-TEE makes this guarantee (it converts from its internal LE representation to BE when enumerating the devices, but it doesn't matter to the kernel). - Therefore %pUb is the correct format. I'm sorry for doubting the BE order initially. I am so used to OP-TEE using LE internally, that I missed the fact that we have an explicit conversion... Does this sound good? Thanks, -- Jerome