diff mbox series

[12/13] target/arm: Correct definition of PMCRDP

Message ID 20200211173726.22541-13-peter.maydell@linaro.org
State New
Headers show
Series arm: Implement ARMv8.1-PMU and ARMv8.4-PMU | expand

Commit Message

Peter Maydell Feb. 11, 2020, 5:37 p.m. UTC
The PMCR_EL0.DP bit is bit 5, which is 0x20, not 0x10.  0x10 is 'X'.
Correct our #define of PMCRDP and add the missing PMCRX.

We do have the correct behaviour for handling the DP bit being
set, so this fixes a guest-visible bug.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 target/arm/helper.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Richard Henderson Feb. 11, 2020, 6:52 p.m. UTC | #1
On 2/11/20 9:37 AM, Peter Maydell wrote:
> The PMCR_EL0.DP bit is bit 5, which is 0x20, not 0x10.  0x10 is 'X'.
> Correct our #define of PMCRDP and add the missing PMCRX.
> 
> We do have the correct behaviour for handling the DP bit being
> set, so this fixes a guest-visible bug.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  target/arm/helper.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~
Philippe Mathieu-Daudé Feb. 12, 2020, 7 a.m. UTC | #2
On 2/11/20 6:37 PM, Peter Maydell wrote:
> The PMCR_EL0.DP bit is bit 5, which is 0x20, not 0x10.  0x10 is 'X'.
> Correct our #define of PMCRDP and add the missing PMCRX.
> 
> We do have the correct behaviour for handling the DP bit being
> set, so this fixes a guest-visible bug.
> 

Fixes: 033614c47de
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>   target/arm/helper.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/target/arm/helper.c b/target/arm/helper.c
> index cb3c30f1725..c6758bfbeb5 100644
> --- a/target/arm/helper.c
> +++ b/target/arm/helper.c
> @@ -1017,7 +1017,8 @@ static const ARMCPRegInfo v6_cp_reginfo[] = {
>   #define PMCRN_MASK  0xf800
>   #define PMCRN_SHIFT 11
>   #define PMCRLC  0x40
> -#define PMCRDP  0x10
> +#define PMCRDP  0x20
> +#define PMCRX   0x10
>   #define PMCRD   0x8
>   #define PMCRC   0x4
>   #define PMCRP   0x2
>
diff mbox series

Patch

diff --git a/target/arm/helper.c b/target/arm/helper.c
index cb3c30f1725..c6758bfbeb5 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -1017,7 +1017,8 @@  static const ARMCPRegInfo v6_cp_reginfo[] = {
 #define PMCRN_MASK  0xf800
 #define PMCRN_SHIFT 11
 #define PMCRLC  0x40
-#define PMCRDP  0x10
+#define PMCRDP  0x20
+#define PMCRX   0x10
 #define PMCRD   0x8
 #define PMCRC   0x4
 #define PMCRP   0x2