Hi Jan > -----Original Message----- > From: Henry Wang > Subject: RE: [PATCH v4 09/17] xen/arm: introduce a helper to parse device > tree NUMA distance map > > Hi Jan, > > > -----Original Message----- > > From: Jan Beulich <jbeul...@suse.com> > > Subject: Re: [PATCH v4 09/17] xen/arm: introduce a helper to parse device > > tree NUMA distance map > > > > > Great points! Thanks for pointing the 8-bit truncation out. You are > > > correct. > > > Somehow my impression of numa_set_distance()'s first two arguments > are > > > already "unsigned int" so I missed this part...Sorry. > > > > > > In that case, I think I will add a check between "from, to" and > > MAX_NUMNODES > > > as soon as the values of "from" and "to" are populated by dt_next_cell(). > > > Hopefully this will address your concern. > > > > While this would address by concern, I don't see why you want to repeat > > the checking that numa_set_distance() already does. > > Correct, I think I would better to move the check in numa_set_distance() to > the caller fdt_parse_numa_distance_map_v1() as I believe if the truncation > really happens it is too late to check in numa_set_distance().
On second thought, maybe even remove the same check in __node_distance() if we do the check in the caller, as I believe they will suffer the same problem... Kind regards, Henry > > Kind regards, > Henry > > > > > Jan