From patchwork Fri Jun 15 19:43:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 138783 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1269404lji; Fri, 15 Jun 2018 13:11:31 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJQa1lAdS3K4i8iiQEjmEFwliaZphbPoeJorI/62qrUR+z2oYzDquVMRHoXN1Z+K2VL0R3S X-Received: by 2002:a37:16e0:: with SMTP id 93-v6mr2780109qkw.148.1529093491438; Fri, 15 Jun 2018 13:11:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529093491; cv=none; d=google.com; s=arc-20160816; b=1Jz+Ijn36EXGuhXr15yMhwvz+/fFu7//2d5jphjjiwoelYk3iD8Mz8grHBFWmKL1sf Jw1qIOxA8OKoHdekAWiB15Q+ZdimE1WzBse/w5A3QpkFaRXrOTN+vji0dt8prcK3Cfnm pwAZ4nOAG2Fp0l2zg/Z10JGMSS27xDU+OfEEhHxgYD85Th2+hWFYoBnGdFpX+tmNKL3J 08nBdo15WIEE+e42q2DzhUL4ze9006PwoGtVqVwrvTKo878DLCPS2a6a+LRmQq5G1dcb HW3I+0jKJQCXKrqUgFyUMsggGGJCNyYWJnK8SlqVTJ2E+h0DGTmjdL8Owm7O7G0YuNY8 /wRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=KuNXtalN93hxfYtS8iiaj+taOz8s1bCsuF+GaVINmmo=; b=a3eba4o6LZNU2H0GLJMnbu3avyQAZk0/1agA1tER9f0lo4vnrpn3mVNUj/3J8cNsVg PMJ8xwdot28heIgNCv++eJvzqtZlGj3yXEO2JdUUzVpjzhS6Dxawc3GWcmyt0nmQFBFj hAsSBNrfiawrVmnj2zCBhXCjtzRBDehpvo63pByFzICIy3IISAQ48+CzFdl0/XWk/urZ 3A9bkrKOtEQKqIeVRnSQzpeo/5WNXTGRMWJO5BcSzSJLzOBi+zU/6Skst+nEPUyH+pPv RLd9kHmm3+oAec2HJCKCpUSVIR4ASu/7/NZS3SYcC7AMuKml9kZkNHphMIQCfb8bit+A OGlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=N5PWQ6t4; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id k1-v6si4809006qtk.400.2018.06.15.13.11.31 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 15 Jun 2018 13:11:31 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=N5PWQ6t4; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:49103 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTv4E-0005Yx-Sx for patch@linaro.org; Fri, 15 Jun 2018 16:11:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51683) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTue8-0000Zo-1M for qemu-devel@nongnu.org; Fri, 15 Jun 2018 15:44:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fTue7-0002gn-4a for qemu-devel@nongnu.org; Fri, 15 Jun 2018 15:44:32 -0400 Received: from mail-pg0-x241.google.com ([2607:f8b0:400e:c05::241]:37929) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fTue6-0002gH-UT for qemu-devel@nongnu.org; Fri, 15 Jun 2018 15:44:31 -0400 Received: by mail-pg0-x241.google.com with SMTP id c9-v6so4855085pgf.5 for ; Fri, 15 Jun 2018 12:44:30 -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=KuNXtalN93hxfYtS8iiaj+taOz8s1bCsuF+GaVINmmo=; b=N5PWQ6t4IrIfOrsuqEOmgnmm7U9Wn/eSq5VbBm9NC3vD/0NcezLllubFwMRuFKueGk KKENHTTL1OvdqnEZcDLnVe0GBy3ORR28BfGva+fdSaDRRWjGpasJ/WLFBLaOyzVwEa66 JBtti1hvI6ZEEx4CXHdqwc2YAzHoEbJqRF7Qw= 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=KuNXtalN93hxfYtS8iiaj+taOz8s1bCsuF+GaVINmmo=; b=lEiEJ/S4MsqSX1UrDvweaknz2DqV7Djo1jVI1ObxoB2/nnQQPYaUwXXCxDvovhCU8K NZK+EvWm8YQxvAH8gMlD5FTXO3j+4eaPY0jHRE1QugCa8Dz3NryZzLaTC0tFjVw/PXLY KhsacGZI3qIpAlX/EWKmm5y6szt5Mq1zjzcbGo8iXgzkdP3JPOifj6WQv4zfVmi4Y8CZ RmDF97a12uKb4HiHQucn5/Lfw5jEiKOmSlMpP9OUmNvisiMQdJxXxL9VBuK0GUm9hRTS 8TgKpvO25H1rLPyeSt0XovzSRk7EPaMBFFH86z6NEqQIJ7+PmQa/g7DdwQjDA/fkWnE8 lMYQ== X-Gm-Message-State: APt69E0LM+jdADp4kj8zKPfMRa+ieOn21Z3iBhgnF6Lg2SfTv4Q/ugfi w5aCXLy2kz46qTtc4isxHhAyexVSB4U= X-Received: by 2002:a62:b90f:: with SMTP id z15-v6mr3413246pfe.254.1529091869682; Fri, 15 Jun 2018 12:44:29 -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 29-v6sm14038360pfj.14.2018.06.15.12.44.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Jun 2018 12:44:28 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 15 Jun 2018 09:43:51 -1000 Message-Id: <20180615194354.12489-17-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180615194354.12489-1-richard.henderson@linaro.org> References: <20180615194354.12489-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::241 Subject: [Qemu-devel] [PULL v2 16/19] 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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ée 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(-) -- 2.17.1 diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index 0a721bb9c4..719cca2268 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()); - 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 = -1; env->tlb_flush_mask = 0; - tb_unlock(); - atomic_mb_set(&cpu->pending_tlb_flush, 0); } @@ -180,8 +176,6 @@ static void tlb_flush_by_mmuidx_async_work(CPUState *cpu, run_on_cpu_data data) assert_cpu_is_self(cpu); - tb_lock(); - tlb_debug("start: mmu_idx:0x%04lx\n", mmu_idx_bitmask); for (mmu_idx = 0; mmu_idx < NB_MMU_MODES; mmu_idx++) { @@ -197,8 +191,6 @@ static void tlb_flush_by_mmuidx_async_work(CPUState *cpu, run_on_cpu_data data) cpu_tb_jmp_cache_clear(cpu); tlb_debug("done\n"); - - tb_unlock(); } void tlb_flush_by_mmuidx(CPUState *cpu, uint16_t idxmap)