Re: [PATCH v1] ACPI/IORT: Workaround for IORT ID count "minus one" issue

Robin Murphy
2020-01-10T10:51:17Z

On 2020-01-10 6:22 am, Hanjun Guo wrote:
> On 2020/1/10 0:02, Lorenzo Pieralisi wrote:
>> On Mon, Jan 06, 2020 at 05:19:32PM +0000, Robin Murphy wrote:
>>> On 30/12/2019 12:27 pm, Hanjun Guo wrote:
>>>> The IORT spec [0] says Number of IDs = The number of IDs in the range minus
>>>> one, it is confusing but it was written down in the first version of the
>>
>> Why is it confusing ? Because we botched the kernel code :) ?
>
> I think 'minus one' is not bringing any benefit :)

Well, in order to describe a 1:1 mapping of the entire possible ID
space, the alternative would have to be to overload the
otherwise-nonsensical value of 0 to mean 2^32, which I would argue is an
even more non-obvious inconsistency. Encoding strictly positive values
as 'value - 1' is a relatively common thing (at least in hardware design).

Robin.