From ee8c9123070c9e57a3b7160c6050e87c3af8ba7a Mon Sep 17 00:00:00 2001 From: kanren3 <760917197@qq.com> Date: Sun, 22 Sep 2024 02:07:40 +0800 Subject: [PATCH] Fix the incorrect write to CR3 in the RSM instruction emulation. --- arch/x86/kvm/emulate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 3fd7a76..6ff0caf 100755 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -2572,7 +2572,7 @@ static int rsm_load_state_64(struct x86_emulate_ctxt *ctxt, u64 smbase) GET_SMSTATE(u64, smbase, 0x7f58, cr0); GET_SMSTATE(u64, smbase, 0x7f50, temp64); - ctxt->ops->set_cr(ctxt, 3, temp); + ctxt->ops->set_cr(ctxt, 3, temp64); GET_SMSTATE(u64, smbase, 0x7f48, cr4); GET_SMSTATE(u32, smbase, 0x7f00, temp); ctxt->ops->set_smbase(ctxt, temp);