From nobody Mon Nov 25 09:18:55 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1716506321; cv=none; d=zohomail.com; s=zohoarc; b=jZXyEYnTLyk+CSL83NVR30U+llBygILunVVvlOgH9nTd/4YJPWSU26TaYSbEMogRl6ILxY/Pnk4x+7ozqbtPUn8vbknMOxookjfg0DB16KCBvbbNRF1M/XrwXhfxlgdqg31JcrNVqvt59vGvI6uJ+Hqdsq6/006fmcECltAzxQA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716506321; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=bFPaaQ719ZGm4ALc/N+temkOdUx18gmGqxDG5JRZ0UE=; b=RmUr+OBilmN+tpa1zVOLDoyHbOsfotifCt+Egk9AHzkNYoWgsncBU+MWZ4un5mSnbAz8E/z4dPpkn7HisZMuPnpSfcjctHj8YWgrMEukfU/PBNf+t80xWMRWSORVeVYrETpmqErPK4QHEL4fUSs1/gsuO9sF6kJjjhpDqNd1foI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1716506321487416.59416821008483; Thu, 23 May 2024 16:18:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sAHZz-0004S7-IP; Thu, 23 May 2024 19:10:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sAHZw-00049O-E1; Thu, 23 May 2024 19:10:32 -0400 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sAHZu-0006Du-N6; Thu, 23 May 2024 19:10:32 -0400 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-6f69422c090so3470543b3a.2; Thu, 23 May 2024 16:10:29 -0700 (PDT) Received: from wheely.local0.net (110-175-65-7.tpgi.com.au. [110.175.65.7]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-682227f1838sm87041a12.46.2024.05.23.16.10.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 16:10:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716505828; x=1717110628; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=bFPaaQ719ZGm4ALc/N+temkOdUx18gmGqxDG5JRZ0UE=; b=aj3L/1KzbJRQNL82NCK0CzxG2orRYLF5lJQZi5fQlKqRj8LPKblkymP4Du9ipSFz84 V8lugIk7h4KE3wmYQowbqw60Xu7TEd0Fyv/Ni3+x9L5Tu/+itLZdtFs4JqqNnWMJxU0B SYIH1dC+iD/l8e00hyfUENXUGUII3sKw2JFm+k7bhGcQ+Qk82WIt8k2GAA8l28axVgSG 8odGu/930OI1hcNqFnnCbhkZrmosZfvMHnLR2UrV0YW+ejBdXV2KnPcmfkF4It6xn/QS MK82SPf/41xDCkHho+4zzo0IgHIbIIsUALnErGk6mhYD/J/HScASkAp09cvH3iy/Hiuc usmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716505828; x=1717110628; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bFPaaQ719ZGm4ALc/N+temkOdUx18gmGqxDG5JRZ0UE=; b=kcmcjRvdRhdgZoOl62jbGkEFmhqkfjfKxrZ1jsL2Da+EAyPrCtkbu+uwdyYo7W1qSR 9AWUd9Ork9zZals1saY7d1jkZUrd7KAg/+q2WHVhMjLRDcEwrHxR+A0KBkq1XsgRYbAB xswLSL2GZghLTOIl0X7S2Fx9cH6/GOooePhK4q6W0Ly2DxEMeZDZr8POLfXMpTBC7Og5 IV4VOSzmEGIPJZbHTDOWmGSy88RCUO0ErWNY/DBY9kVD3NCTB5aoAF16CB7OUCfrQZvi 3KAaqRDE4jaImTjaeG3y2xBFKdS+F/HQYrDMXnguYBZpjKyE1wW8X2kL6ejKYNR9WoSI Z+ag== X-Forwarded-Encrypted: i=1; AJvYcCVooeSpJQlo2OjM7mzDrAdpvNEXIAVV3+cOX4YqpQumk/vM4Y/CnzsAJ2pxnUSiFnY9fwUXfavHX4yIuwXUeDK9CCjP X-Gm-Message-State: AOJu0YwFMQfyh+YycMFl4R9ZEw5r5K40DNUy9pFnlA29p+zZMQRMX3NX kzhjz+UY3DrCfAH+RlfOQRSl0/tN00VQIXeIoquH0SCd6CIOBNaSUbi4rA== X-Google-Smtp-Source: AGHT+IFbkUa4EIpqV8anYcpmgUI2GmsPqq6A0kYRL6F6GGXZUWGF0dC/GVqwlB46qQdJgaeVBb3k7Q== X-Received: by 2002:a05:6a00:2a0f:b0:6ea:c43c:a650 with SMTP id d2e1a72fcca58-6f8f41a95a0mr528602b3a.32.1716505827889; Thu, 23 May 2024 16:10:27 -0700 (PDT) From: Nicholas Piggin To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-ppc@nongnu.org, BALATON Zoltan Subject: [PULL 49/72] target/ppc/mmu_common.c: Split out BookE cases before checking real mode Date: Fri, 24 May 2024 09:07:22 +1000 Message-ID: <20240523230747.45703-50-npiggin@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240523230747.45703-1-npiggin@gmail.com> References: <20240523230747.45703-1-npiggin@gmail.com> 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=2607:f8b0:4864:20::42b; envelope-from=npiggin@gmail.com; helo=mail-pf1-x42b.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, FREEMAIL_FROM=0.001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1716506322455100001 Content-Type: text/plain; charset="utf-8" From: BALATON Zoltan BookE does not have real mode so split off and handle it first in get_physical_address_wtlb() before checking for real mode for other MMU models. Reviewed-by: Nicholas Piggin Signed-off-by: BALATON Zoltan Signed-off-by: Nicholas Piggin --- target/ppc/mmu_common.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/target/ppc/mmu_common.c b/target/ppc/mmu_common.c index 03d9e6bfda..9f177b6976 100644 --- a/target/ppc/mmu_common.c +++ b/target/ppc/mmu_common.c @@ -1175,6 +1175,13 @@ int get_physical_address_wtlb(CPUPPCState *env, mmu_= ctx_t *ctx, int ret =3D -1; bool real_mode; =20 + if (env->mmu_model =3D=3D POWERPC_MMU_BOOKE) { + return mmubooke_get_physical_address(env, ctx, eaddr, access_type); + } else if (env->mmu_model =3D=3D POWERPC_MMU_BOOKE206) { + return mmubooke206_get_physical_address(env, ctx, eaddr, access_ty= pe, + mmu_idx); + } + real_mode =3D (type =3D=3D ACCESS_CODE) ? !FIELD_EX64(env->msr, MSR, I= R) : !FIELD_EX64(env->msr, MSR, DR); =20 @@ -1195,13 +1202,6 @@ int get_physical_address_wtlb(CPUPPCState *env, mmu_= ctx_t *ctx, ret =3D mmu40x_get_physical_address(env, ctx, eaddr, access_ty= pe); } break; - case POWERPC_MMU_BOOKE: - ret =3D mmubooke_get_physical_address(env, ctx, eaddr, access_type= ); - break; - case POWERPC_MMU_BOOKE206: - ret =3D mmubooke206_get_physical_address(env, ctx, eaddr, access_t= ype, - mmu_idx); - break; case POWERPC_MMU_REAL: if (real_mode) { ret =3D check_physical(env, ctx, eaddr, access_type); --=20 2.43.0