From patchwork Fri Apr 5 10:24:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 786211 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:1101:b0:343:f27d:c44e with SMTP id z1csp92628wrw; Fri, 5 Apr 2024 03:25:53 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVsY+jBKV1IwX93ixiQ3t3CP1eLvd6hm+pMDt7lD7osE8ZP2Iuo7XK7YvgJ6jJHcOlp9Gc/xiT974UBDgqYfMmP X-Google-Smtp-Source: AGHT+IGElWcYGNRXnmXEWEitZhYZIrYLaJkvX6fYhLKshpkPpnH7/gphO2TBSN1alr5zCns3AeqW X-Received: by 2002:a05:620a:90f:b0:78d:3cc7:eea2 with SMTP id v15-20020a05620a090f00b0078d3cc7eea2mr731296qkv.53.1712312753613; Fri, 05 Apr 2024 03:25:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1712312753; cv=none; d=google.com; s=arc-20160816; b=u/pW52WDrXOSr40dRATTcDddDsx+CEsokWdrcdxPK8R1/7Tcv5a8Rom4hesBuofHXf OT7i8FlV26S7YmJAUUYkA6U7K5pK5JWd3rvRjmma218qTu9GTdiZNAAKt7RgiV5Q3p4Z y7Ab+t3pkf+Lkdl6mU7kJHZU3XFxl25NsMyZuB0eXajgQQ8Da4p55eZ9tNkf2ZKH7OCI ac1GHaR0fFpfYy2ElLP1yQjk0BGu69pDJ1GTLHk40KqcdNBnmaDnII+CamFUSPdNt/iF bYaHt91AwjL3ymTlV8X9kp8ISESyQOuCfSk6TJAqHiO7ruKOLKWGXwLYIGVVk4VTandE Im3Q== 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:to:from :dkim-signature; bh=5/CiOSfkjWjMtqqZEcZpCs+EVmjBtCRTaDzPf8PAx+4=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=i1GHuTGvrDewFfUeflnhwdts8e//oKqZ+FPoSvxAOB31pcGV9bUKBv1L9OFIBe+RAm MpgK9EA13MSXCKmOZVqP3/NCu2RyGh7npTeDC7hjGGGTv8gsToizhVEcDDH/evXiMPif tps2jq8eoopbIsJfYXvZKYWzz7uIZl948GZb42WWDjsOP1zlLiV9PkYIDSWf+ox/s8wb 4ilwxh+fMPWQ96LaEI/rNf/992lk5YADU2g8Zti+vnK+S48Ot6S1FzRaKcLu78NiLk5C 2xQg5orH0w71yMAIHo4nYU1chCjE3bGkZBz3DKAFmRYUy5ehIcWtyAtDm7tlRg5jYGMV Ph7Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lKCaUAuc; 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 x3-20020a05620a098300b0078d46f2fdcdsi1431981qkx.193.2024.04.05.03.25.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Apr 2024 03:25:53 -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=lKCaUAuc; 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 1rsgl6-0005z6-Nr; Fri, 05 Apr 2024 06:25: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 1rsgl4-0005xk-NJ for qemu-devel@nongnu.org; Fri, 05 Apr 2024 06:25:18 -0400 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rsgkr-0004NN-PQ for qemu-devel@nongnu.org; Fri, 05 Apr 2024 06:25:16 -0400 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-6eced1dab1fso1462824b3a.1 for ; Fri, 05 Apr 2024 03:25:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712312703; x=1712917503; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=5/CiOSfkjWjMtqqZEcZpCs+EVmjBtCRTaDzPf8PAx+4=; b=lKCaUAuctf+nHu7378RzPh/1SAlRwvQMXUV0od/H2oSoeNuFgFeTIVW/NIHIO6ZYAw 5oiKhjyldyI1NYePL6HvHIy8CFGcie15TGDZ9XjNeOorMTHtYUr2pKBiV+rTAcT1CLdX YGz27eesv9ZOtk/FreWTkajtUPHgsTCa1lzTUofXOvpmRhsQY+2oql6oaAZlH5eSRMhw LZOVAP2P/JAtsl1MctJ9IH1qaszKVCoLC0L+LoFNLEc/dzHWgaoypwmp6Stf8GAHiUaB CIZAQKSt48yqUkZgHmjBUey5NgXt1xqipGYTvdcOw7eTvhuIog4VUnBEtUIba1WoORSj 3SAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712312703; x=1712917503; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5/CiOSfkjWjMtqqZEcZpCs+EVmjBtCRTaDzPf8PAx+4=; b=c2lvMC8jpY5U4DxPpwNIdTzoRM2vJnf8Abq7M67OieDI3Sv87gaF0B/vc9hg7rIRLy R4BjYHMn66So/RuDELJU+W3yJOpZFnMigJMiXrcdEScdiMIVin1SrwFMzouUrcT6SDve 0B5eKtbK53k7qJyS7XHR0VXcQxS1Y3tr+srCee6UMDbB67k/ngFuIjyE1mScDM187aZG PqeIy1H30u795ZQnV1tGkDx6dSIcwSyKtCozocT31HN6Q4g3Q5z7bS6qqgIeTeP/GV7d TP4H/7UT/taDXGMbImQfzCc/95RFK5RDqStsicXz2bwkW5Y4f9TImPjVIszBvGUzWP/k dK9Q== X-Gm-Message-State: AOJu0YzvhJlE5XnEj4I3GsR2Tjlxd4LsXVW9uoXkMc0rdcDqZwvOl/iN zD8FOgVlremw7LS+9i5B2ivs7c6WDCjV7qAClsdnGWzQhStrTlc52qWbB/q/9wk69QrP08Bde4R Q X-Received: by 2002:aa7:88d3:0:b0:6e6:970f:a809 with SMTP id k19-20020aa788d3000000b006e6970fa809mr1149843pff.20.1712312703150; Fri, 05 Apr 2024 03:25:03 -0700 (PDT) Received: from stoup.. (098-147-007-212.res.spectrum.com. [98.147.7.212]) by smtp.gmail.com with ESMTPSA id h10-20020a63f90a000000b005e438fe702dsm1104304pgi.65.2024.04.05.03.25.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 03:25:02 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 01/32] accel/tcg: Use vaddr in translator_ld* Date: Fri, 5 Apr 2024 00:24:28 -1000 Message-Id: <20240405102459.462551-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240405102459.462551-1-richard.henderson@linaro.org> References: <20240405102459.462551-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::433; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x433.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, T_SPF_TEMPERROR=0.01 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 Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- include/exec/translator.h | 18 +++++++++--------- accel/tcg/translator.c | 15 ++++++++------- target/hexagon/translate.c | 1 + target/microblaze/translate.c | 1 + target/nios2/translate.c | 1 + 5 files changed, 20 insertions(+), 16 deletions(-) diff --git a/include/exec/translator.h b/include/exec/translator.h index 51624feb10..29804de92e 100644 --- a/include/exec/translator.h +++ b/include/exec/translator.h @@ -19,7 +19,7 @@ */ #include "qemu/bswap.h" -#include "exec/cpu_ldst.h" /* for abi_ptr */ +#include "exec/vaddr.h" /** * gen_intermediate_code @@ -180,14 +180,14 @@ bool translator_io_start(DisasContextBase *db); * the relevant information at translation time. */ -uint8_t translator_ldub(CPUArchState *env, DisasContextBase *db, abi_ptr pc); -uint16_t translator_lduw(CPUArchState *env, DisasContextBase *db, abi_ptr pc); -uint32_t translator_ldl(CPUArchState *env, DisasContextBase *db, abi_ptr pc); -uint64_t translator_ldq(CPUArchState *env, DisasContextBase *db, abi_ptr pc); +uint8_t translator_ldub(CPUArchState *env, DisasContextBase *db, vaddr pc); +uint16_t translator_lduw(CPUArchState *env, DisasContextBase *db, vaddr pc); +uint32_t translator_ldl(CPUArchState *env, DisasContextBase *db, vaddr pc); +uint64_t translator_ldq(CPUArchState *env, DisasContextBase *db, vaddr pc); static inline uint16_t translator_lduw_swap(CPUArchState *env, DisasContextBase *db, - abi_ptr pc, bool do_swap) + vaddr pc, bool do_swap) { uint16_t ret = translator_lduw(env, db, pc); if (do_swap) { @@ -198,7 +198,7 @@ translator_lduw_swap(CPUArchState *env, DisasContextBase *db, static inline uint32_t translator_ldl_swap(CPUArchState *env, DisasContextBase *db, - abi_ptr pc, bool do_swap) + vaddr pc, bool do_swap) { uint32_t ret = translator_ldl(env, db, pc); if (do_swap) { @@ -209,7 +209,7 @@ translator_ldl_swap(CPUArchState *env, DisasContextBase *db, static inline uint64_t translator_ldq_swap(CPUArchState *env, DisasContextBase *db, - abi_ptr pc, bool do_swap) + vaddr pc, bool do_swap) { uint64_t ret = translator_ldq(env, db, pc); if (do_swap) { @@ -228,7 +228,7 @@ translator_ldq_swap(CPUArchState *env, DisasContextBase *db, * re-synthesised for s390x "ex"). It ensures we update other areas of * the translator with details of the executed instruction. */ -void translator_fake_ldb(uint8_t insn8, abi_ptr pc); +void translator_fake_ldb(uint8_t insn8, vaddr pc); /* * Return whether addr is on the same page as where disassembly started. diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c index 38c34009a5..9ac0f52b47 100644 --- a/accel/tcg/translator.c +++ b/accel/tcg/translator.c @@ -13,6 +13,7 @@ #include "exec/exec-all.h" #include "exec/translator.h" #include "exec/plugin-gen.h" +#include "exec/cpu_ldst.h" #include "tcg/tcg-op-common.h" #include "internal-target.h" @@ -290,11 +291,11 @@ static void *translator_access(CPUArchState *env, DisasContextBase *db, return host + (pc - base); } -static void plugin_insn_append(abi_ptr pc, const void *from, size_t size) +static void plugin_insn_append(vaddr pc, const void *from, size_t size) { #ifdef CONFIG_PLUGIN struct qemu_plugin_insn *insn = tcg_ctx->plugin_insn; - abi_ptr off; + size_t off; if (insn == NULL) { return; @@ -311,7 +312,7 @@ static void plugin_insn_append(abi_ptr pc, const void *from, size_t size) #endif } -uint8_t translator_ldub(CPUArchState *env, DisasContextBase *db, abi_ptr pc) +uint8_t translator_ldub(CPUArchState *env, DisasContextBase *db, vaddr pc) { uint8_t ret; void *p = translator_access(env, db, pc, sizeof(ret)); @@ -325,7 +326,7 @@ uint8_t translator_ldub(CPUArchState *env, DisasContextBase *db, abi_ptr pc) return ret; } -uint16_t translator_lduw(CPUArchState *env, DisasContextBase *db, abi_ptr pc) +uint16_t translator_lduw(CPUArchState *env, DisasContextBase *db, vaddr pc) { uint16_t ret, plug; void *p = translator_access(env, db, pc, sizeof(ret)); @@ -340,7 +341,7 @@ uint16_t translator_lduw(CPUArchState *env, DisasContextBase *db, abi_ptr pc) return ret; } -uint32_t translator_ldl(CPUArchState *env, DisasContextBase *db, abi_ptr pc) +uint32_t translator_ldl(CPUArchState *env, DisasContextBase *db, vaddr pc) { uint32_t ret, plug; void *p = translator_access(env, db, pc, sizeof(ret)); @@ -355,7 +356,7 @@ uint32_t translator_ldl(CPUArchState *env, DisasContextBase *db, abi_ptr pc) return ret; } -uint64_t translator_ldq(CPUArchState *env, DisasContextBase *db, abi_ptr pc) +uint64_t translator_ldq(CPUArchState *env, DisasContextBase *db, vaddr pc) { uint64_t ret, plug; void *p = translator_access(env, db, pc, sizeof(ret)); @@ -370,7 +371,7 @@ uint64_t translator_ldq(CPUArchState *env, DisasContextBase *db, abi_ptr pc) return ret; } -void translator_fake_ldb(uint8_t insn8, abi_ptr pc) +void translator_fake_ldb(uint8_t insn8, vaddr pc) { plugin_insn_append(pc, &insn8, sizeof(insn8)); } diff --git a/target/hexagon/translate.c b/target/hexagon/translate.c index f163eefe97..c9bf0e7508 100644 --- a/target/hexagon/translate.c +++ b/target/hexagon/translate.c @@ -24,6 +24,7 @@ #include "exec/helper-proto.h" #include "exec/translation-block.h" #include "exec/log.h" +#include "exec/cpu_ldst.h" #include "internal.h" #include "attribs.h" #include "insn.h" diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index 4e52ef32db..916afd4dec 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -25,6 +25,7 @@ #include "tcg/tcg-op.h" #include "exec/helper-proto.h" #include "exec/helper-gen.h" +#include "exec/cpu_ldst.h" #include "exec/translator.h" #include "qemu/qemu-print.h" diff --git a/target/nios2/translate.c b/target/nios2/translate.c index 7ddc6ac1a2..9c3958a0ba 100644 --- a/target/nios2/translate.c +++ b/target/nios2/translate.c @@ -32,6 +32,7 @@ #include "exec/translator.h" #include "qemu/qemu-print.h" #include "semihosting/semihost.h" +#include "exec/cpu_ldst.h" #define HELPER_H "helper.h" #include "exec/helper-info.c.inc"