Hi Luca,
On 23/05/2025 07:54, Luca Fancellu wrote:
/*
* Macro to prepare and set a EL2 MPU memory region.
* We will also create an according MPU memory region entry, which
@@ -59,6 +79,24 @@
dsb sy
isb
+ /* Load pair into xen_mpumap and invalidate cache */
AFAICT, you don't invalidate the cache below. What did I miss?
The rest of the patch LGTM.
+ adr_l \base, xen_mpumap
+ add \base, \base, \sel, LSL #XEN_MPUMAP_ENTRY_SHIFT
+ store_pair \prbar, \prlar, \base
+
+ /* Set/clear xen_mpumap_mask bitmap */
+ tst \prlar, #PRLAR_ELx_EN
+ bne 2f
+ /* Region is disabled, clear the bit in the bitmap */
+ bitmap_clear_bit xen_mpumap_mask, \sel, \base, \limit, \prbar, \prlar
+ b 3f
+
+2:
+ /* Region is enabled, set the bit in the bitmap */
+ bitmap_set_bit xen_mpumap_mask, \sel, \base, \limit, \prbar, \prlar
+
+3:
+
add \sel, \sel, #1
Cheers,
--
Julien Grall