[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 08/26] hw/intc/arm_gicv3_its: Don't misuse GITS_TYPE_PHYSICAL
Re: [PATCH 08/26] hw/intc/arm_gicv3_its: Don't misuse GITS_TYPE_PHYSICAL define
Mon, 13 Dec 2021 11:52:35 +0000
mu4e 1.7.5; emacs 28.0.90
Peter Maydell <email@example.com> writes:
> The GITS_TYPE_PHYSICAL define is the value we set the
> GITS_TYPER.Physical field to -- this is 1 to indicate that we support
> physical LPIs. (Support for virtual LPIs is the GITS_TYPER.Virtual
> field.) We also use this define as the *value* that we write into an
> interrupt translation table entry's INTTYPE field, which should be 1
> for a physical interrupt and 0 for a virtual interrupt. Finally, we
> use it as a *mask* when we read the interrupt translation table entry
> INTTYPE field.
> Untangle this confusion: define an ITE_INTTYPE_VIRTUAL and
> ITE_INTTYPE_PHYSICAL to be the valid values of the ITE INTTYPE
> field, and replace the ad-hoc collection of ITE_ENTRY_* defines with
> use of the FIELD() macro to define the fields of an ITE and the
> FIELD_EX64() and FIELD_DP64() macros to read and write them.
> We use ITE in the new setup, rather than ITE_ENTRY, because
> ITE stands for "Interrupt translation entry" and so the extra
> "entry" would be redundant.
> We take the opportunity to correct the name of the field that holds
> the GICv4 'doorbell' interrupt ID (this is always the value 1023 in a
> GICv3, which is why we were calling it the 'spurious' field).
> The GITS_TYPE_PHYSICAL define is then used in only one place, where
> we set the initial GITS_TYPER value. Since GITS_TYPER.Physical is
> essentially a boolean, hiding the '1' value behind a macro is more
> confusing than helpful, so expand out the macro there and remove the
> define entirely.
> Signed-off-by: Peter Maydell <firstname.lastname@example.org>
Reviewed-by: Alex Bennée <email@example.com>
- [PATCH 09/26] hw/intc/arm_gicv3_its: Correct handling of MAPI, (continued)
- [PATCH 09/26] hw/intc/arm_gicv3_its: Correct handling of MAPI, Peter Maydell, 2021/12/11
- [PATCH 17/26] hw/intc/arm_gicv3_its: Convert int ID check to num_intids convention, Peter Maydell, 2021/12/11
- [PATCH 21/26] hw/intc/arm_gicv3_its: Fix return codes in process_its_cmd(), Peter Maydell, 2021/12/11
- [PATCH 08/26] hw/intc/arm_gicv3_its: Don't misuse GITS_TYPE_PHYSICAL define, Peter Maydell, 2021/12/11
- [PATCH 20/26] hw/intc/arm_gicv3_its: Use enum for return value of process_* functions, Peter Maydell, 2021/12/11
- [PATCH 26/26] hw/intc/arm_gicv3_its: Factor out "find address of table entry" code, Peter Maydell, 2021/12/11
- [PATCH 24/26] hw/intc/arm_gicv3_its: Fix return codes in process_mapc(), Peter Maydell, 2021/12/11