From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00FD6C2D0DB for ; Mon, 20 Jan 2020 13:43:09 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C2B392087E for ; Mon, 20 Jan 2020 13:43:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="AEET4ddb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C2B392087E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:36740 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1itXKd-0001Sp-UW for qemu-devel@archiver.kernel.org; Mon, 20 Jan 2020 08:43:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35220) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1itXJa-0008Ec-HY for qemu-devel@nongnu.org; Mon, 20 Jan 2020 08:42:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1itXJZ-00027T-Gg for qemu-devel@nongnu.org; Mon, 20 Jan 2020 08:42:02 -0500 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:36800) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1itXJZ-00026v-AL for qemu-devel@nongnu.org; Mon, 20 Jan 2020 08:42:01 -0500 Received: by mail-wm1-x342.google.com with SMTP id p17so14781619wma.1 for ; Mon, 20 Jan 2020 05:42:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version:content-transfer-encoding; bh=gQZrsvfOe7SGWxE11ZazAiZ6sRxF+B8oEBk84dl3phA=; b=AEET4ddbfMgtclpgPylI0JFCWwso6FlOEzNQG5s0CKm4tz6kAGDs7iIBhkKZgmbIO+ AyWVl6RW0PSrmZJnHYk+VSGVkoBwTrhqvBBn7YUTBdntkyJ/kf8BaQ+lMw+8nu19LwYn irX5FkzzsLxky/9SSiG1SCTURjcPVPYN2i2/DwAAYjeQ4mfu9761KmlyTevLeZflRh5T Juj+wavEydbTJsPLSXhaAZ2e6rS+jxaigq39oIGr4S2dXbXMOwxmUEWf1FrmQ9oDjowq UyPFw7w23iF8KNPoqIGs8C1hsMIzd37An8aWLux8Jf2XEpWGhDtMJNW159MOkn9exaxR kl2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version:content-transfer-encoding; bh=gQZrsvfOe7SGWxE11ZazAiZ6sRxF+B8oEBk84dl3phA=; b=pUHNEeXPhaVFWC+oWs+MFdhVT52PnJSydkAT5sUI/teMmmcztcuyr4Wl3n23GcckTz j3DRWAaXHu2HxeVM596ufY71bZ9N7SaVhPWCgqEMNzUOKhlG244EBYawcafq6E92M7vz d2oKBb85kAq4de8w2L2s/64j8tr2S9PbF4FMIxTMZar4/RG57GqeT3SY2uDTC4n95OjC Ie+NIK7lhwr1j8wktAGmMnVXbcj7KCGTPXISpDvTF0Nxbs1qVKUZZqRqhp5Yi+XKuj6r uHhAOHoFZmzT9do5wmtcVhHjlZfIo3vcM+2pqb43eEhmi9vXPaEm2sQGg6Y8icNBYXvE 3cDw== X-Gm-Message-State: APjAAAVTrFwiASNmahCVl9u/DpWv3pXMY4RioiPuJ5MXXFoV1pC05XQr v6XB4lcySqx/DGlj5+DsCqJwad8vESA= X-Google-Smtp-Source: APXvYqxNU0VILBTiop+oZ8aHRQPQfPkB3G7dxebGR0Yjakq8DI4OmW76BKSaftlqW5hf0/+BtH4Npg== X-Received: by 2002:a1c:6605:: with SMTP id a5mr18201796wmc.112.1579527720305; Mon, 20 Jan 2020 05:42:00 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id 60sm48740988wrn.86.2020.01.20.05.41.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jan 2020 05:41:59 -0800 (PST) Received: from zen (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 85E9C1FF87; Mon, 20 Jan 2020 13:41:58 +0000 (GMT) References: <20200109024907.2730-1-richard.henderson@linaro.org> <20200109024907.2730-7-richard.henderson@linaro.org> User-agent: mu4e 1.3.6; emacs 28.0.50 From: Alex =?utf-8?Q?Benn=C3=A9e?= To: Richard Henderson Subject: Re: [PATCH 6/9] cputlb: Split out tlb_mmu_flush_locked In-reply-to: <20200109024907.2730-7-richard.henderson@linaro.org> Date: Mon, 20 Jan 2020 13:41:58 +0000 Message-ID: <878sm22qjd.fsf@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: 2a00:1450:4864:20::342 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: alistair.francis@wdc.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Richard Henderson writes: > We will want to be able to flush a tlb without resizing. Reviewed-by: Alex Benn=C3=A9e > > Signed-off-by: Richard Henderson > --- > accel/tcg/cputlb.c | 15 ++++++++++----- > 1 file changed, 10 insertions(+), 5 deletions(-) > > diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c > index eff427f137..e60e501334 100644 > --- a/accel/tcg/cputlb.c > +++ b/accel/tcg/cputlb.c > @@ -228,12 +228,8 @@ static void tlb_mmu_resize_locked(CPUTLBDesc *desc, = CPUTLBDescFast *fast) > } > } >=20=20 > -static void tlb_flush_one_mmuidx_locked(CPUArchState *env, int mmu_idx) > +static void tlb_mmu_flush_locked(CPUTLBDesc *desc, CPUTLBDescFast *fast) > { > - CPUTLBDesc *desc =3D &env_tlb(env)->d[mmu_idx]; > - CPUTLBDescFast *fast =3D &env_tlb(env)->f[mmu_idx]; > - > - tlb_mmu_resize_locked(desc, fast); > desc->n_used_entries =3D 0; > desc->large_page_addr =3D -1; > desc->large_page_mask =3D -1; > @@ -242,6 +238,15 @@ static void tlb_flush_one_mmuidx_locked(CPUArchState= *env, int mmu_idx) > memset(desc->vtable, -1, sizeof(desc->vtable)); > } >=20=20 > +static void tlb_flush_one_mmuidx_locked(CPUArchState *env, int mmu_idx) > +{ > + CPUTLBDesc *desc =3D &env_tlb(env)->d[mmu_idx]; > + CPUTLBDescFast *fast =3D &env_tlb(env)->f[mmu_idx]; > + > + tlb_mmu_resize_locked(desc, fast); > + tlb_mmu_flush_locked(desc, fast); > +} > + > static inline void tlb_n_used_entries_inc(CPUArchState *env, uintptr_t m= mu_idx) > { > env_tlb(env)->d[mmu_idx].n_used_entries++; --=20 Alex Benn=C3=A9e