From nobody Fri Nov 7 13:02:05 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 (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1539022698955849.074712078321; Mon, 8 Oct 2018 11:18:18 -0700 (PDT) Received: from localhost ([::1]:47716 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g9a6f-0008Jo-Mc for importer@patchew.org; Mon, 08 Oct 2018 14:18:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54992) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g9Zzm-0001kE-TP for qemu-devel@nongnu.org; Mon, 08 Oct 2018 14:11:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g9ZhB-0003UJ-Mr for qemu-devel@nongnu.org; Mon, 08 Oct 2018 13:52:00 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:40965) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g9ZhA-0003SJ-TY for qemu-devel@nongnu.org; Mon, 08 Oct 2018 13:51:53 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 8399D21FDF; Mon, 8 Oct 2018 13:51:51 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 08 Oct 2018 13:51:51 -0400 Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id 90BFD102ED; Mon, 8 Oct 2018 13:51:50 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=braap.org; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mesmtp; bh=w2xlButVNr8XvoKsWO1Rb5GETMtFag2s9Hsug8YA1dE=; b=qaLuh0I2oF0j hVw5tgi5rC+okdfpN3pvPhVEWly9xb4pQezEYOtjHOu1g27YinKhHsNSiun8Q0DP 9Z/sADe7Z8KVnvZ+zRFNzOQee3/pt1NAI9FIuWyNpAUfeA0ifk6fXc2iPRMWvI63 kOX2tKmG5DzKpCkBq72KTFYxNJ7mH88= 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-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=w2xlButVNr8XvoKsWO1Rb5GETMtFag2s9Hsug8YA1 dE=; b=SM2hJHFC6NbWNBDYkkgmYfos7N2UJIGDQS526VgdgUyvgyo9sU1po7qj4 iQ8Q9hhrnHMb5ti88alwLvea62lJgH64D4FlKOvZIQAt/6K4P6VMI30gHHMGRNtd /5bEFqditnFJ3QD1G1bCrJeHWhUuIe2a5EK4+wYlPxiM66H7i9weMwLcbWY4CcSt 5PBoVwoj0Oe2lIadu0J1xq2NqUtR8fJG4Nr0BPtKvx2pwdKyK1vy0KqpVi0ecoFB TMzh10A+9RgM2PB3PL0gMcsbt/WWlxYLJYaVDJokGl1Y/Tl4GJljIQtFy7kOYKVu 14J7JU16LoH9n3Tn2HTjJ2gJjQuzw== X-ME-Sender: X-ME-Proxy: From: "Emilio G. Cota" To: qemu-devel@nongnu.org Date: Mon, 8 Oct 2018 13:51:45 -0400 Message-Id: <20181008175148.15018-2-cota@braap.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181008175148.15018-1-cota@braap.org> References: <20181008175148.15018-1-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] X-Received-From: 66.111.4.27 Subject: [Qemu-devel] [PATCH v4 1/4] 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: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Paolo Bonzini , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Paves the way for the addition of a per-TLB lock. Reviewed-by: Alex Benn=C3=A9e 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 d0821e69aa..4fd831ef06 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