diff options
| author | Vladimir Kondratiev <vladimir.kondratiev@mobileye.com> | 2025-11-11 12:43:26 +0200 |
|---|---|---|
| committer | Anup Patel <anup@brainfault.org> | 2025-12-02 10:52:51 +0530 |
| commit | 4997eb28dab2916d7c4e8d53bfae5ec0d40a0742 (patch) | |
| tree | d350c9ec6e900b2ecda48dec5c1d2299e009d203 /lib/utils | |
| parent | 825d0e918a9e41cc57097a8cb913f26550699911 (diff) | |
| download | opensbi-4997eb28dab2916d7c4e8d53bfae5ec0d40a0742.zip opensbi-4997eb28dab2916d7c4e8d53bfae5ec0d40a0742.tar.gz opensbi-4997eb28dab2916d7c4e8d53bfae5ec0d40a0742.tar.bz2 | |
lib: sbi: fix covered regions handling in sanitize_domain()
In the sanitize_domain, code that checks for the case when one
memory region covered by the other, was never executed. Quote:
/* Sort the memory regions */
for (i = 0; i < (count - 1); i++) {
<snip>
}
/* Remove covered regions */
while(i < (count - 1)) {
Here "while" loop never executed because condition "i < (count - 1)"
is always false after the "for" loop just above.
In addition, when clearing region, "root_memregs_count"
should be adjusted as well, otherwise code that adds memory region
in the "root_add_memregion" will use wrong position:
/* Append the memregion to root memregions */
nreg = &root.regions[root_memregs_count];
empty entry will be created in the middle of regions array, new
regions will be added after this empty entry while sanitizing code
will stop when reaching empty entry.
Fixes: 3b03cdd60ce5 ("lib: sbi: Add regions merging when sanitizing domain region")
Signed-off-by: Vladimir Kondratiev <vladimir.kondratiev@mobileye.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Link: https://lore.kernel.org/r/20251111104327.1170919-2-vladimir.kondratiev@mobileye.com
Signed-off-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'lib/utils')
0 files changed, 0 insertions, 0 deletions
