From nobody Sat Nov 23 19:59:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1731600562; cv=none; d=zohomail.com; s=zohoarc; b=naFtmYbd49eD4gGbVybwbFSJD++e0+4B/MREGtagKz0tIH8HBT7yTe8ikYcR5Yo/UmJ3i5cShhDTZ1YYTC3GdaevN6a5QYlcd2Skqag2H81DUFrT28kDKtaRPqXP81iJVHTpMr9LOxTu5CScsBGYnMjW71mLbaq6/krfmtYzwDA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1731600562; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=8p+yJfYhOb0hWvZrgDQ+COQgpXoEivuXg56vfDbFxMU=; b=LZ12g14XTEy2+j5hz/+6IGYglZh9TBTanXYd60Yk035gXyk7uje7iMTGTHZw98/F7cCmRz5aM9I2Bafu5zt9BxPEr6HzLbE/TV1ZYQEkNtevhn3Yg6dpP5w9WH6Pqk3dKr9pNROWulLGpQpoCuvlYKxkkqvY41hy2KOfN+IERZw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1731600562431418.3159787414378; Thu, 14 Nov 2024 08:09:22 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tBcIb-00059J-0P; Thu, 14 Nov 2024 11:02:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tBcI3-0004z6-Kv for qemu-devel@nongnu.org; Thu, 14 Nov 2024 11:01:51 -0500 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tBcHz-0002DP-OF for qemu-devel@nongnu.org; Thu, 14 Nov 2024 11:01:50 -0500 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-20c805a0753so8528885ad.0 for ; Thu, 14 Nov 2024 08:01:43 -0800 (PST) Received: from stoup.. ([71.212.136.242]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2ea024ec723sm1484438a91.46.2024.11.14.08.01.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Nov 2024 08:01:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1731600102; x=1732204902; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=8p+yJfYhOb0hWvZrgDQ+COQgpXoEivuXg56vfDbFxMU=; b=KiajS9YeEOeO4bZTjdzULh4VpNgvL5pqxep+40EDsK9N5NqxNL97d4xbSgDSTatEyq w6Hdnb0V0hssYu4RjogALWmFYqmSKxDc/LemuzMjSvZazqQEBm72pTNMwQYHftSidkIP njRuYqIe6ntvHlCWOc7Ib7so+bNhs08/lmPoENFWx//ueRmYO/krAPsUAWTDPJqM0aGx GxJrfTBQYbNjzivPTLQDtiUnhWuBDoonTNWBs9+keiKRIYzDfJ3M4tb2bL+O45818I1h 5Vsf358KuqiJUJjDGYNdgufKOoqUAoV/1baC7vDG1AHPgl1IlRn1bRj5+45UWjpFQhmw ofpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731600102; x=1732204902; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8p+yJfYhOb0hWvZrgDQ+COQgpXoEivuXg56vfDbFxMU=; b=HOdDt71TwNh0uytU33D74xlbAVvRgjMBSY84LkSWjQm/iYOcCy5qTFW7zIV+7Ic1Op Pneu5VSyQ2pg7nTYDLv70Lyt8hT33ktn9+az1CxxpQcELPXsdzZgv19VQwzQ5785JdtI 6pCBwginatQRLcJ8LQFwBKkhYI0UCTR4Y5PXtKr1JmVNqSqiwN2edZx2HmIDINDYrqkl 60dcjPaDQIL/+KyvFIhBVBcsQDAijIFCcxma+KYfw8uIZDmvQme7xNeG0ghcyrcBLcso hKlsZxFvl4VkyPeA54r+ZXkl7Ri9SfokswdrMfQoAQQ9CG2R8R1uQBWzF5njN7pwMN1t O3PQ== X-Gm-Message-State: AOJu0YwsXl1TW+zddpnFlMhsmFCSx9TSSHamhL4sd3uHiqwTKUo1DNzK UPM1ini8fyZwtqqnpBdNLU3BBJtkl3hu1L1b4mNShyPLXUFAz5QT7mJAT1CXRwquk7W+1XVtw+G 7 X-Google-Smtp-Source: AGHT+IF+jprbCTqOgF4ottpXzA4kVHm5nA2aY5cLD3avsiOEsDtDYzt3Mjqc6TXOAMl/TajT0Xx8dA== X-Received: by 2002:a17:902:8f8c:b0:20c:bcd8:5ccb with SMTP id d9443c01a7336-21183d67984mr268991755ad.30.1731600101979; Thu, 14 Nov 2024 08:01:41 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 13/54] accel/tcg: Process IntervalTree entries in tlb_reset_dirty Date: Thu, 14 Nov 2024 08:00:49 -0800 Message-ID: <20241114160131.48616-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241114160131.48616-1-richard.henderson@linaro.org> References: <20241114160131.48616-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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; Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1731600564490116600 Content-Type: text/plain; charset="utf-8" Update the addr_write copy within each interval tree node. Tidy the iteration within the other two loops as well. Signed-off-by: Richard Henderson Reviewed-by: Pierrick Bouvier --- accel/tcg/cputlb.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index e2c855f147..0c9f834cbe 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -1010,17 +1010,20 @@ void tlb_reset_dirty(CPUState *cpu, ram_addr_t star= t1, ram_addr_t length) =20 qemu_spin_lock(&cpu->neg.tlb.c.lock); for (mmu_idx =3D 0; mmu_idx < NB_MMU_MODES; mmu_idx++) { - unsigned int i; - unsigned int n =3D tlb_n_entries(&cpu->neg.tlb.f[mmu_idx]); + CPUTLBDesc *desc =3D &cpu->neg.tlb.d[mmu_idx]; + CPUTLBDescFast *fast =3D &cpu->neg.tlb.f[mmu_idx]; =20 - for (i =3D 0; i < n; i++) { - tlb_reset_dirty_range_locked(&cpu->neg.tlb.f[mmu_idx].table[i], - start1, length); + for (size_t i =3D 0, n =3D tlb_n_entries(fast); i < n; i++) { + tlb_reset_dirty_range_locked(&fast->table[i], start1, length); } =20 - for (i =3D 0; i < CPU_VTLB_SIZE; i++) { - tlb_reset_dirty_range_locked(&cpu->neg.tlb.d[mmu_idx].vtable[i= ], - start1, length); + for (size_t i =3D 0; i < CPU_VTLB_SIZE; i++) { + tlb_reset_dirty_range_locked(&desc->vtable[i], start1, length); + } + + for (CPUTLBEntryTree *t =3D tlbtree_lookup_range(desc, 0, -1); t; + t =3D tlbtree_lookup_range_next(t, 0, -1)) { + tlb_reset_dirty_range_locked(&t->copy, start1, length); } } qemu_spin_unlock(&cpu->neg.tlb.c.lock); --=20 2.43.0