Re: [PATCH 05/25] x86, pkey: add PKRU xsave fields and data structure(s)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/01/2015 04:50 AM, Thomas Gleixner wrote:
> On Mon, 28 Sep 2015, Dave Hansen wrote:
>> +/*
>> + * State component 9: 32-bit PKRU register.
>> + */
>> +struct pkru {
>> +	u32 pkru;
>> +} __packed;
>> +
>> +struct pkru_state {
>> +	union {
>> +		struct pkru		pkru;
>> +		u8			pad_to_8_bytes[8];
>> +	};
> 
> Why do you need two structs?
> 
>     struct pkru_state {
>     	   u32 pkru;
> 	   u32 pad;
>     }
> 
> should be sufficient. So instead of
> 
>        xsave.pkru_state.pkru.pkru
> 
> you get the more obvious
> 
>        xsave.pkru_state.pkru
> 
> Hmm?

I was trying to get across that PKRU itself and the "PKRU state" are
differently-sized.

But, it does just end up looking funky if we _use_ it.  I'll fix it up.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]