diff options
| author | Vladimir Kondratiev <[email protected]> | 2025-11-11 12:43:26 +0200 |
|---|---|---|
| committer | Anup Patel <[email protected]> | 2025-12-02 10:52:51 +0530 |
| commit | 4997eb28dab2916d7c4e8d53bfae5ec0d40a0742 (patch) | |
| tree | d350c9ec6e900b2ecda48dec5c1d2299e009d203 /lib/utils/cache | |
| parent | 825d0e918a9e41cc57097a8cb913f26550699911 (diff) | |
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 <[email protected]>
Reviewed-by: Anup Patel <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Anup Patel <[email protected]>
Diffstat (limited to 'lib/utils/cache')
0 files changed, 0 insertions, 0 deletions
