From patchwork Sun Oct 13 18:47:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 835083 Delivered-To: patch@linaro.org Received: by 2002:adf:b352:0:b0:37d:45d0:187 with SMTP id k18csp1686427wrd; Sun, 13 Oct 2024 11:48:39 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW8J+zY0qvdZmcht+z8iHZn9V7RcDGVynlNKSkmY5M/3pg9sx7WRIk2IbpLq6k9W4RFQg3T5A==@linaro.org X-Google-Smtp-Source: AGHT+IGnTK5izOGaj9aAfZ69B89Xq1iaJc7THbL9Hmuo9WQP/Ebf08XGZqxFEfWZ/VeqyQXmQG5d X-Received: by 2002:a05:620a:2915:b0:7ad:832a:4063 with SMTP id af79cd13be357-7b11a35311dmr1649587185a.7.1728845319468; Sun, 13 Oct 2024 11:48:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1728845319; cv=none; d=google.com; s=arc-20240605; b=k71TmvQgLztqJ+yBS/CorhmjwVjQqWbZU05YhsaQQURNxKkDv+uvT2u4QmH9QOqEuq p8v2V1ARl1CYDio/ngp+Qbys8Vr55oNQAk628gK5aFIY76tFnpu4vuzfBTItR0RzsbVi 32vJ/bnsj78zvazBfQg2kUVdrj42jw2SCOyXq55ikUis5X9O+eEEzJviKxUUHZhvD1+Q HJgosbxrySXJMO77K/ApR8TUG/PJL++NXG7FAvPEUJNxiorrAE0F91+9OcZyoG6Y71dn MPirDpAMisaZ1lrRNtm3IOIQVOCocB1CFzgV4yFll/inLv4lVarexosQL8cp3X51xKij BWhg== 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:dkim-signature; bh=izfDyS+bmapVSfLYtSn4xLMYlKwDBm7aSJ/Y/fO7PVc=; fh=eu2DY09p+eeddYDiV+DalJS3Vr0kxK5BujclYkgWvDw=; b=WRJmXuL9mIX484ijcwosCYt9OH4a3bHyNNpWWQ3jdiUPjpqgDOUV52nmwmaGY45Qch HgCdn3FvUmo0k6815Pwr9Y/ELYGfRRl8ehHHW48CBOmLca1WHBhtkvhUwv+SYKRu4QzS 2dK9ZW0v50fXKnQoasbkV5amyVI4uc/+ILpv031dToDRMo4kQPtRDtTrF20ikzlOrXdl WLsqAgV32AEgW6KDKHgMVefVAQkVOj4ESEHYPhJBGIySl91oJyb53K+WwbuqM+AXV2tz /moLCQLrOhHXgqg2rZdTDSns2iH7mvlctpAEKMdZ/YuYqCNRwtUaR8z0Dp5UQQSlC32D xBnw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=xw+Aqhga; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=fail 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-7b1149a51a7si839545885a.437.2024.10.13.11.48.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 13 Oct 2024 11:48:39 -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; dkim=fail header.i=@linaro.org header.s=google header.b=xw+Aqhga; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=fail 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 1t03cz-0001IJ-Eq; Sun, 13 Oct 2024 14:47:41 -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 1t03cx-0001Hi-9k for qemu-devel@nongnu.org; Sun, 13 Oct 2024 14:47:39 -0400 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t03cv-0002So-NL for qemu-devel@nongnu.org; Sun, 13 Oct 2024 14:47:39 -0400 Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-20c805a0753so29309765ad.0 for ; Sun, 13 Oct 2024 11:47:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728845256; x=1729450056; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=izfDyS+bmapVSfLYtSn4xLMYlKwDBm7aSJ/Y/fO7PVc=; b=xw+Aqhga1XmHQB4oBwwXzyZF+3mVHgEHq0KoZhlR5IcvF3ZJU5euEy1XmAUmLEjQ9J Yr6cvNyrtw/fczbLKyKUCdseJSkLbLERh6vu60Dh9XMSUvDog50XHo3U8NA9vpHTEexB To1aceN9agILl4ABYLU+P43CELDx7oHqWUiJZvQ17UnJXftVWhJ2lSkyFavsTs3/o9mE vKX1mGVP7Pd/UAIeoRcE3wB5KmpKe88mM/HMpv/ghXa+/5cjFXsgg9UnjFnP1D8eVX5+ /4QKD6Ca9v/iKZQG2qdSEMDUTTJ+mjUYq/6aS+YHsTzOdaej1unZ4jjiJRAXPBD/T6lo Ss+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728845256; x=1729450056; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=izfDyS+bmapVSfLYtSn4xLMYlKwDBm7aSJ/Y/fO7PVc=; b=p4z18/bA+xvq+EHQtXmLyDJCh9ky4/jFRXAQZEYyaGCo8HRVSbTi4WRhHuRVpbDkjr LHj4I48DEX5mAjzR40j/OIycl57+nSIY9nIBMNKBQPHwUWDeqvyryFtRZzbD0nhSHAcQ MEaJiFllDyAFdaFVg4btYfgSRcJ4J1LdlPptCQxVRRhjDJvY3Kxx+Iu4oqA0WRGQB3hl Az8dEikY3jJkfLh+RJvuM0krrCP+Xn3/rMkcK8Zzjg3eknxIkPkX19dzyMEBvrcelx/3 Q/u1mHuPVxSkkUepXoeijMqiCRZOEpTCrQGCwOVfyjlnBvUhOo5Ip7izQkkjnParV8Bj xbLQ== X-Gm-Message-State: AOJu0YyypFsLx3Sa11E9ZOGkGpm5YjZ4KByjRY69NvtE2/QdfFI4jpJ5 lhk7WldXLv2lvl+tGGj9jHRlAomMKN4pzdKHLJCpHTckYdOvpwbwv0JsnJgU1OEmRMyaT5lvJyC + X-Received: by 2002:a17:903:1d0:b0:20c:e262:2580 with SMTP id d9443c01a7336-20ce2622835mr28409195ad.44.1728845256268; Sun, 13 Oct 2024 11:47:36 -0700 (PDT) Received: from stoup.. (174-21-81-121.tukw.qwest.net. [174.21.81.121]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20c8c35522fsm52811805ad.296.2024.10.13.11.47.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Oct 2024 11:47:35 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v2 1/3] include/exec: Improve probe_access_full{, _mmu} documentation Date: Sun, 13 Oct 2024 11:47:31 -0700 Message-ID: <20241013184733.1423747-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241013184733.1423747-1-richard.henderson@linaro.org> References: <20241013184733.1423747-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::629; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x629.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 Suggested-by: Alex Bennée Signed-off-by: Richard Henderson Reviewed-by: Pierrick Bouvier Reviewed-by: Alex Bennée --- include/exec/exec-all.h | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 72240ef426..2e4c4cc4b4 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -368,6 +368,13 @@ int probe_access_flags(CPUArchState *env, vaddr addr, int size, * The CPUTLBEntryFull structure returned via @pfull is transient * and must be consumed or copied immediately, before any further * access or changes to TLB @mmu_idx. + * + * This function will not fault if @nonfault is set, but will + * return TLB_INVALID_MASK if the page is not mapped, or is not + * accessible with @access_type. + * + * This function will return TLB_MMIO in order to force the access + * to be handled out-of-line if plugins wish to instrument the access. */ int probe_access_full(CPUArchState *env, vaddr addr, int size, MMUAccessType access_type, int mmu_idx, @@ -375,22 +382,14 @@ int probe_access_full(CPUArchState *env, vaddr addr, int size, CPUTLBEntryFull **pfull, uintptr_t retaddr); /** - * probe_access_mmu() - Like probe_access_full except cannot fault and - * doesn't trigger instrumentation. + * probe_access_full_mmu: + * Like probe_access_full, except: * - * @env: CPUArchState - * @vaddr: virtual address to probe - * @size: size of the probe - * @access_type: read, write or execute permission - * @mmu_idx: softmmu index - * @phost: ptr to return value host address or NULL - * @pfull: ptr to return value CPUTLBEntryFull structure or NULL - * - * The CPUTLBEntryFull structure returned via @pfull is transient - * and must be consumed or copied immediately, before any further - * access or changes to TLB @mmu_idx. - * - * Returns: TLB flags as per probe_access_flags() + * This function is intended to be used for page table accesses by + * the target mmu itself. Since such page walking happens while + * handling another potential mmu fault, this function never raises + * exceptions (akin to @nonfault true for probe_access_full). + * Likewise this function does not trigger plugin instrumentation. */ int probe_access_full_mmu(CPUArchState *env, vaddr addr, int size, MMUAccessType access_type, int mmu_idx, From patchwork Sun Oct 13 18:47:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 835082 Delivered-To: patch@linaro.org Received: by 2002:adf:b352:0:b0:37d:45d0:187 with SMTP id k18csp1686428wrd; Sun, 13 Oct 2024 11:48:39 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVafacXLBmpI5ayke89jShQOmRlfbPHiR/5qpy/uWH1DIOPewnPv2bc937+7h5Lk2oCm11smA==@linaro.org X-Google-Smtp-Source: AGHT+IG1lysfGdH3D5iPtfnNglO1CgGkb91qttMkSeSM/IlrEoDJc/+UR1edQi9eo7UImKZs6xlH X-Received: by 2002:a05:620a:191a:b0:7b1:e0f:bf9b with SMTP id af79cd13be357-7b11a3ab9b9mr1428540685a.45.1728845319429; Sun, 13 Oct 2024 11:48:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1728845319; cv=none; d=google.com; s=arc-20240605; b=LJQ+qRhkSYE6PDwziHCt7jMZJyPYOpwdaW1kpIkrsa1Ab60KaNbi04M32SPr7Lahyr GoIU4jRiKwwyZ/p0lYDQCz1SUv669itpIqrQuA6jM7kaNez11v65wGj1L77Ay9xCfslJ HD5NVIhMSxpaWR3dN2Pon2rEntOePi+sllHpPcJ42cRNBl/C3wKWmFvlcNZ3Z3pzw6IC 5zZK9OseYTZScwtoIHZPgULW1V6mZF18xBfpeq+6k9YVrtcqJJacRgUWTpic1jTiJ8/z f3Upqn8wg6Gpj2pC5PTwCHWi11eWA8Mv7L2YRnsAA/Q04aNQn5KQ95q08fHsszh8NV9+ iqXQ== 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:dkim-signature; bh=SF1qZZsN9Tce3zMt/Ww343xHn3LIQsfZL/xAHrr77pE=; fh=aYwv1qvAWDHKcZLZyhvLuIoAkBRd6ysYy/Itgr1WhFg=; b=cjnLPxQV5pnhzejmUvbFKcyV/BZLv/ytat7SNm4qV8SFNvNSvwUf37yFDEI+1+TLks poyjJ8xSKx6wydsTwqXXJLPlK5swdJRP2Vx1mYdoRbUIP+Q/8wfmj/SBM6TVbpsZ7vHa sJPpqDr80A0W82OTSICGDtXuWfPUgeGTvSTaOpWjBSHKXWgEk/TmlgohRbxlZW3LRFkK 9s2vB/b0ndhYYrfx90anb6zahALMEvLgdSJHKWib8qgFyo9n4U/N0+2+kdY22OHmsSlU tWQn8hOevnzMRPjYlVmXbHD+M4FyvNJ3bcYTf6c0SpWXPF11Z1Kwhc1wsKS+bzWQtSfi mpMA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LmwrBdA2; 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-7b1149d2f83si854453285a.714.2024.10.13.11.48.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 13 Oct 2024 11:48:39 -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; dkim=pass header.i=@linaro.org header.s=google header.b=LmwrBdA2; 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 1t03d0-0001JO-U9; Sun, 13 Oct 2024 14:47:42 -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 1t03cy-0001Hu-EG for qemu-devel@nongnu.org; Sun, 13 Oct 2024 14:47:40 -0400 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t03cw-0002Su-IJ for qemu-devel@nongnu.org; Sun, 13 Oct 2024 14:47:40 -0400 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-20cb7088cbcso13897995ad.0 for ; Sun, 13 Oct 2024 11:47:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728845257; x=1729450057; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SF1qZZsN9Tce3zMt/Ww343xHn3LIQsfZL/xAHrr77pE=; b=LmwrBdA2lePbQS47fTiEqEtedR6qZ50j+BNFGnJVNpPkPY4o4+Tw5s+6B3MDmFf4UN hOzeQnw6XqkxeguYeod3xjNqY6d78W/PC/lKioJYm2mSZPkMzFrL3FFS0CJaIpmQdTZc mfCnex1ZCU1kpYoWtL0AxXM81vkyS7Cm6OaWIZPLj0v7kh6npFSbgroXAuATPJoxaill /D2kSS14X1JOmNqukVXH85JBecI178q2xDhS9yGo6Z1Y8uWd0rhSqJNjmnMlUppFgaMg Hz/r473GQG9ZBqepkuNIV7Cm8wNDiNhfxxQowd72YNm/hb6QndMt+GggmM4mXn4OIj5n PU3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728845257; x=1729450057; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SF1qZZsN9Tce3zMt/Ww343xHn3LIQsfZL/xAHrr77pE=; b=SMOdxKMLyT6iiNwmtlI5pAd2cXSd1ZOrN/yYEALV9yIueUQQxKnpfxOGEesNCZ3WFM lTar7lbTb3xtc8DWC5PsQxm230cjbwVQJH+tD92RgvUQrcGxAs6QTBe5n9XvhIdIXD97 OWT/jzff/R96dqbu3NuAhFBO/2isdcWHa9pfJNMXwF+vCsH6QEdqcaVNZG+Di/NeB34K We3fJ2/wqTQVD6Rb4z+2iGLZi55LmS0OZ4BK76nouRA6VU2NFqe7oSSvbbqaefBlXy2/ +vzGmUH3fgUYJz5KjqGrrlN733+sZscjRFbJr5dVlmejyzdw9oVL6UCm8eUfP0YcTbiv jM8g== X-Gm-Message-State: AOJu0YymDI7BQpiGDH+BH2yR2L7JT+f961RHdzSnBCPcJ1kZcFG0WYcu DkfNqZAL/gofixET6ACfWcW/IFZ50lZyN7tdrhvk+dMoF7zlMqsjN2YwuDYLPzc5hbMFY8yreKN z X-Received: by 2002:a17:902:db0e:b0:20c:7720:59b8 with SMTP id d9443c01a7336-20ca142a448mr132609625ad.6.1728845257298; Sun, 13 Oct 2024 11:47:37 -0700 (PDT) Received: from stoup.. (174-21-81-121.tukw.qwest.net. [174.21.81.121]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20c8c35522fsm52811805ad.296.2024.10.13.11.47.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Oct 2024 11:47:36 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 2/3] target/i386: Use probe_access_full_mmu in ptw_translate Date: Sun, 13 Oct 2024 11:47:32 -0700 Message-ID: <20241013184733.1423747-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241013184733.1423747-1-richard.henderson@linaro.org> References: <20241013184733.1423747-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62a; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62a.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=unavailable 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 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") Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée --- target/i386/tcg/sysemu/excp_helper.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/target/i386/tcg/sysemu/excp_helper.c b/target/i386/tcg/sysemu/excp_helper.c index 8fb05b1f53..8f4dc08535 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; @@ -429,9 +428,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, From patchwork Sun Oct 13 18:47:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 835085 Delivered-To: patch@linaro.org Received: by 2002:adf:b352:0:b0:37d:45d0:187 with SMTP id k18csp1686523wrd; Sun, 13 Oct 2024 11:49:03 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVRJEkfoR8mHrAcWg8CujsczrO2/8raAGLzk4EAoZHqe4LSnSaX19dC30C+7D7499UDpV5Z4A==@linaro.org X-Google-Smtp-Source: AGHT+IFEowX+PD4GfIERUL6kv2wLBFJYpz1vS0GZarpjPK8/5tEfY5SZOCFikFUHSwf0k1Vvnbxl X-Received: by 2002:a05:622a:4e88:b0:460:4e79:cb6c with SMTP id d75a77b69052e-4604e79cd22mr130267241cf.6.1728845343597; Sun, 13 Oct 2024 11:49:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1728845343; cv=none; d=google.com; s=arc-20240605; b=dBau25Ao2CAwsJAYMJ+zRUz4LaSqdpn2kScMTt7jjnqGdJHTOv5w5BoK0tJdl1o/YI yG6b0SYR/je+svpKAE2MsMrNO01+t64Y6F1cqOXVPLuBbHzeNC1GsycB6xFA33PzQu42 HojbVGveEKQ/9AX1s1wmnprOIDhE1sTnQPTrB78o9NOwYFV3M3zn1Lo+h0ZARlW/Di2/ mYD30/+OE3J0qxxfBxA0JbPGq6elK42JbVa1AXCi6HWQlaxtGSZ19JOIOhFn1tCH8M2F HE21vjRuy98uSjOqTACNsyjrNejcDa/+vA/ds3JdNw/hgkWVsVOTZ37lmTZ/446F7UU7 dovg== 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:dkim-signature; bh=A367cDE3XXnX+J9PB6YWwLbOv7CCrH8XOGA6B2dAonQ=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=SnmoYyTwACyKCOCg8WrcRN1bC6yuMZtPaCRT1VfTPkiuOGL6YnieSDYgeB1qQtkbrz sdRiKS+VtFIneYHBw8+uGLlTAOCe7sEBEnCVf7HWQNvdC6j8w6L8D8qMEHoTrGc0XEdt XGZyE+K9fHS6OW8jcQOZYMOxzFezaID3D7Q4VGYiBUNKClgZdEcTFle/Gg79+Nh3p3cA qhioEjbz0+DLajqaxaSQqxwkns97dgHq99NN0YpZCR2utKRFRHCqsu+2OC4WvADXqozr qZoKUUuG70R6rBGot+ZgO+WGnkb4yQWXFIlgg8EtVl6sgmNOjuvYOv0nOzEtJSTSVrUU LxpQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="CPdsdk/v"; 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 d75a77b69052e-46042880e35si74331571cf.384.2024.10.13.11.49.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 13 Oct 2024 11:49:03 -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; dkim=pass header.i=@linaro.org header.s=google header.b="CPdsdk/v"; 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 1t03d0-0001J7-CX; Sun, 13 Oct 2024 14:47:42 -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 1t03cz-0001II-3A for qemu-devel@nongnu.org; Sun, 13 Oct 2024 14:47:41 -0400 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t03cx-0002T3-I9 for qemu-devel@nongnu.org; Sun, 13 Oct 2024 14:47:40 -0400 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-20c8b557f91so26393585ad.2 for ; Sun, 13 Oct 2024 11:47:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1728845258; x=1729450058; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=A367cDE3XXnX+J9PB6YWwLbOv7CCrH8XOGA6B2dAonQ=; b=CPdsdk/vadBarphoKLgzZcGC0QcDHf6YHRWApiwV7OORvsuQAMieRWu1Q2NgWGoyZ6 pIKZKKyo5ZGC6nfnbsPAUN+bgESCFZTylQ7XOTR9HA8HgnkYm/F7kMy4+jELz6TOKNAe sEKsNMN/gM3S43NOpBKZxqC3c34s6Q9ONlZf+jQhoxr8HOte9MlphJAqq4OtHk13WVr/ dUvbzh13fiIjv76yGJBlYPUeMUrSkGba4TuhnvP7Vywocl7tOyLrECuZNaQFHHlKnSZ8 yPZjSBIXxwlYle2zVZTEdBuubIV7mn7az3LGce5K3dTPGiYrHRA3kMtQFcrg3SVpVLwl /n3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728845258; x=1729450058; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=A367cDE3XXnX+J9PB6YWwLbOv7CCrH8XOGA6B2dAonQ=; b=TDXk39DHLbK7LkH/ImwrdojC1QV/ZvU1r2GtT3Z27/LNlxY+koeQGO+h65T99qPzNv /HKY6ukWVIXPJ+tGKMhzYJeiBZ2InBYqUShQ6G6OelYN90B6gdBptSXjwECWOb0wea51 51Qr8MKI84JiC8pgEW9WEekVATOxevsdC4IZu4LV8/mG8Y+fFD7R3JgFXgCK2PgNX88u YinLeqMESJGNgaX4L9J6FWDy2TBwhiQ1ZO08/LwOe/+p/jGhHZCW/BM8JXqzMd14uJCK X4fvC51L6fppTWKiTvXXL/CvbHibAGaKxIlj7SbfAO2m687Amk79UGRydy6j78+V6vFD A23Q== X-Gm-Message-State: AOJu0Yz55BYnXHOkg0Kv69D+E9UnZB/kTvXkZw4ks93XS+Y0LAOKqtfd 1p7Fh75bMywRWAzoVDHKRf+cc/+zpKRP+bzC2sKKqNGu+HC2h0PmcQMfNoVAEq6Mouw1NUWwzW0 J X-Received: by 2002:a17:903:11c6:b0:20c:7661:dce8 with SMTP id d9443c01a7336-20ca167d499mr158830245ad.36.1728845258183; Sun, 13 Oct 2024 11:47:38 -0700 (PDT) Received: from stoup.. (174-21-81-121.tukw.qwest.net. [174.21.81.121]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20c8c35522fsm52811805ad.296.2024.10.13.11.47.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Oct 2024 11:47:37 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 3/3] target/i386: Remove ra parameter from ptw_translate Date: Sun, 13 Oct 2024 11:47:33 -0700 Message-ID: <20241013184733.1423747-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241013184733.1423747-1-richard.henderson@linaro.org> References: <20241013184733.1423747-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62a; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62a.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 This argument is no longer used. Suggested-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/i386/tcg/sysemu/excp_helper.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/target/i386/tcg/sysemu/excp_helper.c b/target/i386/tcg/sysemu/excp_helper.c index 8f4dc08535..f97594f4ab 100644 --- a/target/i386/tcg/sysemu/excp_helper.c +++ b/target/i386/tcg/sysemu/excp_helper.c @@ -60,7 +60,7 @@ typedef struct PTETranslate { hwaddr gaddr; } PTETranslate; -static bool ptw_translate(PTETranslate *inout, hwaddr addr, uint64_t ra) +static bool ptw_translate(PTETranslate *inout, hwaddr addr) { int flags; @@ -165,7 +165,7 @@ static bool mmu_translate(CPUX86State *env, const TranslateParams *in, * Page table level 5 */ pte_addr = (in->cr3 & ~0xfff) + (((addr >> 48) & 0x1ff) << 3); - if (!ptw_translate(&pte_trans, pte_addr, ra)) { + if (!ptw_translate(&pte_trans, pte_addr)) { return false; } restart_5: @@ -189,7 +189,7 @@ static bool mmu_translate(CPUX86State *env, const TranslateParams *in, * Page table level 4 */ pte_addr = (pte & PG_ADDRESS_MASK) + (((addr >> 39) & 0x1ff) << 3); - if (!ptw_translate(&pte_trans, pte_addr, ra)) { + if (!ptw_translate(&pte_trans, pte_addr)) { return false; } restart_4: @@ -209,7 +209,7 @@ static bool mmu_translate(CPUX86State *env, const TranslateParams *in, * Page table level 3 */ pte_addr = (pte & PG_ADDRESS_MASK) + (((addr >> 30) & 0x1ff) << 3); - if (!ptw_translate(&pte_trans, pte_addr, ra)) { + if (!ptw_translate(&pte_trans, pte_addr)) { return false; } restart_3_lma: @@ -236,7 +236,7 @@ static bool mmu_translate(CPUX86State *env, const TranslateParams *in, * Page table level 3 */ pte_addr = (in->cr3 & 0xffffffe0ULL) + ((addr >> 27) & 0x18); - if (!ptw_translate(&pte_trans, pte_addr, ra)) { + if (!ptw_translate(&pte_trans, pte_addr)) { return false; } rsvd_mask |= PG_HI_USER_MASK; @@ -258,7 +258,7 @@ static bool mmu_translate(CPUX86State *env, const TranslateParams *in, * Page table level 2 */ pte_addr = (pte & PG_ADDRESS_MASK) + (((addr >> 21) & 0x1ff) << 3); - if (!ptw_translate(&pte_trans, pte_addr, ra)) { + if (!ptw_translate(&pte_trans, pte_addr)) { return false; } restart_2_pae: @@ -284,7 +284,7 @@ static bool mmu_translate(CPUX86State *env, const TranslateParams *in, * Page table level 1 */ pte_addr = (pte & PG_ADDRESS_MASK) + (((addr >> 12) & 0x1ff) << 3); - if (!ptw_translate(&pte_trans, pte_addr, ra)) { + if (!ptw_translate(&pte_trans, pte_addr)) { return false; } pte = ptw_ldq(&pte_trans, ra); @@ -302,7 +302,7 @@ static bool mmu_translate(CPUX86State *env, const TranslateParams *in, * Page table level 2 */ pte_addr = (in->cr3 & 0xfffff000ULL) + ((addr >> 20) & 0xffc); - if (!ptw_translate(&pte_trans, pte_addr, ra)) { + if (!ptw_translate(&pte_trans, pte_addr)) { return false; } restart_2_nopae: @@ -331,7 +331,7 @@ static bool mmu_translate(CPUX86State *env, const TranslateParams *in, * Page table level 1 */ pte_addr = (pte & ~0xfffu) + ((addr >> 10) & 0xffc); - if (!ptw_translate(&pte_trans, pte_addr, ra)) { + if (!ptw_translate(&pte_trans, pte_addr)) { return false; } pte = ptw_ldl(&pte_trans, ra);