From nobody Mon Feb 9 01:35:31 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; dkim=fail spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1495193424287953.2749580705229; Fri, 19 May 2017 04:30:24 -0700 (PDT) Received: from localhost ([::1]:57964 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dBg6x-0003n9-0j for importer@patchew.org; Fri, 19 May 2017 07:30:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49493) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dBfyS-0004UM-0j for qemu-devel@nongnu.org; Fri, 19 May 2017 07:21:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dBfyQ-0000zm-QX for qemu-devel@nongnu.org; Fri, 19 May 2017 07:21:36 -0400 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:32788) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dBfyQ-0000zN-Jk for qemu-devel@nongnu.org; Fri, 19 May 2017 07:21:34 -0400 Received: by mail-wm0-x241.google.com with SMTP id b84so1793111wmh.0 for ; Fri, 19 May 2017 04:21:34 -0700 (PDT) Received: from 640k.lan (94-39-157-43.adsl-ull.clienti.tiscali.it. [94.39.157.43]) by smtp.gmail.com with ESMTPSA id v65sm2640095wmv.5.2017.05.19.04.21.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 May 2017 04:21:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=31lvrrUuhrxHk+N3/PDiYZZ7iLkDPuTr10cSDKl06pc=; b=Q+M1l1DCmCe0rNINCkpc4Xu5yT9dem7prU00b+xuZ50Ayi27Pjk8jPnRKJ+XBL9Pvs g27aSO+ATP46Fow6RA9G1CcIFawihHm+CgsCV+ULWq9XaKoJPjhLjxIrUeP96V3OX8Zp fvrxrxrVcPuAZt/HqzCmfUvF0GvE2vEWTlfXGhpW1Iz1VXzPAHFxNMhgr2KT8geuTHty 8ykqRkiWpH6dP15ZTFA+t7l/9ovjmzoW477bOvzVV/f7afr9CjLlogZj/3eLVrg/vP05 ZCO7s47tV2+ECTfv0DgprAMPFDWy/zldJtfS7NZibVRmm6k+UzzcxgGO1665+zCbDIxC jgVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=31lvrrUuhrxHk+N3/PDiYZZ7iLkDPuTr10cSDKl06pc=; b=SeQIPyFj6UqnLLGMw3EGmuaAoxF8nNKTAdBevsRBrKoN7P13+uT0QfSUhydlQZLqDl JEPadiUZ/4/HbFfSORyBinAG67Cw2Oop8PAJsdBO41MZTzW1oiRxhvJcZ7H9rdEoM48L 8cpyYW0r9kimbt3SbwtKhshKSCg5irqS0sMptLZZH/cLG3imwERIc57km/0cD/wTA8Id OF6neAoI6icQd5VWVdxZ/ofQOu9k9cKwdYbu+hL2/H2H64p+bpTJH0MwVf1HU9vlbo9J TLIsVE+/+unkhQj6OyKf9HElpJTjurRFiJESqE3noKHY3sBjKGEK+hKOBY99r91o3pPG Oh/g== X-Gm-Message-State: AODbwcASIMVZ8hF2XFVvdCce/4Cnfrj1fJdMgcwrms72drv9umMgx+iC D3RmBuJU8nfUjaoTJDA= X-Received: by 10.28.127.82 with SMTP id a79mr17062758wmd.50.1495192893292; Fri, 19 May 2017 04:21:33 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 19 May 2017 13:21:07 +0200 Message-Id: <1495192872-27667-16-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1495192872-27667-1-git-send-email-pbonzini@redhat.com> References: <1495192872-27667-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::241 Subject: [Qemu-devel] [PULL 15/20] exec: simplify phys_page_find() params 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: Peter Xu Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Peter Xu It really only plays with the dispatchers, so the parameter list does not need that complexity. This helps for readability at least. Signed-off-by: Peter Xu Message-Id: <1494838260-30439-2-git-send-email-peterx@redhat.com> Reviewed-by: David Gibson Signed-off-by: Paolo Bonzini --- exec.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/exec.c b/exec.c index 96e3ac9..29633cd 100644 --- a/exec.c +++ b/exec.c @@ -373,10 +373,11 @@ static inline bool section_covers_addr(const MemoryRe= gionSection *section, int128_getlo(section->size), addr); } =20 -static MemoryRegionSection *phys_page_find(PhysPageEntry lp, hwaddr addr, - Node *nodes, MemoryRegionSectio= n *sections) +static MemoryRegionSection *phys_page_find(AddressSpaceDispatch *d, hwaddr= addr) { - PhysPageEntry *p; + PhysPageEntry lp =3D d->phys_map, *p; + Node *nodes =3D d->map.nodes; + MemoryRegionSection *sections =3D d->map.sections; hwaddr index =3D addr >> TARGET_PAGE_BITS; int i; =20 @@ -414,8 +415,7 @@ static MemoryRegionSection *address_space_lookup_region= (AddressSpaceDispatch *d, section_covers_addr(section, addr)) { update =3D false; } else { - section =3D phys_page_find(d->phys_map, addr, d->map.nodes, - d->map.sections); + section =3D phys_page_find(d, addr); update =3D true; } if (resolve_subpage && section->mr->subpage) { @@ -1283,8 +1283,7 @@ static void register_subpage(AddressSpaceDispatch *d,= MemoryRegionSection *secti subpage_t *subpage; hwaddr base =3D section->offset_within_address_space & TARGET_PAGE_MASK; - MemoryRegionSection *existing =3D phys_page_find(d->phys_map, base, - d->map.nodes, d->map.se= ctions); + MemoryRegionSection *existing =3D phys_page_find(d, base); MemoryRegionSection subsection =3D { .offset_within_address_space =3D base, .size =3D int128_make64(TARGET_PAGE_SIZE), --=20 1.8.3.1