From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave Hansen Subject: Re: [PATCH v12 05/13] x86/sgx: architectural structures Date: Thu, 5 Jul 2018 08:31:42 -0700 Message-ID: References: <20180703182118.15024-1-jarkko.sakkinen@linux.intel.com> <20180703182118.15024-6-jarkko.sakkinen@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: In-Reply-To: <20180703182118.15024-6-jarkko.sakkinen@linux.intel.com> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org To: Jarkko Sakkinen , x86@kernel.org, platform-driver-x86@vger.kernel.org Cc: sean.j.christopherson@intel.com, nhorman@redhat.com, npmccallum@redhat.com, linux-sgx@vger.kernel.org, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , "open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)" List-Id: platform-driver-x86.vger.kernel.org On 07/03/2018 11:19 AM, Jarkko Sakkinen wrote: > +struct sgx_secs { > + uint64_t size; > + uint64_t base; > + uint32_t ssaframesize; > + uint32_t miscselect; > + uint8_t reserved1[SGX_SECS_RESERVED1_SIZE]; > + uint64_t attributes; > + uint64_t xfrm; > + uint32_t mrenclave[8]; > + uint8_t reserved2[SGX_SECS_RESERVED2_SIZE]; > + uint32_t mrsigner[8]; > + uint8_t reserved3[SGX_SECS_RESERVED3_SIZE]; > + uint16_t isvvprodid; > + uint16_t isvsvn; > + uint8_t reserved4[SGX_SECS_RESERVED4_SIZE]; > +} __packed __aligned(4096); Why are the uint* versions in use here? Those are for userspace ABI, but this is entirely for in-kernel-use, right? We've used u8/16/32/64 in arch code in a bunch of places. They're at least a bit more compact and easier to read. It's this: u8 foo; u64 bar; vs. this: uint8_t foo; uint64_t bar;