qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v12 2/5] target/ppc: make power8-pmu.c CONFIG_TCG only


From: Daniel Henrique Barboza
Subject: Re: [PATCH v12 2/5] target/ppc: make power8-pmu.c CONFIG_TCG only
Date: Thu, 24 Feb 2022 17:14:01 -0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0



On 2/17/22 19:17, Richard Henderson wrote:
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.


Just tested and it works. Thanks for the tip.

I'll re-send with this change.


Thanks,


Daniel



r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]