From nobody Sun Apr 27 12:41:45 2025
Delivered-To: importer@patchew.org
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;
Authentication-Results: mx.zohomail.com;
	dkim=fail;
	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=fail(p=none dis=none)  header.from=linaro.org
ARC-Seal: i=1; a=rsa-sha256; t=1579661530; cv=none;
	d=zohomail.com; s=zohoarc;
	b=ZZ8cepAqlp86PPGElWCkpaVtdIXTvPASAlS87g7JTGIU6hPzihAynoYlZBuR4pc0ZDozTJK76dnGLyirORLJqi1LB9pCAPrmxCT817+8ta0ERTmx1GYAb2xogKm79cXIVDyQrE20MWRIzSFpDF4jARDCMV6FRq5/JycdAlnSOLw=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com;
 s=zohoarc;
	t=1579661530;
 h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To;
	bh=6xOoTwiPWbJWg1dQvhdtD+14yzwztym6bWFoctdkQiM=;
	b=XEVmjGxF8onO8HcHWCwlvDDvF3k8CrXOZk7n+knNT19+cZuRvpbD6SOUAKAWe6xx0z12gwmEm2YcsULo6h+3wCr9Yk/QV6fgRaDNTFRsJsuz5rFTqDbOwtgpFq+4agb3F2lTqw03FI3CWix8CA8/kRAI3CkAQAR07pVG6ZHZt0Q=
ARC-Authentication-Results: i=1; mx.zohomail.com;
	dkim=fail;
	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=fail header.from=<richard.henderson@linaro.org> (p=none dis=none)
 header.from=<richard.henderson@linaro.org>
Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org>
Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by
 mx.zohomail.com
	with SMTPS id 1579661530586613.8627291880545;
 Tue, 21 Jan 2020 18:52:10 -0800 (PST)
Received: from localhost ([::1]:35688 helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <qemu-devel-bounces+importer=patchew.org@nongnu.org>)
	id 1iu67l-0007qR-2i
	for importer@patchew.org; Tue, 21 Jan 2020 21:52:09 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:45212)
 by lists.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <richard.henderson@linaro.org>) id 1iu65m-0005eX-0f
 for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:50:07 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <richard.henderson@linaro.org>) id 1iu65k-0002lV-5j
 for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:50:05 -0500
Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]:45633)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <richard.henderson@linaro.org>)
 id 1iu65k-0002kx-0T
 for qemu-devel@nongnu.org; Tue, 21 Jan 2020 21:50:04 -0500
Received: by mail-pg1-x543.google.com with SMTP id b9so2608439pgk.12
 for <qemu-devel@nongnu.org>; Tue, 21 Jan 2020 18:50:02 -0800 (PST)
Received: from localhost.localdomain (rrcs-173-198-77-92.west.biz.rr.com.
 [173.198.77.92])
 by smtp.gmail.com with ESMTPSA id c22sm44149883pfo.50.2020.01.21.18.50.00
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 21 Jan 2020 18:50:01 -0800 (PST)
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=6xOoTwiPWbJWg1dQvhdtD+14yzwztym6bWFoctdkQiM=;
 b=kz+qWa5+Z+v/qQftTxebP/DJ4lqYonIlT73ayK6t/p9ob/c3lzdsCrsA201cNA1Gll
 BcuYKQdWK8lqU5elp6mTA16gpqRBVbVOG26wZmMdk/QHpWT7vDiOP5Utx367FfeQnLAx
 rA46XRbP9JqZFfNS9ctyduB2uffw5+RUBBxHOokGBpyM4c9ViqfX7cYg22eFtJqtLS+m
 t2HdWFVanYyNcEgmNfpE/hi/FDeyyPlNvXMYfyqTLX07jRB0l6OqnABahMvwXn37fIcG
 J445cvq7Sd4f/PyK+FKaBPi/1+9gbHyd/lfQQfoPkNWSVkycIZhv2JZQEc5790U2ReFs
 Q3rA==
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=6xOoTwiPWbJWg1dQvhdtD+14yzwztym6bWFoctdkQiM=;
 b=CHWA41Hc0AsGHYuK7m1pxLGLNxLndBOlsn1FCBPxkILMIeRLp2vqyR/MYYkGLTPrn+
 1Lv393sU8yyxRU82YjXWH7hGtYVjOqLBmFpP3eAC9m6fAyP7yI/6SrB2rSnFcQ315dFu
 RLEjNxnlVZdYDI84Fc8Enq6LaGdPcia4OK2Sr8o6WEfPwGsD6hRp/Fxb3vmO7mCidrRn
 wHWzfli/p8H7ujWg3wQAiqE+5Cdyyrs4jxX0OmNsbDdEsaPP5SI4une49yppvLUYuyE4
 JsbiyQ7oxncNRcBfR47He53Suy435VQHrVNVUzGzYV4/1EqCYkXnaimbu9cIn357vvfp
 6cow==
