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

Re: [PATCH v6 3/6] arm/mpu: Provide and populate MPU C data structures



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




 


Rackspace

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