Hi Ayan,
On 21/10/2024 16:07, Ayan Kumar Halder wrote:
On 18/10/2024 23:13, Julien Grall wrote:
Hi Ayan,
+.endm
+
+/*
+ * Maps the various sections of Xen (described in xen.lds.S) as
different MPU
+ * regions.
+ *
+ * Inputs:
+ * lr : Address to return to.
+ *
+ * Clobbers x0 - x5
+ *
+ */
+FUNC(enable_boot_cpu_mm)
+
+ /* Check if the number of regions exceeded the count specified
in MPUIR_EL2 */
AFAIU, this doesn't match what the instruction is doing below.
Sorry, this needs to be removed.
+ mrs x5, MPUIR_EL2
+
+ /* x0: region sel */
+ mov x0, xzr
+ /* Xen text section. */
+ load_paddr x1, _stext
+ load_paddr x2, _etext
+ cmp x1, x2
+ beq 1f
This check seems to be excessive... I can't think of a reason why
there would be no text at all... Same for a lot of the checks below.
Is it ok if we have this excess check ? The downsides are only a small
increase in code size and boot time. Otherwise, I need to justify why we
have this checks in some places, but not in others.
How about moving the check in prepare_xen_region? This should solve the
concerns on both the current approach and my proposed approach.
Cheers,
--
Julien Grall