All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christopher Covington <cov@codeaurora.org>
To: Alistair Francis <alistair.francis@xilinx.com>
Cc: peter.maydell@linaro.org, peter.crosthwaite@xilinx.com,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v1 3/7] target-arm: Add helper macros and defines for CCNT register
Date: Tue, 24 Jun 2014 11:31:08 -0400	[thread overview]
Message-ID: <53A999BC.80806@codeaurora.org> (raw)
In-Reply-To: <b4e670073fafcbac2239e3e58b55d4f11fee39ca.1403572003.git.alistair.francis@xilinx.com>

Hi Alistair,

On 06/23/2014 09:12 PM, Alistair Francis wrote:
> Include a helper function to determine if the CCNT counter
> is enabled as well as the constants used to mask the pmccfiltr_el0
> register.
> 
> Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
> ---
> 
>  target-arm/cpu.h |   19 +++++++++++++++++++
>  1 files changed, 19 insertions(+), 0 deletions(-)
> 
> diff --git a/target-arm/cpu.h b/target-arm/cpu.h
> index 6a2efd8..31aa09c 100644
> --- a/target-arm/cpu.h
> +++ b/target-arm/cpu.h
> @@ -111,6 +111,25 @@ typedef struct ARMGenericTimer {
>  #define GTIMER_VIRT 1
>  #define NUM_GTIMERS 2
>  
> +#ifndef CONFIG_USER_ONLY
> +    /* Definitions for the PMCCFILTR_EL0 and PMXEVTYPER registers */
> +    #define PMCP 0x80000000
> +    #define PMCU 0x40000000

These names are very similar to what one might use for the PMCR, which has its
P bit somewhere completely different. A prefix derived from PMXEVTYPER might
be clearer.

> +    /* This implements the PMCCFILTR_EL0:P and U bits; the PMXEVTYPER:P and U
> +     * bits and the c9_pmcr:E bit.
> +     *
> +     * It does not suppor the secure/non-secure componenets of the

Nit: support, components

> +     * PMCCFILTR_EL0 register
> +     */
> +    #define CCNT_ENABLED(env) \
> +        ((env->cp15.c9_pmcr & PMCRE) && \
> +        !(env->cp15.pmccfiltr_el0 & PMCP && arm_current_pl(env) == 1) && \
> +        !(env->cp15.pmccfiltr_el0 & PMCU && arm_current_pl(env) == 0) && \
> +        !(env->cp15.c9_pmxevtyper & PMCP && arm_current_pl(env) == 1) && \
> +        !(env->cp15.c9_pmxevtyper & PMCU && arm_current_pl(env) == 0))
> +#endif
> +
>  typedef struct CPUARMState {
>      /* Regs for current mode.  */
>      uint32_t regs[16];
> 

Christopher

-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by the Linux Foundation.

  reply	other threads:[~2014-06-24 15:31 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-24  1:11 [Qemu-devel] [PATCH v1 0/7] target-arm: Extend PMCCNTR for ARMv8 Alistair Francis
2014-06-24  1:11 ` [Qemu-devel] [PATCH v1 1/7] target-arm: Make the ARM PMCCNTR register 64-bit Alistair Francis
2014-06-24  1:11 ` [Qemu-devel] [PATCH v1 2/7] target-arm: Implement PMCCNTR_EL0 and related registers Alistair Francis
2014-06-24  1:12 ` [Qemu-devel] [PATCH v1 3/7] target-arm: Add helper macros and defines for CCNT register Alistair Francis
2014-06-24 15:31   ` Christopher Covington [this message]
2014-06-24 22:40     ` Alistair Francis
2014-06-24 15:56   ` Peter Maydell
2014-06-24 22:42     ` Alistair Francis
2014-06-24  1:12 ` [Qemu-devel] [PATCH v1 4/7] target-arm: Implement pmccntr_sync function Alistair Francis
2014-06-24 15:35   ` Christopher Covington
2014-06-24 22:34     ` Alistair Francis
2014-06-24  1:12 ` [Qemu-devel] [PATCH v1 5/7] target-arm: Remove old code and replace with new functions Alistair Francis
2014-06-24  1:12 ` [Qemu-devel] [PATCH v1 6/7] target-arm: Implement pmccfiltr_write function Alistair Francis
2014-06-24  1:12 ` [Qemu-devel] [PATCH v1 7/7] target-arm: Call the pmccntr_sync function when swapping ELs Alistair Francis
2014-06-24 15:55   ` Christopher Covington
2014-06-24 22:39     ` Alistair Francis
2014-06-24 23:07       ` Peter Crosthwaite
2014-06-26  0:37         ` Alistair Francis
2014-06-26 11:40   ` Peter Crosthwaite
2014-06-26 11:43     ` Peter Crosthwaite
2014-06-26 14:58 ` [Qemu-devel] [PATCH v1 0/7] target-arm: Extend PMCCNTR for ARMv8 Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53A999BC.80806@codeaurora.org \
    --to=cov@codeaurora.org \
    --cc=alistair.francis@xilinx.com \
    --cc=peter.crosthwaite@xilinx.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.