[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-arm] [PATCH] nvic: Fix ARMv7M MPU_RBAR reads
From: |
Alex Bennée |
Subject: |
Re: [Qemu-arm] [PATCH] nvic: Fix ARMv7M MPU_RBAR reads |
Date: |
Mon, 06 Nov 2017 16:20:56 +0000 |
User-agent: |
mu4e 1.0-alpha0; emacs 26.0.90 |
Peter Maydell <address@hidden> 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 <address@hidden>
>
> Signed-off-by: Peter Maydell <address@hidden>
> ---
> 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