aboutsummaryrefslogtreecommitdiff
path: root/target-i386/mpx_helper.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2015-07-07 14:38:58 +0100
committerRichard Henderson <rth@twiddle.net>2016-02-15 14:50:00 +1100
commit7d117ce81ef6258cdcc0d24c774d045fa4b5fd26 (patch)
tree527dc8dd09070f575ed06e0677e5e3b9cf206f4a /target-i386/mpx_helper.c
parentbdd87b3b591add6e4d7c6b6125fcf0d706cc8bc4 (diff)
target-i386: Clear bndregs during legacy near jumps
Signed-off-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'target-i386/mpx_helper.c')
-rw-r--r--target-i386/mpx_helper.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/target-i386/mpx_helper.c b/target-i386/mpx_helper.c
index 53d98347d9..1bf717af05 100644
--- a/target-i386/mpx_helper.c
+++ b/target-i386/mpx_helper.c
@@ -156,3 +156,11 @@ void helper_bndstx32(CPUX86State *env, target_ulong base, target_ulong ptr,
cpu_stl_data_ra(env, bte + 4, ub, ra);
cpu_stl_data_ra(env, bte + 8, ptr, ra);
}
+
+void helper_bnd_jmp(CPUX86State *env)
+{
+ if (!(env->hflags2 & HF2_MPX_PR_MASK)) {
+ memset(env->bnd_regs, 0, sizeof(env->bnd_regs));
+ env->hflags &= ~HF_MPX_IU_MASK;
+ }
+}