From patchwork Mon Jun 19 09:19:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 694008 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d91:0:0:0:0:0 with SMTP id b17csp2278658wru; Mon, 19 Jun 2023 02:19:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6KqxcTOmlHaQ2iCdlFkr8fMubXdi5cL/z2pgaXSyQ6fxYviojXXZ1PU2Fnpo8rDzGcvdFu X-Received: by 2002:ad4:576c:0:b0:62f:fe67:7372 with SMTP id r12-20020ad4576c000000b0062ffe677372mr631781qvx.14.1687166381834; Mon, 19 Jun 2023 02:19:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687166381; cv=none; d=google.com; s=arc-20160816; b=rViCC2nIIMFad7Xlkqa2W6ny3JUHfvp9XVCu2uHNujaXU0x6R3DE1eXD9VWEqdbOpu Gn1apyK38jiGKT8Q1JgSwDC5WsXpgIfq/hagCPJLbs4yq8BQUfAHWl944N314n7mM90e M1DjQPJMVAghV+TS7JlNhMm4Z6czgeTkAwtM8RQwbpjsiP7F1G6lhWLoY7ErAIqnHQck ybvZuRZiFXeQaw3koVPi8RTiXpT0yOUkj2zSaz0scZ1v7p6HH56LXGxf5U3b9Rd7H8AE lnHmhiOczGqHy6Krtfh147o+Yl6a8gBZstNo2FNB5hjfrC4zl6vf7dXNsEoqK6USY1Wg xesg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=ymckh/jJUuhk+bN7W/yTN4TDJ8aIcl8RwV72SXESkek=; b=YttyMa3bRPTvENcLYXr5DahzhNInWYXBaIxUGaUTc1QcGZ/8eGzLYQcjHTmLiQHWbn T9N8LG3j4gXCEGLk3bQkWAV6gJMAQyq9Qn5hD1F5IUkOy5AzPl2PciMY3ZeyqK2cJwnF mpMvHqGqbgbP7PFQktOBcs/DsFNWWh9ET/p0n3XKevre3EAvUCd806arfWRKS4s39gHa 87f7Babfk5byMIxdLjAbRMsGJ2tuxZcHqyNTH3mFX619cho6osO47yWw+q4LKw7Y7HB8 p7+hKbK9wYlXTtM4nUEL68qlGh9lMQz+/9hDklvR4z0V3YSZVTOhA93ML5qIanLKQq4X LaXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VYTjg9ou; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d5-20020a05621421c500b0062df8067f77si6813674qvh.402.2023.06.19.02.19.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Jun 2023 02:19:41 -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=VYTjg9ou; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qBB2Z-00034F-DP; Mon, 19 Jun 2023 05:19:15 -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 1qBB2W-00033O-ED for qemu-devel@nongnu.org; Mon, 19 Jun 2023 05:19:12 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qBB2U-0001xi-SA for qemu-devel@nongnu.org; Mon, 19 Jun 2023 05:19:12 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-3f9b1a117caso4353235e9.0 for ; Mon, 19 Jun 2023 02:19:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687166349; x=1689758349; 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=ymckh/jJUuhk+bN7W/yTN4TDJ8aIcl8RwV72SXESkek=; b=VYTjg9ouQCSN11FK8Enjl5bbtCqNjPTp9kwTO9PT3gZIi7b/8f9LAPiQhMGyfVkpvv rXFA6Z0QRwuLGlgI+5eA2hcOcPEf7x842iKYmVShuiKlnip5+hRhWTXnOP8OqKbvP4CV FUTIL9HW08VhtZUAhjhBmoOfFghlBtVjduqOJeAOSyro9u6mLqVSCP+rf8P+0xElt0xC JhtjBVKf4TSCn/O0QjaUnCACMnf7E8bgDsjgJ1yjomUwmujcBl9y1MgRAXMSHtoYEXD0 +IbHeKDIMt+kOZqEsoUToeQ+FyBVEjLDjoLJZS5Wl4xopBFkaUh7vVO3anDBPdEgw1Mq sCww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687166349; x=1689758349; 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=ymckh/jJUuhk+bN7W/yTN4TDJ8aIcl8RwV72SXESkek=; b=iX6GLT1xvCRaWk18u9QOUNP5vCtPGTbSM4WbFD6HB8DfIoCnabsUHYxnBBt97iaNty udRLH81hlFApphJi/neG7QWe4tafDssYB9Wd/8frA+7GpjYgY3Dt44/rX2k4q48wd4FL cwfKo2O0dtMejp0kNeCBhTUD06n5Wg/lyn1b2Q8sI71V882IYhnJZbt973JKfVvbZKga jTjMWBYxL/bs1mnNUi5ezM9dp/KztfsJgupzRh69ixE6I90TqWnPa2/2nGXkr1WfJVES 9x4zDze5qRdL9UpwAZwyXiy3tyejaYeQ8Vf/44bTZu0HaK3wdIVx0XhlbS8Gi2lS2Yln utjg== X-Gm-Message-State: AC+VfDz3gqpJrKAtbfHYd34VzkxKb+QlDEYaL8TbItt7rvjJ82JIhJDV hRb4ohVYJ4jccCAy/eWjytUBkkMwKnj0D3hJGkSz1Q== X-Received: by 2002:a05:600c:acd:b0:3f9:92d:9ffe with SMTP id c13-20020a05600c0acd00b003f9092d9ffemr2854342wmr.14.1687166349005; Mon, 19 Jun 2023 02:19:09 -0700 (PDT) Received: from localhost.localdomain (194.red-95-127-33.staticip.rima-tde.net. [95.127.33.194]) by smtp.gmail.com with ESMTPSA id g18-20020a7bc4d2000000b003f8d0308604sm10189156wmk.9.2023.06.19.02.19.07 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 19 Jun 2023 02:19:08 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Peter Maydell , Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH v2 1/2] target/arm: Widen probe_access()'s address argument to 64-bits Date: Mon, 19 Jun 2023 11:19:00 +0200 Message-Id: <20230619091901.51607-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230619091901.51607-1-philmd@linaro.org> References: <20230619091901.51607-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Make probe_access() agnostic to the address size of the guest, using a uint64_t type since usage varies between guests. Since we don't access any CPUARMState particular env field, use the generic CPUArchState type insted. Signed-off-by: Philippe Mathieu-Daudé --- target/arm/helper.h | 2 +- target/arm/tcg/op_helper.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target/arm/helper.h b/target/arm/helper.h index 3335c2b10b..cee9462c73 100644 --- a/target/arm/helper.h +++ b/target/arm/helper.h @@ -101,7 +101,7 @@ DEF_HELPER_FLAGS_1(rebuild_hflags_a32_newel, TCG_CALL_NO_RWG, void, env) DEF_HELPER_FLAGS_2(rebuild_hflags_a32, TCG_CALL_NO_RWG, void, env, int) DEF_HELPER_FLAGS_2(rebuild_hflags_a64, TCG_CALL_NO_RWG, void, env, int) -DEF_HELPER_FLAGS_5(probe_access, TCG_CALL_NO_WG, void, env, tl, i32, i32, i32) +DEF_HELPER_FLAGS_5(probe_access, TCG_CALL_NO_WG, void, env, i64, i32, i32, i32) DEF_HELPER_1(vfp_get_fpscr, i32, env) DEF_HELPER_2(vfp_set_fpscr, void, env, i32) diff --git a/target/arm/tcg/op_helper.c b/target/arm/tcg/op_helper.c index 3baf8004f6..6cb84bc994 100644 --- a/target/arm/tcg/op_helper.c +++ b/target/arm/tcg/op_helper.c @@ -1009,7 +1009,7 @@ uint32_t HELPER(ror_cc)(CPUARMState *env, uint32_t x, uint32_t i) } } -void HELPER(probe_access)(CPUARMState *env, target_ulong ptr, +void HELPER(probe_access)(CPUArchState *env, uint64_t ptr, uint32_t access_type, uint32_t mmu_idx, uint32_t size) { From patchwork Mon Jun 19 09:19:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 694007 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d91:0:0:0:0:0 with SMTP id b17csp2278632wru; Mon, 19 Jun 2023 02:19:36 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7UmzOanmz8P3o7PpoP7niMs2IgG4aPfKCRTNzJ6lxMGRI73BB+h2GEegHnKWInIIFll2OD X-Received: by 2002:ac8:7fc3:0:b0:3f6:84ac:659f with SMTP id b3-20020ac87fc3000000b003f684ac659fmr11543834qtk.29.1687166376172; Mon, 19 Jun 2023 02:19:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687166376; cv=none; d=google.com; s=arc-20160816; b=LhMBCnXcmyO+yJxl6hnXSC7jlb0kalrNpXbXCaX7mG42ynH3qlprwbziDa8nQFlIbU aTFHZtmPHKka7w2ohuC49+fwlnS84GsZOhmrthgSq2Jnlmu6ZY+Roa2Rqv2kYOXbJ8um Yl+jKIaP/d96PGGWgM0H1ObDG/pCLSEOKBRX0t8/u9i1vfXK4oFMbwN7hKEeFbLMvBOX ZfWLRpolV/IlKxaWQB6q7vDfpXx9Zt1Yv7+njL0jO3eOnlueeuefdRHzLPCxqwVJPlv9 GXb6vOvjLYmcpi9gSE0fwgCnz29ibawY4JEicdjzxQcktZ9wR0BLiHLIqRPBZhFQXtnV h5zA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=VHlHQxlwsOWUk71VYo9wtJBVxxN3mr1x8H8MDl1D0DM=; b=MzoNwfPg1+5VoVM/LR7l/po8CE9qsiRTkIS7zB5aM4ORMHmQj9mDCgqck1Nx67TGOE 3FOmJYM1GChs5iwmZV9TbIph0ve/GXzxJ38eR9KcdMskz1JYuGfyqJVQo6MEUSZk8zC2 jn2cejXA+YsjAm2Wuu3HrGgKwmYxSgXJ+kZJZ1DzdG/W4H51xb+OkiExHpxkuNTSepDB ggtUdVsD/Ktrs7n06PFACtgplxDhy+DTVEMOW+H9Jcf4ieVbOkEhiEmMUpfOI6GRXLwL oRmvcOMiEpc7QYvhamR/L5KSPQBkugZqlwAx67D5w5O9INPvXEuq5JGkPd8vTLwLQ4xX P/gA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=imxgGqvO; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d19-20020a05622a15d300b003f02ab8a1efsi13208171qty.499.2023.06.19.02.19.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Jun 2023 02:19:36 -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=imxgGqvO; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qBB2e-00039S-7I; Mon, 19 Jun 2023 05:19:20 -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 1qBB2b-00038I-U9 for qemu-devel@nongnu.org; Mon, 19 Jun 2023 05:19:17 -0400 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qBB2a-0001yO-Aq for qemu-devel@nongnu.org; Mon, 19 Jun 2023 05:19:17 -0400 Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-4f6283d0d84so4061514e87.1 for ; Mon, 19 Jun 2023 02:19:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687166354; x=1689758354; 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=VHlHQxlwsOWUk71VYo9wtJBVxxN3mr1x8H8MDl1D0DM=; b=imxgGqvOkOFG1f8RZKnvnY7P+BScuqsUEmqwth94f8GDAiqJ3z74o5NSpnt2nhUhq7 KUrGWj+7JKQy+jdT0EStxbc8WlXzgfCSei+y7Mo9iEJaaFkk9L7ZXpi9FkCj2ZCPP1uE I3H3XMd4lbhxj7hnLtUGFQEjP0XTpDG7MQSujWZseOT+1wFCdgvd+JhbIlr2IWca/OMl DX2Syv40GOZogUrcydUec4WZDYWnb6eOsx6dwMaeXM7RDmGrWRes/uuqI9BxKFO9R9PS dRzEmzpcYoriXp4lql+Ua4To0AqXtGzu2A6i4ESg6rarv56nFme4jClkj/lmaZ5VzvKA YynQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687166354; x=1689758354; 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=VHlHQxlwsOWUk71VYo9wtJBVxxN3mr1x8H8MDl1D0DM=; b=LYCpkC9ROkZZhRgiJhtk1P/7yhv5nS4NAXrmOPwkH3OGw1izV9TfTPehzUsBcfzeQt eg7PdlIsAa6LXHI4l0CYq96PWyNZ6y1bE947UAxBsAZs+0D7Ywn/rLM8DPFghV7ZV05V T9KtxouDaLUY5P/vw/obS1MkWsJFQglYJY1zeZyNSb6NNmDtCqiLsfP4pWBxFNs9B98x rJjjPQO0VHdu9+ufUFppeSNAvROqkeRREtzKDcdz3I4zm7NvXjBPEcSzfa3o7bfBWPQo fQNskm0pn+hbPNGK2/izDv+kt7PHRYmpPJk4Rc/aaFQj8xUmVN6vhIKR+9yc8e/7dePG agIw== X-Gm-Message-State: AC+VfDxYbQzkvzKcSdGGDS1+Pq7BFzhDq9vvcMxX5iRUUL5i1H4zdaYg CbN5HwcTBjbmUWIogBnxmeTLGo845U4W2aEdpjEEGQ== X-Received: by 2002:ac2:5b0c:0:b0:4f8:666b:9de8 with SMTP id v12-20020ac25b0c000000b004f8666b9de8mr2580890lfn.13.1687166354401; Mon, 19 Jun 2023 02:19:14 -0700 (PDT) Received: from localhost.localdomain (194.red-95-127-33.staticip.rima-tde.net. [95.127.33.194]) by smtp.gmail.com with ESMTPSA id j15-20020a05600c2b8f00b003f4266965fbsm10101063wmc.5.2023.06.19.02.19.13 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 19 Jun 2023 02:19:14 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Peter Maydell , Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH v2 2/2] accel/tcg: Make probe_access() a generic TCG helper Date: Mon, 19 Jun 2023 11:19:01 +0200 Message-Id: <20230619091901.51607-3-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230619091901.51607-1-philmd@linaro.org> References: <20230619091901.51607-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12b; envelope-from=philmd@linaro.org; helo=mail-lf1-x12b.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, T_SCC_BODY_TEXT_LINE=-0.01 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 probe_access() is not ARM specific and can be reused by other targets. Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/tcg-runtime.h | 2 ++ target/arm/helper.h | 2 -- accel/tcg/tcg-runtime.c | 16 ++++++++++++++++ target/arm/tcg/op_helper.c | 16 ---------------- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/accel/tcg/tcg-runtime.h b/accel/tcg/tcg-runtime.h index 39e68007f9..a93a5d87a5 100644 --- a/accel/tcg/tcg-runtime.h +++ b/accel/tcg/tcg-runtime.h @@ -28,6 +28,8 @@ DEF_HELPER_FLAGS_1(lookup_tb_ptr, TCG_CALL_NO_WG_SE, cptr, env) DEF_HELPER_FLAGS_1(exit_atomic, TCG_CALL_NO_WG, noreturn, env) +DEF_HELPER_FLAGS_5(probe_access, TCG_CALL_NO_WG, void, env, i64, i32, i32, i32) + #ifndef IN_HELPER_PROTO /* * Pass calls to memset directly to libc, without a thunk in qemu. diff --git a/target/arm/helper.h b/target/arm/helper.h index cee9462c73..4336571d88 100644 --- a/target/arm/helper.h +++ b/target/arm/helper.h @@ -101,8 +101,6 @@ DEF_HELPER_FLAGS_1(rebuild_hflags_a32_newel, TCG_CALL_NO_RWG, void, env) DEF_HELPER_FLAGS_2(rebuild_hflags_a32, TCG_CALL_NO_RWG, void, env, int) DEF_HELPER_FLAGS_2(rebuild_hflags_a64, TCG_CALL_NO_RWG, void, env, int) -DEF_HELPER_FLAGS_5(probe_access, TCG_CALL_NO_WG, void, env, i64, i32, i32, i32) - DEF_HELPER_1(vfp_get_fpscr, i32, env) DEF_HELPER_2(vfp_set_fpscr, void, env, i32) diff --git a/accel/tcg/tcg-runtime.c b/accel/tcg/tcg-runtime.c index 9fa539ad3d..b241a11791 100644 --- a/accel/tcg/tcg-runtime.c +++ b/accel/tcg/tcg-runtime.c @@ -152,3 +152,19 @@ void HELPER(exit_atomic)(CPUArchState *env) { cpu_loop_exit_atomic(env_cpu(env), GETPC()); } + +void HELPER(probe_access)(CPUArchState *env, uint64_t ptr, + uint32_t access_type, uint32_t mmu_idx, + uint32_t size) +{ + uint32_t in_page = -((uint32_t)ptr | TARGET_PAGE_SIZE); + uintptr_t ra = GETPC(); + + if (likely(size <= in_page)) { + probe_access(env, ptr, size, access_type, mmu_idx, ra); + } else { + probe_access(env, ptr, in_page, access_type, mmu_idx, ra); + probe_access(env, ptr + in_page, size - in_page, + access_type, mmu_idx, ra); + } +} diff --git a/target/arm/tcg/op_helper.c b/target/arm/tcg/op_helper.c index 6cb84bc994..d507a3df16 100644 --- a/target/arm/tcg/op_helper.c +++ b/target/arm/tcg/op_helper.c @@ -1009,22 +1009,6 @@ uint32_t HELPER(ror_cc)(CPUARMState *env, uint32_t x, uint32_t i) } } -void HELPER(probe_access)(CPUArchState *env, uint64_t ptr, - uint32_t access_type, uint32_t mmu_idx, - uint32_t size) -{ - uint32_t in_page = -((uint32_t)ptr | TARGET_PAGE_SIZE); - uintptr_t ra = GETPC(); - - if (likely(size <= in_page)) { - probe_access(env, ptr, size, access_type, mmu_idx, ra); - } else { - probe_access(env, ptr, in_page, access_type, mmu_idx, ra); - probe_access(env, ptr + in_page, size - in_page, - access_type, mmu_idx, ra); - } -} - /* * This function corresponds to AArch64.vESBOperation(). * Note that the AArch32 version is not functionally different.