From nobody Tue Feb 10 15:28:35 2026 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; dkim=fail; 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; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1529005985828262.02623818659833; Thu, 14 Jun 2018 12:53:05 -0700 (PDT) Received: from localhost ([::1]:42499 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTYIr-0006jp-5j for importer@patchew.org; Thu, 14 Jun 2018 15:53:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37241) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTXyt-0007EO-Ck for qemu-devel@nongnu.org; Thu, 14 Jun 2018 15:32:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fTXyp-000622-Cb for qemu-devel@nongnu.org; Thu, 14 Jun 2018 15:32:27 -0400 Received: from mail-pg0-x244.google.com ([2607:f8b0:400e:c05::244]:38220) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fTXyp-00061a-6j for qemu-devel@nongnu.org; Thu, 14 Jun 2018 15:32:23 -0400 Received: by mail-pg0-x244.google.com with SMTP id c9-v6so3364501pgf.5 for ; Thu, 14 Jun 2018 12:32:23 -0700 (PDT) Received: from cloudburst.twiddle.net (rrcs-173-198-77-219.west.biz.rr.com. [173.198.77.219]) by smtp.gmail.com with ESMTPSA id x24-v6sm11532184pfj.104.2018.06.14.12.32.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 14 Jun 2018 12:32:21 -0700 (PDT) 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=1bRKDGWKZCLgSDuPUlRc6n0F/WmiP6u9YX3vZUkLxH0=; b=ElLISmQzkryUD4oY4fgl+nGO80wUIRgNLoRGyKwcC86u/cYOR2ZIRjxuu6jk1FQbmi kV6gDF+yPiS/2ZRqrK/MjM6jnFFKURZCslLjIRUZgVTIGVI2cIZuaqI5mhjV40YzookY muW1K2zeOS34LGKwl1Jq1bOvfFrj5ysahMVuw= 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=1bRKDGWKZCLgSDuPUlRc6n0F/WmiP6u9YX3vZUkLxH0=; b=J62QpQZo4lm9XTW0tRGblkTWk2HqZ7+zXuD+DoHfNzjJIivnaRNt0K66gbHFtex+qZ skW5qAvNapp/5RXho68OL/7LNSvSmLsnhjXK00w/FXMSLL+g2AJ3KZXvSTNog0Rwh6Co 52RVG0eTND6Uu9B0YKCYPCUKCsZTDt3KSy5G1f08wjvT1fXz2HSZeGbj0cIjlAZUwTct 9QgdRE9/X1y+0OScAj1wRrlctHuIMIQPowc/Of5+S0iSKF21Y6OWzx1eU5Wr66fhERW/ APnbuOvrwjYEA4oXGE/4qRQoW1QErEV/9zxnT5e7tI8HLaoNV4AJOr/ePGwnXvd/j/hH UAqg== X-Gm-Message-State: APt69E2VnpfLx3DcDsNoxIP5aEDZtcFXEuCjLTf4iqckE4yjuP799X3v 9Qir6CepiPpC/He+gIcw43/sIm3pdFs= X-Google-Smtp-Source: ADUXVKIq01KCWfXhGfDb65lYKh/ESh9LwISdPZwtsgAZBIFJ9jDUVlfLnEXqjGyog8XSUUbGOS0G8Q== X-Received: by 2002:a63:370f:: with SMTP id e15-v6mr3392213pga.192.1529004741945; Thu, 14 Jun 2018 12:32:21 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 14 Jun 2018 09:31:45 -1000 Message-Id: <20180614193147.29680-17-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180614193147.29680-1-richard.henderson@linaro.org> References: <20180614193147.29680-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:400e:c05::244 Subject: [Qemu-devel] [PULL 16/18] 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: peter.maydell@linaro.org, "Emilio G. Cota" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 From: "Emilio G. Cota" 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 Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota Signed-off-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 05439039e9..f5c3a0926f 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.17.1