target/i386: update MPX flags when CPL changes

Backports commit 5e76d84e690954d79af357fafb1903113a00b32e from qemu
This commit is contained in:
Paolo Bonzini 2018-08-25 03:32:14 -04:00 committed by Lioncash
parent e4b66a0ef3
commit 85303e3caf
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -1435,6 +1435,8 @@ int cpu_x86_support_mca_broadcast(CPUX86State *env);
int cpu_get_pic_interrupt(CPUX86State *s);
/* MSDOS compatibility mode FPU exception support */
void cpu_set_ferr(CPUX86State *s);
/* mpx_helper.c */
void cpu_sync_bndcs_hflags(CPUX86State *env);
/* this function must always be used to load data in the segment
cache: it synchronizes the hflags with the segment cache values */
@ -1477,6 +1479,8 @@ static inline void cpu_x86_load_seg_cache(CPUX86State *env,
#error HF_CPL_MASK is hardcoded
#endif
env->hflags = (env->hflags & ~HF_CPL_MASK) | cpl;
/* Possibly switch between BNDCFGS and BNDCFGU */
cpu_sync_bndcs_hflags(env);
}
new_hflags = (env->segs[R_SS].flags & DESC_B_MASK)
>> (DESC_B_SHIFT - HF_SS32_SHIFT);
@ -1792,9 +1796,6 @@ void cpu_report_tpr_access(CPUX86State *env, TPRAccess access);
void x86_cpu_compat_kvm_no_autoenable(FeatureWord w, uint32_t features);
void x86_cpu_compat_kvm_no_autodisable(FeatureWord w, uint32_t features);
/* mpx_helper.c */
void cpu_sync_bndcs_hflags(CPUX86State *env);
/* Return name of 32-bit register, from a R_* constant */
const char *get_register_name_32(unsigned int reg);