From patchwork Fri Oct 19 06:06:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 149222 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp2905920lji; Thu, 18 Oct 2018 23:10:40 -0700 (PDT) X-Google-Smtp-Source: ACcGV60iDhnwBzZ4DNueGLOmxzB3Ua5+uTTkdJ48K4Exy/D8vFMjnqsg9TLaDVFAcwyUsnbMuzN1 X-Received: by 2002:ac8:f29:: with SMTP id e38-v6mr2536195qtk.262.1539929440124; Thu, 18 Oct 2018 23:10:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539929440; cv=none; d=google.com; s=arc-20160816; b=mVBJcsE3PRvt2Nf9t4MX5AcR+iGZHtOVlKEapGK1jU2OBDKzab4Q1sDY2G+6nMsrQn eqV98c5RQ7OSA9P2LzPfXwUiw41TmzqW1o04stjmd3fVC9qHF53/nLUmbgG46M8jOQA6 KR8c8Rci6tRu7N4E4WrIRl8sQk6qK4MEZdHkO6tDVtkbAQ41wGJUX6qTu6UvStu7TvUe R+CCpiypGThshu3HKgp0rhysnN0HLzx+HVFJsXKsXphB8kRTqAOHA7OCRoD4gh39lM9P NyS2jib4iU6fHXlHvxnOCDgyHLdfjAhe/H4uMfUfp9WlaqK2xuA80pTg0O3s1D9yRTet WPRQ== 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; bh=LKN2z9Wa6kilfugmhk5H2yz/XJ83s7o6//DumOkcw8c=; b=DYBRrXPDBnVyiLjcnFfJF+ct5xhUNy4DDlMRMpHsP5Wf9tPZkthDVZ1zGCkP0eSyCM 8jwI/YbCpI73M0Dme3Cbb+FQutnqPQIHr7YXkGLqf7RHwEAu84MMUOP9MemRo8NS1QWF jTbDoOB29gMUe8lEGg2he7kCXl+lEFKezxhsCuWbNhY6RSbAf0A0LCYgcwVt/m+uGF60 xKvZ9BCtmsnhpvDymrT6ZZJmoUWwrnc3GALzBEDfMj+PYHaZuIH0Kzw2h9gbVQtqelDZ Phh/Ts6b4XoYG2Nd4PqVFJjALIffyHSkx0QrxPxu0fbvIscgtUHqrfzR7YM1GQTcmOKI muiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="VIkVC5O/"; 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 q8-v6si472892qtp.2.2018.10.18.23.10.39 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 18 Oct 2018 23:10:40 -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="VIkVC5O/"; 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]:47233 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDNzb-0007Hc-E8 for patch@linaro.org; Fri, 19 Oct 2018 02:10:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39068) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDNwa-0004FL-6i for qemu-devel@nongnu.org; Fri, 19 Oct 2018 02:07:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gDNwT-0002L4-2G for qemu-devel@nongnu.org; Fri, 19 Oct 2018 02:07:29 -0400 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]:42564) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gDNwK-00024u-98 for qemu-devel@nongnu.org; Fri, 19 Oct 2018 02:07:20 -0400 Received: by mail-pl1-x641.google.com with SMTP id c8-v6so15376081plo.9 for ; Thu, 18 Oct 2018 23:07:11 -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=LKN2z9Wa6kilfugmhk5H2yz/XJ83s7o6//DumOkcw8c=; b=VIkVC5O/lHKdzuaT8U1Mwcn+qfMDWiu7qQmOu0BNuc67vL6HhjvWa5jhvtoVZj7NiZ 1ZDMlF21ss4NwEtxmc70cM3ScCrn0aaeafwM3IU1EdzvrzXaefdjh6Cw5J8+ku9P9Dr5 uBbehl1QxFpnZXGv3OYHd6qII+wJUlHCM+8V4= 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=LKN2z9Wa6kilfugmhk5H2yz/XJ83s7o6//DumOkcw8c=; b=lR5Cw8OVlAJkhoQFhar7gVhl7ydKyMmn4u1htOwNN+MqN9/3IcwXIf+4aEoYZeVUhH ePjoxoSBTj5XTzSsxJ77lF1P3PTseUXNi6fY1jlUWmzH8qM4LypC9Z+irysPuBp/oY/r jlEUgE5LJZc/jcKcgCtD7nLYWpfgOrXFlUrExcy+LOE4JwCmY3QbeeulZdCSSjZ80RpS SBBIT+Wl4k/upVN4p05r6uP77u0282oWVIMCPCQuSBJHkAhxwB9j2cvJ7Lh/vWuSMF/h TyDw8Zwz2xj5eL4qs7Nb48yQXB9fgsG03OF+6eWpT9WN2PnxeboNxFw9/DceYeIZLojE TC+w== X-Gm-Message-State: ABuFfoi5Bb0dn2oVLbq4ry2rflnc0+lRREo/H+Ilry8+HoBtbj89quYl rzw4K570/0VLR7EiXT3NOraFXxzffLw= X-Received: by 2002:a17:902:6689:: with SMTP id e9-v6mr8841189plk.128.1539929229788; Thu, 18 Oct 2018 23:07:09 -0700 (PDT) Received: from cloudburst.twiddle.net (174-21-9-133.tukw.qwest.net. [174.21.9.133]) by smtp.gmail.com with ESMTPSA id q24-v6sm25609327pff.83.2018.10.18.23.07.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 18 Oct 2018 23:07:08 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 18 Oct 2018 23:06:43 -0700 Message-Id: <20181019060656.7968-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181019060656.7968-1-richard.henderson@linaro.org> References: <20181019060656.7968-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:4864:20::641 Subject: [Qemu-devel] [PULL v2 08/21] 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: peter.maydell@linaro.org, "Emilio G. Cota" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Paves the way for the addition of a per-TLB lock. Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson Signed-off-by: Emilio G. Cota Message-Id: <20181009174557.16125-4-cota@braap.org> Signed-off-by: Richard Henderson --- include/exec/exec-all.h | 8 ++++++++ accel/tcg/cputlb.c | 4 ++++ exec.c | 1 + 3 files changed, 13 insertions(+) -- 2.17.2 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, #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_idx, 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_cpu_data)); QEMU_BUILD_BUG_ON(NB_MMU_MODES > 16); #define ALL_MMUIDX_BITS ((1 << NB_MMU_MODES) - 1) +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 5d99ef5c93..bb6170dbff 100644 --- a/exec.c +++ b/exec.c @@ -965,6 +965,7 @@ void cpu_exec_realizefn(CPUState *cpu, Error **errp) tcg_target_initialized = true; cc->tcg_initialize(); } + tlb_init(cpu); #ifndef CONFIG_USER_ONLY if (qdev_get_vmsd(DEVICE(cpu)) == NULL) {