All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org, patches@linaro.org
Subject: Re: [PATCH] arm_gicv3: Fix ICC_BPR1 reset value when EL3 not implemented
Date: Wed, 07 Jun 2017 17:13:46 +0100	[thread overview]
Message-ID: <87a85jdbd1.fsf@linaro.org> (raw)
In-Reply-To: <1496849369-30282-1-git-send-email-peter.maydell@linaro.org>


Peter Maydell <peter.maydell@linaro.org> writes:

> If EL3 is not implemented (ie only one security state) then the
> one and only ICC_BPR1 register behaves like the Non-secure
> ICC_BPR1 in an EL3-present configuration. In particular, its
> reset value is GIC_MIN_BPR_NS, not GIC_MIN_BPR.
>
> Correct the erroneous reset value; this fixes a problem where
> we might hit the assert added in commit a89ff39ee901.
>
> Reported-by: Alex Bennée <alex.bennee@linaro.org>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Alex Bennée <alex.bennee@linaro.org>

> ---
>  hw/intc/arm_gicv3_cpuif.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/hw/intc/arm_gicv3_cpuif.c b/hw/intc/arm_gicv3_cpuif.c
> index 09d8ba0..5cbafaf 100644
> --- a/hw/intc/arm_gicv3_cpuif.c
> +++ b/hw/intc/arm_gicv3_cpuif.c
> @@ -2039,11 +2039,7 @@ static void icc_reset(CPUARMState *env, const ARMCPRegInfo *ri)
>      cs->icc_pmr_el1 = 0;
>      cs->icc_bpr[GICV3_G0] = GIC_MIN_BPR;
>      cs->icc_bpr[GICV3_G1] = GIC_MIN_BPR;
> -    if (arm_feature(env, ARM_FEATURE_EL3)) {
> -        cs->icc_bpr[GICV3_G1NS] = GIC_MIN_BPR_NS;
> -    } else {
> -        cs->icc_bpr[GICV3_G1NS] = GIC_MIN_BPR;
> -    }
> +    cs->icc_bpr[GICV3_G1NS] = GIC_MIN_BPR_NS;
>      memset(cs->icc_apr, 0, sizeof(cs->icc_apr));
>      memset(cs->icc_igrpen, 0, sizeof(cs->icc_igrpen));
>      cs->icc_ctlr_el3 = ICC_CTLR_EL3_NDS | ICC_CTLR_EL3_A3V |


--
Alex Bennée

WARNING: multiple messages have this Message-ID (diff)
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org, patches@linaro.org
Subject: Re: [Qemu-devel] [PATCH] arm_gicv3: Fix ICC_BPR1 reset value when EL3 not implemented
Date: Wed, 07 Jun 2017 17:13:46 +0100	[thread overview]
Message-ID: <87a85jdbd1.fsf@linaro.org> (raw)
In-Reply-To: <1496849369-30282-1-git-send-email-peter.maydell@linaro.org>


Peter Maydell <peter.maydell@linaro.org> writes:

> If EL3 is not implemented (ie only one security state) then the
> one and only ICC_BPR1 register behaves like the Non-secure
> ICC_BPR1 in an EL3-present configuration. In particular, its
> reset value is GIC_MIN_BPR_NS, not GIC_MIN_BPR.
>
> Correct the erroneous reset value; this fixes a problem where
> we might hit the assert added in commit a89ff39ee901.
>
> Reported-by: Alex Bennée <alex.bennee@linaro.org>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Alex Bennée <alex.bennee@linaro.org>

> ---
>  hw/intc/arm_gicv3_cpuif.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/hw/intc/arm_gicv3_cpuif.c b/hw/intc/arm_gicv3_cpuif.c
> index 09d8ba0..5cbafaf 100644
> --- a/hw/intc/arm_gicv3_cpuif.c
> +++ b/hw/intc/arm_gicv3_cpuif.c
> @@ -2039,11 +2039,7 @@ static void icc_reset(CPUARMState *env, const ARMCPRegInfo *ri)
>      cs->icc_pmr_el1 = 0;
>      cs->icc_bpr[GICV3_G0] = GIC_MIN_BPR;
>      cs->icc_bpr[GICV3_G1] = GIC_MIN_BPR;
> -    if (arm_feature(env, ARM_FEATURE_EL3)) {
> -        cs->icc_bpr[GICV3_G1NS] = GIC_MIN_BPR_NS;
> -    } else {
> -        cs->icc_bpr[GICV3_G1NS] = GIC_MIN_BPR;
> -    }
> +    cs->icc_bpr[GICV3_G1NS] = GIC_MIN_BPR_NS;
>      memset(cs->icc_apr, 0, sizeof(cs->icc_apr));
>      memset(cs->icc_igrpen, 0, sizeof(cs->icc_igrpen));
>      cs->icc_ctlr_el3 = ICC_CTLR_EL3_NDS | ICC_CTLR_EL3_A3V |


--
Alex Bennée

  reply	other threads:[~2017-06-07 16:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-07 15:29 [PATCH] arm_gicv3: Fix ICC_BPR1 reset value when EL3 not implemented Peter Maydell
2017-06-07 15:29 ` [Qemu-devel] " Peter Maydell
2017-06-07 16:13 ` Alex Bennée [this message]
2017-06-07 16:13   ` Alex Bennée
2017-06-07 17:23   ` Peter Maydell
2017-06-07 17:23     ` [Qemu-devel] " 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=87a85jdbd1.fsf@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=patches@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.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.