Skip to content
Snippets Groups Projects
Commit 1852f094 authored by Claudio Fontana's avatar Claudio Fontana Committed by Paolo Bonzini
Browse files

target/i386: gdbstub: only write CR0/CR2/CR3/EFER for sysemu


Signed-off-by: default avatarClaudio Fontana <cfontana@suse.de>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
Message-Id: <20210322132800.7470-21-cfontana@suse.de>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 4d81e285
No related branches found
No related tags found
No related merge requests found
......@@ -351,22 +351,30 @@ int x86_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
case IDX_CTL_CR0_REG:
len = gdb_write_reg_cs64(env->hflags, mem_buf, &tmp);
#ifndef CONFIG_USER_ONLY
cpu_x86_update_cr0(env, tmp);
#endif
return len;
case IDX_CTL_CR2_REG:
len = gdb_write_reg_cs64(env->hflags, mem_buf, &tmp);
#ifndef CONFIG_USER_ONLY
env->cr[2] = tmp;
#endif
return len;
case IDX_CTL_CR3_REG:
len = gdb_write_reg_cs64(env->hflags, mem_buf, &tmp);
#ifndef CONFIG_USER_ONLY
cpu_x86_update_cr3(env, tmp);
#endif
return len;
case IDX_CTL_CR4_REG:
len = gdb_write_reg_cs64(env->hflags, mem_buf, &tmp);
#ifndef CONFIG_USER_ONLY
cpu_x86_update_cr4(env, tmp);
#endif
return len;
case IDX_CTL_CR8_REG:
......@@ -378,7 +386,9 @@ int x86_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
case IDX_CTL_EFER_REG:
len = gdb_write_reg_cs64(env->hflags, mem_buf, &tmp);
#ifndef CONFIG_USER_ONLY
cpu_load_efer(env, tmp);
#endif
return len;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment