From nobody Wed May 7 06:21:34 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1664913456; cv=none; d=zohomail.com; s=zohoarc; b=YJV0j0ZAAWx3wHVZAD4CMQeEOZfMPAdFF8/whjEm0FOOWnCC8SE76mNyFFvS01jsw3/vavPu+nVHDIM5nuxIzIkd0aR+RGrWE+5d748FXGryUjYPLOlZNyroVk0Tr9Qu2drf3ehxwa1Jitc4LG11EUWpRVi4qvQvA2CpBkupX2o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664913456; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=St5dCg8yC5zIkIV0jUFWp9UWjpefIW881mvaUfGPCfo=; b=YiJOa05rakb0O8F+3E0QEe6ap9KFcntpYlElRdrEziOhJ1rapF0pMQXOqJs8fdVtdfV67bLHkGBRdG/UF+vgxYtiD/9BPSMB6RoCCy2ztJVoYshO/4Fkl0KQ5N5SF36rUvUtYbt514w9LINba6qQCqmTWmayGdRRdXIFfPFVREo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from=<richard.henderson@linaro.org> (p=none dis=none) Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1664913456916103.92080613660971; Tue, 4 Oct 2022 12:57:36 -0700 (PDT) Received: from localhost ([::1]:59860 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces+importer=patchew.org@nongnu.org>) id 1ofo2o-0004mx-GF for importer@patchew.org; Tue, 04 Oct 2022 15:57:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41268) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <richard.henderson@linaro.org>) id 1ofnyG-0001iS-2G for qemu-devel@nongnu.org; Tue, 04 Oct 2022 15:52:52 -0400 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]:46614) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <richard.henderson@linaro.org>) id 1ofnyE-0000GD-FH for qemu-devel@nongnu.org; Tue, 04 Oct 2022 15:52:51 -0400 Received: by mail-pl1-x62a.google.com with SMTP id l1so729895pld.13 for <qemu-devel@nongnu.org>; Tue, 04 Oct 2022 12:52:49 -0700 (PDT) Received: from stoup.. ([2602:47:d49d:ec01:526e:3326:a84e:e5e3]) by smtp.gmail.com with ESMTPSA id u23-20020a1709026e1700b00172973d3cd9sm9293406plk.55.2022.10.04.12.52.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Oct 2022 12:52:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=St5dCg8yC5zIkIV0jUFWp9UWjpefIW881mvaUfGPCfo=; b=KBNKLDkoV6FyvbfjKKLGdRo3UUeOFuWALGQt/O7p7ylLoI4IMaE8rYSNu0a04WqIwM Ha0WUHTgWqLyAXXgp4YlNtmrgG15mfS0J1UJLmmQP7Dzk0Vd2mhtPm3S7xqHmKRmkgqe pkZP1Ft/sqEuagv8q3FSPGN8sA6Lnv7+mWT3eOhAOcx7kp1JBbE7qf5G33CuHWkJuKn1 FelsDWIDzVvzI5wWJDnnbyyVucl5HsZbHW2ymh2TXDk80SV+P4MU53txb7GQ9wg1dqyo J5MD/OP3/8rt+mBY6mt3lUN4sQ1NP2839ow6PRHJZ1RoR0tl8YrNuAWVxp3iPUq3q+XQ 2Q+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=St5dCg8yC5zIkIV0jUFWp9UWjpefIW881mvaUfGPCfo=; b=zDUAD41fT1JYSF2ttyFnXm9B+bsB2j20ye/gLilzfXqnhe730jI4Sl+KDNRBIgwLrT UTjHdgSfpL6xm778osz3caWpwbZ5LincSpAYjukrRUGA8fglDz60HkbWAV+V26aHD09q BHkKgdlUovfqrhUTzNLfpLwj720jWw4NsmU/8UnjVKcuwxdPviVC+RedD8vMlPqBz0uk b9I7/NuEvETgCFyQfuiQaooJcJDMun7OS3Ml4yPe99WsMPGRsW1pPufX2/WG0dLPtKTN ziT5X+8UHHbZYHKI5uBdtM0Qak4DGs5adIhRU197hE4fdl4CbUM4ULsb3twZtLzH3/yb vUwQ== X-Gm-Message-State: ACrzQf3Hi+7aLNTZ4p9b19B61/nUX7Zeds6QuUzvjuZNJh+AF1aV2heX L+gaqPbZk07+rs08dYfw9q5r5qRUvOU3ew== X-Google-Smtp-Source: AMsMyM41pGfkiduqIsgrAIuwo+6KqyJb0Nx9qXEKYAS4zrMXjiqdP3DrZcVYBMul242tcAIb6kNRBg== X-Received: by 2002:a17:90a:1c02:b0:1e0:df7:31f2 with SMTP id s2-20020a17090a1c0200b001e00df731f2mr1264580pjs.222.1664913168688; Tue, 04 Oct 2022 12:52:48 -0700 (PDT) From: Richard Henderson <richard.henderson@linaro.org> To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?UTF-8?q?Alex=20Benn=C3=A9e?= <alex.bennee@linaro.org>, David Hildenbrand <david@redhat.com>, Peter Maydell <peter.maydell@linaro.org> Subject: [PULL 06/20] accel/tcg: Suppress auto-invalidate in probe_access_internal Date: Tue, 4 Oct 2022 12:52:27 -0700 Message-Id: <20221004195241.46491-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221004195241.46491-1-richard.henderson@linaro.org> References: <20221004195241.46491-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62a; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+importer=patchew.org@nongnu.org> X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1664913458857100003 When PAGE_WRITE_INV is set when calling tlb_set_page, we immediately set TLB_INVALID_MASK in order to force tlb_fill to be called on the next lookup. Here in probe_access_internal, we have just called tlb_fill and eliminated true misses, thus the lookup must be valid. This allows us to remove a warning comment from s390x. There doesn't seem to be a reason to change the code though. Reviewed-by: Alex Benn=C3=A9e <alex.bennee@linaro.org> Reviewed-by: David Hildenbrand <david@redhat.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> --- accel/tcg/cputlb.c | 10 +++++++++- target/s390x/tcg/mem_helper.c | 4 ---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index d06ff44ce9..264f84a248 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -1533,6 +1533,7 @@ static int probe_access_internal(CPUArchState *env, t= arget_ulong addr, } tlb_addr =3D tlb_read_ofs(entry, elt_ofs); =20 + flags =3D TLB_FLAGS_MASK; page_addr =3D addr & TARGET_PAGE_MASK; if (!tlb_hit_page(tlb_addr, page_addr)) { if (!victim_tlb_hit(env, mmu_idx, index, elt_ofs, page_addr)) { @@ -1547,10 +1548,17 @@ static int probe_access_internal(CPUArchState *env,= target_ulong addr, =20 /* TLB resize via tlb_fill may have moved the entry. */ entry =3D tlb_entry(env, mmu_idx, addr); + + /* + * With PAGE_WRITE_INV, we set TLB_INVALID_MASK immediately, + * to force the next access through tlb_fill. We've just + * called tlb_fill, so we know that this entry *is* valid. + */ + flags &=3D ~TLB_INVALID_MASK; } tlb_addr =3D tlb_read_ofs(entry, elt_ofs); } - flags =3D tlb_addr & TLB_FLAGS_MASK; + flags &=3D tlb_addr; =20 /* Fold all "mmio-like" bits into TLB_MMIO. This is not RAM. */ if (unlikely(flags & ~(TLB_WATCHPOINT | TLB_NOTDIRTY))) { diff --git a/target/s390x/tcg/mem_helper.c b/target/s390x/tcg/mem_helper.c index fc52aa128b..3758b9e688 100644 --- a/target/s390x/tcg/mem_helper.c +++ b/target/s390x/tcg/mem_helper.c @@ -148,10 +148,6 @@ static int s390_probe_access(CPUArchState *env, target= _ulong addr, int size, #else int flags; =20 - /* - * For !CONFIG_USER_ONLY, we cannot rely on TLB_INVALID_MASK or haddr= =3D=3DNULL - * to detect if there was an exception during tlb_fill(). - */ env->tlb_fill_exc =3D 0; flags =3D probe_access_flags(env, addr, access_type, mmu_idx, nonfault= , phost, ra); --=20 2.34.1