|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [RFC PATCH 02/24] ARM: GICv3: allocate LPI pending and property table
Hi Andre, On 15/11/16 11:32, Andre Przywara wrote: On 01/11/16 17:22, Julien Grall wrote:On 28/09/2016 19:24, Andre Przywara wrote: You know my answer here ;). Linux is not the only guests OS supports on Xen, so we should avoid making assumptions on the best behavior based on this. [...] + + /* + * The pending table holds one bit per LPI, so we need three bits less + * than the number of LPI_BITs. But the alignment requirement from the + * ITS is 64K, so make order at least 16 (-12). + */ + pendtable = alloc_xenheap_pages(MAX(lpi_data.host_lpi_bits - 3, 16) - 12, 0); + if ( !pendtable ) + return 0; + + memset(pendtable, 0, BIT(lpi_data.host_lpi_bits - 3));Same remark for BIT here.+ this_cpu(pending_table) = pendtable; + + reg = attr | GICR_PENDBASER_PTZ; + reg |= virt_to_maddr(pendtable) & GENMASK(51, 16);I don't think the mask is useful and would need to be changed if the physical address bits increased as it was done in ARMv8.2.Mmmh, not so sure we can extend the mask to cover the region that it RES0 at the moment. We need some mask anyway (to not clobber the upper bits), so I figured we just use what the spec says. The masked PA should always be equal to the PA. Otherwise we would program the wrong address into the register and who knows what can happen. So this mask is pointless. [..] #endif /* CONFIG_HAS_ITS */ #endif /* __ASSEMBLY__ */ diff --git a/xen/include/asm-arm/gic_v3_defs.h b/xen/include/asm-arm/gic_v3_defs.h index 6bd25a5..da5fb77 100644 --- a/xen/include/asm-arm/gic_v3_defs.h +++ b/xen/include/asm-arm/gic_v3_defs.h @@ -44,7 +44,8 @@ #define GICC_SRE_EL2_ENEL1 (1UL << 3) /* Additional bits in GICD_TYPER defined by GICv3 */ -#define GICD_TYPE_ID_BITS_SHIFT 19 +#define GICD_TYPE_ID_BITS_SHIFT 19 +#define GICD_TYPE_LPIS (1U << 17)I was about to say that this should be named GICD_TYPER... but it looks like we already defined and use GIC_TYPE_ID_BITS_SHIFTS. So it is up to you if you rename it to get the correct register name.Yeah, I was unsure about this as well. My hunch is we should avoid the churn and keep existing names around. Experience shows that those simple renames tend to introduce nasty rebase issues, especially with a long-standing series like this. Clean up are always welcomed ;). I am fine if it comes after. Regards, -- Julien Grall _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |