x86/fpu/mpx: Rework MPX 'xstate' types
MPX includes two separate "extended state components". There is no real need to have an 'mpx_struct' because we never really manage the states together. We also separate out the actual data in 'mpx_bndcsr_state' from the padding. We will shortly be checking the state sizes against our structures and need them to match. For consistency, we also ensure to prefix these types with 'mpx_'. Lastly, we add some comments to mirror some of the descriptions in the Intel documents (SDM) of the various state components. Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com> Cc: Andy Lutomirski <luto@amacapital.net> Cc: Borislav Petkov <bp@alien8.de> Cc: Brian Gerst <brgerst@gmail.com> Cc: Denys Vlasenko <dvlasenk@redhat.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Tim Chen <tim.c.chen@linux.intel.com> Cc: dave@sr71.net Cc: linux-kernel@vger.kernel.org Link: http://lkml.kernel.org/r/20150902233129.384B73EB@viggo.jf.intel.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
@@ -141,20 +141,37 @@ struct ymmh_struct {
|
||||
};
|
||||
|
||||
/* Intel MPX support: */
|
||||
struct bndreg {
|
||||
|
||||
struct mpx_bndreg {
|
||||
u64 lower_bound;
|
||||
u64 upper_bound;
|
||||
} __packed;
|
||||
/*
|
||||
* State component 3 is used for the 4 128-bit bounds registers
|
||||
*/
|
||||
struct mpx_bndreg_state {
|
||||
struct mpx_bndreg bndreg[4];
|
||||
} __packed;
|
||||
|
||||
struct bndcsr {
|
||||
/*
|
||||
* State component 4 is used for the 64-bit user-mode MPX
|
||||
* configuration register BNDCFGU and the 64-bit MPX status
|
||||
* register BNDSTATUS. We call the pair "BNDCSR".
|
||||
*/
|
||||
struct mpx_bndcsr {
|
||||
u64 bndcfgu;
|
||||
u64 bndstatus;
|
||||
} __packed;
|
||||
|
||||
struct mpx_struct {
|
||||
struct bndreg bndreg[4];
|
||||
struct bndcsr bndcsr;
|
||||
};
|
||||
/*
|
||||
* The BNDCSR state is padded out to be 64-bytes in size.
|
||||
*/
|
||||
struct mpx_bndcsr_state {
|
||||
union {
|
||||
struct mpx_bndcsr bndcsr;
|
||||
u8 pad_to_64_bytes[64];
|
||||
};
|
||||
} __packed;
|
||||
|
||||
struct xstate_header {
|
||||
u64 xfeatures;
|
||||
|
Reference in New Issue
Block a user