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

RE: [PATCH v2 1/3] xen/arm: Add memory overlap check for bootinfo.reserved_mem


  • To: Julien Grall <julien@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Henry Wang <Henry.Wang@xxxxxxx>
  • Date: Fri, 27 Jan 2023 11:43:41 +0000
  • Accept-language: zh-CN, 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=0E9/pU3fuaw+nh0NzIeuODgm/QU38osue3b8VFLQ5Gs=; b=ShWRHAJdkyevaHWHsGlSrPbUaUKYQQyZOLfqRIFpRKTT6jHwAkqnINMtjM2/I12Ax88f8E2u3WOp1K7HnniZZCaNvk4vKXEQSgsWuNlAtw6CPhg3oSPsgJefT2IhQd6wZoKyP8h9flF6Fz2SB0/YGzL0TkAFqjdjbzMWeviiVLgx0bf794FUE1Wqi1kjJhsGaqAJiT89Xx9ECZVtz1a8rTTkuZJjVIqWSXQUCjuXtYjtHWIi80v0B5Y+4IIiN1jfwqyNbgs6ZWSYqjg1rQ+kvgXNdNxCfed6QZB0VFuXek+aRXgmngrFDSQcj30oxmermGqJlhDN+CeSexiP9xuZjw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SCh+pyQTm/dUr2N4L48rhAUSbA6+i8T7M6cCSKBGw2G7f4zMDn1MUAbKZJfPCLEd0dxuHWaRe8pOFf50WJdt1GtowEqeLuFnW6Z+qaU8+Akdk3BaVJGZ1IvYHAEHGWD62AjdJcLYT51lvMrXeIT4sPj5ektpUQ6mrjIMN6JX3x7EvgLjPtrDv6Lug0M54l/hlUJkJJzT1Dhnx0XGPYU46Z1ETI2ier6zt8UJhgY1+CjLKqB0YvoMsZ6mpstjb/Czcl0UaDHM80I5YxDPccqTbecoCMVAQVlrTUsiTWOUuYWNAX5LNL8P01VlWnJ2P+qPPnji39quyAPDwUWDnmObqA==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Fri, 27 Jan 2023 11:44:09 +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: AQHZD2qaLVIiQ3Z13EK3E/FV+D1Sxa6vQQGAgAMop3A=
  • Thread-topic: [PATCH v2 1/3] xen/arm: Add memory overlap check for bootinfo.reserved_mem

Hi Julien,

> -----Original Message-----
> Subject: Re: [PATCH v2 1/3] xen/arm: Add memory overlap check for
> bootinfo.reserved_mem
> 
> Hi Henry,
> 
> On 14/12/2022 03:16, Henry Wang wrote:
> >
> > +static int __init meminfo_overlap_check(struct meminfo *meminfo,
> > +                                        paddr_t region_start,
> > +                                        paddr_t region_end)
> 
> I am starting to dislike the use of 'end' for a couple of reasons:
>    1) It never clear whether this is inclusive or exclusive
>    2) When it is exclusive, this doesn't properly work if the region
> finish at (2^64 - 1) as 'end' would be 0

Good points!

> 
> I have started to clean-up the Arm code to avoid all those issues. So
> for new code, I would rather prefer if we use 'start' and 'size' to
> describe a region.

So I will use 'start' and 'size' in v3.

> 
> > +/*
> > + * Given an input physical address range, check if this range is 
> > overlapping
> > + * with the existing reserved memory regions defined in bootinfo.
> > + * Return 0 if the input physical address range is not overlapping with any
> > + * existing reserved memory regions, otherwise -EINVAL.
> > + */
> > +int __init check_reserved_regions_overlap(paddr_t region_start,
> > +                                          paddr_t region_size)
> 
> None of the caller seems to care about the return (other than it is
> failing or not). So I would prefer if this returns a boolean to indicate
> whether the check pass or not.

Sure, will fix in v3.

Kind regards,
Henry

 


Rackspace

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