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

Re: [PATCH v7 2/3] xen/arm32: Create the same boot-time MPU regions as arm64


  • To: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: "Orzel, Michal" <michal.orzel@xxxxxxx>
  • Date: Tue, 15 Apr 2025 08:17:02 +0200
  • 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=LOumO4VpLPUn91AvwhNi8nzir0dcLkg4zI2wljtJbm4=; b=CjcWqlOtOrQrDmBZz9TYFYb4EQKSv7E8qCbWTfTRh0isKDOYhP/8w3m4Hfofki+zvXRrfpB3hS89upSMDbpDNhYCSRozMzBlbAkU4zbfXNFS+KcEy3mIPNGh7LRH/ypkipRiq04A4wQk7osjfbPcevzVKmbJuXksYfBH3wNUrkMHHhkQLfT+X0c589gC9PHKYzB9xt8wa6stLZxVIePSaJuSg6OGBTUL2zLdEjqTebVM6OHNC39pG/+WsfW5gzqu3ALR5zZJAchK8tywU5fwvqlUSomwJN1nIrko13Xy21LXyN0IaKhU3G4OJ5grRBUT+sD2cN0JR0Dx0yCOt4y6PA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=leSzKzVDxX25vVCAcE7VTNF1PMl9oup5CV+gYT9Y6rKOKUR9d28Rl11ARjSe2CC5CCqmv3SBSYZBzoxtYK+U6CZ913GUhFNu2TWtWE4JqUdLkop1E5/XpK8LKy5CiSng39cqyGIUvPKkstvUc8XyKHS0ufmaa/j85CNVg7wYZSUKBWRZaSj6BK9IHXUYqispLySDxlsuBMkJbOMAPpK2odCRnxh61rv3uFa+5XDIywWYdykCjB0afNDKcMf4c4e+Us9H3Yvg5WSpG/Syb8U6Yp3DQ4jiDvFXk30RTTXxgyqJBDTlu+Egx86jjO6QrHADqlL51n/apNoBNbDUm/oiWA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Luca Fancellu <luca.fancellu@xxxxxxx>
  • Delivery-date: Tue, 15 Apr 2025 06:17:15 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 14/04/2025 18:45, Ayan Kumar Halder wrote:
> Create Boot-time MPU protection regions (similar to Armv8-R AArch64) for
> Armv8-R AArch32.
> Also, defined *_PRBAR macros for arm32. The only difference from arm64 is that
> XN is 1-bit for arm32.
> Define the system registers and macros in mpu/cpregs.h.
> 
> Introduce WRITE_SYSREG_ASM() to write to system registers in assembly.
> 
> Signed-off-by: Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
> Reviewed-by: Luca Fancellu <luca.fancellu@xxxxxxx>
> Tested-by: Luca Fancellu <luca.fancellu@xxxxxxx>
> ---
> Changes from
> 
> v1 -
> 
> 1. enable_mpu() now sets HMAIR{0,1} registers. This is similar to what is
> being done in enable_mmu(). All the mm related configurations happen in this
> function.
> 
> 2. Fixed some typos. 
> 
> v2 -
> 1. Include the common prepare_xen_region.inc in head.S.
> 
> 2. Define LOAD_SYSREG()/STORE_SYSREG() for arm32.
> 
> v3 -
> 1. Rename STORE_SYSREG() as WRITE_SYSREG_ASM()
> 
> 2. enable_boot_cpu_mm() is defined in head.S
> 
> v4 -
> 1. *_PRBAR is moved to arm32/sysregs.h.
> 
> 2. MPU specific CP15 system registers are defined in mpu/cpregs.h. 
> 
> v5 -
> 1. WRITE_SYSREG_ASM is enclosed within #ifdef __ASSEMBLY__
> 
> 2. enable_mpu() clobbers r0 only.
> 
> 3. Definitions in mpu/cpregs.h in enclosed within ARM_32.
> 
> 4. Removed some #ifdefs and style changes.
> 
> v6 -
> 1. Coding style issues.
> 
> 2. Kept Luca's R-b and T-b as the changes should not impact the behavior.
Note for the future: Especially for T-b, it's better to drop the tags because
the series has not been tested in its current shape.

Reviewed-by: Michal Orzel <michal.orzel@xxxxxxx>

~Michal




 


Rackspace

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