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

[PATCH] arm/its: Decode BASER cacheability field before comparing



From: Mykola Kvach <mykola_kvach@xxxxxxxx>

GITS_BASER_INNER_CACHEABILITY_MASK is a shifted mask. Comparing the
masked but unshifted value against GIC_BASER_CACHE_nC, which is an
unshifted value, leads to incorrect detection of non-cacheable
table mappings.

Shift the masked value to properly detect if the BASER backing memory
requires flushing.

Fixes: 05238012b86 ("ARM: GICv3 ITS: allocate device and collection table")
Signed-off-by: Mykyta Poturai <mykyta_poturai@xxxxxxxx>
Signed-off-by: Mykola Kvach <mykola_kvach@xxxxxxxx>
---
 xen/arch/arm/gic-v3-its.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/gic-v3-its.c b/xen/arch/arm/gic-v3-its.c
index 9ba068c46f..6a46bcc8af 100644
--- a/xen/arch/arm/gic-v3-its.c
+++ b/xen/arch/arm/gic-v3-its.c
@@ -496,7 +496,8 @@ retry:
         }
         attr = regc & BASER_ATTR_MASK;
     }
-    if ( (regc & GITS_BASER_INNER_CACHEABILITY_MASK) <= GIC_BASER_CACHE_nC )
+    if ( ((regc & GITS_BASER_INNER_CACHEABILITY_MASK) >>
+          GITS_BASER_INNER_CACHEABILITY_SHIFT) <= GIC_BASER_CACHE_nC )
         clean_and_invalidate_dcache_va_range(buffer, table_size);
 
     /* If the host accepted our page size, we are done. */
-- 
2.43.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.