From patchwork Fri Jul 1 17:04:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 9210239 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 361A0607D8 for ; Fri, 1 Jul 2016 17:05:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 23049286C5 for ; Fri, 1 Jul 2016 17:05:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 17C1E286C4; Fri, 1 Jul 2016 17:05:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BD20D286C4 for ; Fri, 1 Jul 2016 17:05:42 +0000 (UTC) Received: from localhost ([::1]:34622 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bJ1sr-0002Ed-Vj for patchwork-qemu-devel@patchwork.kernel.org; Fri, 01 Jul 2016 13:05:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53477) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bJ1sD-0002BP-Mk for qemu-devel@nongnu.org; Fri, 01 Jul 2016 13:05:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bJ1sB-0005Jp-5a for qemu-devel@nongnu.org; Fri, 01 Jul 2016 13:05:00 -0400 Received: from mail-pa0-x242.google.com ([2607:f8b0:400e:c03::242]:33050) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bJ1sA-0005Jl-Uh for qemu-devel@nongnu.org; Fri, 01 Jul 2016 13:04:59 -0400 Received: by mail-pa0-x242.google.com with SMTP id ts6so10168313pac.0 for ; Fri, 01 Jul 2016 10:04:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=fyKIvgnkHbVcQVOKG3Qifrxdy1pL8fwj+zLztlZZR20=; b=RzsO/hCQBYipjPxvYqGW/SYXPKELpMXHxssam6VXH0QgVwJ4MYxRu59tC5qN6Rg/j6 xnxFgvHZXxKFafV1raqEgBvWCo6eXnJMEkv02xjyMHJQSPWijV2+5Mh9qGU8C8XJf/Vl KJ3Uck/m4CwoeRj7wV4f6SgqE6cJBu09oMat5RTeLZITXvYRhAGeL3ztl81AbXvNnXGP JuBfHfZwgT9jtzj/WJePp2mIep08irxDfDJPw3eA+daz1OnHKhmb1WmDPXXN0XtJAvpV HIlnow8sD6xoOy08RnJhp2+f+tTBezn2Oqeq6k/CPQdsMkp4bruaOdCOBjWq0nnwFOIX iv0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=fyKIvgnkHbVcQVOKG3Qifrxdy1pL8fwj+zLztlZZR20=; b=OsXZ6N8hR78FiNB/V5adYNfCiXtfv44ZahfsY2ud9tgWrWn+nt7GYmr8MO6YT2da2j 2FVIhD68JFpsXpaDfkKylhH1EpH/7bMc3AAF0G86aLbbrUjEFihcHTlWJlL0uMIXnFQn pX4pPrgMHA94o3gz6AJSo65YPE7bBgxtSbu84Z7kOON5o/EWat6noqYF5L/slZ6Ii0Qg EDqNXeykr0g5ACJVlagoBE2SUSB9z66FuCiWVoQg25sR6aaCCF4NrAm5zO1g+mrPms+g 352bVjRvQDker66W9K0uM7IOp94F9kzxjP0Vp9MD5875bBy1jy26Z/bIa7P1LmZGadON RiYw== X-Gm-Message-State: ALyK8tId6D2GGW/RBDoLc0siWfJkqxOPO7BVKwOUUpVWeUYMC/Icu+2mgImKuncxD/v5uA== X-Received: by 10.66.51.42 with SMTP id h10mr33223159pao.31.1467392698174; Fri, 01 Jul 2016 10:04:58 -0700 (PDT) Received: from bigtime.twiddle.net (71-37-54-227.tukw.qwest.net. [71.37.54.227]) by smtp.gmail.com with ESMTPSA id ff9sm2652229pac.5.2016.07.01.10.04.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Jul 2016 10:04:57 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 1 Jul 2016 10:04:29 -0700 Message-Id: <1467392693-22715-4-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1467392693-22715-1-git-send-email-rth@twiddle.net> References: <1467392693-22715-1-git-send-email-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c03::242 Subject: [Qemu-devel] [PATCH v2 03/27] exec: Avoid direct references to Int128 parts X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pbonzini@redhat.com, serge.fdrv@gmail.com, cota@braap.org, alex.bennee@linaro.org, peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Richard Henderson --- exec.c | 4 ++-- include/qemu/int128.h | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/exec.c b/exec.c index 0122ef7..806e2fe 100644 --- a/exec.c +++ b/exec.c @@ -318,9 +318,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/include/qemu/int128.h b/include/qemu/int128.h index c598881..52aaf99 100644 --- a/include/qemu/int128.h +++ b/include/qemu/int128.h @@ -20,6 +20,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);