[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 36/37] hw/misc/tz-mpc: Fix value of BLK_MAX register
From: |
Peter Maydell |
Subject: |
[Qemu-devel] [PULL 36/37] hw/misc/tz-mpc: Fix value of BLK_MAX register |
Date: |
Mon, 7 Jan 2019 16:31:16 +0000 |
In the TZ Memory Protection Controller, the BLK_MAX register is supposed
to return the maximum permitted value of the BLK_IDX register. Our
implementation incorrectly returned max+1 (ie the total number of
valid index values, since BLK_IDX is zero-based).
Correct this off-by-one error. Since we consistently initialize
and use s->blk_max throughout the implementation as the 'size'
of the LUT, just adjust the value we return when the guest reads
the BLK_MAX register, rather than trying to change the semantics
of the s->blk_max internal struct field.
Fixes: https://bugs.launchpad.net/qemu/+bug/1806824
Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Message-id: address@hidden
---
hw/misc/tz-mpc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/misc/tz-mpc.c b/hw/misc/tz-mpc.c
index fb48a1540b9..9a84be75ed6 100644
--- a/hw/misc/tz-mpc.c
+++ b/hw/misc/tz-mpc.c
@@ -150,7 +150,7 @@ static MemTxResult tz_mpc_reg_read(void *opaque, hwaddr
addr,
r = s->ctrl;
break;
case A_BLK_MAX:
- r = s->blk_max;
+ r = s->blk_max - 1;
break;
case A_BLK_CFG:
/* We are never in "init in progress state", so this just indicates
--
2.19.2
- [Qemu-devel] [PULL 25/37] arm: Add header to host common definition for nRF51 SOC peripherals, (continued)
- [Qemu-devel] [PULL 25/37] arm: Add header to host common definition for nRF51 SOC peripherals, Peter Maydell, 2019/01/07
- [Qemu-devel] [PULL 30/37] tests/microbit-test: Add Tests for nRF51 GPIO, Peter Maydell, 2019/01/07
- [Qemu-devel] [PULL 26/37] hw/misc/nrf51_rng: Add NRF51 random number generator peripheral, Peter Maydell, 2019/01/07
- [Qemu-devel] [PULL 31/37] hw/timer/nrf51_timer: Add nRF51 Timer peripheral, Peter Maydell, 2019/01/07
- [Qemu-devel] [PULL 29/37] arm: Instantiate NRF51 general purpose I/O, Peter Maydell, 2019/01/07
- [Qemu-devel] [PULL 28/37] hw/gpio/nrf51_gpio: Add nRF51 GPIO peripheral, Peter Maydell, 2019/01/07
- [Qemu-devel] [PULL 37/37] Support u-boot noload images for arm as used by, NetBSD/evbarm GENERIC kernel., Peter Maydell, 2019/01/07
- [Qemu-devel] [PULL 33/37] tests/microbit-test: Add Tests for nRF51 Timer, Peter Maydell, 2019/01/07
- [Qemu-devel] [PULL 32/37] arm: Instantiate NRF51 Timers, Peter Maydell, 2019/01/07
- [Qemu-devel] [PULL 35/37] target/arm: Emit barriers for A32/T32 load-acquire/store-release insns, Peter Maydell, 2019/01/07
- [Qemu-devel] [PULL 36/37] hw/misc/tz-mpc: Fix value of BLK_MAX register,
Peter Maydell <=
- [Qemu-devel] [PULL 34/37] arm: Add Clock peripheral stub to NRF51 SOC, Peter Maydell, 2019/01/07
- Re: [Qemu-devel] [PULL 00/37] target-arm queue, Peter Maydell, 2019/01/07
- Re: [Qemu-devel] [PULL 00/37] target-arm queue, no-reply, 2019/01/07