From patchwork Tue Nov 19 06:04:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 844266 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:8b:b0:382:43a8:7b94 with SMTP id m11csp1005323wrx; Mon, 18 Nov 2024 22:08:00 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXCJcjefaI5VnEw2UnemS2d9Xd4YQi6SnAJIhCUwFdSwL7zfbIJNpoYhTv39ZOOe1Ha6v2Z5Q==@linaro.org X-Google-Smtp-Source: AGHT+IEMPI7+69MHWYfpSJlH/eXrwUICubk7rVokXHRqL92A6OrQdZbti5YcmqixgsTFLkMdCsc6 X-Received: by 2002:a05:6214:cc8:b0:6d4:edc:12fc with SMTP id 6a1803df08f44-6d40edc162cmr176292496d6.46.1731996480673; Mon, 18 Nov 2024 22:08:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731996480; cv=none; d=google.com; s=arc-20240605; b=GZFVsMvjj75bMpR1iYdGOw39wJ1xcIm32TB5zTOssWYe/t1QMvRVJn9U7wdN8ulrZV sHXmenE8feGrZdXEjiQKj9KkyBC3YYyQZlyvIzJ6JkXhUsVQZFq3CFXiIXVHouFWZFF0 gosMsCOPGC7Ym/JrKtlsvmtYUDMvzscdSsG6oaJ3XhqV6dNl0sE8a8lKjuy8/XyGaXFH ycysed3GQczysTJAvz98uuqB4RxtR1OHLxkb3CSm9EYmVRwMjNWX2OpyiQlixzDWz+KM NTuKH1hxyxRZkLxicTfkcIBz9DSyYnI+2Y4Rw8vKD+WxtG++tEeovdu3HZjk7+X0EuA/ DDhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=wMjABy+hk5DF/13bOYxyKWUoJVSk12Uk0Kv7PsGKnR8=; fh=fA8wXgZkOijV3QzeJqIqYxlGqKQb9nNVVJRQwjQ6hao=; b=geQWD6l9+C1OhiwstGjXoUS/UBDoertzQDpC2A0Vrwe6013Oh82ECrA+whtywaf1xm 0byyts4h+qLkv9TwGza4PaZ6jdc4gKyXSb2fl4IUq/lCzbbYuqOxE09bwMupA0P+9f1F YanKcdTeMuH402sOJBaAqsAcVZybsOiKARL9Y3yic2RJTz3VvMfnmjgKYnwmOvR/zfUy r6fqcsD+9BxZe4tf0zIarHS90cs331UZvBUpwt1e3XqACD2YGvyCCRmSzmWUJCEGOgmJ 40QDTBlym9PfUwWi3oAm9r9nPbxxydraau7TdzMF+tQHKWEM8a0lKpHhJ32MbprjsQOm Ef2w==; dara=google.com 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 6a1803df08f44-6d40dc93733si84092776d6.345.2024.11.18.22.08.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 18 Nov 2024 22:08:00 -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; 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 1tDHLx-000162-DS; Tue, 19 Nov 2024 01:04:45 -0500 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 1tDHLt-00012Z-DD; Tue, 19 Nov 2024 01:04:41 -0500 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 1tDHLr-0004eJ-5m; Tue, 19 Nov 2024 01:04:41 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id D04A4A6264; Tue, 19 Nov 2024 09:04:14 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 042E91738DA; Tue, 19 Nov 2024 09:04:19 +0300 (MSK) Received: (nullmailer pid 2368938 invoked by uid 1000); Tue, 19 Nov 2024 06:04:18 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9e?= , Michael Tokarev Subject: [Stable-9.1.2 62/72] accel/tcg: Fix user-only probe_access_internal plugin check Date: Tue, 19 Nov 2024 09:04:03 +0300 Message-Id: <20241119060418.2368866-5-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.5 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, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, 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: 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 The acc_flag check for write should have been against PAGE_WRITE_ORG, not PAGE_WRITE. But it is better to combine two acc_flag checks to a single check against access_type. This matches the system code in cputlb.c. Cc: qemu-stable@nongnu.org Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2647 Signed-off-by: Richard Henderson Message-Id: 20241111145002.144995-1-richard.henderson@linaro.org Reviewed-by: Alex Bennée (cherry picked from commit 2a339fee450638b512c5122281cb5ab49331cfb8) Signed-off-by: Michael Tokarev diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index 7ddc47b0ba..4c269daf7d 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -805,7 +805,7 @@ static int probe_access_internal(CPUArchState *env, vaddr addr, if (guest_addr_valid_untagged(addr)) { int page_flags = page_get_flags(addr); if (page_flags & acc_flag) { - if ((acc_flag == PAGE_READ || acc_flag == PAGE_WRITE) + if (access_type != MMU_INST_FETCH && cpu_plugin_mem_cbs_enabled(env_cpu(env))) { return TLB_MMIO; }