From patchwork Tue May 18 20:11:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 441242 Delivered-To: patch@linaro.org Received: by 2002:a02:7a1b:0:0:0:0:0 with SMTP id a27csp587678jac; Tue, 18 May 2021 13:28:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyzcahj9BZUju0cRwX+My3tkWpI0pX7a05dglXOhybY9rqckd2M9O3uDO6WaEYW5Aw4kqtw X-Received: by 2002:a6b:4f07:: with SMTP id d7mr5810488iob.160.1621369723337; Tue, 18 May 2021 13:28:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621369723; cv=none; d=google.com; s=arc-20160816; b=H2D9DvyXmdUQhqzTwg/NzuaMbv1ppmUqdtj6Q5dTY9Ll0FvKYFkqwDAgD5U9rHF+QG qvBgoJX8x2kQaS51J3wKV2rKqt32F15CuNsWi1tn2Bj2UCyyg6Gv1k3bXJxuipP1KIqo tz3K3rgvGdwP2+dsYWvZTLaL9fn5+2d4mYexz9zK9GMGXuSI/1ffRRC23iP0cBbj5h6S P+K0tatBal6+TWvmEoligU8QoB16ZlhVdxCSlJjBlfqhYYXU9+CCQqs2/DWe7IretrPM XH1bUKZReo6IP2CLorqcE0nuPmNh5MJnu1Z3dDGmxeti6nu/CmbHdHubCYLK59ayXWzD KPDA== 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=Ga6+PvszREjIhxPzZ4wKB8ru0YkaJYB0oJlgtxa3ZkM=; b=hiGnoteTecIV6Ozl7SC6CCoNMdHnrJxO1V6ehwNsJ/OBQiCfOVUI84zfIZqm2gRNfU WMtlNA3JzM4rYKtrHycr/eBn16judnB16pILcqg5tKtVjGMdoyFx3DfNLgT/fF6DNDGf XQI2rOPkEG9/m+8Lw1vy4G/8metYGfy+nHkIOnn3EhmuMRpI2NcZxE1byVMj/6AsMSmd o5wZ5nriE7IKnTJ+q1irZNiNOZpYmSpfbxjGbONC797pp3EMKjcMUdkCU8fwkHlF4ICN aE4Qg5QXfpbwdOEPfj2/b9xjQudljIJ98KOa6bbaF2se+o8f+MZrdzl3hb00Gf37HeyA gXsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=FqjVjxK7; 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"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id m17si12868102ilg.130.2021.05.18.13.28.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 18 May 2021 13:28:43 -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=@linaro.org header.s=google header.b=FqjVjxK7; 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"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:50204 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lj6KY-0002Pi-Ox for patch@linaro.org; Tue, 18 May 2021 16:28:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42974) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lj64i-00013S-D9 for qemu-devel@nongnu.org; Tue, 18 May 2021 16:12:20 -0400 Received: from mail-ot1-x332.google.com ([2607:f8b0:4864:20::332]:38803) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lj64W-0006LL-3f for qemu-devel@nongnu.org; Tue, 18 May 2021 16:12:20 -0400 Received: by mail-ot1-x332.google.com with SMTP id q7-20020a9d57870000b02902a5c2bd8c17so9760636oth.5 for ; Tue, 18 May 2021 13:12:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ga6+PvszREjIhxPzZ4wKB8ru0YkaJYB0oJlgtxa3ZkM=; b=FqjVjxK7FBBoMkX3/VJQo6F3VfY8kNbunHSSjfnW09eaLRIc3M6PMVNPlaqDghf6k3 yexF9+xild93TKPTk0iAdclCGUV9U+A1t+4Sf5SIm0GaDobG07oLThtUyq+dJcm49zPA qlKLMvu11vuwnjPVSkvZs3Ohg1ogWteXkm1+wZUT8QkA+OwRiP14+SXIbwBPS57RcPLE xCpZpH22v4zggjcMejheHQTjN7J8PV0MzwqHDUlyEqGOrW61N1hcMPErxURHHQnLE+aw ql8ZqJLjyVN7W2VbZQfrB9ki3eN5WpogMUdlqwRf+3f+aw0bGPqRndsVHsXd3BFjS+Rt fJ+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ga6+PvszREjIhxPzZ4wKB8ru0YkaJYB0oJlgtxa3ZkM=; b=s3nMX2AqaGJLIs5ttdarUwrNBqzBfbthjFfHF5vaQ/4sKOjGAcpr+NcSm1G4hbzaGv /QEvCRF0RqBXSLoYHb31bxOl2oSESpBIuS4T4gIMVpoUFpzR21OnhEQpiCLZWRNU9yiA ML8F3Pi7Rr9QME+Av4jCEGo/KEBRPbLtalWHPKD0PYY2zM5i7ZFC/KHlVG76k0y3QxTP 1aUotfic6T/P9s1Q0cqPyZqe/g8XWdQMUBWstrjQ6S/DUpM9UTc8zDzVO81Mg1Vsrlys OCbGyquztIxjqc3CWxMrQdWAAvrKrz9GV6IPjSqrQzTZyuguk9x8zVMcJWy4dK1wjdj4 2Stg== X-Gm-Message-State: AOAM530wOlhH1lQt3zKR0aqpOUP5oPXXSGZsZL6S+e/hdnZYRze0Hxge sHk2ojUqnx49SlDYlVBMtybofJpxyJXCpTGM X-Received: by 2002:a05:6830:151a:: with SMTP id k26mr5475361otp.10.1621368727162; Tue, 18 May 2021 13:12:07 -0700 (PDT) Received: from localhost.localdomain ([45.235.253.15]) by smtp.gmail.com with ESMTPSA id u27sm3953204oof.38.2021.05.18.13.12.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 May 2021 13:12:06 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 19/24] target/ppc: Use bool success for ppc_radix64_xlate Date: Tue, 18 May 2021 15:11:41 -0500 Message-Id: <20210518201146.794854-20-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210518201146.794854-1-richard.henderson@linaro.org> References: <20210518201146.794854-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::332; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=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: bruno.larsen@eldorado.org.br, qemu-ppc@nongnu.org, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Instead of returning non-zero for failure, return true for success. Signed-off-by: Richard Henderson --- target/ppc/mmu-radix64.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) -- 2.25.1 Reviewed-by: Bruno Larsen (billionai) Signed-off-by: Richard Henderson <richard.henderson@linaro.org> diff --git a/target/ppc/mmu-radix64.c b/target/ppc/mmu-radix64.c index 76a5cc8cdb..7af3e697b2 100644 --- a/target/ppc/mmu-radix64.c +++ b/target/ppc/mmu-radix64.c @@ -464,10 +464,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; @@ -493,7 +493,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; } /* @@ -511,7 +511,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 */ @@ -524,13 +524,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; } } @@ -550,7 +550,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; @@ -574,7 +574,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; @@ -583,7 +583,7 @@ static int ppc_radix64_xlate(PowerPCCPU *cpu, vaddr eaddr, } } - return 0; + return true; } int ppc_radix64_handle_mmu_fault(PowerPCCPU *cpu, vaddr eaddr, @@ -594,8 +594,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; } @@ -609,8 +609,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; }