From patchwork Tue Oct 16 17:48:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 148974 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp5429254lji; Tue, 16 Oct 2018 11:15:16 -0700 (PDT) X-Google-Smtp-Source: ACcGV63ip8X/5dW9aL7dmLm0GJ6t/EpUKr5bHloiARoIzXstP6BpDYUJHJBDT0H/LL+n/cM6f/Ll X-Received: by 2002:a0c:b257:: with SMTP id k23mr17442652qve.87.1539713716207; Tue, 16 Oct 2018 11:15:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539713716; cv=none; d=google.com; s=arc-20160816; b=0Fi68i5zYmdN1nfVPnyF3lrNIsL6YFuA4aih6DvGFLnF/ILPUh50GL5wYCldb25aRN CuTXcVORqUu6OOdFFHCO24426+afo5TQpUalYjgcCBfiW0VpuvpoDRtPcKSvGqBXvAZA uMy4q3YNFKeXBKeqfjw4rbhPYUoJXPqJ3Gmv2SU5Ca4A4/LGR3OjLqgOy6MJ2IlN5kt7 rFZqg19hl537HytT8RrdmYyDwKahvxToTC9Wgu/sIKJ6DgusdOxaleoxT8noQ+/SIEwH ZbS3VfGk+gPQ5rrG7hvHQdGcqRhsUTvGyNhCVPKcXLzT3ObTJ+GGZsOu8lcFDllEBjbj nbrg== 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=mNeH2UybqAeBdXYEpo8e4HunbPQRrwwxFmV/1vG0wc0=; b=h9pWrb6e3YKdgaMRRW+VHENpjBnMb8skzdQme+UIradMN/JKieoTqTfihwpkhnYGyb GVv5MZS0szrWt5efVLu9naqDd0mRgxCsA4IEZ4m4u0MB/icAplK7zUX7nSBO4JtEy7qD UgQi2DI2qJ3ToLU56ycxqGbm6oWXtAUfQ1JuCsXRJhvcTXAxFni2uLiajj9CzYoDnnP0 LqhuAgepIfhANl4gD7f2zc/t4cV2CReZTXQiAreN5TUY7KfJTFiuZ8pVN1w41V6OONQT nNdM7ugdKJ4zDlMBFZQptBzGmMhuI10PF6iLzAl/G15mTa08aLd/FTx5muTW+oR3f16K eDoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=L8hsWgHP; 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 q33-v6si6465512qtd.148.2018.10.16.11.15.16 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 16 Oct 2018 11:15:16 -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=L8hsWgHP; 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]:59524 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gCTsB-0002tJ-Ih for patch@linaro.org; Tue, 16 Oct 2018 14:15:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59696) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gCTTP-00046U-5w for qemu-devel@nongnu.org; Tue, 16 Oct 2018 13:49:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gCTTK-0000zh-Qr for qemu-devel@nongnu.org; Tue, 16 Oct 2018 13:49:38 -0400 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]:34983) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gCTTK-0000lq-Hr for qemu-devel@nongnu.org; Tue, 16 Oct 2018 13:49:34 -0400 Received: by mail-pg1-x544.google.com with SMTP id 32-v6so20135pgu.2 for ; Tue, 16 Oct 2018 10:49:27 -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=mNeH2UybqAeBdXYEpo8e4HunbPQRrwwxFmV/1vG0wc0=; b=L8hsWgHPoTn1N+ReG3sdFnB1EP5+woEo6VbD15HtbVc07WhCxoeMQ0R9uQKjZfWTxu ygVCGU6JgYu1OyzEf60WlXaLLv6hJ0B6Bo9VwTD/gWTNVTw3HFQgy7UkiRX0cfEUK6Ef KVY0X2ohP4cM9hZDlp57Pff6IWwoThRm499k8= 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=mNeH2UybqAeBdXYEpo8e4HunbPQRrwwxFmV/1vG0wc0=; b=n3oouBQ/p854TqL/Js7FISV7I8awLfbj44moiH/wsk6h3+VILR35usP/6vSmooWBfJ UFQKrh7PiYxUYu2kgZeU8Mef2PgSjI5/xXeaqVfnikj2gbDhW764lci6LYiA1r4B6T55 zr22OrrWq/1qfkd+FaYL3yBBG3VMtDO4ZxtW3hise87+Kfi38pNw6+jcEuOxRL5q9W4V RiMkCup/yIAyAbXUAa4XidWpftelZHCIxt/WNmAQayXtmC4ESoX50OL0hMzpqdWL8dwS q66n5ZYIaNGGFazW0evTf1khlplm97dFrHOyPh0vYYo17QWVc5ryZyae/cnEbVEgaRyN ubNg== X-Gm-Message-State: ABuFfogcdr5R7czF3l8N8fgS8msP/k+RvydGAz3AoZhwMi1rdpXzI+4f IZ+iWKAZZsYSv6XMt8Qzu0ZfMLtLeWs= X-Received: by 2002:a62:ce83:: with SMTP id y125-v6mr23119326pfg.201.1539712166064; Tue, 16 Oct 2018 10:49:26 -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 6-v6sm17441210pgl.6.2018.10.16.10.49.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Oct 2018 10:49:25 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 16 Oct 2018 10:48:58 -0700 Message-Id: <20181016174911.9052-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181016174911.9052-1-richard.henderson@linaro.org> References: <20181016174911.9052-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::544 Subject: [Qemu-devel] [PULL 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 d0821e69aa..4fd831ef06 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) {