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

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


  • To: Julien Grall <julien@xxxxxxx>, "Orzel, Michal" <michal.orzel@xxxxxxx>, Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Ayan Kumar Halder <ayankuma@xxxxxxx>
  • Date: Mon, 9 Jun 2025 11:43:48 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Y6LUEIsuq0nFx2TIOmQ5bupBDyKIWNqB15EzXC+qyIM=; b=roLXBB/pYfH8Vy1iTorwILDWajrdL5zhi581JzH2G9HZU2PfqCx5shzAHYlmARjHKENY2XGc4jJ3gAxRFart+l3FGsXw31oKHSfqOce7TPvnlYLuyoPihipBGK9UCVqFMz00R2+IJxtxxpFWbeJFYURl2ryI8F2GTDKwwfBxgXsPlMl2GStLU/QVzN42h6ZZH34yYMDrS2qxtvvxUGRhesiWLgh4B5onZvXr/VVlrV6vJguX9tpM1KU8iFfF+WarECgyPsHGrSc9AYvFy+WQ81JIAZlA9bPTWVQNNiZijxNs4iojGgea6BFtNJxPdYiS5Srtn+BDCa6ug2yYr1U/lg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=lMgWITPgC69v+FjjFS7yj2gB1+q1GfXDHmhE0YS+LztRXO+BIT3ax4Z16lBTEA5cHdxUKWlLd0UtpFEkJN99a8FBcvWg1jytBWRHRECge43p+ZZe9lj2nSRGWA/TahME6miaDEY4czRyeXWR+/LjD3jZeH5+Ee7koEbJEE0IL+s5l2F18Mzpuh4bbRhW7W4MxmxW1dmNKUuD/xkA1Jx0jQmsDN/+lBeX1zO7ubxhxl0Qn3YwxyRKjXdqE6YUhJw08u9QbkcP6ozwlft5474CCRKBEqjPCibKebg8zkA8QBz2OdKT2jZLATmh0h3AcxrEENJGt0QQcQuSQxYXN6MVZA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Mon, 09 Jun 2025 10:44:19 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi,

On 09/06/2025 10:16, Ayan Kumar Halder wrote:

On 09/06/2025 09:42, Julien Grall wrote:
Hi Ayan,
Hi Julien,

On 09/06/2025 09:27, Ayan Kumar Halder wrote:
On 09/06/2025 08:41, Orzel, Michal wrote:
diff --git a/xen/arch/arm/include/asm/mpu/regions.inc b/xen/arch/arm/ include/asm/mpu/regions.inc
index 6b8c233e6c..631b0b2b86 100644
--- a/xen/arch/arm/include/asm/mpu/regions.inc
+++ b/xen/arch/arm/include/asm/mpu/regions.inc
@@ -24,7 +24,7 @@
  #define XEN_MPUMAP_ENTRY_SHIFT  0x3     /* 8 byte structure */
  .macro store_pair reg1, reg2, dst
-    .word 0xe7f000f0                    /* unimplemented */
+    stm \dst, {\reg1, \reg2}  /* reg2 should be a higher register than reg1 */
Didn't we agree not to use STM (I suggested it but then Julien pointed out that
it's use in macro might not be the best)?

Ah my last response was not sent.

I realized that I cannot use strd due to the following error

Error: first transfer register must be even -- `strd r3,r4,[r1]'

Ah I missed the "even" part when reading the specification. However, we control the set of registers, so we can't we follow the restriction? This would be better...

I am ok to follow this. I just want to make sure that this looks ok to you

prepare_xen_region() invokes store_pair(). They are in common header.

So we need to make the change wherever prepare_xen_region() is invoked from arm32/mpu/head.S. This would look like

--- a/xen/arch/arm/arm32/mpu/head.S
+++ b/xen/arch/arm/arm32/mpu/head.S
@@ -58,33 +58,33 @@ FUNC(enable_boot_cpu_mm)
     /* Xen text section. */
     mov_w   r1, _stext
     mov_w   r2, _etext
-    prepare_xen_region r0, r1, r2, r3, r4, r5, attr_prbar=REGION_TEXT_PRBAR +    prepare_xen_region r0, r1, r2, r4, r3, r5, attr_prbar=REGION_TEXT_PRBAR

My mistake, It should be

prepare_xen_region r0, r1, r2, r4, r5, r6, attr_prbar=REGION_TEXT_PRBAR

We will be clobbering an extra register.

- Ayan




 


Rackspace

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