mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
hw/intc/arm_gicv3_its: Drop TableDesc and CmdQDesc valid fields
Currently we track in the TableDesc and CmdQDesc structs the state of the GITS_BASER<n> and GITS_CBASER Valid bits. However we aren't very consistent abut checking the valid field: we test it in update_cte() and update_dte(), but not anywhere else we look things up in tables. The GIC specification says that it is UNPREDICTABLE if a guest fails to set any of these Valid bits before enabling the ITS via GITS_CTLR.Enabled. So we can choose to handle Valid == 0 as equivalent to a zero-length table. This is in fact how we're already catching this case in most of the table-access paths: when Valid is 0 we leave the num_entries fields in TableDesc or CmdQDesc set to zero, and then the out-of-bounds check "index >= num_entries" that we have to do anyway before doing any of these table lookups will always be true, catching the no-valid-table case without any extra code. So we can remove the checks on the valid field from update_cte() and update_dte(): since these happen after the bounds check there was never any case when the test could fail. That means the valid fields would be entirely unused, so just remove them. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20220201193207.2771604-11-peter.maydell@linaro.org
This commit is contained in:
parent
7eb54267f2
commit
da4680ce3a
2 changed files with 14 additions and 19 deletions
|
@ -42,7 +42,6 @@
|
|||
#define GITS_TRANSLATER 0x0040
|
||||
|
||||
typedef struct {
|
||||
bool valid;
|
||||
bool indirect;
|
||||
uint16_t entry_sz;
|
||||
uint32_t page_sz;
|
||||
|
@ -51,7 +50,6 @@ typedef struct {
|
|||
} TableDesc;
|
||||
|
||||
typedef struct {
|
||||
bool valid;
|
||||
uint32_t num_entries;
|
||||
uint64_t base_addr;
|
||||
} CmdQDesc;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue