Re: [PATCH 2/3 v9] resource: add the new I/O resource descriptor 'IORES_DESC_RESERVED'

From: lijiang
Date: Thu Mar 28 2019 - 10:00:31 EST


å 2019å03æ25æ 20:24, Borislav Petkov åé:
> On Mon, Mar 25, 2019 at 02:53:02PM +0800, lijiang wrote:
>> In this function, i printed its values, and only got the value of reserved
>> type, so i changed the IORES_DESC_NONE to the IORES_DESC_RESERVED.
>>
>> In addition, after the new descriptor 'IORES_DESC_RESERVED' is introduced,
>> the IORES_DESC_NONE does not include the IORES_DESC_RESERVED any more, it
>> could miss to handle the value of the reserved type.
>
> Yes, IORES_DESC_RESERVED is supposed to denote the e820 reserved type.
> Why should IORES_DESC_NONE include it ?!?!
>
> IORES_DESC_NONE is, well, an invalid, i.e., "none" type:

Yes, i see. That indicates an empty area, or "void" type.

>
> /*
> * I/O Resource Descriptors
> *
> * Descriptors are used by walk_iomem_res_desc() and region_intersects()
> * for searching a specific resource range in the iomem table. Assign
> * a new descriptor when a resource range supports the search interfaces.
> * Otherwise, resource.desc must be set to IORES_DESC_NONE (0).
> */
>
>> Do you mean i should never touch the three chunks? If i made a mistake, i
>> will remove this changes next post.
>
> I'm looking at the hunks below and you're changing ->desc assignments in
> some random function which doesn't look like you know what you're doing.
> Maybe it gets you what you want but it sure as hell doesn't look right
> to me.
>
I have realized that there could be a problem with this changes. Indeed, here
it denotes an empty area instead of a reserved area.

BTW: Looks like the name of this function(__reserve_region_with_split) is a bit
misleading.

Thank you for pointing out this problem, i will correct them next post.

Lianbo