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

Re: [PATCH v5 5/6] arm/mpu: Introduce utility functions for the pr_t type


  • To: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • From: "Orzel, Michal" <michal.orzel@xxxxxxx>
  • Date: Thu, 22 May 2025 12:01:46 +0200
  • 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=6hyIZAZIXb6CfumXiODnehY590AZP1SGyYkc/rf1q34=; b=ihWgoTtGm4V270/P6bFm1sGYZsw4z2K+z7Pmlyzcyiog0mbGI0Al0Eg9qlHwBMarQTMidfJtY4qdpsE29efIO+SKmFp32y+EVvMDDXDLVMvSY68IpP9TZfuOURh1S+k/EG8ai/oJG+XdZracf2ENPk+sKKCTQ2pInpUoK6hZkNh4RfgtvujpE4dquFgk3bXlopWdspBP1x+yUisu+KjbzcNx6YhirchUybFniux0uC6ieRTljuj5GXA3wgBew8Y9Trie9z08XOB0snmZXzfmvD1H/5jwpIFiSMY/wUv3sQSlEs13GzWcG1kX4VLfGOHPvLv1pCZ/dK7B1cfZAXyoOg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZyYFfofb7RRxU0Neu6+j7sGaHeKOi9bZbBaQvw33NwZ9H0gcAeQ52e0M9JNICLa57r3oS5vMo/ogyLms/LE+85mWqj60OdokNgoWPrEjwWp9R9vG/0TF0d6U9OkLajzmQeJVNZwoosgvWky9xavL1I59rc1s10YZ59q7BOInPHRQVm8SUdNESX8Ir/tfMyTdPrM6yY5meVi4d6hJnScBk+6o7UJv6gIx+ECB+HKs1XrYtwao/96nyYPHz3ZbuH2e4CcviKp9crLXVBITcEQPHF2WesJUscg2KoVyAe6DF12Nj8OwOaQ/Vk5j8nt5DRRjhGU0noOhQuqsdDppWgQt5g==
  • 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>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Thu, 22 May 2025 10:01:59 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 22/05/2025 11:56, Luca Fancellu wrote:
> Hi Michal,
> 
>>> +
>>> +/*
>>> + * Set limit address of MPU protection region.
>>> + *
>>> + * @pr: pointer to the protection region structure.
>>> + * @limit: exclusive address as limit of the protection region.
>>> + */
>>> +static inline void pr_set_limit(pr_t *pr, paddr_t limit)
>>> +{
>>> +    pr->prlar.reg.limit = (((limit - 1) & ~MPU_REGION_RES0)
>> Might be worth adding a comment that PRLAR expects inclusive limit hence 
>> (limit -1).
> 
> You mean on top of the assignment? I’ve probably misunderstood you comment in 
> the past version
> and thought that the @limit description was enough, I’m ok to add also this 
> comment.
The comment says that the address must be exclusive. The code then transforms it
into inclusive before the write, so one might wonder why.

~Michal




 


Rackspace

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