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

Re: [PATCH 7/9] arm/mpu: Introduce MPU memory mapping flags


  • To: Ayan Kumar Halder <ayankuma@xxxxxxx>
  • From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Date: Tue, 4 Mar 2025 12:34:46 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org 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=renp6NUFPwLDQcAZam3SHySFZV7cJ0HGwG3/Ce30Vvo=; b=lyPe6OStATLPuKe6te26/wWziwBrEO2esTKQk2Uipej+//YbYJ2b8sxpnB2d2vnfGqTjzW/PzOGzYf9SCb6BhZC7cfla2xIzoImcJ/ChESOUEVCW7Wch81zZx5r7ASPmVEnBXSiwILYlav1LnazSxa/x4T9WRtoOV3oI8L74M/A1WWEPSavmuqdd4RhQKi9b9kYSUd0XBzNgMVVe63RP46EmH6uaebP6s69B7JilSptenzO7L5VK98J0Ha8NFtsobdVaPb5JLMDBcyJki1T5covHWaw5F6vgGNw24h/MMoGF6LdJknO+gDM5CfgkNUk8Y3XXDbXgvsXBvTfdlWQVog==
  • 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=renp6NUFPwLDQcAZam3SHySFZV7cJ0HGwG3/Ce30Vvo=; b=qb+ZkGD6MzwqOyQ4+eN7AZ0IH3EsYiEsnYg2Js7LXxMuVaUI6H2H4wfTUuUZK4fpnaKTQeImklrZfF4ea0KJ00HHAduD0smxMSRsLiIXhFqPCGjawNcvCMTeN3xR0byTFXF8B5Cgg33mMCJsFURi3rwq9YVeDjp+Mkvk0PgG7lANc3p8KfI5Da4yu6hBFX2+dRq8d/2uKeCSo8UVPhspaJyRM6pr1tWCt/kDqDFEYcYe8Dqnz3caEXDFtJ6GweoRPAEaspJIAC1yWqKRCkZoHbkwnFAXY+75MlonJ9kb0BY8y9NRb9xMyIskl/+lUhhLPfehjZhKl0AvzrBhT3Tv/A==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=DSoLizXazBM7Si5ol2ork/YWA/LhtTieEPSeOVcKmRwmSi8yIDyezswHbtcZcaD6a94VjY1nziSaskF3/OM+5fh7ncEs8wHFG5xMAYqlDgmxb2MSW2PoNi0mVatVnFaY0SoPtTe6Xa7xd1DCHQ72o/f2zpWtw3dmeRV6exTApya446k6FZxpecjIMdt6d8FmuwDfGz8amYUcjDrw4/y4Kc2/zWrs+KB3aE7cMIG0EOJHr2u/azST2cS3dvvgDu3Swl4TTfba0SeN0BSQt/JQyUm7n1GBPeAodvmF9tghBsynapZUgU8HWRnVfzk46FqxJ1hXtm8AszeDND1/tN6qPQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=K9w/fTRQxXBEw+kxEYQfcDYytT7/+L6mxZBq8zdhIKsJPB1pdeaZl56uoqKe1JitdwecGPnkw2xxhqnbi6OdeABmPDYemnxMZsgP0+gkf9Df6rJ4AUICkD2Wn3o5gbrlVieygtxqnXeA7TjD+FAsZ6unK+pdqb4TyJG7qpHdNLWDdRp0z6XqBKUNmOz3gP06rlPOxyYvVpKJJOaQF9zNL2RsJgRfFsQXS0A1pgX7ug4CRqGRhtflr4kceKhzVxEFn1QAOEI+F3fMIN+tugD7wdnp3fSx0Z1ucR3kwlT0DUUNpwKeHRHDRm0OHB6rXndDrZvTCOgI6fo4h2icvnRYFA==
  • 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>, 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, 04 Mar 2025 12:35:11 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHbifxxstWZu1+izkm98KZaptgcyrNi5MCAgAAKwYA=
  • Thread-topic: [PATCH 7/9] arm/mpu: Introduce MPU memory mapping flags

Hi Ayan,


> On 4 Mar 2025, at 11:55, Ayan Kumar Halder <ayankuma@xxxxxxx> wrote:
> 
> Hi Luca,
> 
> On 28/02/2025 16:18, 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.
>> 
>> 
>> Introduce the MPU memory mapping flags in asm/page.h.
>> 
>> Signed-off-by: Luca Fancellu <luca.fancellu@xxxxxxx>
>> ---
>>  xen/arch/arm/include/asm/page.h | 25 +++++++++++++++++++++++++
>>  1 file changed, 25 insertions(+)
>> 
>> diff --git a/xen/arch/arm/include/asm/page.h 
>> b/xen/arch/arm/include/asm/page.h
>> index 69f817d1e68a..22f7d2c6cb30 100644
>> --- a/xen/arch/arm/include/asm/page.h
>> +++ b/xen/arch/arm/include/asm/page.h
>> @@ -62,6 +62,7 @@
>> 
>>  #define MAIRVAL (MAIR1VAL << 32 | MAIR0VAL)
>> 
>> +#ifdef CONFIG_MMU
>>  /*
>>   * Layout of the flags used for updating the hypervisor page tables
>>   *
>> @@ -90,6 +91,30 @@
>>  #define _PAGE_CONTIG_BIT    8
>>  #define _PAGE_CONTIG        (1U << _PAGE_CONTIG_BIT)
>> 
>> +#else /* !CONFIG_MMU */
>> +
>> +/*
>> + * Layout of the flags used for updating MPU memory region attributes
>> + * [0:2] Memory attribute Index
>> + * [3:4] Execute Never
>> + * [5:6] Access Permission
>> + * [7]   Region Present
>> + */
>> +#define _PAGE_AI_BIT            0
>> +#define _PAGE_XN_BIT            3
>> +#define _PAGE_AP_BIT            5
>> +#define _PAGE_PRESENT_BIT       7
>> +#define _PAGE_AI                (7U << _PAGE_AI_BIT)
>> +#define _PAGE_XN                (2U << _PAGE_XN_BIT)
>> +#define _PAGE_RO                (2U << _PAGE_AP_BIT)
>> +#define _PAGE_PRESENT           (1U << _PAGE_PRESENT_BIT)
>> +#define PAGE_AI_MASK(x)         (((x) >> _PAGE_AI_BIT) & 0x7U)
>> +#define PAGE_XN_MASK(x)         (((x) >> _PAGE_XN_BIT) & 0x3U)
>> +#define PAGE_AP_MASK(x)         (((x) >> _PAGE_AP_BIT) & 0x3U)
>> +#define PAGE_RO_MASK(x)         (((x) >> _PAGE_AP_BIT) & 0x2U)
> 
> Can you point out to the references (in some Arm doc or somewhere) from where 
> you have picked these values ?
> 
> Also, AFAICS you are not using these macros in your current patch serie. So 
> can you send this patch later (along with another patch showing the usage).

I’ve used all of them in the following patches, the only one not used is 
_PAGE_PRESENT,
but if possible I would like to keep it there as it will be used on the MPU 
subsystem management
in order to signal to the subsystem if the mapping is to be created etc, so 
here we are trying to
use the same interfaces of MMU in order to reuse the most of the common code.

Cheers,
Luca

 


Rackspace

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