X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=target-i386%2Fcpu.c;h=e3f75a81a79c417b3283b4f4a4f1b450250625a7;hb=f290e4988dd8eb012de0517a1ff93df130e87da1;hp=762baadd4b5ffd27ffc96064a0b2f31ef65ff0ee;hpb=6b11322e0f724eb0649fdc324a44288b783023ad;p=qemu.git diff --git a/target-i386/cpu.c b/target-i386/cpu.c index 762baadd4..e3f75a81a 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -221,7 +221,7 @@ X86RegisterInfo32 x86_reg_info_32[CPU_NB_REGS32] = { const char *get_register_name_32(unsigned int reg) { - if (reg > CPU_NB_REGS32) { + if (reg >= CPU_NB_REGS32) { return NULL; } return x86_reg_info_32[reg].name; @@ -2175,11 +2175,6 @@ static void x86_cpu_reset(CPUState *s) CPUX86State *env = &cpu->env; int i; - if (qemu_loglevel_mask(CPU_LOG_RESET)) { - qemu_log("CPU Reset (CPU %d)\n", s->cpu_index); - log_cpu_state(env, CPU_DUMP_FPU | CPU_DUMP_CCOP); - } - xcc->parent_reset(s); @@ -2392,7 +2387,6 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp) #endif mce_init(cpu); - qemu_init_vcpu(&cpu->env); x86_cpu_apic_realize(cpu, &local_err); if (local_err != NULL) { @@ -2505,6 +2499,13 @@ static int64_t x86_cpu_get_arch_id(CPUState *cs) return env->cpuid_apic_id; } +static bool x86_cpu_get_paging_enabled(const CPUState *cs) +{ + X86CPU *cpu = X86_CPU(cs); + + return cpu->env.cr[0] & CR0_PG_MASK; +} + static void x86_cpu_common_class_init(ObjectClass *oc, void *data) { X86CPUClass *xcc = X86_CPU_CLASS(oc); @@ -2517,17 +2518,20 @@ static void x86_cpu_common_class_init(ObjectClass *oc, void *data) xcc->parent_reset = cc->reset; cc->reset = x86_cpu_reset; + cc->reset_dump_flags = CPU_DUMP_FPU | CPU_DUMP_CCOP; cc->do_interrupt = x86_cpu_do_interrupt; + cc->dump_state = x86_cpu_dump_state; + cc->get_arch_id = x86_cpu_get_arch_id; + cc->get_paging_enabled = x86_cpu_get_paging_enabled; #ifndef CONFIG_USER_ONLY + cc->get_memory_mapping = x86_cpu_get_memory_mapping; cc->write_elf64_note = x86_cpu_write_elf64_note; cc->write_elf64_qemunote = x86_cpu_write_elf64_qemunote; cc->write_elf32_note = x86_cpu_write_elf32_note; cc->write_elf32_qemunote = x86_cpu_write_elf32_qemunote; #endif cpu_class_set_vmsd(cc, &vmstate_x86_cpu); - - cc->get_arch_id = x86_cpu_get_arch_id; } static const TypeInfo x86_cpu_type_info = {