From patchwork Sat Nov 9 12:08:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 842105 Delivered-To: patch@linaro.org Received: by 2002:a5d:6307:0:b0:381:e71e:8f7b with SMTP id i7csp2122091wru; Sat, 9 Nov 2024 04:33:09 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUZTJYbXiP+LunrVFY8+fK0FiI57X4ZMH76H5KtsCJA7cIf7B4wwxcOC+OnBgd+wSFjN45lbQ==@linaro.org X-Google-Smtp-Source: AGHT+IG9ZGdrjth4xD+CtMzLruVNWoI8oFHh6+VMbvj9DzacQoudXQdxzUTjUx6EZh65nuNIi5T8 X-Received: by 2002:a05:6214:3217:b0:6cb:7104:f115 with SMTP id 6a1803df08f44-6d39e11799emr83470506d6.11.1731155588892; Sat, 09 Nov 2024 04:33:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731155588; cv=none; d=google.com; s=arc-20240605; b=HKsXGGpJ29nnKGT5bm1Xu9FSJpX7e7z9hiV5xjr+niHuWEAzRGBDCcAqdL7WX5izYb UfWISPCCqbwWTrFEDNwC/aH0rvUcfy3EvHNHqr8YJh+J3woE53AlWQbVYI+o4Ph8rIOL kuqG1iaFm8KkPVfQkuOU4RxdjAVgMhIiMIdOxPSJdcVTlHJ0+tEHT7ogyeSHJE11ha3R NW3R972Y2PvkzAbl/iAHGuaRI/cuU0TO1ojnxhPusiAwu9X/DBEPxnxe70rNaUlw4Y40 MWJ2AGo9Hgls0PU8KWFB/pVd/OZ3EW6ZRB2EIFidwya81U9nkWL2uKfNQodqdDP1Vf9/ 2evA== 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=z3pj6X3Ill9NP2OAJpWlHyEFbARuARoiP8+KN+mT2FI=; fh=jnOGvdacaTpco5Be5Zrr9OXpoek4qPe+c7L5Gapq/Ic=; b=bVa2l2foq5N1wNaCqU2FBEd9IFydTl6RjYnhlUfKfnnvW3cxxLPx8Rd1+wioTIn22I sGn+JbZE6pnBPYgs4i6j0aZw9wiFlFruyIPByfS3h8u9W2SVkzMsLYHuj2YhghtpGmvk L4riNEzvnETvI2hfNRqBFs6Fx4r1QAeEaDawBg6Nm2/WlhYmu+NuOZ/hnXSUjK1bSaeY t4u7RTt/jFyvI4B+a19AJTqm/Pi4NTqGWewtfkP/H6aY7G7vOyzViYpUxhq1JoQa5f/O jDNSdDPhtNpDyS2qH2Lu0ryM2bA9GYKAQdp8tudIr0D5pkzzbY8qXtDIK92NyHgtVrge j7Pg==; 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-6d3962107e6si66809586d6.27.2024.11.09.04.33.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Nov 2024 04:33:08 -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 1t9kOj-0005DS-8y; Sat, 09 Nov 2024 07:17:08 -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 1t9kNv-0004St-3K; Sat, 09 Nov 2024 07:16:13 -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 1t9kNt-00055M-FQ; Sat, 09 Nov 2024 07:16:10 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 65AFEA1635; Sat, 9 Nov 2024 15:08:07 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 2C2E0167FBC; Sat, 9 Nov 2024 15:09:02 +0300 (MSK) Received: (nullmailer pid 3296163 invoked by uid 1000); Sat, 09 Nov 2024 12:09:01 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Richard Henderson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Alex?= =?utf-8?q?_Benn=C3=A9e?= , Michael Tokarev Subject: [Stable-9.1.2 12/58] target/i386: Use probe_access_full_mmu in ptw_translate Date: Sat, 9 Nov 2024 15:08:13 +0300 Message-Id: <20241109120901.3295995-12-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 probe_access_full_mmu function was designed for this purpose, and does not report the memory operation event to plugins. Cc: qemu-stable@nongnu.org Fixes: 6d03226b422 ("plugins: force slow path when plugins instrument memory ops") Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson Message-ID: <20241013184733.1423747-3-richard.henderson@linaro.org> (cherry picked from commit 115ade42d50144c15b74368d32dc734ea277d853) Signed-off-by: Michael Tokarev diff --git a/target/i386/tcg/sysemu/excp_helper.c b/target/i386/tcg/sysemu/excp_helper.c index 8cb0d80177..8b046ee4be 100644 --- a/target/i386/tcg/sysemu/excp_helper.c +++ b/target/i386/tcg/sysemu/excp_helper.c @@ -62,12 +62,11 @@ typedef struct PTETranslate { static bool ptw_translate(PTETranslate *inout, hwaddr addr, uint64_t ra) { - CPUTLBEntryFull *full; int flags; inout->gaddr = addr; - flags = probe_access_full(inout->env, addr, 0, MMU_DATA_STORE, - inout->ptw_idx, true, &inout->haddr, &full, ra); + flags = probe_access_full_mmu(inout->env, addr, 0, MMU_DATA_STORE, + inout->ptw_idx, &inout->haddr, NULL); if (unlikely(flags & TLB_INVALID_MASK)) { TranslateFault *err = inout->err; @@ -440,9 +439,8 @@ do_check_protect_pse36: CPUTLBEntryFull *full; int flags, nested_page_size; - flags = probe_access_full(env, paddr, 0, access_type, - MMU_NESTED_IDX, true, - &pte_trans.haddr, &full, 0); + flags = probe_access_full_mmu(env, paddr, 0, access_type, + MMU_NESTED_IDX, &pte_trans.haddr, &full); if (unlikely(flags & TLB_INVALID_MASK)) { *err = (TranslateFault){ .error_code = env->error_code,