[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 11/13] hw/intc/arm_gicv3_its: Factor out "find address of
From: |
Alex Bennée |
Subject: |
Re: [PATCH v2 11/13] hw/intc/arm_gicv3_its: Factor out "find address of table entry" code |
Date: |
Tue, 18 Jan 2022 17:31:20 +0000 |
User-agent: |
mu4e 1.7.5; emacs 28.0.91 |
Peter Maydell <peter.maydell@linaro.org> writes:
> The ITS has several tables which all share a similar format,
> described by the TableDesc struct: the guest may configure them
> to be a single-level table or a two-level table. Currently we
> open-code the process of finding the table entry in all the
> functions which read or write the device table or the collection
> table. Factor out the "get the address of the table entry"
> logic into a new function, so that the code which needs to
> read or write a table entry only needs to call table_entry_addr()
> and then perform a suitable load or store to that address.
>
> Note that the error handling is slightly complicated because
> we want to handle two cases differently:
> * failure to read the L1 table entry should end up causing
> a command stall, like other kinds of DMA error
> * an L1 table entry that says there is no L2 table for this
> index (ie whose valid bit is 0) must result in us treating
> the table entry as not-valid on read, and discarding
> writes (this is mandated by the spec)
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
--
Alex Bennée
- [PATCH v2 01/13] hw/intc/arm_gicv3_its: Fix event ID bounds checks, (continued)
- [PATCH v2 01/13] hw/intc/arm_gicv3_its: Fix event ID bounds checks, Peter Maydell, 2022/01/11
- [PATCH v2 03/13] hw/intc/arm_gicv3_its: Fix handling of process_its_cmd() return value, Peter Maydell, 2022/01/11
- [PATCH v2 05/13] hw/intc/arm_gicv3_its: Use enum for return value of process_* functions, Peter Maydell, 2022/01/11
- [PATCH v2 07/13] hw/intc/arm_gicv3_its: Refactor process_its_cmd() to reduce nesting, Peter Maydell, 2022/01/11
- [PATCH v2 10/13] hw/intc/arm_gicv3_its: Fix return codes in process_mapd(), Peter Maydell, 2022/01/11
- [PATCH v2 09/13] hw/intc/arm_gicv3_its: Fix return codes in process_mapc(), Peter Maydell, 2022/01/11
- [PATCH v2 11/13] hw/intc/arm_gicv3_its: Factor out "find address of table entry" code, Peter Maydell, 2022/01/11
- Re: [PATCH v2 11/13] hw/intc/arm_gicv3_its: Factor out "find address of table entry" code,
Alex Bennée <=
- [PATCH v2 13/13] hw/intc/arm_gicv3_its: Range-check ICID before indexing into collection table, Peter Maydell, 2022/01/11
- [PATCH v2 12/13] hw/intc/arm_gicv3_its: Check indexes before use, not after, Peter Maydell, 2022/01/11
- Re: [PATCH v2 00/13] arm gicv3 ITS: Various bug fixes and refactorings, Alex Bennée, 2022/01/18