From nobody Fri Oct 18 08:33:31 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=1721952292; cv=none; d=zohomail.com; s=zohoarc; b=KXjV4fVTFVPS/J9i2hHDo4U5+KOpPbELYUhjat84UjmZZZw1wBoauAzHjx0HnF7MjKdC+0ewt945q3Hx6jBZps+DhfzOP1nhVMBSW1N71eHrel7gsLEgTdlIuyhs06X5OJTrI8VWlCL1IboG2j04SpkPX1zJi6WLMyM+OFk2EyY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1721952292; 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=PetIsmnUlhClflxRVIROa6IgPnq0DtxeztGXxhCMqKs=; b=fyQpFmgb/1ljdSKIMVNvd4dR6AILP9Of/kmM91nLrhBMZ0565xY+AGZzUa46vnGpDNICSZmeGUESWtjTwEflLlwlCbI44scyUPojd/IcSMWp99MsSiRPHrgiB21XLg+dNl6uPW9zOzdEmdgAb2+mNDezMV57fuLsKUh316xRBWg= 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 1721952292534934.694077505908; Thu, 25 Jul 2024 17:04:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sX8Nd-00081d-Jg; Thu, 25 Jul 2024 20:00:20 -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 1sX8N8-0005np-Fj; Thu, 25 Jul 2024 19:59:47 -0400 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sX8N6-0001wc-W9; Thu, 25 Jul 2024 19:59:46 -0400 Received: by mail-pj1-x102a.google.com with SMTP id 98e67ed59e1d1-2cb64529a36so315615a91.0; Thu, 25 Jul 2024 16:59:43 -0700 (PDT) Received: from wheely.local0.net ([203.220.44.216]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2cf28c7fef3sm2142060a91.16.2024.07.25.16.59.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 16:59:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721951982; x=1722556782; 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=PetIsmnUlhClflxRVIROa6IgPnq0DtxeztGXxhCMqKs=; b=H5hzl4qaRCbVVkn/CBb2EgyOjw8hfgxpEw9Hnt/olSbizjA4WoZvJW3vczrOwsfbYQ Qf4YmYnYvbfQ2r434muN06e7ZI7RoK6fXgPPcVuZJSbxc7sDDq8XHFmJQjyKGaUI2Qbm 5Nw2zUGBOS7FijFipHKs5nFFlmvxUw2elGxNRPVCzauewT1GmhyxGxg73aUr+Z611n/x jwlUmi91YAoHMPEgqyp/FpTdKQWSArchKjtrIfqrAShU4g95XZknFILsMpSXvehwDUIe BrSU8PSlZUdkjOi4CYkLlt+zzTixaZ6wjgy7DlVtQPGXeLKTsLXXGRZk5vhvWaHhWZhX Wt7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721951982; x=1722556782; 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=PetIsmnUlhClflxRVIROa6IgPnq0DtxeztGXxhCMqKs=; b=rXVsD/g1lcvaEY2sgVY2CgmLHH0yXAi8NWVDJEDRkOwFzflCtFzeAojoh1evxjKJ2b LzytbjfmUo5AKFDoTtYcRsFW6I5kn5pKgyyDwMGQmRRnDRFdG+hFbHPPsvmDpQfm3BsM 58a0PJ7iyUJ9zGzm6aDbQaHU88MkMHhgLT8ocs0/+FYKDdLXxHwK2zmrr8YUaouu1tit 6sZXFLFFw3kxbLkEXXbCt+ug+W87J4ht314tUYXBLD3RiycFsgaPMAZNMdunvDbWfamZ R+yjCqpBtb3wItmOPCpd+JqIJm7x82oecSMWnHg4t9Dk9Ah6ekF1eWEIFy+vLHD+QMie cc9A== X-Forwarded-Encrypted: i=1; AJvYcCVIFgBijyMZaG4XpGJpNhGS10rQsvoqWRZ4PKMi0kMKhHYGK1hm1aNkGxauoSngQ/mIaeKbF5J5X8Bjte/WcDSlhNVw X-Gm-Message-State: AOJu0YwyNwfP/KekkWox/rAjwSWDC1gBvZ6vEuodkz6Z+MZDto2lxQQP KsfXObYJxMUdvlGLuin3lficTTFLWpZuGMub5FYbsWarOkw6Wt7BSeRR9A== X-Google-Smtp-Source: AGHT+IEbpVOquXCFhabAd8DgtnCFKfDXM789Vwyh0Og/oVtWzUrJNzrctXZkteUSHF+gsFtZejslyw== X-Received: by 2002:a17:90a:ac05:b0:2c9:6514:39ff with SMTP id 98e67ed59e1d1-2cf238ebb83mr4776722a91.33.1721951982157; Thu, 25 Jul 2024 16:59:42 -0700 (PDT) From: Nicholas Piggin To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-ppc@nongnu.org, BALATON Zoltan Subject: [PULL 92/96] target/ppc/mmu-hash32.c: Inline and remove ppc_hash32_pte_raddr() Date: Fri, 26 Jul 2024 09:54:05 +1000 Message-ID: <20240725235410.451624-93-npiggin@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240725235410.451624-1-npiggin@gmail.com> References: <20240725235410.451624-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::102a; envelope-from=npiggin@gmail.com; helo=mail-pj1-x102a.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: 1721952293319116600 Content-Type: text/plain; charset="utf-8" From: BALATON Zoltan This function is used only once and does not add more clarity than doing it inline. Signed-off-by: BALATON Zoltan Reviewed-by: Nicholas Piggin Signed-off-by: Nicholas Piggin --- target/ppc/mmu-hash32.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/target/ppc/mmu-hash32.c b/target/ppc/mmu-hash32.c index 6f0f0bbb00..c4de1647e2 100644 --- a/target/ppc/mmu-hash32.c +++ b/target/ppc/mmu-hash32.c @@ -298,15 +298,6 @@ static hwaddr ppc_hash32_htab_lookup(PowerPCCPU *cpu, return pte_offset; } =20 -static hwaddr ppc_hash32_pte_raddr(target_ulong sr, ppc_hash_pte32_t pte, - target_ulong eaddr) -{ - hwaddr rpn =3D pte.pte1 & HPTE32_R_RPN; - hwaddr mask =3D ~TARGET_PAGE_MASK; - - return (rpn & ~mask) | (eaddr & mask); -} - bool ppc_hash32_xlate(PowerPCCPU *cpu, vaddr eaddr, MMUAccessType access_t= ype, hwaddr *raddrp, int *psizep, int *protp, int mmu_idx, bool guest_visible) @@ -440,11 +431,12 @@ bool ppc_hash32_xlate(PowerPCCPU *cpu, vaddr eaddr, M= MUAccessType access_type, */ prot &=3D ~PAGE_WRITE; } - } + } + *protp =3D prot; =20 /* 9. Determine the real address from the PTE */ - - *raddrp =3D ppc_hash32_pte_raddr(sr, pte, eaddr); - *protp =3D prot; + *raddrp =3D pte.pte1 & HPTE32_R_RPN; + *raddrp &=3D TARGET_PAGE_MASK; + *raddrp |=3D eaddr & ~TARGET_PAGE_MASK; return true; } --=20 2.45.2