Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp282556ybt; Thu, 25 Jun 2020 22:28:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyrP931qNBvAouqekcTki/Qce4f4eWGHpHRdGBf7bFcqgTcABbg22Fyo1ngIH49F4lvGhYz X-Received: by 2002:a50:d0cc:: with SMTP id g12mr1675433edf.57.1593149286390; Thu, 25 Jun 2020 22:28:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593149286; cv=none; d=google.com; s=arc-20160816; b=bPJ3jdehHR38sEUj9vsSnoNJVIezMjjs47K3KzBACfNM1FVk1UfIH2fURgYprnIDyU YffCfQzPeEnrs0gxaNTC7Zna4lAMQ7qU3OAOv7/Tw/IONjc8XS4qz4/QA2A6zmHpfHfV AnpJ7ivve8RP70Z3MURTsQSjWN9r06pV6lzkU5luTWniXsqWs3U5UftpZoFIe86ZHnq3 Gtv8fvb8AySfuhgtU2P6vT/PSEwTx+Y+8li0bPgIJrPf8/WOR3DQTpS0l4W5u3B4c75N 4e1WWR/Oe4kFZh6lYerag8MyfRHDkmNQTqLa23riMdJPNpNyYy4y4BkVdBm3WdyM3fg+ sv9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=jWSmhFAjgCJ/4MERZDdmV3HHdWRMsmmhbC6NHwQFBlg=; b=C96iSWgrcaWyz7WsagHpMl0tfbBt2J3BzmsCjEAw3zzqNzLeqSPYoTrMeZeig6fQU/ hYxqXC459ZG/WPvLCaNnsir7d3v+Km8xMUPBbWkKiftwfVaBjHHa4+NS8yyg05D4PZVw 6/7OOLAxGGBEGUIVnAjw7J0QimsoIWj7pwbttGCfJACKooUuGq5WepV4qkOM4hbFrdFM 1tG4Xt/6YniMXsjgQ0IMUaovxwEPiv/xR2IqzdG0FqC1vxx78FWhj+zcx7zsikrKIHnz UpPQM5CA/0OQcIApMLZQ6ro2kp+JDLMOhxp6EWrJc6H9eiQblOD+N0jzGoyZ8oZyPt4U 68XQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rb8Q+1dS; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m23si2057527ejk.664.2020.06.25.22.27.43; Thu, 25 Jun 2020 22:28:06 -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=@linaro.org header.s=google header.b=rb8Q+1dS; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727010AbgFZF1F (ORCPT + 99 others); Fri, 26 Jun 2020 01:27:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726082AbgFZF1E (ORCPT ); Fri, 26 Jun 2020 01:27:04 -0400 Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17C5CC08C5DB for ; Thu, 25 Jun 2020 22:27:04 -0700 (PDT) Received: by mail-lj1-x243.google.com with SMTP id b25so5383131ljp.6 for ; Thu, 25 Jun 2020 22:27:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jWSmhFAjgCJ/4MERZDdmV3HHdWRMsmmhbC6NHwQFBlg=; b=rb8Q+1dSzwKbczJC5klufjbDjum1q93zdZOH735pHh1ahl0p0Wjlgwz7/o0lxO2jxs Qf2E5FdecXLm4csarrYSzG97tKlHAZAwikBjrkkB8JyAte0JamXRvT3iIZ/QaXOEN8+x ar+vbtnyb4fgUOCQLQtZ5pcMBOIK9XkrfdELE5kUxx42alUIBef2Ny0mFjlNGcqncndB Y5yCF2b6L6Vany4DXOCVDwXSr/8xuxxXOY9RZRJ++3YlmBaBGq3YmB/enn7n9/NSlBU1 tBsRWmOpKPWCoabOLlsc4uDNLq5+ESq6j6476gVUQHGaUFF937Q3kgzUzwGQGXVsYfUa azyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=jWSmhFAjgCJ/4MERZDdmV3HHdWRMsmmhbC6NHwQFBlg=; b=SSkepc9TGnHPcOE0Sv95v+NIljBQV2CJUX0v8fW2WSuCAM26ZZcmgHbDSN7xqk0wSC bMMaEHUervdmImn27ew8wVirt8Ev7Cv2KnuWcKAp/BAy+Axo3eWgMZDI8qfEIswamgbX 7OOPgU5pESsyjenT0PJoB4KpIkfiw2udl3CTRmgaMwFpL2eZfqEkf/SgBoy12T1DLqVN SQv0zLnpCldkNn9VZyE2U4P/halFsmbMAvEoUOsf1JY1PxEvCKKBKl26fPHo9TyhXnv0 cOht70TZTtVp3ccVkn5u+AnOLHg4CADAn1gWl99R/7rejXdfv0xopbaqb4Oz6CEk28UG U0og== X-Gm-Message-State: AOAM5331sf6wn5f2bnAJHH7NdDcOrOqqG5SCZy2Qec97k/z8C0tOv3a+ uA5pooUyF4DFYy3GJfYdtqnLuQgu5ZsXahvnJ2ZEgQ== X-Received: by 2002:a2e:b04c:: with SMTP id d12mr511914ljl.256.1593149222348; Thu, 25 Jun 2020 22:27:02 -0700 (PDT) MIME-Version: 1.0 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> <3aa8705a-0342-25ea-00c4-d5370d91ddb4@forissier.org> In-Reply-To: From: Sumit Garg Date: Fri, 26 Jun 2020 10:56:50 +0530 Message-ID: Subject: Re: [Tee-dev] [PATCHv8 1/3] optee: use uuid for sysfs driver entry To: Maxim Uvarov Cc: Jerome Forissier , James Bottomley , 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 25 Jun 2020 at 18:22, Maxim Uvarov wrote: > > On Wed, 24 Jun 2020 at 18:44, Jerome Forissier wrote: > > > > > > > > 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 > > I think your description is correct. But I think this problem would > be solved outside of the current patchset. > All places should use one single format (LE): > - internal optee representation; > - device enumeration pta; > - this kernel driver which creates sysfs entry and sets > uid_copy(&optee_device->id.uuid, device_uuid); > - matching function; > - drivers use UUID_INIT(); > > In that way everything will be consistent. But it will require > changing other pieces, not just the kernel. While > these patches add functionality to support current device enumeration > in optee os. > So I think this version is ok to be applied. I guess here you meant v9 patch-set. If yes then it's fine with me as well. -Sumit > > Regards, > Maxim.