Commit 489e9c01 authored by Ingo Molnar's avatar Ingo Molnar
Browse files

x86/fpu: Clean up xstate feature reservation



Put MPX support into its separate high level structure, and
also replace the fixed YMM, LWP and MPX structures in
xregs_state with just reservations - their exact offsets
in the structure will depend on the CPU and no code actually
relies on those fields.

No change in functionality.

Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 39f1acd2
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -145,12 +145,21 @@ struct bndcsr {
	u64				bndstatus;
} __packed;

struct mpx_struct {
	struct bndreg			bndreg[4];
	struct bndcsr			bndcsr;
};

struct xstate_header {
	u64				xfeatures;
	u64				xcomp_bv;
	u64				reserved[6];
} __attribute__((packed));

/* New processor state extensions should be added here: */
#define XSTATE_RESERVE			(sizeof(struct ymmh_struct) + \
					 sizeof(struct lwp_struct)  + \
					 sizeof(struct mpx_struct)  )
/*
 * This is our most modern FPU state format, as saved by the XSAVE
 * and restored by the XRSTOR instructions.
@@ -162,11 +171,7 @@ struct xstate_header {
struct xregs_state {
	struct fxregs_state		i387;
	struct xstate_header		header;
	struct ymmh_struct		ymmh;
	struct lwp_struct		lwp;
	struct bndreg			bndreg[4];
	struct bndcsr			bndcsr;
	/* New processor state extensions will go here. */
	u8				__reserved[XSTATE_RESERVE];
} __attribute__ ((packed, aligned (64)));

/*