Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1237578

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

From Dave Hansen <dave@sr71.net>
Newsgroups linux.kernel
Subject Re: [PATCH 05/25] x86, pkey: add PKRU xsave fields and data structure(s)
Date 2015-10-01 19:20 +0200
Message-ID <qePGp-2Bk-11@gated-at.bofh.it> (permalink)
References <qdM7T-59-3@gated-at.bofh.it> <qdMhz-gH-5@gated-at.bofh.it> <qeKGL-383-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH 05/25] x86, pkey: add PKRU xsave fields and data structure(s) Dave Hansen <dave@sr71.net> - 2015-09-28 21:30 +0200
  Re: [PATCH 05/25] x86, pkey: add PKRU xsave fields and data  structure(s) Thomas Gleixner <tglx@linutronix.de> - 2015-10-01 14:00 +0200
    Re: [PATCH 05/25] x86, pkey: add PKRU xsave fields and data  structure(s) Dave Hansen <dave@sr71.net> - 2015-10-01 19:20 +0200

csiph-web