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-arm] [PATCH] nvic: Fix ARMv7M MPU_RBAR reads
Date: Mon, 06 Nov 2017 16:20:56 +0000 [thread overview]
Message-ID: <871slbs7iv.fsf@linaro.org> (raw)
In-Reply-To: <1509732813-22957-1-git-send-email-peter.maydell@linaro.org>
Peter Maydell <peter.maydell@linaro.org> writes:
> Fix an incorrect mask expression in the handling of v7M MPU_RBAR
> reads that meant that we would always report the ADDR field as zero.
nit: you could extend that to: "..as zero because we mask it when
written".
As I see you do:
cpu->env.pmsav7.drbar[region] = value & ~0x1f;
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> Doesn't affect v8M, which is a different codepath.
>
> hw/intc/armv7m_nvic.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c
> index be46639..5d9c883 100644
> --- a/hw/intc/armv7m_nvic.c
> +++ b/hw/intc/armv7m_nvic.c
> @@ -977,7 +977,7 @@ static uint32_t nvic_readl(NVICState *s, uint32_t offset, MemTxAttrs attrs)
> if (region >= cpu->pmsav7_dregion) {
> return 0;
> }
> - return (cpu->env.pmsav7.drbar[region] & 0x1f) | (region & 0xf);
> + return (cpu->env.pmsav7.drbar[region] & ~0x1f) | (region & 0xf);
> }
> case 0xda0: /* MPU_RASR (v7M), MPU_RLAR (v8M) */
> case 0xda8: /* MPU_RASR_A1 (v7M), MPU_RLAR_A1 (v8M) */
--
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] [Qemu-arm] [PATCH] nvic: Fix ARMv7M MPU_RBAR reads
Date: Mon, 06 Nov 2017 16:20:56 +0000 [thread overview]
Message-ID: <871slbs7iv.fsf@linaro.org> (raw)
In-Reply-To: <1509732813-22957-1-git-send-email-peter.maydell@linaro.org>
Peter Maydell <peter.maydell@linaro.org> writes:
> Fix an incorrect mask expression in the handling of v7M MPU_RBAR
> reads that meant that we would always report the ADDR field as zero.
nit: you could extend that to: "..as zero because we mask it when
written".
As I see you do:
cpu->env.pmsav7.drbar[region] = value & ~0x1f;
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> Doesn't affect v8M, which is a different codepath.
>
> hw/intc/armv7m_nvic.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c
> index be46639..5d9c883 100644
> --- a/hw/intc/armv7m_nvic.c
> +++ b/hw/intc/armv7m_nvic.c
> @@ -977,7 +977,7 @@ static uint32_t nvic_readl(NVICState *s, uint32_t offset, MemTxAttrs attrs)
> if (region >= cpu->pmsav7_dregion) {
> return 0;
> }
> - return (cpu->env.pmsav7.drbar[region] & 0x1f) | (region & 0xf);
> + return (cpu->env.pmsav7.drbar[region] & ~0x1f) | (region & 0xf);
> }
> case 0xda0: /* MPU_RASR (v7M), MPU_RLAR (v8M) */
> case 0xda8: /* MPU_RASR_A1 (v7M), MPU_RLAR_A1 (v8M) */
--
Alex Bennée
next prev parent reply other threads:[~2017-11-06 16:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-03 18:13 [Qemu-arm] [PATCH] nvic: Fix ARMv7M MPU_RBAR reads Peter Maydell
2017-11-03 18:13 ` [Qemu-devel] " Peter Maydell
2017-11-06 16:20 ` Alex Bennée [this message]
2017-11-06 16:20 ` [Qemu-devel] [Qemu-arm] " Alex Bennée
2017-11-06 16:34 ` Peter Maydell
2017-11-06 16:34 ` [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=871slbs7iv.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.