diff options
author | Claudio Fontana | 2021-03-22 14:27:56 +0100 |
---|---|---|
committer | Paolo Bonzini | 2021-05-10 21:41:52 +0200 |
commit | 1852f0942c815d07f9a07d1006c17570862f517e (patch) | |
tree | 510c818eef0aeacb81b1c986628e7677bc620cdf | |
parent | target/i386: gdbstub: introduce aux functions to read/write CS64 regs (diff) | |
download | qemu-1852f0942c815d07f9a07d1006c17570862f517e.tar.gz qemu-1852f0942c815d07f9a07d1006c17570862f517e.tar.xz qemu-1852f0942c815d07f9a07d1006c17570862f517e.zip |
target/i386: gdbstub: only write CR0/CR2/CR3/EFER for sysemu
Signed-off-by: Claudio Fontana <cfontana@suse.de>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20210322132800.7470-21-cfontana@suse.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r-- | target/i386/gdbstub.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/target/i386/gdbstub.c b/target/i386/gdbstub.c index 4ad1295425..098a2ad15a 100644 --- a/target/i386/gdbstub.c +++ b/target/i386/gdbstub.c @@ -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; } } |