From patchwork Thu Jan 9 02:49:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 182754 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp3119964ile; Sun, 12 Jan 2020 08:03:43 -0800 (PST) X-Google-Smtp-Source: APXvYqzuoQuSvR6Vz7HgQ2frQ69DArfzvn69y5pO+q3dO1HAxNMKnzCz6iwlRE0g93p1vG/obUSQ X-Received: by 2002:a17:906:19d8:: with SMTP id h24mr12467152ejd.166.1578845023450; Sun, 12 Jan 2020 08:03:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578845023; cv=none; d=google.com; s=arc-20160816; b=sRhtv010tXkZ0HcFYWGIbFn0DATd+5GYNHAF37r/8i7rWpUE85k/faItdIkdno4H7y JZaED28N7o4bCqILVY60wzWC+tP6IB7xakvRDQFTUqucoVh500hCpjIblNiDybBSXOZ4 8j4YMa75UGeq7GhkdkF16+5T+ELJ7v1ZVaqKLDE9pqTzw8oB+Yg7myYXzgOvVBh7Bfpl 5WBMwxog8Fe0w6WuAopFcGOr/s9J7kUWCiKfB0PsEmWIA6VjBMmypycc4AL9k7r/PgO2 mOF4LGXJHEXnDOyDr5JkJpds3CAYjpYLl1e+9taXVJnlyFSI8gbDUOgb5GSMv2L2sBgQ fgEw== 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=taUAUKC6BKYXJEWWKuFwpPcKa1boShSWsRP/UsHn9jc=; b=ddAe4dVXrX4Wjfr1EdYWU2UticJT5hnrU3ZdCPxec4PMI3ZxLxDJ37tsYj7+QFMxxY 6t9bD4ohSmbsdNB4+8LlK4JNXUZMeEkRdynI3Q5VWJ6rg8FWNIL8vpVHGH1cuHvX0IHg vTcQ9AkhhkTqYw+Ryw9pqYGPxLYZsMdVujfoUF11s3o79cg7VeMuByhKFLffRiTi4ItX Q3olSiTL//qiDdpwlitDyqjKtnakzbCSMIwUisS5KbKVx2phmag/mdUP4KqvOo3TIOXr WSih4SUUhhQP+G4R+N7La2ML6NgO+0dQ7Ui66/Gleha/xysYQYnrWmdRMVBrkxVEO8LO YmGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NoY5F58w; 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 k12si5091126ejx.78.2020.01.12.08.03.43 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 12 Jan 2020 08:03:43 -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=NoY5F58w; 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]:54108 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipO0A-0005nv-97 for patch@linaro.org; Wed, 08 Jan 2020 21:56:50 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52872) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ipNt2-0002xu-Rn for qemu-devel@nongnu.org; Wed, 08 Jan 2020 21:49:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ipNsz-0006Ho-SA for qemu-devel@nongnu.org; Wed, 08 Jan 2020 21:49:28 -0500 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]:38161) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ipNsz-0006GR-LI for qemu-devel@nongnu.org; Wed, 08 Jan 2020 21:49:25 -0500 Received: by mail-pl1-x644.google.com with SMTP id f20so1924747plj.5 for ; Wed, 08 Jan 2020 18:49:25 -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=taUAUKC6BKYXJEWWKuFwpPcKa1boShSWsRP/UsHn9jc=; b=NoY5F58wu95p5ldgu3bNBAWK5JMbnfBU3g+F+E1zD/Q+rq0MYLKV7uOWPmxGEOkwZU PMXYV59UHLZMwm/2yRf/HvYnKLHDqeqzSWlKvm2LlknbhSbvCvJQ4ZSBZPNy9/AIUeAC 8RgCfFdDRmL/fCvQgf8allmpWdNqYNcO44rOGKuIM1S3SabFgZc2HpGo7LZIwWe+ay+R EbkHvLLKCt10jLb326PsJI8FP1MVEo/xZT8rLZuW4dNBNLsbNrMlJwaxMTAbOYGQ7MxK 1Sn5N2xDxoye/2QetoZVRKA+8SNqX9eA+u3oVy3xCD/ja6ABDKpDFWuUrexEjpxQeblj M9WQ== 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=taUAUKC6BKYXJEWWKuFwpPcKa1boShSWsRP/UsHn9jc=; b=DpWToTPPo38bTjvbE2ufh6ScwinEGEz+bHKBkSvQkOP1cQfVDn+h0nlvvNw/vX3tTb /FQkn2QPWSx5fIvHTBVpsk5W2rr6csmkSVH84f1MuvRVpP6NorrNOHT/5Gnx1PlfWuse /i7md5u92COCdyBC/TYawxUWmqSHAJy7Gz04bPDGosvZPW/QyiLDGjXZsshK+9/7w9RV rRcNtV9z1Y4pPjAFHYraT/Rg2k2gIzqvMIhDx5ASbQ5Jx8xqhleemylkX1UCzkYWTvHA 2gffHAaV3tGtFTGfo3s0O9CeC1xfpgTLyDiRJeYH2IniFTbtefHD3vgVbRSZ4Bwmsg8C 2urA== X-Gm-Message-State: APjAAAUcMC5EFo5XQTY4fMKHQf3QgQ1HO7ptvuyqLgMUoNkPvKT6Kviw O/r3wx4M+Q8pfugH7Ti07ewhT6I3XoI2cQ== X-Received: by 2002:a17:90a:b904:: with SMTP id p4mr2496940pjr.62.1578538164395; Wed, 08 Jan 2020 18:49:24 -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.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jan 2020 18:49:23 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 5/9] cputlb: Hoist tlb portions in tlb_flush_one_mmuidx_locked Date: Thu, 9 Jan 2020 13:49:03 +1100 Message-Id: <20200109024907.2730-6-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::644 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" No functional change, but the smaller expressions make the code easier to read. Signed-off-by: Richard Henderson --- accel/tcg/cputlb.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) -- 2.20.1 diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index c7dc1dc85a..eff427f137 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -230,15 +230,16 @@ static void tlb_mmu_resize_locked(CPUTLBDesc *desc, CPUTLBDescFast *fast) static void tlb_flush_one_mmuidx_locked(CPUArchState *env, int mmu_idx) { - tlb_mmu_resize_locked(&env_tlb(env)->d[mmu_idx], &env_tlb(env)->f[mmu_idx]); - env_tlb(env)->d[mmu_idx].n_used_entries = 0; - env_tlb(env)->d[mmu_idx].large_page_addr = -1; - env_tlb(env)->d[mmu_idx].large_page_mask = -1; - env_tlb(env)->d[mmu_idx].vindex = 0; - memset(env_tlb(env)->f[mmu_idx].table, -1, - sizeof_tlb(&env_tlb(env)->f[mmu_idx])); - memset(env_tlb(env)->d[mmu_idx].vtable, -1, - sizeof(env_tlb(env)->d[0].vtable)); + CPUTLBDesc *desc = &env_tlb(env)->d[mmu_idx]; + CPUTLBDescFast *fast = &env_tlb(env)->f[mmu_idx]; + + tlb_mmu_resize_locked(desc, fast); + desc->n_used_entries = 0; + desc->large_page_addr = -1; + desc->large_page_mask = -1; + desc->vindex = 0; + memset(fast->table, -1, sizeof_tlb(fast)); + memset(desc->vtable, -1, sizeof(desc->vtable)); } static inline void tlb_n_used_entries_inc(CPUArchState *env, uintptr_t mmu_idx)