lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 05 Jul 2018 14:50:05 -0700
From:   hpa@...or.com
To:     Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>,
        Dave Hansen <dave.hansen@...el.com>
CC:     x86@...nel.org, platform-driver-x86@...r.kernel.org,
        sean.j.christopherson@...el.com, nhorman@...hat.com,
        npmccallum@...hat.com, linux-sgx@...r.kernel.org,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>,
        "open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)" 
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v12 05/13] x86/sgx: architectural structures

On July 5, 2018 1:09:12 PM PDT, Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com> wrote:
>On Thu, Jul 05, 2018 at 08:31:42AM -0700, Dave Hansen wrote:
>> 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;
>
>The reason was that with in-kernel LE these were in fact used by
>user space code. Now they can be changed to those that you
>suggested.
>
>/Jarkko

For things exported to user space use __u* and __s* types... the _t types would actually violate the C standard with respect to namespace pollution.
-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