[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 21/21] target/arm: Send interrupts on PMU cou
From: |
Aaron Lindsay |
Subject: |
Re: [Qemu-devel] [PATCH v4 21/21] target/arm: Send interrupts on PMU counter overflow |
Date: |
Wed, 18 Apr 2018 10:31:37 -0400 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Apr 17 16:38, Aaron Lindsay wrote:
> diff --git a/target/arm/helper.c b/target/arm/helper.c
> index 046e37c..2efdc63 100644
> --- a/target/arm/helper.c
> +++ b/target/arm/helper.c
> @@ -973,6 +986,11 @@ static uint64_t cycles_get_count(CPUARMState *env)
> }
>
> #ifndef CONFIG_USER_ONLY
> +static int64_t cycles_ns_per(uint64_t cycles)
> +{
> + return ARM_CPU_FREQ / NANOSECONDS_PER_SECOND;
> +}
This should be:
return (ARM_CPU_FREQ / NANOSECONDS_PER_SECOND) * cycles;
This took me a while to catch because it doesn't actually affect
functional correctness, but means QEMU slows down because the timer
callback is called every ns...
> @@ -1215,13 +1259,24 @@ void pmccntr_op_start(CPUARMState *env)
> void pmccntr_op_finish(CPUARMState *env)
> {
> if (pmu_counter_enabled(env, 31)) {
> - uint64_t prev_cycles = env->cp15.c15_ccnt_delta;
> +#ifndef CONFIG_USER_ONLY
> + uint64_t delta = ((env->cp15.c9_pmcr & PMCRLC) ?
> + UINT64_MAX : UINT32_MAX) - (uint32_t)env->cp15.c15_ccnt + 1;
I also shouldn't be casting to a uint32_t if PMCR.LC is set. I've fixed
these locally for the next round.
-Aaron
--
Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.
- [Qemu-devel] [PATCH v4 10/21] target/arm: Filter cycle counter based on PMCCFILTR_EL0, (continued)
- [Qemu-devel] [PATCH v4 10/21] target/arm: Filter cycle counter based on PMCCFILTR_EL0, Aaron Lindsay, 2018/04/17
- [Qemu-devel] [PATCH v4 14/21] target/arm: Implement PMOVSSET, Aaron Lindsay, 2018/04/17
- [Qemu-devel] [PATCH v4 18/21] target/arm: PMU: Set PMCR.N to 4, Aaron Lindsay, 2018/04/17
- [Qemu-devel] [PATCH v4 13/21] target/arm: Add ARM_FEATURE_V7VE for v7 Virtualization Extensions, Aaron Lindsay, 2018/04/17
- [Qemu-devel] [PATCH v4 17/21] target/arm: PMU: Add instruction and cycle events, Aaron Lindsay, 2018/04/17
- [Qemu-devel] [PATCH v4 15/21] target/arm: Add array for supported PMU events, generate PMCEID[01], Aaron Lindsay, 2018/04/17
- [Qemu-devel] [PATCH v4 19/21] target/arm: Implement PMSWINC, Aaron Lindsay, 2018/04/17
- [Qemu-devel] [PATCH v4 16/21] target/arm: Finish implementation of PM[X]EVCNTR and PM[X]EVTYPER, Aaron Lindsay, 2018/04/17
- [Qemu-devel] [PATCH v4 20/21] target/arm: Mark PMINTENSET accesses as possibly doing IO, Aaron Lindsay, 2018/04/17
- [Qemu-devel] [PATCH v4 21/21] target/arm: Send interrupts on PMU counter overflow, Aaron Lindsay, 2018/04/17
- Re: [Qemu-devel] [PATCH v4 21/21] target/arm: Send interrupts on PMU counter overflow,
Aaron Lindsay <=
- Re: [Qemu-devel] [PATCH v4 00/21] More fully implement ARM PMUv3, Peter Maydell, 2018/04/20