[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 12/13] xen/device_tree: Introduce function to merge overlapping intervals
- To: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
- Date: Thu, 11 Apr 2024 13:36:17 +0000
- Accept-language: en-GB, en-US
- Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
- Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Lb7QXCCmn67zncSAysXNO9F+injbQ4l3htdtoi5lf50=; b=RFDrb+NglJmwnyAPizPmNZU4bBbFs66b2SDj9Ezi5uzImlzs4k9fHmJ8M5l1rwI8vns/Pa1GO+Qa8oVBRv98Uwc6AC1PQKuFD85XAiLPaBtpmvc8kymOuQ2TfpTuRWWxMaW8Kac/he5ccqXFWhTqhDn/eE7YsfDsBOF1lMtvePxMelNptw48Nk3Y1gLvNuLmQqF1CBlOlxBmUyJnDCIztReWnCh65vzUxhI64Rhr1om+4RX2QoOJz0BsCNxC1o83AA83XEDm/sf0a8IQilwRrEUW0zIF1rQDT/KLzvB4wwliwtoXUbAgxRxI4bm4WLhQ9AMM+r8pTD71wRTHKeMDgw==
- 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Lb7QXCCmn67zncSAysXNO9F+injbQ4l3htdtoi5lf50=; b=BDHU5BheOQ1U4oUSD3C5qmUc3TJI6xPY8v3cj2an+r743klkdd0RKdh2/ESwt7x4Lg0iODhI7HUsL2kYsKsPXO0iSR9HuLhS8wgN550oY8F2JEqWrDY9Zr/1zPUhWoxv0A2y/VHPoQUGYr2X/FdGHyWuzZOxIvERCgCVw81r8bk7FZxG9VRpOUz6vyvtn534Ex9kZETVipjppD+z+KvQfhmOUV9RFFaMWAakWNTevYxioJnBf+nUGwUp705TliRsrZBrFt5qZj5voc3AcETQ6hnMlmRK9+4o5OPXfejZcvLxB7kU+qRwvQvrbqolWRVJjsGpCF7IxUZR76jdC648gA==
- Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=cZo7tn1gnGDkSCtWrLiL/ZRKSaWG6taFBcYHnlYK5GlRBYXtPDG9erWNz++Sk2HqLoXhlzI7R39R6GQEDDfA5UlEtYp2TXQsD++fomruYzcOtAjNrPf+WVMpwkQ1d5FCAAsQioM7MUG3dkdsUCcSG6/Ly9aluHhKp7xYPsuymUKkoUmJ6VJpTGisqTgIwo4tJC0Y5RnM4aoqXBcIivIw3ciIClAmt38Os0mRknm6DRvMA5JxQVfHz9xyn7i1TJYyL3cnQv0y43DCbyd8FKAheuebRU1+fkJ2uuW9rGJtdLpxtZwv4wO59ROKUc8v/dLl424mYtNiwozOuCpqvH4INw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KN/E3y5DzElZlGxuz/60Ii01mVwd/kaYy4AOpzTRG54Jyoa3nm+Jo9A/TgSVqqDmQijzSjhseyIhluO3owAJRcCzklJzJA1kuwuxK9Gvldw5tpnkwSwhBOPlMABbWenke1rPd/5GNwzxwZiIxsz0m4JyBaElPqeY4StBIOav28e3yTUJzl3DMAn40M8FJPVnvz/zJYUvTQfNsjHxHz3ee05G+gABpX+3aC2kvOw0r0g76BGhIb1w2A5RJ7SV+VNy2URtAkNeeARWOlyfd85Tt6apzvMKkJXeSSFwvtFf+BAJELCLgg9fXeUZ8yduo3zOw0X/uPYOenTK3t/Jf8nRUA==
- Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Delivery-date: Thu, 11 Apr 2024 13:36:43 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Nodisclaimer: true
- Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Thread-index: AQHainObwzEJT+Mf6kG9My8yFKsem7Fi1oaAgAA++wA=
- Thread-topic: [PATCH v2 12/13] xen/device_tree: Introduce function to merge overlapping intervals
>
> I’ve just spotted an issue with the algorithm, the fix is this one:
>
> diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> index 24914a80d03b..262385a041a8 100644
> --- a/xen/common/device_tree.c
> +++ b/xen/common/device_tree.c
> @@ -2360,6 +2360,10 @@ int __init
> dt_merge_overlapping_addr_size_intervals(__be32 *reg, int *nr_cells,
> __be32 *tmp_last_cell_size = last_cell + addrcells;
>
> dt_set_cell(&tmp_last_cell_size, sizecells, new_size);
> +
> + /* Last interval updated, so the end is changed */
> + end_last = start_last + size_last;
> +
> /*
> * This current interval is merged with the last one, so remove
> this
> * interval and shift left all the remaining elements
>
Apologies, this is the fix:
diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 24914a80d03b..9a2f5b27aa9b 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -2360,6 +2360,10 @@ int __init
dt_merge_overlapping_addr_size_intervals(__be32 *reg, int *nr_cells,
__be32 *tmp_last_cell_size = last_cell + addrcells;
dt_set_cell(&tmp_last_cell_size, sizecells, new_size);
+
+ /* Last interval updated, so the end is changed */
+ end_last = start_last + new_size;
+
/*
* This current interval is merged with the last one, so remove
this
* interval and shift left all the remaining elements
So instead of “size_last” -> “new_size”.
Sorry for the noise.
Cheers,
Luca
|