mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
arm/gicv3: Decode cacheability fields before comparing
GITS_BASER_INNER_CACHEABILITY_MASK and GICR_PROPBASER_INNER_CACHEABILITY_MASK are shifted masks. Comparing the masked but unshifted values against GIC_BASER_CACHE_nC, which is an unshifted enum value, leads to incorrect detection of non-cacheable GITS_BASER tables and GICR_PROPBASER mappings. Use MASK_EXTR() to decode these cacheability fields before comparing against GIC_BASER_CACHE_nC, so the backing memory is flushed when required. Fixes:05238012b8("ARM: GICv3 ITS: allocate device and collection table") Fixes:c9b939863c("ARM: GICv3: allocate LPI pending and property table") Signed-off-by: Mykyta Poturai <mykyta_poturai@epam.com> Signed-off-by: Mykola Kvach <mykola_kvach@epam.com> Reviewed-by: Michal Orzel <michal.orzel@amd.com>
This commit is contained in:
1 parent
de99f32635
commit
49e0ce5b34
2 files changed
+4
-2
No files matched your search
@@ -496,7 +496,8 @@ retry:
|
||||
}
|
||||
attr = regc & BASER_ATTR_MASK;
|
||||
}
|
||||
if ( (regc & GITS_BASER_INNER_CACHEABILITY_MASK) <= GIC_BASER_CACHE_nC )
|
||||
if ( MASK_EXTR(regc, GITS_BASER_INNER_CACHEABILITY_MASK) <=
|
||||
GIC_BASER_CACHE_nC )
|
||||
clean_and_invalidate_dcache_va_range(buffer, table_size);
|
||||
|
||||
/* If the host accepted our page size, we are done. */
|
||||
|
||||
@@ -351,7 +351,8 @@ static int gicv3_lpi_set_proptable(void __iomem * rdist_base)
|
||||
}
|
||||
|
||||
/* Remember that we have to flush the property table if non-cacheable. */
|
||||
if ( (reg & GICR_PROPBASER_INNER_CACHEABILITY_MASK) <= GIC_BASER_CACHE_nC )
|
||||
if ( MASK_EXTR(reg, GICR_PROPBASER_INNER_CACHEABILITY_MASK) <=
|
||||
GIC_BASER_CACHE_nC )
|
||||
{
|
||||
lpi_data.flags |= LPI_PROPTABLE_NEEDS_FLUSHING;
|
||||
/* Update the redistributors knowledge about the attributes. */
|
||||
|
||||