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

Re: [PATCH v3 03/19] xen/arm: p2m: Replace level_{orders, masks} arrays with XEN_PT_LEVEL_{ORDER, MASK}


  • To: Julien Grall <julien@xxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Fri, 25 Feb 2022 08:27:14 +0000
  • Accept-language: en-GB, en-US
  • 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=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=gkd/1LMAIeDmVlc4RspthIUiwxY6FbLzuBtfbkw98OA=; b=Llna29zj+CiIIgANgRmzfuOJe2v1yCHBjrgEkVK0jHruN/CNfZsnO9hB0UhllzUM1w71/ha6YsemTNe+1HfJjcjjLxhYn4elZpcte+baEEfKB+5bfPpKYbzHYHTmkgdxK1kRxPNkbhEa3aHTt0tBPPhBRScFUrl8mAb6+l+y0zQrPU5JWAFHWGnaUrITmoAYlEXqy3KrQFqE+3WyFHXbSpc39LL6qMIM043OnhNBshLNUoHIh1FbogErlolha9ndEI6QrmGLOaFEmeQ3XiazSppdjlXGM+HFnOMUA79E+xZYMag8FXYb1yuSkjiJ2InBuTo34Q/aevuql1pKjlKMng==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IxIf4QKx0le80i26AsB+XGIi5U3Tj7be3LfHBMMu4N2FwuVrNBzzoglnfMrJYA5NQFXVa2weA/8n0Bij5d2ojh9mwgqg4Lw/VLteShCA2/T3xgDhYe2XJXmxZuxc0VsmmtL8p3FOvoWqW9xD4CBlhO4RcuKyevkDWC3M8qNTrff0ygVgZK3+gzY2DbH7DNWTg1FEKhe9aZg7K8KV4ka5R/sRH4C0jDttHdXKZKmKCJMhzAxo5mJRzSicmN/S4w420Xsu7/7GqkeEcQazfXNcrTHhW9VvaXoKlhDNEiSZcC473SrvoVNxNKQiUrM89krMnRc6RddrmE6LWqGFHq/K+A==
  • 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>, Julien Grall <jgrall@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Fri, 25 Feb 2022 08:27:45 +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: AQHYJwz3/5rVW4vmxU2XDig/F0ROyKyfuzqAgAOV+oCAAKOsgA==
  • Thread-topic: [PATCH v3 03/19] xen/arm: p2m: Replace level_{orders, masks} arrays with XEN_PT_LEVEL_{ORDER, MASK}

Hi Julien,

> On 24 Feb 2022, at 22:41, Julien Grall <julien@xxxxxxx> wrote:
> 
> 
> 
> On 22/02/2022 15:55, Bertrand Marquis wrote:
>> Hi Julien,
> 
> Hi Bertrand,
> 
>>> On 21 Feb 2022, at 10:22, Julien Grall <julien@xxxxxxx> wrote:
>>> 
>>> From: Julien Grall <jgrall@xxxxxxxxxx>
>>> 
>>> The array level_orders and level_masks can be replaced with the
>>> recently introduced macros LEVEL_ORDER and LEVEL_MASK.
>>> 
>>> Signed-off-by: Julien Grall <jgrall@xxxxxxxxxx>
>> Reviewed-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>
>> One open question: At this stage the convenience aliases that you
>> kept in include/asm/lpae.h are used in a very limited number of places.
> 
> I am not sure I would call it very limited:
> 
> 42sh> ack "(FIRST|SECOND|THIRD)_(ORDER|SHIFT|MASK)" | wc -l
> 65
> 
> That's including the 9 definitions.

My bad I looked with your full serie in my tree.

> 
>> Could we remove those and use only XEN_PT_LEVEL_* to make the
>> code a bit more coherent.
> 
> I made an attempt in the past and it resulted to longer line in assembly. So 
> I am on the fence to whether the aliases should be completely removed.
> 
> At the same time, XEN_PT_LEVEL(...) is handy for places where we don't know 
> at compile time the level.

One other big argument for making the switch is that XEN_PT_LEVEL is far more 
specific then FIRST_ORDER and others which are very unspecific names.

Anyway definitely something that we could do after your serie.

Cheers
Bertrand

> 
> Cheers,
> 
> -- 
> Julien Grall




 


Rackspace

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