From cf40e63b87bf25aef8899f0337beb0f200bac868 Mon Sep 17 00:00:00 2001 From: Stanislav Shwartsman Date: Mon, 29 Jan 2024 19:40:21 +0200 Subject: [PATCH] XRSTOR: correct 'format' for case compaction is not enabled --- bochs/cpu/xsave.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bochs/cpu/xsave.cc b/bochs/cpu/xsave.cc index 35c19fe77..03aafc6f4 100644 --- a/bochs/cpu/xsave.cc +++ b/bochs/cpu/xsave.cc @@ -339,7 +339,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::XRSTOR(bxInstruction_c *i) } Bit32u requested_feature_bitmap = xcr0 & EAX; - Bit64u format = xcomp_bv & ~XSAVEC_COMPACTION_ENABLED; + Bit64u format = (compaction) ? (xcomp_bv & ~XSAVEC_COMPACTION_ENABLED) : (~XSAVEC_COMPACTION_ENABLED); Bit32u restore_mask = xstate_bv & format; /////////////////////////////////////////////////////////////////////////////