aboutsummaryrefslogtreecommitdiff
path: root/target-i386/mpx_helper.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2016-02-17 10:54:53 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2016-02-25 16:11:29 +0100
commitcfc3b074de4b4ccee2540edbf8cfdb026dc19943 (patch)
tree90583dfea43e624612f2c6ad9fecabf3213e2dfb /target-i386/mpx_helper.c
parent21a933ea33c820515f331c162c9f7053ca6f4129 (diff)
target-i386: fix confusion in xcr0 bit position vs. mask
The xsave and xrstor helpers are accessing the x86_ext_save_areas array using a bit mask instead of a bit position. Provide two sets of XSTATE_* definitions and use XSTATE_*_BIT when a bit position is requested. Reviewed-by: Richard Henderson <rth@twiddle.net> Acked-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'target-i386/mpx_helper.c')
-rw-r--r--target-i386/mpx_helper.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/target-i386/mpx_helper.c b/target-i386/mpx_helper.c
index 1bf717af05..8c6c2e7227 100644
--- a/target-i386/mpx_helper.c
+++ b/target-i386/mpx_helper.c
@@ -35,7 +35,7 @@ void cpu_sync_bndcs_hflags(CPUX86State *env)
}
if ((env->cr[4] & CR4_OSXSAVE_MASK)
- && (env->xcr0 & XSTATE_BNDCSR)
+ && (env->xcr0 & XSTATE_BNDCSR_MASK)
&& (bndcsr & BNDCFG_ENABLE)) {
hflags |= HF_MPX_EN_MASK;
} else {