From patchwork Tue May 18 20:11:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 441232 Delivered-To: patch@linaro.org Received: by 2002:a02:7a1b:0:0:0:0:0 with SMTP id a27csp581323jac; Tue, 18 May 2021 13:19:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPRmb0NUFbd2kSttDD0g9KIuBd8GRGpVOfpiZ7plk3Jdz/UgcTAub8r0Uxiyh5b0ygKqp6 X-Received: by 2002:a92:b746:: with SMTP id c6mr6612877ilm.240.1621369180042; Tue, 18 May 2021 13:19:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621369180; cv=none; d=google.com; s=arc-20160816; b=XtbLWt79KDACKuzaaTkyQ6aIB06ssA/kSKWXDws2nafMf0UJpEUXUA1m9p5TI8hf3E e6wj0m7Gt8gdze1LNRzQ12SbimNTBHip9y0ZrpBct5Q/4l0lgRraPlz2QHz3Y/c3Ok/9 uXhzZRHHV3BXwDCe71HAbgdnsxXkPkbxMPo7jKpSykDxXnj2CikGDNqcud3C2kK0aKdO LiDa8KOONQaIca1go2Mhgd5blObXGW0p8hrYeRhwoSz0lejgYhuGRDNNVOsIrD0NSB7P Iw7ccK1jMLzfrGp0pMRgNAx7RgySvKwRBlOG00FVxGkpVRVHdvQJbP/vQX47BEDbT03V Tqfw== 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=iRIwmv/u97xPnpJtsivAqnqvUPyTpMn8dKYh7FflpCs=; b=lZCqpp56oFzazjTt8UjrT48zpcWAtuU9PlSqog5tabUps6sW5TOhoC+8bDCYdImKPv U8SZA49AhPNVn31w/aLgP/n1adpVer2pLuvgtzCwj1X7fx6pWBXg9oO7KSxN60p+dFZR 8kqL1iWMMe9mT1Dv/LBBNhQkgxxXTPnE7UCtIEzbRe2S30goT/wAUXEIrtw02XXSuW8h GJjJofSfWFBQAXRRcO9O2CmwuHwUND9w7fIa34t0jgxnm7IqCjro7HhFpzKFM4MzrRSP Kw7oQ5YIWQGWEnmluW1HOXjvECLRgklMO7ps/AX1/eWb6Iu+KnTCxQoUT8b1yNd552Bm DaDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=RweNGdj9; 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 j23si22626473ila.81.2021.05.18.13.19.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 18 May 2021 13:19:40 -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=RweNGdj9; 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]:50514 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lj6Bn-0008Fs-Do for patch@linaro.org; Tue, 18 May 2021 16:19:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42670) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lj64T-0000Tp-Gv for qemu-devel@nongnu.org; Tue, 18 May 2021 16:12:05 -0400 Received: from mail-oi1-x22d.google.com ([2607:f8b0:4864:20::22d]:37742) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lj64O-0006DB-MS for qemu-devel@nongnu.org; Tue, 18 May 2021 16:12:05 -0400 Received: by mail-oi1-x22d.google.com with SMTP id h9so10994673oih.4 for ; Tue, 18 May 2021 13:11:59 -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=iRIwmv/u97xPnpJtsivAqnqvUPyTpMn8dKYh7FflpCs=; b=RweNGdj98f77+VX/ZBp/221GVzK3yABDYjt2BKsHyEnqPZHFkizm6hoSDqr2plKuMr lR1Psf6VcGdSdbp3pOw0YB2J8Ur9yIYGDK/grpb4GWT/6yg5Zk/srWJPeVmIb69Az3GH SJo7DKZGY/YcAiP5Ecv3gKOUi5ysP3Q/sJu9vcqyV0mpaKHRvzfyzE2V63kUrp139AF9 KnBRA4j5u5zxvQX4qlg6ZYdZGcV9nIag6ncM6PWrynRF7Xn8kKYFvcT6iQjRV0NCGbrA ocZUiD/Pdmmta18NTt9pd9KGuN6lX1F+8Y6C3Ealw7Eiu//M/BoODaPxRCjmMrtHe6E3 ILJQ== 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=iRIwmv/u97xPnpJtsivAqnqvUPyTpMn8dKYh7FflpCs=; b=mGCEztqIDDfaINJL2vYmEL41SomZ6QiTLSKaaaxv+xw46vdJdZ2fVNds9Lxq0QzdxR SLznAg1s48YAWwhxJZ9eVFWPZ0iiu9rT4nWtzA6jyX8JXliTdOf0MdzVM+N4l1SJIQCP 5M/8bq7V1h1M/iC713GXBEbKP9B9Pv/V8SA6jzl7mZW2b6Z5hqRUiiowU/mX7cv44SqU Fqdj1/32DhYHeXwEmc5YaWvMrxvp/3jZNHyNNeLzlCFicoQaSDbllrxYhFXcoTtN/UrE YojqdPZoda9R8SfjZ734Ma9CQp+CMFPvzey8LmML1LWUepfLIIMHdQGZC4H49hbU0CQL fl8A== X-Gm-Message-State: AOAM530lpocJI8xKpZDHRi6cOn7V8cD47U3aKFt5uO6W49alTvIdClFL r8nDMK+yK+3+H6fhx46RjUP9ewA6xPvPpl6s X-Received: by 2002:aca:4a52:: with SMTP id x79mr4956852oia.115.1621368718451; Tue, 18 May 2021 13:11:58 -0700 (PDT) Received: from localhost.localdomain ([45.235.253.15]) by smtp.gmail.com with ESMTPSA id u27sm3953204oof.38.2021.05.18.13.11.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 May 2021 13:11:58 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 10/24] target/ppc: Remove type argument from get_bat_6xx_tlb Date: Tue, 18 May 2021 15:11:32 -0500 Message-Id: <20210518201146.794854-11-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::22d; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x22d.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" We can now use MMU_INST_FETCH from access_type for this. Signed-off-by: Richard Henderson --- target/ppc/mmu_helper.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) -- 2.25.1 diff --git a/target/ppc/mmu_helper.c b/target/ppc/mmu_helper.c index 506b0e4d90..0809210d3b 100644 --- a/target/ppc/mmu_helper.c +++ b/target/ppc/mmu_helper.c @@ -379,25 +379,22 @@ static inline void bat_size_prot(CPUPPCState *env, target_ulong *blp, } static int get_bat_6xx_tlb(CPUPPCState *env, mmu_ctx_t *ctx, - target_ulong virtual, MMUAccessType access_type, - int type) + target_ulong virtual, MMUAccessType access_type) { target_ulong *BATlt, *BATut, *BATu, *BATl; target_ulong BEPIl, BEPIu, bl; int i, valid, prot; int ret = -1; + bool ifetch = access_type == MMU_INST_FETCH; LOG_BATS("%s: %cBAT v " TARGET_FMT_lx "\n", __func__, - type == ACCESS_CODE ? 'I' : 'D', virtual); - switch (type) { - case ACCESS_CODE: + ifetch ? 'I' : 'D', virtual); + if (ifetch) { BATlt = env->IBAT[1]; BATut = env->IBAT[0]; - break; - default: + } else { BATlt = env->DBAT[1]; BATut = env->DBAT[0]; - break; } for (i = 0; i < env->nb_BATs; i++) { BATu = &BATut[i]; @@ -407,7 +404,7 @@ static int get_bat_6xx_tlb(CPUPPCState *env, mmu_ctx_t *ctx, bat_size_prot(env, &bl, &valid, &prot, BATu, BATl); LOG_BATS("%s: %cBAT%d v " TARGET_FMT_lx " BATu " TARGET_FMT_lx " BATl " TARGET_FMT_lx "\n", __func__, - type == ACCESS_CODE ? 'I' : 'D', i, virtual, *BATu, *BATl); + ifetch ? 'I' : 'D', i, virtual, *BATu, *BATl); if ((virtual & 0xF0000000) == BEPIu && ((virtual & 0x0FFE0000) & ~bl) == BEPIl) { /* BAT matches */ @@ -441,7 +438,7 @@ static int get_bat_6xx_tlb(CPUPPCState *env, mmu_ctx_t *ctx, LOG_BATS("%s: %cBAT%d v " TARGET_FMT_lx " BATu " TARGET_FMT_lx " BATl " TARGET_FMT_lx "\n\t" TARGET_FMT_lx " " TARGET_FMT_lx " " TARGET_FMT_lx "\n", - __func__, type == ACCESS_CODE ? 'I' : 'D', i, virtual, + __func__, ifetch ? 'I' : 'D', i, virtual, *BATu, *BATl, BEPIu, BEPIl, bl); } } @@ -1415,7 +1412,7 @@ static int get_physical_address_wtlb(CPUPPCState *env, mmu_ctx_t *ctx, } else { /* Try to find a BAT */ if (env->nb_BATs != 0) { - ret = get_bat_6xx_tlb(env, ctx, eaddr, access_type, type); + ret = get_bat_6xx_tlb(env, ctx, eaddr, access_type); } if (ret < 0) { /* We didn't match any BAT entry or don't have BATs */