[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 1/7] arm/mpu: Introduce MPU memory region map structure
- To: "Orzel, Michal" <Michal.Orzel@xxxxxxx>
- From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
- Date: Mon, 14 Apr 2025 15:21:00 +0000
- Accept-language: en-GB, en-US
- Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 4.158.2.129) smtp.rcpttodomain=amd.com smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
- Arc-message-signature: i=2; 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=dJtGkPvDkxhK6OHak/6MJ9rzmbPmzya5BKyZyO8mUIY=; b=H/xaxA1suAFYIWWD+PrGLyOiQKTW5xUJ1m6OgzlSX46fb+PXvNwRLRXwWDgPARsAAS4hzQaxNqjoYcmkEIXsTiA9UQxG+c2rBKUOsSjGC6rX7T3I19YH8vFDW7Ck7L8g3NgOD/PAcPHfu7lEj4ZDE979UD0hvIqVo4z/BRDIlh2xQlPp0ouu4V+iKEfBA6QF0O55+VjxY/NNGrCR3QMfgktLxiId4oW9xhcYjIKm4wpcGW0Zh5/B0fw7q+iQNyBK+100AW+uG6SL3p7RF/xIOuQ9J7a1U5j7DBCvT97hEYY9/Q6SptRd9z7rYoyArfHvKuX7dMdEffxekLVSON05jw==
- 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=dJtGkPvDkxhK6OHak/6MJ9rzmbPmzya5BKyZyO8mUIY=; b=gb0JqsF+qXYwe7lfKvIxJ7T8CizARMCGXsLZB/LspRjPIYUbMf0ZH8y90+Z4c2Ua9nDtl4AO7CeL8n+kyb3DzEbJZbpU4tNgLmwFF0+0sTS14ufnHHwtwuv0LLuIT+qjYAzACgO5XiiRTxKR1D5W2rnuwJ1OcbMf7fwfazS4SV2a9JSsFoZl6X2vDjHd2tzsDjONdU946LkgrHKh7PNRoihr8BwHZf18KMcpriEv3KK6/adQpMSCTcmDBGLkn/Vkt2QAIPsTraO29R7lF2uyy1mak1jbgfnjM5gxcey5hDk2wSaH8wxe2Yfcgzbo98bI/3sNNxaqILFmxUNeklyN6w==
- Arc-seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=C0e1vRTn3150nxlNbDlsPfNQcLo36OneZiXwW8Zmcaptv9OwXRy7lif6g2pxUxWr6VswEwhg1A/G42PxnLKsk3vnAIhNHgL0ZCi8P3TjlcJiN16Krg4IN9wuLpJTlt1UA/4F/+cDRX7MICjtgGjm8tmv8FJ0OJcG83k49+OGdYYmyS2KQxoq3IWBxkqQRAHChRCrf2R6O4JQrG2UZY4HgFsdpTQcArsOHojHM65/yZHR7hc1cCM4M60FxeBHUlIvBXbUJHBLG1efGXEAXOndUYvPENpw2VtDTlaaBdUtEHIN3SCyQAA0TK5e4Juebu+kmuK26Om5vb1QGrpoYSl6iw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=uzrQBe5k2hXZpB9twZv73Tb5ncZgouCSQEzmjyq/6GMDgBO5toW6BClUMe/PcOkHn3YMBTd5iNoHm+cJqtCshZb1d0Dgnf6aFqoQb3qhSNymfxFJAXuukk7LROxoAyJWCjreKZN4vPdKvpcOcPXjv7PWE8dd8awS1E9EHoH1Lj7SjK3DeZgjuwF4aorDVhgnBF4TtRWcm9ZkvVojLFmIxhLtrOu4gpdi/dF4oHQP51nAsg5ozvAXbwdSzMHzRo90vbJnt8MROflftkDbI9Ja9NYY1xp/ANo5fjAgG7zJ4CgGBPrqpWZuKgCh3YE6KLqzuvj9nj+E999rGCSQVFWoPA==
- Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Penny Zheng <Penny.Zheng@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Wei Chen <Wei.Chen@xxxxxxx>
- Delivery-date: Mon, 14 Apr 2025 15:21:48 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Nodisclaimer: true
- Thread-index: AQHbqvIQP3h8YyZqYkSDv4tGWZWI7LOi9uCAgABMVgCAAAL/gIAABWmA
- Thread-topic: [PATCH v3 1/7] arm/mpu: Introduce MPU memory region map structure
Hi Michal,
> On 14 Apr 2025, at 16:01, Orzel, Michal <Michal.Orzel@xxxxxxx> wrote:
>
>
>
> On 14/04/2025 16:50, Luca Fancellu wrote:
>> Hi Michal,
>>
>>> On 14 Apr 2025, at 11:17, Orzel, Michal <michal.orzel@xxxxxxx> wrote:
>>>
>>>
>>>
>>> On 11/04/2025 16:56, Luca Fancellu wrote:
>>>> From: Penny Zheng <Penny.Zheng@xxxxxxx>
>>>>
>>>> Introduce pr_t typedef which is a structure having the prbar
>>>> and prlar members, each being structured as the registers of
>>>> the aarch64 armv8-r architecture.
>>>>
>>>> Introduce the array 'xen_mpumap' that will store a view of
>>>> the content of the MPU regions.
>>>>
>>>> Introduce MAX_MPU_REGIONS macro that uses the value of
>>>> NUM_MPU_REGIONS_MASK just for clarity, because using the
>>>> latter as number of elements of the xen_mpumap array might
>>>> be misleading.
>>> What should be the size of this array? I thought NUM_MPU_REGIONS indicates
>>> how
>>> many regions there can be (i.e. 256) and this should be the size. Yet you
>>> use
>>> MASK for size which is odd.
>>
>> So the maximum number of regions for aarch64 armv8-r are 255,
>> MPUIR_EL2.REGION is an
>> 8 bit field advertising the number of region supported.
> So there can be max 255 regions. Ok.
>
>>
>> Is it better if I use just the below?
>>
>> #define MAX_MPU_REGIONS 255
> If there are 255 regions, what NUM_MPU_REGIONS macro is for which stores 256?
> These two macros confuse me. Or is it that by your macro you want to denote
> the
> max region number? In that case, the macro should be named MAX_MPU_REGION_NR
> or
> alike.
I know, NUM_MPU_REGIONS should have a different name as it’s a bit misleading,
ok
I’ll name the macro I use here as MAX_MPU_REGION_NR.
Cheers,
Luca
|