From nobody Tue Oct 28 12:39:19 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1522981318474645.1054505169096; Thu, 5 Apr 2018 19:21:58 -0700 (PDT) Received: from localhost ([::1]:44032 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f4H0f-0000tY-4q for importer@patchew.org; Thu, 05 Apr 2018 22:21:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58487) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f4GsN-0002Gp-7Q for qemu-devel@nongnu.org; Thu, 05 Apr 2018 22:13:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f4GsK-0003Wn-Tc for qemu-devel@nongnu.org; Thu, 05 Apr 2018 22:13:15 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:50313) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f4GsK-0003WR-PJ for qemu-devel@nongnu.org; Thu, 05 Apr 2018 22:13:12 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 6B27020A90; Thu, 5 Apr 2018 22:13:12 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 05 Apr 2018 22:13:12 -0400 Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id 1FFC51025D; Thu, 5 Apr 2018 22:13:12 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=braap.org; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=l4oZAUooxG4YyRh3wz9cPP56lQ xqYVAGvH0lWVow2P8=; b=xrgror2gTBO/Fb6Ktp9QgTGeuY9ewaoIjNUlbnHg9u axqGKaQf7QhdmwpPI2j1XRsQn6LEOExjRaFv0mPueLXBlbdaOXH5bawSBGOgmkQc 7pGKmirxA9F1Tz9ApOogc8hyY1LxMtdxcEObWqwd4utc8rrB4pjd1haNUflzZmRz Q= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=l4oZAU ooxG4YyRh3wz9cPP56lQxqYVAGvH0lWVow2P8=; b=OGE5z14itchFC+x9vu+vjH NqWP2z4+UtfmvkiyRZHKE5QytjAqrHMJvMyEbvfYbPRzaUGPAlyr0uIMXt1Y8bPm c7d4PemE+sdZzulr49izDlTjgHlo4EjpFiacINJGc2YAz0LspmTcYD6+2busE4mn l0vJQDplUZ2+c5HHkCUo+c6EvOP7z511tZpP1+Nxhdf/ZKxAYfu/GnCOziaADSpk itPNSpdTMPJeeXZLAor5KPnBnwteBBiaCdsG0cgkIcwuXfUqitgxZO2x8PurlWfd eqJ3lyRR63tZZS60lghp1gKKtESG5pJJ3RvFDkFqXCwTmPm/lHgERbn1DkTmrxQg == X-ME-Sender: From: "Emilio G. Cota" To: qemu-devel@nongnu.org Date: Thu, 5 Apr 2018 22:13:06 -0400 Message-Id: <1522980788-1252-16-git-send-email-cota@braap.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1522980788-1252-1-git-send-email-cota@braap.org> References: <1522980788-1252-1-git-send-email-cota@braap.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: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.111.4.29 Subject: [Qemu-devel] [PATCH v2 15/17] cputlb: remove tb_lock from tlb_flush functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 The acquisition of tb_lock was added when the async tlb_flush was introduced in e3b9ca810 ("cputlb: introduce tlb_flush_* async work.") tb_lock was there to allow us to do memset() on the tb_jmp_cache's. However, since f3ced3c5928 ("tcg: consistently access cpu->tb_jmp_cache atomically") all accesses to tb_jmp_cache are atomic, so tb_lock is not needed here. Get rid of it. Reviewed-by: Alex Benn=C3=A9e Signed-off-by: Emilio G. Cota Reviewed-by: Richard Henderson --- accel/tcg/cputlb.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index 0543903..f5c3a09 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -125,8 +125,6 @@ static void tlb_flush_nocheck(CPUState *cpu) atomic_set(&env->tlb_flush_count, env->tlb_flush_count + 1); tlb_debug("(count: %zu)\n", tlb_flush_count()); =20 - tb_lock(); - memset(env->tlb_table, -1, sizeof(env->tlb_table)); memset(env->tlb_v_table, -1, sizeof(env->tlb_v_table)); cpu_tb_jmp_cache_clear(cpu); @@ -135,8 +133,6 @@ static void tlb_flush_nocheck(CPUState *cpu) env->tlb_flush_addr =3D -1; env->tlb_flush_mask =3D 0; =20 - tb_unlock(); - atomic_mb_set(&cpu->pending_tlb_flush, 0); } =20 @@ -180,8 +176,6 @@ static void tlb_flush_by_mmuidx_async_work(CPUState *cp= u, run_on_cpu_data data) =20 assert_cpu_is_self(cpu); =20 - tb_lock(); - tlb_debug("start: mmu_idx:0x%04lx\n", mmu_idx_bitmask); =20 for (mmu_idx =3D 0; mmu_idx < NB_MMU_MODES; mmu_idx++) { @@ -197,8 +191,6 @@ static void tlb_flush_by_mmuidx_async_work(CPUState *cp= u, run_on_cpu_data data) cpu_tb_jmp_cache_clear(cpu); =20 tlb_debug("done\n"); - - tb_unlock(); } =20 void tlb_flush_by_mmuidx(CPUState *cpu, uint16_t idxmap) --=20 2.7.4