From patchwork Wed May 17 08:00:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 682899 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp229652wrt; Wed, 17 May 2023 01:07:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5mJ4y6DRoHVWY20qJQr51arCh9rtakJbOqu7pSmOcrVD+dOoPogJDLTig/wSBYyoIlT6NC X-Received: by 2002:a05:622a:1455:b0:3f3:9013:5839 with SMTP id v21-20020a05622a145500b003f390135839mr2239786qtx.23.1684310824375; Wed, 17 May 2023 01:07:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684310824; cv=none; d=google.com; s=arc-20160816; b=IN2NhuMVyAPp+Yl8Xf1SoyVlak/46mhwtw7daDBFormg34/9vQltyYH7se+sECu4fw w2uQdKSUHSNj8YvPA+dGfAxq0GBVtTkI8d88r0CQWJm9NvJQeoqoN3xaRjxnEUJU7ugO 3r1AsAUVmbx9kgbrRL1KLiuh6tMH8Tyu3mkF2wivab1wHkyWfX4TAAf6wBPccvAUSPwb ntVGjI7ipL7QZb+Z39vPvVr1jPgQjvazrTraRW9+ufltpGKiRMJcA3UjH4SOnXLRsel6 pmUhlYbf/nXA3W0bpyX3fC7kbHFCwl1eoyT1q4wVh1SQuNDJWy9qz+XHzdzfZK36Si1V ilFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from; bh=vPqRupbs22Sh3V43PtNGIjpixBlVvIdwr/MZVmu8Qn0=; b=b1ncHY+BW6T+O5p8E0ZM5NLYsPw+IBRLIiTvwi88Ju3kxRbklhheBPfTkZTYNiTV38 hKapC1E2cb4PYWuij28VcQHE2eRlddHBYwdGYhgvIEDT7ORkjJ25JdbKe4EjHwDD33pr NdfVpZxsbj+4Ii465yQi0MUcbgWRlUpxLRg1TNu+GqFku4nwm8dh30k8idIl4qKr13pw N+Kj+n8dn5lroRdLl3/iG+oZK/K2Y+YJFwBrdOChgXijwM555vcjmTJxpWqcP5+nS1i/ c2DowNA8B0nisFxDfNj0FZTaeVVbvmuMfF6np9wKbvTcXHmwJu5jole7umZ8CRkiO4iq u5Bw== ARC-Authentication-Results: i=1; mx.google.com; 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" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d21-20020a05622a15d500b003e398af5dcdsi12021130qty.599.2023.05.17.01.07.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 May 2023 01:07:04 -0700 (PDT) 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; 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" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzC6k-0002my-UX; Wed, 17 May 2023 04:02:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzC6d-0002cw-Oi; Wed, 17 May 2023 04:01:55 -0400 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzC6b-0000ko-QF; Wed, 17 May 2023 04:01:55 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id BE56C6765; Wed, 17 May 2023 11:01:00 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 4D94C5E1D; Wed, 17 May 2023 11:01:00 +0300 (MSK) Received: (nullmailer pid 3624163 invoked by uid 1000); Wed, 17 May 2023 08:00:56 -0000 From: Michael Tokarev To: qemu-stable@nongnu.org Cc: qemu-devel@nongnu.org, Richard Henderson , Peter Maydell , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH v8.0.1 28/36] accel/tcg: Fix atomic_mmu_lookup for reads Date: Wed, 17 May 2023 11:00:48 +0300 Message-Id: <20230517080056.3623993-28-mjt@msgid.tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: <<20230517073442.3622973-0-mjt@msgid.tls.msk.ru> References: <20230517073442.3622973-0-mjt@msgid.tls.msk.ru> MIME-Version: 1.0 Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson A copy-paste bug had us looking at the victim cache for writes. Cc: qemu-stable@nongnu.org Reported-by: Peter Maydell Signed-off-by: Richard Henderson Fixes: 08dff435e2 ("tcg: Probe the proper permissions for atomic ops") Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell Message-Id: <20230505204049.352469-1-richard.henderson@linaro.org> (cherry picked from commit 8c313254e61ed47a1bf4a2db714b25cdd94fbcce) Signed-off-by: Michael Tokarev --- accel/tcg/cputlb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index e984a98dc4..145fba45b2 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -1830,7 +1830,7 @@ static void *atomic_mmu_lookup(CPUArchState *env, target_ulong addr, } else /* if (prot & PAGE_READ) */ { tlb_addr = tlbe->addr_read; if (!tlb_hit(tlb_addr, addr)) { - if (!VICTIM_TLB_HIT(addr_write, addr)) { + if (!VICTIM_TLB_HIT(addr_read, addr)) { tlb_fill(env_cpu(env), addr, size, MMU_DATA_LOAD, mmu_idx, retaddr); index = tlb_index(env, mmu_idx, addr);