From patchwork Fri Jul 9 05:17:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 471801 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp975948jao; Thu, 8 Jul 2021 22:24:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzFSlerOonEf+ZP8iMis0womegiWfUR4pU3LPkD7ETtpxOBFr1s53sbnSk+ehF0dwhLAuhJ X-Received: by 2002:ae9:e807:: with SMTP id a7mr22326146qkg.78.1625808267186; Thu, 08 Jul 2021 22:24:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625808267; cv=none; d=google.com; s=arc-20160816; b=ICOvMV93B/+01Hv8crAZKtYCjOXHM1Yy8QL8lUOIYs4LyaO7AP+1s2zMa2Czv3aYBa arDR2MCGhaHhm9wnpwyKcnnI3+tgDfCmRYTu2JO1u9Y9eFn7hwiBjamBWK6HceM4xUEy VCdVr84O2ZNm3QuK/bCb/mJe9SX5HVn2VZRXuL1jbUVSURs+GjsfcHGNtrxJ13a4T1Py mubSUIakYepDKzAbQGvax6svFnxMJGUAPQYgkf5wYCzwpmBxJNar1EaXFLiQDUBu6gFS Xt/iS4r1zvwtxI6gsMMAUcf1TBMOa1fLD2WErBdtkUzdu+6Wbyb3IdxcuaHyyQEO+84/ 04Tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=Zke3FDQcFYZtIm5LkVcRUoJBldpcILEqBaA3Bvce6tc=; b=MLICUxidzpnSuYKr7fmeQMzbehRIABuadKLDHpnhjk2Y2ks9jeTTsW0XXQZV+ZBF2s amaEMeXeSgpWwMPOyywYVmboJZqowB+vjIoJQ6ZyrzCJATauMWysHgN6832tUqLWkfWd gWuejz7nAJ93i57vO/qO/qF9l3Be/G6h0/yMMRE07y/cC5XjivmphBn8n6ElRXETctFY PJmIKJeQAJv8vZArXUFJ/j+HDPx5K0/00ti9ntltJ8324kUQ8zn8hhie9Fn1bIKyoMHD 9XwRCv7dsJl90oDOLQg6j0lTOGzonN0K8pNWSvjl95SqscypyBWBOGDGaIjo4BNMpFJE ik8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gibson.dropbear.id.au header.s=201602 header.b="Un/gFhqH"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id m7si4044555qtp.84.2021.07.08.22.24.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Jul 2021 22:24:27 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@gibson.dropbear.id.au header.s=201602 header.b="Un/gFhqH"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:55680 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m1izy-00050d-8l for patch@linaro.org; Fri, 09 Jul 2021 01:24:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35098) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m1itd-0000xL-03; Fri, 09 Jul 2021 01:17:53 -0400 Received: from bilbo.ozlabs.org ([2401:3900:2:1::2]:40195 helo=ozlabs.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m1itb-0001w6-3e; Fri, 09 Jul 2021 01:17:52 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 4GLhHd3YwGz9sfR; Fri, 9 Jul 2021 15:17:33 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1625807853; bh=W1hgkBfntpE0AVG54dGL+htM4AdTKAwQqPJZRbk5Sfg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Un/gFhqHayno7RWrnNUV6AvenIsHKERR5avajE2uMAQBkRuFR7IRpO/I3vn7PesPm OAD9r3gaXU7QvuV4R87sXJmdJ0jy8lojTCgLzI4imQTRIMoElRi63UajDf1967zWq8 YFyMnGNSwd8RhnsqOkMI8jcWNYOiV8zpbwWZtK1I= From: David Gibson To: peter.maydell@linaro.org, groug@kaod.org Subject: [PULL 07/33] target/ppc: Use bool success for ppc_radix64_xlate Date: Fri, 9 Jul 2021 15:17:02 +1000 Message-Id: <20210709051728.170203-8-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210709051728.170203-1-david@gibson.dropbear.id.au> References: <20210709051728.170203-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Received-SPF: pass client-ip=2401:3900:2:1::2; envelope-from=dgibson@ozlabs.org; helo=ozlabs.org X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 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.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham 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: aik@ozlabs.ru, Richard Henderson , qemu-ppc@nongnu.org, qemu-devel@nongnu.org, David Gibson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Instead of returning non-zero for failure, return true for success. Signed-off-by: Richard Henderson Message-Id: <20210621125115.67717-5-bruno.larsen@eldorado.org.br> Signed-off-by: David Gibson --- target/ppc/mmu-radix64.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) -- 2.31.1 diff --git a/target/ppc/mmu-radix64.c b/target/ppc/mmu-radix64.c index dd5ae69052..2d5f0850c9 100644 --- a/target/ppc/mmu-radix64.c +++ b/target/ppc/mmu-radix64.c @@ -463,10 +463,10 @@ static int ppc_radix64_process_scoped_xlate(PowerPCCPU *cpu, * | = On | Process Scoped | Scoped | * +-------------+----------------+---------------+ */ -static int ppc_radix64_xlate(PowerPCCPU *cpu, vaddr eaddr, - MMUAccessType access_type, - hwaddr *raddr, int *psizep, int *protp, - bool guest_visible) +static bool ppc_radix64_xlate(PowerPCCPU *cpu, vaddr eaddr, + MMUAccessType access_type, + hwaddr *raddr, int *psizep, int *protp, + bool guest_visible) { CPUPPCState *env = &cpu->env; uint64_t lpid, pid; @@ -492,7 +492,7 @@ static int ppc_radix64_xlate(PowerPCCPU *cpu, vaddr eaddr, } *protp = PAGE_READ | PAGE_WRITE | PAGE_EXEC; *psizep = TARGET_PAGE_BITS; - return 0; + return true; } /* @@ -510,7 +510,7 @@ static int ppc_radix64_xlate(PowerPCCPU *cpu, vaddr eaddr, if (guest_visible) { ppc_radix64_raise_segi(cpu, access_type, eaddr); } - return 1; + return false; } /* Get Process Table */ @@ -523,13 +523,13 @@ static int ppc_radix64_xlate(PowerPCCPU *cpu, vaddr eaddr, if (guest_visible) { ppc_radix64_raise_si(cpu, access_type, eaddr, DSISR_NOPTE); } - return 1; + return false; } if (!validate_pate(cpu, lpid, &pate)) { if (guest_visible) { ppc_radix64_raise_si(cpu, access_type, eaddr, DSISR_R_BADCONFIG); } - return 1; + return false; } } @@ -549,7 +549,7 @@ static int ppc_radix64_xlate(PowerPCCPU *cpu, vaddr eaddr, pate, &g_raddr, &prot, &psize, guest_visible); if (ret) { - return ret; + return false; } *psizep = MIN(*psizep, psize); *protp &= prot; @@ -573,7 +573,7 @@ static int ppc_radix64_xlate(PowerPCCPU *cpu, vaddr eaddr, &prot, &psize, false, guest_visible); if (ret) { - return ret; + return false; } *psizep = MIN(*psizep, psize); *protp &= prot; @@ -582,7 +582,7 @@ static int ppc_radix64_xlate(PowerPCCPU *cpu, vaddr eaddr, } } - return 0; + return true; } int ppc_radix64_handle_mmu_fault(PowerPCCPU *cpu, vaddr eaddr, @@ -593,8 +593,8 @@ int ppc_radix64_handle_mmu_fault(PowerPCCPU *cpu, vaddr eaddr, hwaddr raddr; /* Translate eaddr to raddr (where raddr is addr qemu needs for access) */ - if (ppc_radix64_xlate(cpu, eaddr, access_type, &raddr, - &page_size, &prot, true)) { + if (!ppc_radix64_xlate(cpu, eaddr, access_type, &raddr, + &page_size, &prot, true)) { return 1; } @@ -608,8 +608,8 @@ hwaddr ppc_radix64_get_phys_page_debug(PowerPCCPU *cpu, target_ulong eaddr) int psize, prot; hwaddr raddr; - if (ppc_radix64_xlate(cpu, eaddr, MMU_DATA_LOAD, &raddr, - &psize, &prot, false)) { + if (!ppc_radix64_xlate(cpu, eaddr, MMU_DATA_LOAD, &raddr, + &psize, &prot, false)) { return -1; }