mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
include/exec: Change reserved_va semantics to last byte
Change the semantics to be the last byte of the guest va, rather than the following byte. This avoids some overflow conditions. Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
a3a67f54f0
commit
95059f9c31
7 changed files with 38 additions and 34 deletions
|
@ -283,7 +283,7 @@ static abi_ulong mmap_find_vma_reserved(abi_ulong start, abi_ulong size,
|
|||
end_addr = start + size;
|
||||
if (start > reserved_va - size) {
|
||||
/* Start at the top of the address space. */
|
||||
end_addr = ((reserved_va - size) & -align) + size;
|
||||
end_addr = ((reserved_va + 1 - size) & -align) + size;
|
||||
looped = true;
|
||||
}
|
||||
|
||||
|
@ -297,7 +297,7 @@ static abi_ulong mmap_find_vma_reserved(abi_ulong start, abi_ulong size,
|
|||
return (abi_ulong)-1;
|
||||
}
|
||||
/* Re-start at the top of the address space. */
|
||||
addr = end_addr = ((reserved_va - size) & -align) + size;
|
||||
addr = end_addr = ((reserved_va + 1 - size) & -align) + size;
|
||||
looped = true;
|
||||
} else {
|
||||
prot = page_get_flags(addr);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue