From nobody Tue Feb 10 03:39:14 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1621429261; cv=none; d=zohomail.com; s=zohoarc; b=kpxGi6OugFZYoiqqe3+5iCr5wgZ3qH6i0+9UhgR0+z3Ni+Kq2x3zWUEdtv7i2JUiEU6+/TiYN48O85ShBKKzksZwM5bHxvRJJqiYARYFlTcU8SDPLMpxX1KewW3JORDUDC4CpEOOIuHPi+Ypy49D1rbSlLrDS1Y/cReC1jzTMD4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621429261; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=2ZzikfLm+fg0OnKEEf79OdRqWSLv5kdYBjnNnufHVkQ=; b=iMWnaViDr0z/5L+7GquN3kZiafOhiliS3TJHbwkxg4aGDWm7UC9hY4rySRM5kbv2iB55TpAlmSvedREeEvxz0KD6Ukz095zRbHjhY3UQ3Q21PKvV7w7KsyTTjnovnctcwXiMNbuPz0rbNOIxuyym9WU/135Wv1PXdtfApLk26ik= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1621429261652379.9868041878774; Wed, 19 May 2021 06:01:01 -0700 (PDT) Received: from localhost ([::1]:49706 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ljLop-0008G2-SH for importer@patchew.org; Wed, 19 May 2021 09:00:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33094) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljLga-0000ec-IB; Wed, 19 May 2021 08:52:28 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:34695) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ljLgX-00017a-M8; Wed, 19 May 2021 08:52:28 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 4FlXnX2qPYz9sXS; Wed, 19 May 2021 22:52:00 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1621428720; bh=fPgOqNCttS4nP8bU9GwG0rrKEjYX+fEmmXtxRvF78io=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R8PBDqpdK0P2g28pNyz7L3FHfjcKzn5AI2P0aoBrvmQBIZs6Uk4X9ROxBp4ts81/+ +2sfSDRa19m6p5wRyfuRaij1oDdrXGpUukM7VsyV2qn5dRfZ5M9nxsGh6Yb5veX2t/ qa9vcPR8/b7IYnsYKZ/RVx+A7C/+0vWXtuaOYXWE= From: David Gibson To: peter.maydell@linaro.org, groug@kaod.org Subject: [PULL 07/48] target/ppc: moved function out of mmu-hash64 Date: Wed, 19 May 2021 22:51:07 +1000 Message-Id: <20210519125148.27720-8-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210519125148.27720-1-david@gibson.dropbear.id.au> References: <20210519125148.27720-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2401:3900:2:1::2; envelope-from=dgibson@ozlabs.org; helo=ozlabs.org X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: richard.henderson@linaro.org, "Lucas Mateus Castro \(alqotel\)" , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: "Lucas Mateus Castro (alqotel)" The function ppc_hash64_filter_pagesizes has been moved from a function with prototype in mmu-hash64.h and implemented in mmu-hash64.c to a static function in hw/ppc/spapr_caps.c as it's only used in that file. Signed-off-by: Lucas Mateus Castro (alqotel) Message-Id: <20210506163941.106984-3-lucas.araujo@eldorado.org.br> Signed-off-by: David Gibson --- hw/ppc/spapr_caps.c | 59 +++++++++++++++++++++++++++++++++++++++++ target/ppc/mmu-hash64.c | 57 --------------------------------------- target/ppc/mmu-hash64.h | 3 --- 3 files changed, 59 insertions(+), 60 deletions(-) diff --git a/hw/ppc/spapr_caps.c b/hw/ppc/spapr_caps.c index 9ea7ddd1e9..d0c419b392 100644 --- a/hw/ppc/spapr_caps.c +++ b/hw/ppc/spapr_caps.c @@ -371,6 +371,65 @@ static bool spapr_pagesize_cb(void *opaque, uint32_t s= eg_pshift, return true; } =20 +static void ppc_hash64_filter_pagesizes(PowerPCCPU *cpu, + bool (*cb)(void *, uint32_t, uint32_t), + void *opaque) +{ + PPCHash64Options *opts =3D cpu->hash64_opts; + int i; + int n =3D 0; + bool ci_largepage =3D false; + + assert(opts); + + n =3D 0; + for (i =3D 0; i < ARRAY_SIZE(opts->sps); i++) { + PPCHash64SegmentPageSizes *sps =3D &opts->sps[i]; + int j; + int m =3D 0; + + assert(n <=3D i); + + if (!sps->page_shift) { + break; + } + + for (j =3D 0; j < ARRAY_SIZE(sps->enc); j++) { + PPCHash64PageSize *ps =3D &sps->enc[j]; + + assert(m <=3D j); + if (!ps->page_shift) { + break; + } + + if (cb(opaque, sps->page_shift, ps->page_shift)) { + if (ps->page_shift >=3D 16) { + ci_largepage =3D true; + } + sps->enc[m++] =3D *ps; + } + } + + /* Clear rest of the row */ + for (j =3D m; j < ARRAY_SIZE(sps->enc); j++) { + memset(&sps->enc[j], 0, sizeof(sps->enc[j])); + } + + if (m) { + n++; + } + } + + /* Clear the rest of the table */ + for (i =3D n; i < ARRAY_SIZE(opts->sps); i++) { + memset(&opts->sps[i], 0, sizeof(opts->sps[i])); + } + + if (!ci_largepage) { + opts->flags &=3D ~PPC_HASH64_CI_LARGEPAGE; + } +} + static void cap_hpt_maxpagesize_cpu_apply(SpaprMachineState *spapr, PowerPCCPU *cpu, uint8_t val, Error **errp) diff --git a/target/ppc/mmu-hash64.c b/target/ppc/mmu-hash64.c index d517a99832..be3596f27b 100644 --- a/target/ppc/mmu-hash64.c +++ b/target/ppc/mmu-hash64.c @@ -1200,61 +1200,4 @@ const PPCHash64Options ppc_hash64_opts_POWER7 =3D { } }; =20 -void ppc_hash64_filter_pagesizes(PowerPCCPU *cpu, - bool (*cb)(void *, uint32_t, uint32_t), - void *opaque) -{ - PPCHash64Options *opts =3D cpu->hash64_opts; - int i; - int n =3D 0; - bool ci_largepage =3D false; - - assert(opts); - - n =3D 0; - for (i =3D 0; i < ARRAY_SIZE(opts->sps); i++) { - PPCHash64SegmentPageSizes *sps =3D &opts->sps[i]; - int j; - int m =3D 0; =20 - assert(n <=3D i); - - if (!sps->page_shift) { - break; - } - - for (j =3D 0; j < ARRAY_SIZE(sps->enc); j++) { - PPCHash64PageSize *ps =3D &sps->enc[j]; - - assert(m <=3D j); - if (!ps->page_shift) { - break; - } - - if (cb(opaque, sps->page_shift, ps->page_shift)) { - if (ps->page_shift >=3D 16) { - ci_largepage =3D true; - } - sps->enc[m++] =3D *ps; - } - } - - /* Clear rest of the row */ - for (j =3D m; j < ARRAY_SIZE(sps->enc); j++) { - memset(&sps->enc[j], 0, sizeof(sps->enc[j])); - } - - if (m) { - n++; - } - } - - /* Clear the rest of the table */ - for (i =3D n; i < ARRAY_SIZE(opts->sps); i++) { - memset(&opts->sps[i], 0, sizeof(opts->sps[i])); - } - - if (!ci_largepage) { - opts->flags &=3D ~PPC_HASH64_CI_LARGEPAGE; - } -} diff --git a/target/ppc/mmu-hash64.h b/target/ppc/mmu-hash64.h index 87729d48b3..5dfd7f8b93 100644 --- a/target/ppc/mmu-hash64.h +++ b/target/ppc/mmu-hash64.h @@ -18,9 +18,6 @@ unsigned ppc_hash64_hpte_page_shift_noslb(PowerPCCPU *cpu, void ppc_store_lpcr(PowerPCCPU *cpu, target_ulong val); void ppc_hash64_init(PowerPCCPU *cpu); void ppc_hash64_finalize(PowerPCCPU *cpu); -void ppc_hash64_filter_pagesizes(PowerPCCPU *cpu, - bool (*cb)(void *, uint32_t, uint32_t), - void *opaque); #endif =20 /* --=20 2.31.1