From nobody Mon Nov 25 10:27:05 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=1716506571; cv=none; d=zohomail.com; s=zohoarc; b=X1n9rK6jgGHkM3EdbNB8Ye3HQfi1t1tR44wJgdN+AYfwfJKviexrV/X/leh0sMreYqkrOS7kSSQqNFoQCYMdBZUrW5YJa1+jebj8yPX56W2AAHiGhmswRJiwu9poAE2xl7hxsbcf7fBsH62s5CYzGE7sqiUIXyFzXI1uLQOz124= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716506571; 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=CwUtarmCOIlit6nKCVmwVsEWWjZXwUEGtfIuJDu/51c=; b=LmrPVSBWn7XnjNEuxv54UfnGT1fPVSYz6uj2IrmIy4jm4h5I2zCrXJoIp6gFDUR4C5eXkVhSBn8s0B3OicS97L6/pGDBYSJZlDC8/Gfj7Dh85duV2JmzxfFOKiPUJpsQ3eYaAtcFUPiORLWkfwYI8hsGSqXsLc/W5Tbwuqx9FRI= 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 1716506571884798.9203922801582; Thu, 23 May 2024 16:22:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sAHa2-0004oO-LK; Thu, 23 May 2024 19:10:38 -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 1sAHZl-00037x-3K; Thu, 23 May 2024 19:10:21 -0400 Received: from mail-il1-x136.google.com ([2607:f8b0:4864:20::136]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sAHZc-00065E-Qj; Thu, 23 May 2024 19:10:20 -0400 Received: by mail-il1-x136.google.com with SMTP id e9e14a558f8ab-3737b27dc95so1569135ab.0; Thu, 23 May 2024 16:10:11 -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.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 16:10:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716505810; x=1717110610; 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=CwUtarmCOIlit6nKCVmwVsEWWjZXwUEGtfIuJDu/51c=; b=O6wDGnPuVQj6sYXRp7pr6Wuy6r7IIpq6uSTdNGi4Rm9BRkwBp8CqRvzBpJ7eoYsoR0 hC/bO1/hBjASDS2RK+ym0MpzZFmicciGMqWKV6WCxK9FzWb9rAzP1lharbi1b2zKO9yH qyt2erDb+PDlyo+lO3f6pwi8dG+woHwH2VBMfGnMuT7R2resJA0Jkz6WAa7PVJMmPIZd 5G6SmxgBYjPkfHfF798RnYlFKJC3h7EVAGhgrkZG4I4eENL4xkZceFV0S0AC8H+0t2a9 RhGPwFMISHHBlSNFBkicfw2lJi9mLiiluX2EAyax/66ePp1qgboixTGYtmzm3iaM0fJP zZ8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716505810; x=1717110610; 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=CwUtarmCOIlit6nKCVmwVsEWWjZXwUEGtfIuJDu/51c=; b=AnVulkdYjefVq5HKtyPHib5aYNbH9dkVhUigoY6DE7gB3JGoQCblF63tduYc60O7rd 7BLR9tF3jgXtrrBWMirEpOwOmCDLRX+rWgh9OWOm19a6NTpmNCSLnz1bcI85Awid1NF8 rzltwYcT5KsPXmCyWFxx25O+rjvik1LHcdy8dVj//gX5ee/yycY1ar0ayo97NR8M68gu EHBhGWlOnpCf0Vv8/K3n9ryfcPcOSpZIQfRY7eIen6crMDi0hbtKHRiX0aWRw53mJINq uOw/SJa5NoGrykDtJIkEflD8ZPxIgjVPoUQi6wOPscUd0jS58FN4ceAvB61kaUPLrDeD swPQ== X-Forwarded-Encrypted: i=1; AJvYcCXgiWWYq03+q6nE6vMk84DjZULs4ieMQ0Nk8WDgH2Ldk6j82UmvL3QuuIIaeFmLBh8470EukAWurCgjpdnP5FrWBXL/ X-Gm-Message-State: AOJu0YzDj/pGxrMrGrocQq58CfZ/+k3JhHfAHmim8uFpLicmiiDhNBRh nNRztJhC/yP8E2kA2i9Nr3d+REp+T778TiYBvPSHFY5qWGcNuwjRx8ef4Q== X-Google-Smtp-Source: AGHT+IFbpxA8zOzxHC6/1m+Vr5PakA295xwdeklWi7oJqXu66cQx6GVCs1RyPyIYlwWCxauVTA1eiA== X-Received: by 2002:a05:6e02:1c88:b0:36c:5228:446 with SMTP id e9e14a558f8ab-3737b31e13amr9395835ab.26.1716505810557; Thu, 23 May 2024 16:10:10 -0700 (PDT) From: Nicholas Piggin To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-ppc@nongnu.org, BALATON Zoltan Subject: [PULL 43/72] target/ppc/mmu_common.c: Simplify checking for real mode Date: Fri, 24 May 2024 09:07:16 +1000 Message-ID: <20240523230747.45703-44-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::136; envelope-from=npiggin@gmail.com; helo=mail-il1-x136.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: 1716506573526100006 Content-Type: text/plain; charset="utf-8" From: BALATON Zoltan In get_physical_address_wtlb() the real_mode flag depends on either the MSR[IR] or MSR[DR] bit depending on access_type. Extract just the needed bit in a more straight forward way instead of doing unnecessary computation. Reviewed-by: Nicholas Piggin Signed-off-by: BALATON Zoltan Signed-off-by: Nicholas Piggin --- target/ppc/mmu_common.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/ppc/mmu_common.c b/target/ppc/mmu_common.c index 09cbeb0052..886fb6a657 100644 --- a/target/ppc/mmu_common.c +++ b/target/ppc/mmu_common.c @@ -1184,8 +1184,10 @@ int get_physical_address_wtlb(CPUPPCState *env, mmu_= ctx_t *ctx, int mmu_idx) { int ret =3D -1; - bool real_mode =3D (type =3D=3D ACCESS_CODE && !FIELD_EX64(env->msr, M= SR, IR)) || - (type !=3D ACCESS_CODE && !FIELD_EX64(env->msr, MSR, = DR)); + bool real_mode; + + real_mode =3D (type =3D=3D ACCESS_CODE) ? !FIELD_EX64(env->msr, MSR, I= R) + : !FIELD_EX64(env->msr, MSR, DR); =20 switch (env->mmu_model) { case POWERPC_MMU_SOFT_6xx: --=20 2.43.0