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

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



Hi Michal,

On 05/06/2025 08:44, Orzel, Michal wrote:


On 04/06/2025 19:43, Ayan Kumar Halder wrote:
Do the arm32 equivalent initialization for commit id ca5df936c4.
This is not a good commit msg.
Also, we somewhat require passing 12 char long IDs.

We are following the same convention as Linux. IIRC this was updated because there was some collision with 10 characters in Linux (not sure if we have seen it in Xen yet).

[...]

diff --git a/xen/arch/arm/include/asm/mpu/regions.inc 
b/xen/arch/arm/include/asm/mpu/regions.inc
index 6b8c233e6c..943bcda346 100644
--- a/xen/arch/arm/include/asm/mpu/regions.inc
+++ b/xen/arch/arm/include/asm/mpu/regions.inc
@@ -24,7 +24,13 @@
  #define XEN_MPUMAP_ENTRY_SHIFT  0x3     /* 8 byte structure */
.macro store_pair reg1, reg2, dst
-    .word 0xe7f000f0                    /* unimplemented */
+    str \reg1, [\dst]
+    add \dst, \dst, #4
+    str \reg2, [\dst]
AFAIR there is STM instruction to do the same

AFAICT, one issue with stm is the ordering is forced by the instruction rather than the user. So \reg1 could be stored first.

I think it would be better to use "strd". It still has restriction
(the two registers need to have contiguous index). But I think that would be better if we want to reduce the number of instructions.

Cheers,


+.endm
+
+.macro invalidate_dcache_one reg
+    mcr CP32(\reg, DCIMVAC)
Why? You don't seem to use this macro

  .endm
#endif

~Michal


--
Julien Grall




 


Rackspace

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