X-Gm-Message-State: APjAAAXP0njcRq7OZRqnvUvCvym1q3gU6SCMy9Dmpzy0m3tMlxi6Gfud
 SlYEEe0GhhsqoEio5pPD3FSYYTf26mw=
X-Google-Smtp-Source: 
 APXvYqzNwo6Sr1TuBt4tfMN5kcXQ//tKME085H2vus2z0X4Og1j4uk4UZRsUmWJnOZrTGIms/LlgUw==
X-Received: by 2002:a65:4109:: with SMTP id w9mr8683687pgp.383.1579661401842;
 Tue, 21 Jan 2020 18:50:01 -0800 (PST)
From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Subject: [PULL 07/16] cputlb: Merge tlb_table_flush_by_mmuidx into
 tlb_flush_one_mmuidx_locked
Date: Tue, 21 Jan 2020 16:49:37 -1000
Message-Id: <20200122024946.28484-8-richard.henderson@linaro.org>
X-Mailer: git-send-email 2.20.1
In-Reply-To: <20200122024946.28484-1-richard.henderson@linaro.org>
References: <20200122024946.28484-1-richard.henderson@linaro.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
 recognized.
X-Received-From: 2607:f8b0:4864:20::543
X-BeenThere: qemu-devel@nongnu.org
X-Mailman-Version: 2.1.23
Precedence: list
List-Id: <qemu-devel.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>,
 <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>
List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel>
List-Post: <mailto:qemu-devel@nongnu.org>
List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>,
 <mailto:qemu-devel-request@nongnu.org?subject=subscribe>
Cc: peter.maydell@linaro.org, Alistair Francis <alistair.francis@wdc.com>,
 =?UTF-8?q?Alex=20Benn=C3=A9e?= <alex.bennee@linaro.org>
Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org
Sender: "Qemu-devel" <qemu-devel-bounces+importer=patchew.org@nongnu.org>
X-ZohoMail-DKIM: fail (Header signature does not verify)

There is only one caller for tlb_table_flush_by_mmuidx.  Place
the result at the earlier line number, due to an expected user
in the near future.

Reviewed-by: Alex Benn=C3=A9e <alex.bennee@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 accel/tcg/cputlb.c | 19 +++++++------------
 1 file changed, 7 insertions(+), 12 deletions(-)

diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
index 02b381cf50..3a4881cf69 100644
--- a/accel/tcg/cputlb.c
+++ b/accel/tcg/cputlb.c
@@ -224,11 +224,16 @@ static void tlb_mmu_resize_locked(CPUArchState *env, =
int mmu_idx)
     }
 }
=20
-static inline void tlb_table_flush_by_mmuidx(CPUArchState *env, int mmu_id=
x)
+static void tlb_flush_one_mmuidx_locked(CPUArchState *env, int mmu_idx)
 {
     tlb_mmu_resize_locked(env, mmu_idx);
-    memset(env_tlb(env)->f[mmu_idx].table, -1, sizeof_tlb(env, mmu_idx));
     env_tlb(env)->d[mmu_idx].n_used_entries =3D 0;
+    env_tlb(env)->d[mmu_idx].large_page_addr =3D -1;
+    env_tlb(env)->d[mmu_idx].large_page_mask =3D -1;
+    env_tlb(env)->d[mmu_idx].vindex =3D 0;
+    memset(env_tlb(env)->f[mmu_idx].table, -1, sizeof_tlb(env, mmu_idx));
+    memset(env_tlb(env)->d[mmu_idx].vtable, -1,
+           sizeof(env_tlb(env)->d[0].vtable));
 }
=20
 static inline void tlb_n_used_entries_inc(CPUArchState *env, uintptr_t mmu=
_idx)
@@ -289,16 +294,6 @@ void tlb_flush_counts(size_t *pfull, size_t *ppart, si=
ze_t *pelide)
     *pelide =3D elide;
 }
=20
-static void tlb_flush_one_mmuidx_locked(CPUArchState *env, int mmu_idx)
-{
-    tlb_table_flush_by_mmuidx(env, mmu_idx);
-    env_tlb(env)->d[mmu_idx].large_page_addr =3D -1;
-    env_tlb(env)->d[mmu_idx].large_page_mask =3D -1;
-    env_tlb(env)->d[mmu_idx].vindex =3D 0;
-    memset(env_tlb(env)->d[mmu_idx].vtable, -1,
-           sizeof(env_tlb(env)->d[0].vtable));
-}
-
 static void tlb_flush_by_mmuidx_async_work(CPUState *cpu, run_on_cpu_data =
data)
 {
     CPUArchState *env =3D cpu->env_ptr;
--=20
2.20.1