mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
x86: reduce magic number usage in XSAVE code
Signed-off-by: Wei Gang <gang.wei@intel.com>
This commit is contained in:
1 parent
76bb33a03e
commit
aa479ce9d1
3 files changed
+3
-3
No files matched your search
@@ -2223,7 +2223,7 @@ void hvm_cpuid(unsigned int input, unsigned int *eax, unsigned int *ebx,
|
||||
if ( count == 0 && v->arch.xcr0 )
|
||||
{
|
||||
/* reset EBX to default value first */
|
||||
*ebx = 576;
|
||||
*ebx = XSAVE_AREA_MIN_SIZE;
|
||||
for ( sub_leaf = 2; sub_leaf < 64; sub_leaf++ )
|
||||
{
|
||||
if ( !(v->arch.xcr0 & (1ULL << sub_leaf)) )
|
||||
|
||||
@@ -221,7 +221,6 @@ static void restore_fpu(struct vcpu *v)
|
||||
}
|
||||
|
||||
#define XSTATE_CPUID 0xd
|
||||
#define XSAVE_AREA_MIN_SIZE (512 + 64) /* FP/SSE + XSAVE.HEADER */
|
||||
|
||||
/*
|
||||
* Maximum size (in byte) of the XSAVE/XRSTOR save area required by all
|
||||
|
||||
@@ -21,13 +21,14 @@ void xsave_init(void);
|
||||
int xsave_alloc_save_area(struct vcpu *v);
|
||||
void xsave_free_save_area(struct vcpu *v);
|
||||
|
||||
#define XSAVE_AREA_MIN_SIZE (512 + 64) /* FP/SSE + XSAVE.HEADER */
|
||||
#define XSTATE_FP (1ULL << 0)
|
||||
#define XSTATE_SSE (1ULL << 1)
|
||||
#define XSTATE_YMM (1ULL << 2)
|
||||
#define XSTATE_LWP (1ULL << 62) /* AMD lightweight profiling */
|
||||
#define XSTATE_FP_SSE (XSTATE_FP | XSTATE_SSE)
|
||||
#define XCNTXT_MASK (XSTATE_FP | XSTATE_SSE | XSTATE_YMM | XSTATE_LWP)
|
||||
#define XSTATE_YMM_OFFSET (512 + 64)
|
||||
#define XSTATE_YMM_OFFSET XSAVE_AREA_MIN_SIZE
|
||||
#define XSTATE_YMM_SIZE 256
|
||||
#define XSAVEOPT (1 << 0)
|
||||
|
||||
|
||||