From patchwork Thu Jan 9 02:49:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 182770 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp3154650ile; Sun, 12 Jan 2020 08:43:21 -0800 (PST) X-Google-Smtp-Source: APXvYqxcWUDgXJpLNj7pDvNeVzydbZQ8hHaQoimSJxW3oUcVWKGu+/mGZPcDeyh4Je4FVdXy/ZGD X-Received: by 2002:a50:ec1a:: with SMTP id g26mr13012275edr.164.1578845063133; Sun, 12 Jan 2020 08:04:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578845063; cv=none; d=google.com; s=arc-20160816; b=GgT3E7ohTw3RGxgM2EBBEBM9uFpKpxAdPWgimuR+1INCFLujoeBkuhu6GijdsG9LL5 9RYetLKOF77xXKLd2BTgBI1H/n747z5cB8Kk1WN6VXv/rsOPZHl70IwNTKpjpqjFJkC/ IGOMXzX8UgP5AxTmUerL6ZMpyJhJM1TD9uDodL998v4hgsNnScSI8ZCyFQ16MnknY79w /0dtYjsWVLAOMnw8iHQnVep4Xym4Hd/s1Nq5oJcSxqAV7IHzPlMaVPm0PqzfeaVQy4C+ FSw58YNDENDmHw6cmMFuhCpQKsIP7lXb7PbHArNeXbceFkiyh+jk/Stl7vFuMdOt9YsA z77A== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=bI837W0qu61ZCvf0+RXhi7DDjyBjyOrHLVOGWGh4Vsw=; b=GBpV2EMr8L1y2lPOX4vP3bwbRmOPXyyLoPMVhyaQwPTkQV6EfMXamFTw7GcjoybL8h F53Eom1sXmfRT03hpKHQmvuc0pwcSe37aZPTdxwvwhAjIS/tb1vNgtdAyfZk+8rlnNd7 CYGSPiqSWAzC/im+OLPVlypdLKN8JEhisqxzZhgWyAQH+Sg+7RUq5oejC8FgUBuNmvIW OJ1E90+hu8gqoOUziI3LgyKECskw+LGeHjodbomEPSPPFHqTIZkmgSpDJO7fYFfbA3b8 HAwoSOLyA7niAPjRND3mh6IYgmDAZIRi1FZ8tdzpzDJIjA/xTqJyluhw3RLmbn0JRiS6 Cy/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iIG46fRp; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id a3si5456399ejj.293.2020.01.12.08.04.22 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2020 08:04:23 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iIG46fRp; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:54170 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipO1l-0007FZ-Gv for patch@linaro.org; Wed, 08 Jan 2020 21:58:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53708) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipNt9-00037M-0G for qemu-devel@nongnu.org; Wed, 08 Jan 2020 21:49:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ipNt6-0006UC-W8 for qemu-devel@nongnu.org; Wed, 08 Jan 2020 21:49:34 -0500 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]:38160) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ipNt6-0006SQ-Nr for qemu-devel@nongnu.org; Wed, 08 Jan 2020 21:49:32 -0500 Received: by mail-pl1-x642.google.com with SMTP id f20so1924843plj.5 for ; Wed, 08 Jan 2020 18:49:32 -0800 (PST) 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=bI837W0qu61ZCvf0+RXhi7DDjyBjyOrHLVOGWGh4Vsw=; b=iIG46fRp5ogMZwkYU6WuosNs1OINhSRHQhTCR9vDcxL+xBJXTkPoX+uyWMziexP0l4 9EkpqqqU69DPscWfYLa2EeeuVQMjftx6IVjmfiIIaW9aVfEooLfYU5li63N6zF1AsWIL 76liK7RFPBG2oRM1/Iu5i92JYpPTC8SrBziSQVt6mbAdpn8XQioo0goqdB2EDwfI26F/ GXeTsT9LmMT9Yi9b+gef/ohV19Yvl9qTKrhftH4d+UknHYFz63j+fTfQ44W8GE9a4Lfn 9znMOZZvpMb6vL42PonCvvdwu2W1X72yZvn6qMHZW0GZIs3GikgofENjztnlZTEdsjEy t6bQ== 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=bI837W0qu61ZCvf0+RXhi7DDjyBjyOrHLVOGWGh4Vsw=; b=MVlUNEB1kuprsPBb+uFhEf5uOLCe7Vs3dgXtDIkpB7OG2XCCjaDGEM7Ll0QSfER1y0 Nq/7AdQ/xrdrrXEAxLX0xiBoLcXItGe0jEFWK5YDubrds1CA98txJZQ3lw8j+IA+57o9 ivPZRk7b2PeIZs8ChamzoSKWj8chGsSiJ38or3nPfZ3LDB0i+V/ljDaUhYAE4dVzT7Sm AeUXUf3MieX5W0WZqDjyI4lLuCWK2IG48kFSOqMTEP4DUx5Vd2+ugDMK13cV5Xrlgb08 jy1c85/2RTQD+H4oKjg5WUSNmw9ZYZl1mzlNArQzRYr7v0sRp7h75sxAUbS1yLyJlK8J MLyg== X-Gm-Message-State: APjAAAXRAW7gcs3RIMaXrfXFlGYc35cA7AtWnOzklanF4qE4LTBm/toV B/6PMMTD466xku9erTUDe7ORESpgqSTqtA== X-Received: by 2002:a17:902:7792:: with SMTP id o18mr8409379pll.31.1578538171454; Wed, 08 Jan 2020 18:49:31 -0800 (PST) Received: from localhost.localdomain (alanje.lnk.telstra.net. [120.151.179.201]) by smtp.gmail.com with ESMTPSA id b4sm5337844pfd.18.2020.01.08.18.49.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jan 2020 18:49:30 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 8/9] cputlb: Initialize tlbs as flushed Date: Thu, 9 Jan 2020 13:49:06 +1100 Message-Id: <20200109024907.2730-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200109024907.2730-1-richard.henderson@linaro.org> References: <20200109024907.2730-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::642 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alistair.francis@wdc.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" There's little point in leaving these data structures half initialized, and relying on a flush to be done during reset. Signed-off-by: Richard Henderson --- accel/tcg/cputlb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.20.1 diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index c7c34b185b..761e9d44d7 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -240,6 +240,7 @@ static void tlb_mmu_init(CPUTLBDesc *desc, CPUTLBDescFast *fast, int64_t now) fast->mask = (n_entries - 1) << CPU_TLB_ENTRY_BITS; fast->table = g_new(CPUTLBEntry, n_entries); desc->iotlb = g_new(CPUIOTLBEntry, n_entries); + tlb_mmu_flush_locked(desc, fast); } static inline void tlb_n_used_entries_inc(CPUArchState *env, uintptr_t mmu_idx) @@ -260,8 +261,8 @@ void tlb_init(CPUState *cpu) qemu_spin_init(&env_tlb(env)->c.lock); - /* Ensure that cpu_reset performs a full flush. */ - env_tlb(env)->c.dirty = ALL_MMUIDX_BITS; + /* All tlbs are initialized flushed. */ + env_tlb(env)->c.dirty = 0; for (i = 0; i < NB_MMU_MODES; i++) { tlb_mmu_init(&env_tlb(env)->d[i], &env_tlb(env)->f[i], now);