[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 26/26] hw/intc/arm_gicv3_its: Factor out "find address of tab

From: Richard Henderson
Subject: Re: [PATCH 26/26] hw/intc/arm_gicv3_its: Factor out "find address of table entry" code
Date: Sun, 12 Dec 2021 14:52:01 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0

On 12/11/21 11:11 AM, Peter Maydell wrote:
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>
This is a worthwhile refactoring on its own, but still more
so given that GICv4 adds another table in this format.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]