[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 4/5] arm/mpu: Implement ioremap_attr for MPU
- To: "Orzel, Michal" <michal.orzel@xxxxxxx>
- From: Hari Limaye <Hari.Limaye@xxxxxxx>
- Date: Wed, 27 Aug 2025 12:25:44 +0000
- Accept-language: 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=yKmhsdNUzQbr3Ja1zHQ/k6AJXdET1rTC4/GgK9+u1Ts=; b=EJ5W4G7ETRvUEmImdh3ajartoslDksez13I3eqDS1sMMzr/H8cZVlhQF5wJf1uGUOtf+VxYHtAslJh8GcnuqoCxpVwJYjuY8DEauFzXdNsUVMCMAbagK2b3+u231rfKmyaJOjzyYTdQA0x6NYhQm1nyLxAoNqZhJWjd5k9z89oQxaPBeNFQ5x1IWvLGLBlLnDPXlzwxuea5UKdUZgm1mjcc6bVfiM74ghayTL9QMfM5HIInmKyImsgAFxotpioUofL/cP56oPn2FmffQI+9o767LKJyO3UH4pPbi1GrJM6A+jk0WUlrZFfH/BPEoHKg2L6Q1eC5sjP+al/YL+eoa1g==
- 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=yKmhsdNUzQbr3Ja1zHQ/k6AJXdET1rTC4/GgK9+u1Ts=; b=GdFBhAPROU/tvfQcviyGYySznWMDRr0J35giTPBZ96BzryND6di4O7eJBb/AZdItTG1e2kxOpD60WxDvIFwzw5aVNUPpcU9pOXQf0CUHGYnWXDW8sNQhf+oHIAGrYKZghu1fqy6dVVAgGUcOgJAWx0epDd/UPhg6GPr1B+jFXGjIJYvnD4D9DhzeqOtsBsKuBCsIpuYsxI50CdQOmb6SwLcMhBDC1zJS3HDQ08LTliSjENk6HqAaYoxdbUCjd8HS+R3ZPv3sQ8ok8fFQ1AqrN7x/U3dB1WESMrgPp6Tzdwwo5OwF+pmiDPKB0DTv67bSkPcsGys+c4XIjTslbcQMmA==
- Arc-seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=TT8gz4LpNNm9PGZ3O9Sqi3VUmasrreOIqFb10iZlFM09C9IlK1MOVotA0lZezQP0GXPGEQwn7amttgeeLDaacTRuGsJcPBvsEruTos3OZWJ84+wzXG+T8VBmqwp096Uw511VzCTYSodmhPKIUMsJUxO8GWdhJwU350YVE5Nc1fQ9Crc7rtYPAt1VtPc0NamngELW7R56QV3Qe3ABQcd3tELg/9npIc9Bn4XgcPr7zAj4xoZfqriwGjHQf21d2myVdN3R3A2GoejysZCQAIhOPZyrB0LXb6pWSknPNm+6AUwlvFIBjgK6ysB8gWzIlExUTrwQBQwYf4tyy1V6aY1UeQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=lZEat4D1Ufu/LBe7j5fEI7EA8DvUhGNixFYVR8AhzpTVe7IXrwbcwoh1KJHs2EgZNjze4tg/6wGO4+mr0zNf21D2Zo2xBbswhuxGKIVKvzgv91jrVtm81gQuUm/cnZfq11oAWozUJoZ8wp+KrCZmFxKqjFxbE9clHM5kBUWox2QlYS8z0dzoXvAYRuHChNO6h44RtTTvO3F5nPIKBnhwh9BEc1Mw0FNsr6V9lRKCOJ8/OGWIs2kMZRtufwn1NKBRORDZCvle9uRapXU5gMsp+E+6G2dTXvrzMOaLXntwr40j3NYgzkfJwOMSNQ7bsAN2bhNTaZpOLUaM4tsZCpQ9/Q==
- 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>, Luca Fancellu <Luca.Fancellu@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
- Delivery-date: Wed, 27 Aug 2025 12:26:38 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Nodisclaimer: true
- Thread-index: AQHcEzkCJOS9/PWe+UmuJdsGAsOPLbR2dO0A
- Thread-topic: [PATCH 4/5] arm/mpu: Implement ioremap_attr for MPU
Hi Michal,
>> + * Maps a temporary range of memory with attributes `flags`; if the range is
> Why do you always mention 'temporary' in the context of these functions? What
> prevents us from using them to map a region for a longer period of time?
> Also, temporary range is a bit confusing term and should better be replaced
> with
> 'Maps temporarily a range of memory ...'
The intended meaning of ’temporary’ in the context of these functions is that
the mapping is created, used, and then destroyed in a sequence e.g. where
map_domain_page and unmap_domain_page are used. The term transient is possibly
more fitting than temporary, and this is the term used in
xen/common/page_alloc.c. Nothing actually prevents us from using them to map a
region for a longer period of time, it is just that the intended use of the API
is for transient mapping. Regarding the confusing comment - noted I will fix
this in the next version of the series.
>> + * already mapped with the same attributes, including an inclusive match,
>> the
>> + * existing mapping is returned. This API is intended for mappings that
>> exist
> What are the use cases you want to cover to try to map the same range with the
> same attributes more than once (without unmapping in the meantime)?
The use case here is some places where a memory region is requested that has
already been mapped, so we want to simply return the mapping. For example when
the fdt is relocated in start_xen this uses a call to `xmalloc`, which
eventually calls `map_domain_page` for an address in the static heap which has
already been mapped.
>> + * transiently for a short period between calls to this function and
>> + * `unmap_mm_range`.
>> + *
>> + * @param start Base address of the range to map (inclusive).
>> + * @param end Limit address of the range to map (exclusive).
>> + * @param flags Flags for the memory range to map.
>> + * @return Pointer to start of region on success, NULL on error.
>> + */
>> +void *map_mm_range(paddr_t start, paddr_t end, unsigned int flags);
> So far, all the MPU related functions use [base, limit) instead of [start,
> end).
> Do we see the benefit of diverging here?
>
> ~Michal
Noted, I will align this to use [base, limit) in the next version of the series.
Many thanks,
Hari
|