From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:4864:20::442; helo=mail-wr1-x442.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id A90BB21173C65 for ; Thu, 18 Oct 2018 01:34:16 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id q7-v6so4800006wrr.8 for ; Thu, 18 Oct 2018 01:34:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=p9JsLEa6pidotSgb2+MPqy4PtafLiH4eKtnkcnHpqUo=; b=YDItgm0Ufbj5NQLPuJtHUp5raOVuBR89pedJBp8HFohZzEfNyWOsmLt3rN4sNxiamF C2WsNQyv3yaIdTKUa9lxQjcDTrriA31uAP4LF9B6FNti+uIXWOvnZ6+lCLJDdHx5ER06 +jfzDCA37Igw4CofaxrRS/CIykLguShrmPHhE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=p9JsLEa6pidotSgb2+MPqy4PtafLiH4eKtnkcnHpqUo=; b=Q50tBl7DXwxaveVWn5nQB09x3Ac4Fym2S7KhPW0xbP+/MjK5haNtCbDN2OlkFJH2ZC jE+F6/rWgqD9FEg78cLk2jky3iBkp4wJZtzCMstm2/VU8gD8HHgUX7j+YDoCL+03jmEd Kc4pFvtAHTAzOrjzF6xqZjAh2sFo8vUR1JygOsAU3GlUvZFu3p9XHntgy3ZeY/sQlNQ/ Fs7fSPO8kojVfUwHW02zsYtdEff370Vdkt8NGRlDOlB3MKiksRRbh8bCPdliSYZkUd0b P44TzKjrlnj3uwTySqbMbWiersls06HK60JsC3pBhQNYeUn60/L7t1SsshEMDpeYhZTg cENw== X-Gm-Message-State: ABuFfoj5ua79+38u6PeCto05kYGZjujO7K8rRRbNvk86KVKLg2h7X24U FZjiPD0y4Oi/CxWh0CtvbveGVA== X-Google-Smtp-Source: ACcGV62cm1QJd81R8BmkAK+QLfqxqLScUXsdOqcalnZEGFJZEscPUUFWePeCcOW/fXEc8SnMmDghWQ== X-Received: by 2002:adf:8103:: with SMTP id 3-v6mr26729226wrm.106.1539851654315; Thu, 18 Oct 2018 01:34:14 -0700 (PDT) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id u5-v6sm21334919wru.16.2018.10.18.01.34.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 18 Oct 2018 01:34:13 -0700 (PDT) Date: Thu, 18 Oct 2018 09:34:11 +0100 From: Leif Lindholm To: Sumit Garg Cc: edk2-devel@lists.01.org, Ard Biesheuvel , Michael D Kinney , tee-dev@lists.linaro.org, Daniel Thompson , Joakim Bech , Matteo.Carlini@arm.com, Achin.Gupta@arm.com, udit.kumar@nxp.com Message-ID: <20181018083411.iplsdsrrswvuhacl@bivouac.eciton.net> References: <1539148733-5426-1-git-send-email-sumit.garg@linaro.org> <1539148733-5426-2-git-send-email-sumit.garg@linaro.org> <20181018062343.w3343srhcq4dv65p@bivouac.eciton.net> MIME-Version: 1.0 In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [PATCH v4 1/1] ArmPkg/OpteeLib: Add APIs to communicate with OP-TEE X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2018 08:34:17 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Oct 18, 2018 at 12:59:32PM +0530, Sumit Garg wrote: > > So, looking at the OpTee sources, TEE_UUID is defined as a struct, to > > exactly the same layout as the EFI_GUID type (which is a typedef of > > the GUID struct). Could we add a OPTEE_UUID typedef for the same > > struct in OpteeLib.h? > > > > Since it comes in as an OPTEE_MESSAGE_PARAM_VALUE, alignment is > > already guaranteed to be 64-bit. > > > > (This also deserves a comment explaining how EFI_GUID basically > > follows rfc4122, but uses little-endian for the timestamp fields.) > > Actually, OP-TEE also uses little-endian format for timestamp fields. > You can refer to [1] for conversion from network byte order (octets) > to little-endian and vice-versa. > > So for communications among secure world and non-secure world it uses > network byte order for UUID/GUID to comply with rfc4122. > > [1] https://github.com/OP-TEE/optee_os/blob/master/core/tee/uuid.c Huh, ok. That's good to know. It does however not change my comments. Since we're dealing with data structures of a known layout, I am not a fan of treating them as byte arrays. / Leif