target-i386: Update BNDSTATUS for exceptions raised by BOUND

Backports commit 75d14edcf5fd9d5bb614554539799abaaeab3166 from qemu
This commit is contained in:
Richard Henderson 2018-02-20 14:23:59 -05:00 committed by Lioncash
parent 554c41f05f
commit a02626afe7
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -91,6 +91,9 @@ void helper_boundw(CPUX86State *env, target_ulong a0, int v)
high = cpu_ldsw_data_ra(env, a0 + 2, GETPC());
v = (int16_t)v;
if (v < low || v > high) {
if (env->hflags & HF_MPX_EN_MASK) {
env->bndcs_regs.sts = 0;
}
raise_exception_ra(env, EXCP05_BOUND, GETPC());
}
}
@ -102,6 +105,9 @@ void helper_boundl(CPUX86State *env, target_ulong a0, int v)
low = cpu_ldl_data_ra(env, a0, GETPC());
high = cpu_ldl_data_ra(env, a0 + 4, GETPC());
if (v < low || v > high) {
if (env->hflags & HF_MPX_EN_MASK) {
env->bndcs_regs.sts = 0;
}
raise_exception_ra(env, EXCP05_BOUND, GETPC());
}
}