|
From: | Richard Henderson |
Subject: | Re: [PATCH v12 2/5] target/ppc: make power8-pmu.c CONFIG_TCG only |
Date: | Fri, 18 Feb 2022 09:17:09 +1100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 |
On 2/16/22 21:10, Daniel Henrique Barboza wrote:
static void init_tcg_pmu_power8(CPUPPCState *env) { -#if defined(TARGET_PPC64) && !defined(CONFIG_USER_ONLY) +#if defined(CONFIG_TCG) /* Init PMU overflow timers */ if (!kvm_enabled()) { cpu_ppc_pmu_init(env); @@ -7872,10 +7872,9 @@ static void ppc_cpu_reset(DeviceState *dev) if (env->mmu_model != POWERPC_MMU_REAL) { ppc_tlb_invalidate_all(env); } + pmu_update_summaries(env); #endif /* CONFIG_TCG */ #endif - - pmu_update_summaries(env);
It looks like you could remove all of the ifdefs if you simply use tcg_enabled() rather than !kvm_enabled(). If !defined(CONFIG_TCG), tcg_enabled() will be constant false, and the block will be optimized away.
r~
[Prev in Thread] | Current Thread | [Next in Thread] |