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
|
@ -152,6 +152,15 @@ static inline void tswap64s(uint64_t *s)
|
|||
*/
|
||||
extern uintptr_t guest_base;
|
||||
extern bool have_guest_base;
|
||||
|
||||
/*
|
||||
* If non-zero, the guest virtual address space is a contiguous subset
|
||||
* of the host virtual address space, i.e. '-R reserved_va' is in effect
|
||||
* either from the command-line or by default. The value is the last
|
||||
* byte of the guest address space e.g. UINT32_MAX.
|
||||
*
|
||||
* If zero, the host and guest virtual address spaces are intermingled.
|
||||
*/
|
||||
extern unsigned long reserved_va;
|
||||
|
||||
/*
|
||||
|
@ -171,7 +180,7 @@ extern unsigned long reserved_va;
|
|||
#define GUEST_ADDR_MAX_ \
|
||||
((MIN_CONST(TARGET_VIRT_ADDR_SPACE_BITS, TARGET_ABI_BITS) <= 32) ? \
|
||||
UINT32_MAX : ~0ul)
|
||||
#define GUEST_ADDR_MAX (reserved_va ? reserved_va - 1 : GUEST_ADDR_MAX_)
|
||||
#define GUEST_ADDR_MAX (reserved_va ? : GUEST_ADDR_MAX_)
|
||||
|
||||
#else
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue