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

Re: [PATCH v2 7/7] arm/mpu: Implement setup_mpu for MPU system


  • To: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • From: Ayan Kumar Halder <ayankuma@xxxxxxx>
  • Date: Tue, 8 Apr 2025 16:29:15 +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=Mz1x03g7J3AAtX3SVyV3AwR03UOOS9GXgPQq7Yazlq8=; b=ZvzsK2NU+moukN5vGXY41nkhCXgSt/SCG4xS2jy4nHosOSA+NiZpgK39YZBOywoqVGXYYkfK1eIsIs2qRt3IDe0FfzkbiU7kj5hA/a4NwIFFzMqlZ1pnk9rwkBBpWcI3xXhnv/OX1ma0gLF+7yzqpvLXULRZjV3Ed5Ps/7WA/ayMy5WP2SMWB2x/g/svAMRGsUsEVlVWgNEY8lLVIZb3K2r5HWKNXLeOYXZdl4JxxgCTg9hNKcPsvgbVJPEsnZMm2M1shl2HZKRVSyv/dUTmMUSbyG/Frf9RMFvMxt/xx/jqWDNXpaIA1Aev/eGckkaU3DLLzIaNgUTH4oyrtYH0xw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=CSU7sAyOfXTfX7gzTfn/1JO6EptI8KNpeNSLrI8xgUhHyUmxhxxUAnh3oTU4PJLZFlAnJpQl+la6rZpGqdw1Ls/M1FerOeYagDtgrWW3D6wPANTsH4OFXRNymF7uCt0n35Dlw4fuHsIpAQBsfyYn1BdfR1XpDjyEQRZUVIFUp7b7l9/GFYrGF4dDoL5Md4tCuEogctfN68vYLLxJfbJh0XJEeqif6vA7/5/OGPHYOiGqyTAMssyRBjVkULg8tNdePuw0g5p/kMxCVlWW6ysDRFnHJQteUGe8gaPV+O8yEaJhDyfln69gyhxAGeb3sb39k5jfTmkBh7EtKHHK/ikX7Q==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Tue, 08 Apr 2025 15:29:35 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 08/04/2025 14:51, Luca Fancellu wrote:
Hi Ayan,
Hi Luca,

On 8 Apr 2025, at 14:32, Ayan Kumar Halder <ayankuma@xxxxxxx> wrote:

Hi Luca,

On 07/04/2025 10:14, Luca Fancellu wrote:
CAUTION: This message has originated from an External Source. Please use proper 
judgment and caution when opening attachments, clicking links, or responding to 
this email.


Implement the function setup_mpu that will logically track the MPU
regions defined by hardware registers, start introducing data
structures and functions to track the status from the C world.

The xen_mpumap_mask bitmap is used to track which MPU region are
enabled at runtime.

This function is called from setup_mm() which full implementation
will be provided in a later stage.

Signed-off-by: Luca Fancellu <luca.fancellu@xxxxxxx>
---
  xen/arch/arm/include/asm/arm64/mpu.h |  2 ++
  xen/arch/arm/mpu/mm.c                | 49 +++++++++++++++++++++++++++-
  2 files changed, 50 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/include/asm/arm64/mpu.h 
b/xen/arch/arm/include/asm/arm64/mpu.h
index 7cf8d355a1af..ff5a957bf085 100644
--- a/xen/arch/arm/include/asm/arm64/mpu.h
+++ b/xen/arch/arm/include/asm/arm64/mpu.h
@@ -6,6 +6,8 @@
  #ifndef __ARM_ARM64_MPU_H__
  #define __ARM_ARM64_MPU_H__

+#define PRENR_MASK  GENMASK(31, 0)
This can be moved to xen/arch/arm/include/asm/mpu.h
I can see from the Arm® Cortex®-R52 Processor TRM, r1p1, 3.3.46 Hyp MPU Region 
Enable Register,
that HPRENR can have 16/20/24 enabled bits, the rest is RAZ.

Yes, I see that. However, if you see ARM DDI 0568A.c ID110520 ArmV8-R32 supplement

E2.2.4 HPRENR

Provides direct access to the HPRLAR.EN bits for EL2 MPU regions 0 to 31.

AFAIU, the maximum number of EL2 MPU regions will always be 32. This doesnot seem to be configurable.

The R52 TRM isn't clear when it says "{no,16,20,24} EL2-controlled MPU regions implemented" as there is no register to set/check how many EL2 MPU regions are implemented.

So, I suggest we can keep this in the common file for now.

- Ayan


Because of that I’ve put that here, maybe you should implement it in the arm32 
part since you have this
difference from Arm64.

Cheers,
Luca




 


Rackspace

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