From patchwork Mon Nov 11 14:50:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 842467 Delivered-To: patch@linaro.org Received: by 2002:a5d:6307:0:b0:381:e71e:8f7b with SMTP id i7csp3069177wru; Mon, 11 Nov 2024 06:51:00 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWyyL34VlVcHTls1fdAk7XzxtqbyXxHTDa6Y+pZ6o/2uwO9mmVcbDx+E0k8xtJks+1ecvElfg==@linaro.org X-Google-Smtp-Source: AGHT+IHuoCR0g0UWXv1fESCL2wdZXXmOBCCmBEywl6PNc5VbtxPJAf2C0AD1zloxy7vfL7wWbc2U X-Received: by 2002:a05:6830:6389:b0:710:fae8:fcc1 with SMTP id 46e09a7af769-71a1c22ded5mr9367834a34.12.1731336659878; Mon, 11 Nov 2024 06:50:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731336659; cv=none; d=google.com; s=arc-20240605; b=T2P0Y2uGWa+LbyDV99bqoMLZPAghcTr1hZ6Kce66/QLUjSBF0IyC5YhPXQnFI3gvRv FD0F8z5I5dMIer6XUuRBf5Mu6/S59i3fjWB70lZDwIA8AVFsXHQyKSchGOK9Z+RmXO4R 80GGXfxu0UB6J6cuDgjTiFXrZUUsaWV5le7Jc0F1qV+RvaX2+rRJKHQ2qd0ammSAhudL oclkpCEH3QXtvpPyyaEVC4eyqgsZn3wPntSN63nsYKZSuuNoWyudJkZ7xpdIzQb9gkkI e1q+5wWhhnYqO6o2JFU52Y4liik+4VGYlND7JStC+tn8RoLdS0MWS938k3sFNdr6buJJ Auvg== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=2M/3qA8mMKz7DvBymSN5QuTvN/Xyu5smd+SKwoEDOq0=; fh=HGMLmPLDRBgS2M2DmRioi6Q+pUL3jqoEM8UtJkY6Dtg=; b=DxIKXeApRxsCTc+lGo3xRYLZuzJ0rNpROHEhxsOr2RiyGTZCvcY/R3pWfbotfafUBU UBZPkKAFm65eDMXqrgVmOb8i9Dq6SFb1oxbTZ1bc0+l5GgmqrnZ3zSJsalzbAlJA6lve vNFD8BOE9nu2ZWr90G58z/YV3gHPAELiDAkBJ3tJMrkEfETA6TEx6RGjPxCddumAt3zx /1UfqWCeSuezP+cESRgZbcIGRRPe7uUcIUfQ+LXIRzJ6mXSnw0i1XHDlPBlplAWjH4oW 8OYnuIFAJ4J7GIAZd4Pt4AlfWENs9/jRyvzmjxZQ1sxIDJvcnfSrHh266+uHRtsTQcam SPzg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OouI765a; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b32acee837si1142712485a.409.2024.11.11.06.50.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Nov 2024 06:50:59 -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=OouI765a; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tAVk2-0002Cq-JF; Mon, 11 Nov 2024 09:50:10 -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 1tAVk0-0002Bu-II for qemu-devel@nongnu.org; Mon, 11 Nov 2024 09:50:08 -0500 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tAVjy-0001wr-GF for qemu-devel@nongnu.org; Mon, 11 Nov 2024 09:50:08 -0500 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-20cb7139d9dso42173345ad.1 for ; Mon, 11 Nov 2024 06:50:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1731336604; x=1731941404; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=2M/3qA8mMKz7DvBymSN5QuTvN/Xyu5smd+SKwoEDOq0=; b=OouI765aM7lkx+/k56qqY7OLSHXtyl2wSePhdbc8iarcrbL4RmihUCybYuqUWiqc7x XXm73OxnCuL0ZEgdcrMh+qZROS5o9PNYeMOJE2AO6NH7Gc9F+429p1CsLaQnAl4HnggT PDdaAEFJRHxbLgMB7EOYpmMHwDYynMDxngYEwY9Ejf5jUzG0ZKjYZLxgItnoijAhB06C IRmdgqb4KCRHSrGo35fY/6QIvDv29/CMxdr2MjEXHe829gmAIHDmb9N4ED4sKMnbNUh1 Ib2cS/cKg8mcCzKvG+PFBarlHb4LVQl0o6swRJNEDf+I87gadaobjfX5drkQEeV8qzE4 TIwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731336604; x=1731941404; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=2M/3qA8mMKz7DvBymSN5QuTvN/Xyu5smd+SKwoEDOq0=; b=X5XQoAnbyyrsBF9KkydIjvwrZ1eI8TiQei4yyUTPBSmoN4PmX60NYvNtdE5gQhI/VW lSZP7o89no3RBvj7h7Ndk/VXhBFuFvFV/DwAyRTe9R76osEEAX5VxxC8YtSgWXlWNsDc zYPBbtF24zegVJVd4GMZOevj0o3N+q8WyvNxl4dLHEjf3IqZAlLu+Vc3FR3iX+h/6mv7 z8oBVR9TkXLa1JEp+8Oc/bbByCmZzS2Z4jdnWA4hn96DEVOiA6f63sB1GcqGpGAwL16N OllETxqQVpPDi/H/ny7tLfSexK8G+A/voGwdgfO47v+g2VlM3dTwK5FzX5NwJdW+rCDU ZgxA== X-Gm-Message-State: AOJu0Yx8nIJRvbhIntCuv/L49JZLT1/bnYjBKA/ID3/Otzl73WMESElg GpVNtUaIh23JPFkhuiXaAWCKOS/zTRyXsSqeGy7+ZjKwfJ3S8rVZcP2ekoGehcOkjoBMWQtkj08 K X-Received: by 2002:a17:902:ea12:b0:20c:ccb7:df84 with SMTP id d9443c01a7336-21183e0dd1cmr183698405ad.42.1731336604557; Mon, 11 Nov 2024 06:50:04 -0800 (PST) Received: from stoup.. (wsip-24-120-228-34.lv.lv.cox.net. [24.120.228.34]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21177e68cb0sm76213705ad.224.2024.11.11.06.50.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Nov 2024 06:50:04 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: pierrick.bouvier@linaro.org Subject: [PATCH for-9.2] accel/tcg: Fix user-only probe_access_internal plugin check Date: Mon, 11 Nov 2024 06:50:02 -0800 Message-ID: <20241111145002.144995-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x630.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: 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 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. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2647 Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée --- accel/tcg/user-exec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index aa8af52cc3..06016eb030 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -800,7 +800,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; }