qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 08/19] target/ppc/pmu_book3s_helper.c: do an actual cycles ca


From: Richard Henderson
Subject: Re: [PATCH 08/19] target/ppc/pmu_book3s_helper.c: do an actual cycles calculation
Date: Tue, 10 Aug 2021 14:34:57 -1000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0

On 8/9/21 3:10 AM, Daniel Henrique Barboza wrote:
+/*
+ * Set arbitrarily based on clock-frequency values used in PNV
+ * and SPAPR code.
+ */
+#define PPC_CPU_FREQ 1000000000
static uint64_t get_cycles(uint64_t icount_delta)
  {
-    /* Placeholder value */
-    return icount_delta * 4;
+    return muldiv64(icount_to_ns(icount_delta), PPC_CPU_FREQ,
+                    NANOSECONDS_PER_SECOND);

So, unless you're going to do something real, you might as well just return icount_to_ns, and skip all of the no-op scaling.


r~



reply via email to

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