aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Roth <michael.roth@amd.com>2023-11-03 10:13:54 -0500
committerArd Biesheuvel <ardb@kernel.org>2023-11-28 12:49:21 +0100
commit01b1e3ca0e5ce47bbae8217d47376ad01b331b07 (patch)
tree58f8b4dce4a23d239744ade27a9a65d2abb0740d
parent2cc14f52aeb78ce3f29677c2de1f06c0e91471ab (diff)
downloadlinux-01b1e3ca0e5ce47bbae8217d47376ad01b331b07.tar.gz
efi/unaccepted: Fix off-by-one when checking for overlapping ranges
When a task needs to accept memory it will scan the accepting_list to see if any ranges already being processed by other tasks overlap with its range. Due to an off-by-one in the range comparisons, a task might falsely determine that an overlapping range is being accepted, leading to an unnecessary delay before it begins processing the range. Fix the off-by-one in the range comparison to prevent this and slightly improve performance. Fixes: 50e782a86c98 ("efi/unaccepted: Fix soft lockups caused by parallel memory acceptance") Link: https://lore.kernel.org/linux-mm/20231101004523.vseyi5bezgfaht5i@amd.com/T/#me2eceb9906fcae5fe958b3fe88e41f920f8335b6 Reviewed-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Signed-off-by: Michael Roth <michael.roth@amd.com> Acked-by: Vlastimil Babka <vbabka@suse.cz> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
-rw-r--r--drivers/firmware/efi/unaccepted_memory.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/firmware/efi/unaccepted_memory.c b/drivers/firmware/efi/unaccepted_memory.c
index 3f2f7bf6e33526..5b439d04079c84 100644
--- a/drivers/firmware/efi/unaccepted_memory.c
+++ b/drivers/firmware/efi/unaccepted_memory.c
@@ -101,7 +101,7 @@ retry:
* overlap on physical address level.
*/
list_for_each_entry(entry, &accepting_list, list) {
- if (entry->end < range.start)
+ if (entry->end <= range.start)
continue;
if (entry->start >= range.end)
continue;