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

Re: [Xen-devel] [PATCH v5 3/7] xen/arm: keep track of reserved-memory regions


  • To: Julien Grall <julien.grall@xxxxxxx>
  • From: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Date: Tue, 13 Aug 2019 15:39:35 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.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-SenderADCheck; bh=R2DoG6AcJki3Wd8psWnSVRHpCZXONme9FMjjwKM4Afk=; b=PD8XBVcE4ytrw9svHnAWrNXH/qjf20pWKHyY+h/tjud9+N0dHH6kMYqO7XvMDhf3cyZcwBt6I4vTcpGSh3y2ltQ0cAi3Q5b5XzvXrPix+aGCpXoJXWK8aoNiu/mlhshZlerBumxNAuV4ZpoRan3Mjeq5zOOrTyB0DaH3i5n76ZnAFqqhaqH/5CqYl6DrHncw6K1q1LoMsXW+BJ0YOan4HKLNLQSAoHvasS2K/6OF150uiqWxsMBOUGgUyvzwS9G3NWx5g5LmHbmC7OX0iv2Ez36FoMdsFUdKAGBLJCGeLnq6y4deVynM0ECQgJdh59LLHIOsyq6QenXbYn3hTkNVOQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NrT0bUNqmxMP0W21WJDdLl0o6dNTv9nQi+J6dLpKAQ55ssoqeSEfZhaV2HTKtW1nqhTQBS8EHeI8tW0Do2xRgjkbFbMC/8tPbMz1aAKvLsuDXsl+zLBV1xmygZxrAdR8nYO6BSwADzQfczUAuyHUz1BczC3UNaI4FSX9dR+XhGlNBB+dFcAVEo5z8RJm/83gSOmq4lOLKKGjVD9WmsBt2AwxXmP6nSJPy3LWRq6wpRrcsZMzS0AMgrgVkO1+EQ5wAeg/rOVeWggahIWdrEr/AjcwnUEpuxvvr7Qd/3p45lXznOUtZ74Zs8Syp/KjC+htatHMvxfYRjHqIirI4iM/rg==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=Volodymyr_Babchuk@xxxxxxxx;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Stefano Stabellini <stefanos@xxxxxxxxxx>
  • Delivery-date: Tue, 13 Aug 2019 15:39:55 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVUV1QMNfXhdMZzkSWk2vkeQwkS6b5IrWAgAAGPwCAAAfPgIAAAHEAgAAGrQA=
  • Thread-topic: [PATCH v5 3/7] xen/arm: keep track of reserved-memory regions

Julien Grall writes:

> Hi,
>
> On 8/13/19 4:14 PM, Volodymyr Babchuk wrote:
>> Julien Grall writes:
>>> On 8/13/19 3:23 PM, Volodymyr Babchuk wrote:
>>>> Stefano Stabellini writes:
>>>>
>>>>>        {
>>>>>            device_tree_get_reg(&cell, address_cells, size_cells, &start, 
>>>>> &size);
>>>>>            if ( !size )
>>>>>                continue;
>>>>> -        bootinfo.mem.bank[bootinfo.mem.nr_banks].start = start;
>>>>> -        bootinfo.mem.bank[bootinfo.mem.nr_banks].size = size;
>>>>> -        bootinfo.mem.nr_banks++;
>>>>> +        mem->bank[mem->nr_banks].start = start;
>>>>> +        mem->bank[mem->nr_banks].size = size;
>>>>> +        mem->nr_banks++;
>>>>>        }
>>>>>
>>>>> -    if ( bootinfo.mem.nr_banks == NR_MEM_BANKS )
>>>>> +    if ( mem->nr_banks == NR_MEM_BANKS )
>>>> Looks like you have the same off-by-one error, as in previous patch.
>>>> I can see that it was there earlier. But it is good time to fix it.
>>>
>>> I don't think there was an off-by-one error before this series. So
>>> what do you mean?
>> I explained this in patch #2. Imagine that NR_MEM_BANKS = 1 and you have
>> one memory node in the dtb. You'll fill the first element of the array
>> and mem->nr_banks will become 1. This is absolutely normal. But check
>> above will fail, which is not right.
>
> Ok. So the off-by-one error has been introduced by this series. So
> this should be fixed in patch #2 not here.
Yes, sorry. I got lost in the code.

-- 
Volodymyr Babchuk at EPAM
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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