From d23c2a613df47d68d9ec3988f4eaf4c804501b6e Mon Sep 17 00:00:00 2001 From: OBattler Date: Fri, 24 May 2024 00:10:04 +0200 Subject: [PATCH] 286/386 interpreter: reinstall VM_FLAG check on accessin the debug registers. --- src/cpu/x86_ops_mov_ctrl_2386.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cpu/x86_ops_mov_ctrl_2386.h b/src/cpu/x86_ops_mov_ctrl_2386.h index cae6c9957..6bb00d8da 100644 --- a/src/cpu/x86_ops_mov_ctrl_2386.h +++ b/src/cpu/x86_ops_mov_ctrl_2386.h @@ -82,7 +82,7 @@ opMOV_r_CRx_a32(uint32_t fetchdat) static int opMOV_r_DRx_a16(uint32_t fetchdat) { - if ((CPL > 0) && (cr0 & 1)) { + if (((CPL > 0) || (cpu_state.eflags & VM_FLAG)) && (cr0 & 1)) { x86gpf(NULL, 0); return 1; } @@ -124,7 +124,7 @@ opMOV_r_DRx_a16(uint32_t fetchdat) static int opMOV_r_DRx_a32(uint32_t fetchdat) { - if ((CPL > 0) && (cr0 & 1)) { + if (((CPL > 0) || (cpu_state.eflags & VM_FLAG)) && (cr0 & 1)) { x86gpf(NULL, 0); return 1; } @@ -282,7 +282,7 @@ opMOV_CRx_r_a32(uint32_t fetchdat) static int opMOV_DRx_r_a16(uint32_t fetchdat) { - if ((CPL > 0) && (cr0 & 1)) { + if (((CPL > 0) || (cpu_state.eflags & VM_FLAG)) && (cr0 & 1)) { x86gpf(NULL, 0); return 1; } @@ -325,7 +325,7 @@ opMOV_DRx_r_a16(uint32_t fetchdat) static int opMOV_DRx_r_a32(uint32_t fetchdat) { - if ((CPL > 0) && (cr0 & 1)) { + if (((CPL > 0) || (cpu_state.eflags & VM_FLAG)) && (cr0 & 1)) { x86gpf(NULL, 0); return 1; }