[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v6 11/14] target/arm: PMU: Add instruction and c
From: |
Aaron Lindsay |
Subject: |
Re: [Qemu-devel] [PATCH v6 11/14] target/arm: PMU: Add instruction and cycle events |
Date: |
Wed, 17 Oct 2018 19:47:56 +0000 |
On Oct 16 17:04, Richard Henderson wrote:
> On 10/10/18 1:37 PM, Aaron Lindsay wrote:
> > + * Return the underlying cycle count for the PMU cycle counters. If we're
> > in
> > + * usermode, simply return 0.
> > + */
> > +static uint64_t cycles_get_count(CPUARMState *env)
> > +{
> > +#ifndef CONFIG_USER_ONLY
> > + return muldiv64(qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL),
> > + ARM_CPU_FREQ, NANOSECONDS_PER_SECOND);
> > +#else
> > + return 0;
> > +#endif
> > +}
>
> Usually we pass through the host cycle counter.
> See cpu_get_host_ticks().
Why do you prefer cpu_get_host_ticks()? And are you suggesting this for
just user-mode, or both system and user?
PMCCNTR used this same qemu_clock_get_ns() call previous to my patch
(see where this patch replaces that call with one to cycles_get_count()
in pmccntr_op_start()). Of course, we could keep the preexisting PMCCNTR
behavior while making the new cycle counter use cpu_get_host_ticks(),
but having two ways through the same interface which count cycles
differently feels wrong.
-Aaron
- [Qemu-devel] [PATCH v6 12/14] target/arm: PMU: Set PMCR.N to 4, (continued)
- [Qemu-devel] [PATCH v6 12/14] target/arm: PMU: Set PMCR.N to 4, Aaron Lindsay, 2018/10/10
- Re: [Qemu-devel] [PATCH v6 12/14] target/arm: PMU: Set PMCR.N to 4, Richard Henderson, 2018/10/16
- Re: [Qemu-devel] [PATCH v6 12/14] target/arm: PMU: Set PMCR.N to 4, Aaron Lindsay, 2018/10/17
- Re: [Qemu-devel] [PATCH v6 12/14] target/arm: PMU: Set PMCR.N to 4, Richard Henderson, 2018/10/17
- Re: [Qemu-devel] [PATCH v6 12/14] target/arm: PMU: Set PMCR.N to 4, Aaron Lindsay, 2018/10/17
- Re: [Qemu-devel] [PATCH v6 12/14] target/arm: PMU: Set PMCR.N to 4, Richard Henderson, 2018/10/17
- Re: [Qemu-devel] [PATCH v6 12/14] target/arm: PMU: Set PMCR.N to 4, Peter Maydell, 2018/10/18
[Qemu-devel] [PATCH v6 14/14] target/arm: Send interrupts on PMU counter overflow, Aaron Lindsay, 2018/10/10
[Qemu-devel] [PATCH v6 11/14] target/arm: PMU: Add instruction and cycle events, Aaron Lindsay, 2018/10/10
[Qemu-devel] [PATCH v6 10/14] target/arm: Finish implementation of PM[X]EVCNTR and PM[X]EVTYPER, Aaron Lindsay, 2018/10/10
[Qemu-devel] [PATCH v6 13/14] target/arm: Implement PMSWINC, Aaron Lindsay, 2018/10/10
Re: [Qemu-devel] [PATCH v6 00/14] More fully implement ARM PMUv3, Peter Maydell, 2018/10/16