From patchwork Sat Nov 9 12:07:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 842095 Delivered-To: patch@linaro.org Received: by 2002:a5d:6307:0:b0:381:e71e:8f7b with SMTP id i7csp2117401wru; Sat, 9 Nov 2024 04:19:33 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXXHJxGnRdIJoT+R+xQEuu2bozTrZBVnixkdeblnBmS0jvBqSMMavYjQ4nYWv6dwndO78o9+w==@linaro.org X-Google-Smtp-Source: AGHT+IFHkJf0o7mqR8bhS0qr4D6dBTU4U06xYO2WPGgGdZCnQacKMht3IfK92UAyhapoCPW5no0a X-Received: by 2002:a05:620a:3704:b0:7b2:fa17:f7d4 with SMTP id af79cd13be357-7b331ea9f42mr908071685a.20.1731154773693; Sat, 09 Nov 2024 04:19:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731154773; cv=none; d=google.com; s=arc-20240605; b=D7gsyP0v/RJrmkOYKIKuBceibF4iL+L9JeIO07pm3Cwobrtf2r5hBaDPolFnHVyvcK k+e+SSreGooaS7CIWM/SF86YWRSvCuTZQompy8hTrs3R32y/542gdBbi1yJk6Ka/cMjU bhaUiJNmQRC75QENvEzdEUHX8B6t9bq7WEr1gRFnCK8W/DAj4iZ8Yo7PYh1Sn1fDRBwH JUwrnd9ffONKc5eYw6jAGPoFkLiXU42J0TeEoO6yuwjcux6ANMcOIbVKYl3a2Uggfb+K 7lUfT5FoSPsgMpBTZVNBnT+TqZqaEBtGfHc3eHOPvCFC5pn/F1vtl8bCtfxalPGalGEK +b/Q== 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=h9aVlYLCKD1NhC9xGKdu2g3w7SBQlop+lT5iyoi0Aco=; fh=jnOGvdacaTpco5Be5Zrr9OXpoek4qPe+c7L5Gapq/Ic=; b=O4fV0EU3mSbJ3pa7vXP1PZ8x9OUqNKVqEhABf6GfDpcfgpxCaHGr82hWSwrbbMW8+l xwImaoU0QSGfRV0urGsf7EA0g3SgPX1puobbKkTGbz62ouuUOmYTKSgi7R4eqyU0BXuc xyshkoqUbAgWf0SHq+3scxH4LmufQn90LTiOVJVUB13MNRGCDXR4ooWguZh1Ihrzj9CU sN7jbINiE+DLH4If6CcD191ApKeonps5mCXjCNg/onRQFvB51UpUxiuuW38cUZfc8tX1 pH+4aXMX1WIYykZpgTvRPVFtx0LTLtZeyuEP1U33tAGptsbJG3NEQVe0rIE5p516u3N7 WO+Q==; 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 af79cd13be357-7b32ac54f47si647570485a.167.2024.11.09.04.19.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 09 Nov 2024 04:19:33 -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 1t9kJK-0005DF-IX; Sat, 09 Nov 2024 07:11:29 -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 1t9kIY-00047S-7y; Sat, 09 Nov 2024 07:10:40 -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 1t9kIW-0004J1-L2; Sat, 09 Nov 2024 07:10:38 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 7A655A1605; Sat, 9 Nov 2024 15:07:08 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 40BB4167F93; Sat, 9 Nov 2024 15:08:03 +0300 (MSK) Received: (nullmailer pid 3295342 invoked by uid 1000); Sat, 09 Nov 2024 12:08: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.0.4 29/57] target/i386: Use probe_access_full_mmu in ptw_translate Date: Sat, 9 Nov 2024 15:07:31 +0300 Message-Id: <20241109120801.3295120-29-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 319b23762c..31c5032ace 100644 --- a/target/i386/tcg/sysemu/excp_helper.c +++ b/target/i386/tcg/sysemu/excp_helper.c @@ -61,12 +61,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; @@ -439,9 +438,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,