From patchwork Wed May 17 09:10:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 682916 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp251868wrt; Wed, 17 May 2023 02:14:48 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6gg1oYDHMQxYPSCafOL2gMYqT8YW9mVfxfUBHkcthv566L7nX5rJnsVxq8r1SJZnmEg+ui X-Received: by 2002:a05:6214:19ef:b0:61b:79ab:7129 with SMTP id q15-20020a05621419ef00b0061b79ab7129mr64783469qvc.37.1684314888437; Wed, 17 May 2023 02:14:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684314888; cv=none; d=google.com; s=arc-20160816; b=pB3GiySV1z9+Jjh9eEgT5X11vctp4Sylz8xLH0cdvRmHqw0DXIFWJyELzOrvkWCH7f LrF2fJZcjBmBxQyM8toEsa5iB5iidsDve03FqKRabwTEcDUTsX/yCzz66RwGRHbtG1TI 77wanwkMbhycaqcMul/iRfhtsR/KVLfluO3Fuwd7x/Dq3JXI6RDOViS+ZZP5PuWssK/c vTw/HKYA1Oj7S47zsKg3yc1hzYKj3E1tCUYqlroUAiwAYlcGs6ksxg6wVrmGEEIW8MGZ ealSYp6F91bjj0cAvqSv/LadrSqAIQuc16ndVAu8Tvpx9zkNO/mv1W7YZ2nUBv8/5z5g 5wnQ== 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=NQcBdafCZ9NnuhEM8aC+mQ3m+uc6gwaM3wX5Lc2Nbeg=; b=Pc5WHzMgozLr+nSLcVRxIyu5RfOJqnzoLm1vv1Ub+XwzKcGmBUDMQ1wZSWmzVCIR/C QyBs691QT1r1oOamveapD+wKAcOS1J79YTw1nNi0yrO/WhbHF5YZsfpgcCpBrLPC9/ER kMCV6C3gM2WpvjzCRcOWh/xbuCROzLgXIR55AjlqsG28hRl8YBY74RdL94bfU6Oqp3lD aSUJMZBYXRJn2K+/A8Eshgp9xGP5bWKOx+t34RRHLjIsgyTjmfIWMbMn83rhikrpc9XW 0hmeYT9eptZ7xn7m+bsMmi1nSR825l4lfFqOUc78MDsmHZQlK3VaGwCdnQVpuqEkr1nV AU4A== 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 fv11-20020a056214240b00b006164ba29fbesi13076551qvb.473.2023.05.17.02.14.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 May 2023 02:14:48 -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 1pzDC3-0001RG-3x; Wed, 17 May 2023 05:11:36 -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 1pzDBj-0000wK-Tq; Wed, 17 May 2023 05:11:15 -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 1pzDBh-0006Pf-UR; Wed, 17 May 2023 05:11:15 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id BB9796839; Wed, 17 May 2023 12:10:45 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 361095F0A; Wed, 17 May 2023 12:10:45 +0300 (MSK) Received: (nullmailer pid 3626723 invoked by uid 1000); Wed, 17 May 2023 09:10:42 -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 v7.2.3 19/30] accel/tcg: Fix atomic_mmu_lookup for reads Date: Wed, 17 May 2023 12:10:31 +0300 Message-Id: <20230517091042.3626593-19-mjt@msgid.tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: 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 (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 6f1c00682b..1160aec626 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -1817,7 +1817,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);