[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 06/19] hw/intc/arm_gicv3_its: Don't return early in extract_table_
From: |
Peter Maydell |
Subject: |
[PULL 06/19] hw/intc/arm_gicv3_its: Don't return early in extract_table_params() loop |
Date: |
Fri, 7 Jan 2022 17:21:29 +0000 |
In extract_table_params() we process each GITS_BASER<n> register. If
the register's Valid bit is not set, this means there is no
in-guest-memory table and so we should not try to interpret the other
fields in the register. This was incorrectly coded as a 'return'
rather than a 'break', so instead of looping round to process the
next GITS_BASER<n> we would stop entirely, treating any later tables
as being not valid also.
This has no real guest-visible effects because (since we don't have
GITS_TYPER.HCC != 0) the guest must in any case set up all the
GITS_BASER<n> to point to valid tables, so this only happens in an
odd misbehaving-guest corner case.
Fix the check to 'break', so that we leave the case statement and
loop back around to the next GITS_BASER<n>.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
hw/intc/arm_gicv3_its.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/intc/arm_gicv3_its.c b/hw/intc/arm_gicv3_its.c
index f321f10189e..c97b9982ae1 100644
--- a/hw/intc/arm_gicv3_its.c
+++ b/hw/intc/arm_gicv3_its.c
@@ -795,7 +795,7 @@ static void extract_table_params(GICv3ITSState *s)
s->dt.valid = FIELD_EX64(value, GITS_BASER, VALID);
if (!s->dt.valid) {
- return;
+ break;
}
s->dt.page_sz = page_sz;
@@ -826,7 +826,7 @@ static void extract_table_params(GICv3ITSState *s)
* hence writes are discarded if ct.valid is 0
*/
if (!s->ct.valid) {
- return;
+ break;
}
s->ct.page_sz = page_sz;
--
2.25.1
- [PULL 00/19] target-arm queue, Peter Maydell, 2022/01/07
- [PULL 02/19] target/arm: Add missing FEAT_TLBIOS instructions, Peter Maydell, 2022/01/07
- [PULL 08/19] hw/intc/arm_gicv3_its: Correct setting of TableDesc entry_sz, Peter Maydell, 2022/01/07
- [PULL 11/19] hw/intc/arm_gicv3_its: Use FIELD macros for DTEs, Peter Maydell, 2022/01/07
- [PULL 05/19] hw/intc/arm_gicv3_its: Remove maxids union from TableDesc, Peter Maydell, 2022/01/07
- [PULL 01/19] Add dummy Aspeed AST2600 Display Port MCU (DPMCU), Peter Maydell, 2022/01/07
- [PULL 03/19] hw/intc/arm_gicv3_its: Correct off-by-one bounds check on rdbase, Peter Maydell, 2022/01/07
- [PULL 04/19] hw/intc/arm_gicv3_its: Remove redundant ITS_CTLR_ENABLED define, Peter Maydell, 2022/01/07
- [PULL 06/19] hw/intc/arm_gicv3_its: Don't return early in extract_table_params() loop,
Peter Maydell <=
- [PULL 07/19] hw/intc/arm_gicv3_its: Reduce code duplication in extract_table_params(), Peter Maydell, 2022/01/07
- [PULL 14/19] hw/intc/arm_gicv3_its: Fix various off-by-one errors, Peter Maydell, 2022/01/07
- [PULL 18/19] hw/arm: add i2c muxes to kudo-bmc, Peter Maydell, 2022/01/07
- [PULL 16/19] hw/arm: Add kudo i2c eeproms., Peter Maydell, 2022/01/07
- [PULL 17/19] hw/arm: attach MMC to kudo-bmc, Peter Maydell, 2022/01/07
- [PULL 12/19] hw/intc/arm_gicv3_its: Correct comment about CTE RDBase field size, Peter Maydell, 2022/01/07
- [PULL 10/19] hw/intc/arm_gicv3_its: Correct handling of MAPI, Peter Maydell, 2022/01/07
- [PULL 13/19] hw/intc/arm_gicv3_its: Use FIELD macros for CTEs, Peter Maydell, 2022/01/07
- [PULL 09/19] hw/intc/arm_gicv3_its: Don't misuse GITS_TYPE_PHYSICAL define, Peter Maydell, 2022/01/07
- [PULL 15/19] hw/intc/arm_gicv3_its: Rename max_l2_entries to num_l2_entries, Peter Maydell, 2022/01/07