]> Git Repo - qemu.git/blobdiff - target-i386/mpx_helper.c
block: Introduce blk_set_allow_write_beyond_eof()
[qemu.git] / target-i386 / mpx_helper.c
index 53d98347d9631713433d91f4a4b039671627596b..4d1785ecefd86a0dbb1e307bd58e808390d2198b 100644 (file)
@@ -17,6 +17,7 @@
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "qemu/osdep.h"
 #include "cpu.h"
 #include "exec/helper-proto.h"
 #include "exec/cpu_ldst.h"
@@ -35,7 +36,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 {
@@ -156,3 +157,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;
+    }
+}
This page took 0.02102 seconds and 4 git commands to generate.