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
