From nobody Tue Feb 10 01:19:30 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; 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 (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1538516255399453.6296569401095; Tue, 2 Oct 2018 14:37:35 -0700 (PDT) Received: from localhost ([::1]:45789 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g7SMI-0005OL-5i for importer@patchew.org; Tue, 02 Oct 2018 17:37:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44070) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g7SEo-0007fu-UI for qemu-devel@nongnu.org; Tue, 02 Oct 2018 17:29:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g7SEj-0001Mn-Qr for qemu-devel@nongnu.org; Tue, 02 Oct 2018 17:29:50 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:51401) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g7SEj-0001LS-Ky for qemu-devel@nongnu.org; Tue, 02 Oct 2018 17:29:45 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 66D4A21E1D; Tue, 2 Oct 2018 17:29:43 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 02 Oct 2018 17:29:43 -0400 Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id 78E4CE4118; Tue, 2 Oct 2018 17:29:42 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=braap.org; h=cc :date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=mesmtp; bh=IuTddT7FiFfxXv wQpcfQ3nJxG1K0NrdQP+f/2ExFaok=; b=ij4jY6WsvWIDK0v8CJ85i3FOUUCR54 ZEy5ejXzQ43JlBjAZMDVY2onKL0PDu1gcy7rtWuJg8KrIeFe07ldvkGS9Iqt/3D4 x+J8zAfYGZcQ3Wrj9IWSdFPAO5U2rhzhHlpPAfN2HSv0MssX+orBzghGg9LoMWBe VHuyR79YQ2rZU= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=IuTddT7FiFfxXvwQpcfQ3nJxG1K0NrdQP+f/2ExFaok=; b=R2Og282D jNEy03e39+MzymB8KoFpRHUvdgCnI0+7DLOxmLAGe/eXjyy4roW/XM2bpaMKrPgt joI0sspPriS5+tIj+rdli/aVXDov9lWpfbIvqwPgFUNl+REXdybXMOBpv8rrgPWZ LiXynEFEkNcV2qkxGV/5/MBvb8d2ztPUNxA8xh3cvqL8PSWaVNswJypjRxxugNsm UfyOk4uV3NR1NuCk7casah3C4wsHvMybUF94apJ/eYnkw3E5xfUK+nJZojwEciXZ 2348QiQJBz9TJniifJEKyIKZm083nxKwJuzPeaEwjD0YATTXcT9msA/uYLDpUCNB wEoI5edella/UA== X-ME-Sender: X-ME-Proxy: From: "Emilio G. Cota" To: qemu-devel@nongnu.org Date: Tue, 2 Oct 2018 17:29:19 -0400 Message-Id: <20181002212921.30982-2-cota@braap.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181002212921.30982-1-cota@braap.org> References: <20181002212921.30982-1-cota@braap.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.27 Subject: [Qemu-devel] [PATCH 1/3] exec: introduce tlb_init 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: Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Paves the way for the addition of a per-TLB lock. Signed-off-by: Emilio G. Cota --- include/exec/exec-all.h | 8 ++++++++ accel/tcg/cputlb.c | 4 ++++ exec.c | 1 + 3 files changed, 13 insertions(+) diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 5f78125582..815e5b1e83 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -99,6 +99,11 @@ void cpu_address_space_init(CPUState *cpu, int asidx, =20 #if !defined(CONFIG_USER_ONLY) && defined(CONFIG_TCG) /* cputlb.c */ +/** + * tlb_init - initialize a CPU's TLB + * @cpu: CPU whose TLB should be initialized + */ +void tlb_init(CPUState *cpu); /** * tlb_flush_page: * @cpu: CPU whose TLB should be flushed @@ -258,6 +263,9 @@ void tlb_set_page(CPUState *cpu, target_ulong vaddr, void probe_write(CPUArchState *env, target_ulong addr, int size, int mmu_i= dx, uintptr_t retaddr); #else +static inline void tlb_init(CPUState *cpu) +{ +} static inline void tlb_flush_page(CPUState *cpu, target_ulong addr) { } diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index f4702ce91f..502eea2850 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -73,6 +73,10 @@ QEMU_BUILD_BUG_ON(sizeof(target_ulong) > sizeof(run_on_c= pu_data)); QEMU_BUILD_BUG_ON(NB_MMU_MODES > 16); #define ALL_MMUIDX_BITS ((1 << NB_MMU_MODES) - 1) =20 +void tlb_init(CPUState *cpu) +{ +} + /* flush_all_helper: run fn across all cpus * * If the wait flag is set then the src cpu's helper will be queued as diff --git a/exec.c b/exec.c index 6826c8337d..595deae346 100644 --- a/exec.c +++ b/exec.c @@ -965,6 +965,7 @@ void cpu_exec_realizefn(CPUState *cpu, Error **errp) tcg_target_initialized =3D true; cc->tcg_initialize(); } + tlb_init(cpu); =20 #ifndef CONFIG_USER_ONLY if (qdev_get_vmsd(DEVICE(cpu)) =3D=3D NULL) { --=20 2.17.1