From 4fdbe94eea26de55cf05674e3d2b15894b0cf05c Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Tue, 27 Feb 2018 11:01:41 -0500 Subject: [PATCH] exec: Avoid direct references to Int128 parts Backports commit 258dfaaad05a5fbe32a142b794e1df3e16501d0e from qemu --- qemu/exec.c | 4 ++-- qemu/include/qemu/int128.h | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/qemu/exec.c b/qemu/exec.c index 7ec7c609..77d1650f 100644 --- a/qemu/exec.c +++ b/qemu/exec.c @@ -299,9 +299,9 @@ static inline bool section_covers_addr(const MemoryRegionSection *section, /* Memory topology clips a memory region to [0, 2^64); size.hi > 0 means * the section must cover the entire address space. */ - return section->size.hi || + return int128_gethi(section->size) || range_covers_byte(section->offset_within_address_space, - section->size.lo, addr); + int128_getlo(section->size), addr); } static MemoryRegionSection *phys_page_find(PhysPageEntry lp, hwaddr addr, diff --git a/qemu/include/qemu/int128.h b/qemu/include/qemu/int128.h index f4352100..eac165b4 100644 --- a/qemu/include/qemu/int128.h +++ b/qemu/include/qemu/int128.h @@ -23,6 +23,16 @@ static inline uint64_t int128_get64(Int128 a) return a.lo; } +static inline uint64_t int128_getlo(Int128 a) +{ + return a.lo; +} + +static inline int64_t int128_gethi(Int128 a) +{ + return a.hi; +} + static inline Int128 int128_zero(void) { return int128_make64(0);