Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
target/i386/helper: Shuffle do_cpu_init()
Move the #ifdef'ry inside do_cpu_init() instead of
declaring an empty stub for user emulation.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230602224628.59546-3-philmd@linaro.org>
  • Loading branch information
philmd committed Jun 13, 2023
1 parent 3b8484c commit 6d70b36
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions target/i386/helper.c
Expand Up @@ -580,9 +580,9 @@ int cpu_x86_get_descr_debug(CPUX86State *env, unsigned int selector,
return 1;
}

#if !defined(CONFIG_USER_ONLY)
void do_cpu_init(X86CPU *cpu)
{
#if !defined(CONFIG_USER_ONLY)
CPUState *cs = CPU(cpu);
CPUX86State *env = &cpu->env;
CPUX86State *save = g_new(CPUX86State, 1);
Expand All @@ -601,19 +601,15 @@ void do_cpu_init(X86CPU *cpu)
kvm_arch_do_init_vcpu(cpu);
}
apic_init_reset(cpu->apic_state);
#endif /* CONFIG_USER_ONLY */
}

#ifndef CONFIG_USER_ONLY

void do_cpu_sipi(X86CPU *cpu)
{
apic_sipi(cpu->apic_state);
}
#else
void do_cpu_init(X86CPU *cpu)
{
}
#endif

#ifndef CONFIG_USER_ONLY

void cpu_load_efer(CPUX86State *env, uint64_t val)
{
Expand Down

0 comments on commit 6d70b36

Please sign in to comment.