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

Re: [PATCH v2 4/5] arm/mpu: Implement ioremap_attr for MPU


  • To: Hari Limaye <Hari.Limaye@xxxxxxx>
  • From: "Orzel, Michal" <michal.orzel@xxxxxxx>
  • Date: Thu, 28 Aug 2025 11:41:47 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=arm.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • 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=/wtlJM1S8+cvOPbwuOh4GOQdJo1AYMqBzooFprWDJtE=; b=UfsUS6K0mB02HkZk6re6jrLhHioT8iAmd2OzLR7jHDd2YafMLBsYVIJBGXlh9m8Ai8l0vRLyIlHId2SDqbF/z1n0QXv1HRxtzKtzbusAya2SKqr9uRgV9wuQ9sXkHOSso7Eopt35NVyMvRC8/GQat+hnVC6ScBkqDo/ZN31GfRPlj492O7zJXhUKBAN77NT3dZ+vbELdE+sHGIspdsu8C7pUCeI7R/JcEqmkNOs3KTMtSqsk5wLd0a/2XY5b0nRGJEWlTpFQ+jcxUSifxgVIrYFAU+hOZZnU9deUbM/ppyQjfye3LSdAQ/qL81QCcE9YiNNowJqKZHZzIRU8dB85Zg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=B0UZuCteC4Xx42uxEAvuJnwAfht6CeUikq7BoLhyDwHTPJWfdU+PfDV6YI9kp5xuvr+awU0UWt4daG899i07bGUrWCYSIXoJhJULMUwD7CNwN0U+B1lUiv8JC92DWq713DAQ2aLrY/a5OS1uWFLpKtUqVO8kXa/FuKsbJCs66crPeL3m5OSSDkgyCO9zUGd1HjA0WjhZ+1Arhao4Dqj2Mq7aBVQjizCub6buUq+dgY3z0KzEco0lZfj/wGVaFNP63sJZmri9fMiz9XksTvCKjyPOZnfZcZHTwzk5N9NPfpQdMZsZJc5jv6kg1d2LmjdoRlP28at4Ez7IgofJ+p2E8A==
  • 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: Thu, 28 Aug 2025 09:42:00 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 28/08/2025 11:37, Hari Limaye wrote:
> Hi Michal,
> 
>>>
>>> +    rc = mpumap_contains_region(xen_mpumap, max_mpu_regions, start, end, 
>>> &idx);
>>> +    if ( rc < 0 )
>>> +         panic("Cannot handle overlapping MPU memory protection 
>>> regions\n");
>> Why panic? This function is not used only at boot time and should propagate
>> error to the caller, it's also within a spin lock.
> 
> Good point - I will update this to propagate the error in the next version of 
> the series.
> 
>>> +    /* This API is only meant to unmap transient regions */
>>> +    if ( !region_is_transient(&xen_mpumap[idx]) )
>> So is this the only purpose of the transient flag? To check that 
>> unmap_mm_range
>> is used on the range that was mapped with map_mm_range? What would happen
>> without introducing this flag? You already check for the matching attributes.
>>
>> ~Michal
>>
> 
> Yes this is the purpose of the transient flag - we want to ensure that a call 
> to unmap_mm_range only destroys a mapping that was created by a matching call 
> to map_mm_range. Due to the fact that map_mm_range may not create a mapping 
> in the instance that one already exists - `/* Already mapped with same 
> attributes */` - we need this check to ensure that unmap_mm_range will not 
> destroy a pre-existing mapping.
Ok, understood.

~Michal




 


Rackspace

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