From patchwork Tue May 23 13:53:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 684957 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1732758wrt; Tue, 23 May 2023 06:57:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5xvQHFACW038MEK5uTxx9W4EFZVJzq6gm67AwIK9Ib+M2JdSUx54KKgNDzzu1xaY1zfV2E X-Received: by 2002:a05:620a:95d:b0:75b:23a1:8e31 with SMTP id w29-20020a05620a095d00b0075b23a18e31mr3690839qkw.2.1684850240038; Tue, 23 May 2023 06:57:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684850240; cv=none; d=google.com; s=arc-20160816; b=QhXGGiQIwk8j4jn+YwS0VIGri0XoYL/+98P2TWrGWv7MOfz0V+g9NRu8G05yG0TkBJ ssb94w1xNus061fLkY1iMUTevjYSjx7ly8VKOREhdP5OLUJCYp4B87pYpoxeGPcoKXh1 /Qr9WxUVqkFvK5jYf+mM5DMp94Sff/ALHDIgLAzlet/vIJ/KItaI9P9IHjBJr+U6UMR8 ITmD9Tc1oSBmsSjWPtBrwl9K4DQ4CoMCYHr3FkoG8/sBmMeN1qEhOi47CMlpLq6vNgjb HZRIekxBVn8dpNgBygT2hNjO6JOBeaOfqz3Lxrmwb3m7Jib/+CBhhbr/YQ/WS91xQfEL oL0Q== 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=Eu9NQtb2FUQWFu9rVl+RtTj4i7Vm9wmVlC22z1EyvKw=; b=nXLGUjg9/cvGyuBByztdXk4N7YJ3NTa7AHBF1oS/qBW3Ht3djUymwtEqjOecUkd2VK yWAKdyFN5ViT9tfev5Y4U9h77m26zskgtLNRK5RRFWeLACoI70KHJJODKX1l9DBeXkTW 5p0kA3oLR5/vgHddLZpff5leyV/5mLCsFiHnSJXcPUoR5/NTnVmIB13lyKpNigv6tZll gEX0jb8F9Tj+OF7sT1sQ69sKanqsq6WxR4k6nqW2rCEs30soQziXpI27N3fot/tIXHWC i3STqupHUDTGgadQwhQIw5kJrFubBDcB3i8QJvxJIg1ZZW7GWj0DVFpF0lnVfc+mI8Hg Tr6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="E/wbr1Ur"; 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 bn48-20020a05620a2af000b00753e1f61a0bsi4763409qkb.777.2023.05.23.06.57.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 May 2023 06:57:20 -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="E/wbr1Ur"; 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 1q1STY-0008ST-B2; Tue, 23 May 2023 09:54:56 -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 1q1SSX-00057f-03 for qemu-devel@nongnu.org; Tue, 23 May 2023 09:53:54 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q1SSV-00038b-DD for qemu-devel@nongnu.org; Tue, 23 May 2023 09:53:52 -0400 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-64d3e5e5980so4971099b3a.2 for ; Tue, 23 May 2023 06:53:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684850030; x=1687442030; 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=Eu9NQtb2FUQWFu9rVl+RtTj4i7Vm9wmVlC22z1EyvKw=; b=E/wbr1Urw+1b0wYhdpsyx/a7B28ufV68QreggBfw9CTKCvrSGbaTy9GadpwxTiziAT tuwFgFh7Bi+BGQyiJp97KBmZ8hjglsbedBljdmH+NLmEvF0Rdz+a9Ld6oJNjHVgW62uL BibcwdonmPwiJnFztqvPeomjJym1LbFEcy74BXyFVHUuhva2QdW1KaDNV9Do0Y+zx80m ROMywTwWYEPtwxX1iqaTne6z8ILx0Gx/2zZmRUf/Dhk4yzSa8Z0yw3WYg9kY40G1HvzJ vVTyJxWcJlHLvJGk9xkPlsSIjRN5rvYfgesibMBDB9vZKYbpn8XeoX+eL4nA+vNkHLzh Abrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684850030; x=1687442030; 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=Eu9NQtb2FUQWFu9rVl+RtTj4i7Vm9wmVlC22z1EyvKw=; b=c0naECXXRQVZeNRP1PmiskGW4hdWPixO+YKkSitZFzsfjWVst3roVuLExxqQaS7xIa UT87mtc6zZM3bf2aWNvrjS2axBVMONWmQyHND6JoGQJhn1t2hT/XF4i7Ir143OgImhLT cQYTctTJoErAQX6YcwX5ajamd+Zj2uBqfGe4jXkb/Jw2S6m9E5578vqMvMpxEZ0WLI1N uI670kUbMQkmnyBs/XroIO1AlUVhDsISUYIm+8JYpCzKE0qdrVoFatUahYhuw3Tx0/je 3H7jZyBI0Ole/pjSGqyMqiqS12+BjVrhLXdgGNRxAbBOvrSr90LXUl19MASvUvo+vk96 UEfA== X-Gm-Message-State: AC+VfDy4fAEqYdc19vYDgq0PrdKPc1V32NzkdRPaJPfbBUWOBAwjVAgA h8Kzfh3ORqDOSljzChp5GZ0DauTfiujANA+OKSM= X-Received: by 2002:a05:6a00:2d04:b0:64f:4812:8c7e with SMTP id fa4-20020a056a002d0400b0064f48128c7emr1527332pfb.19.1684850030153; Tue, 23 May 2023 06:53:50 -0700 (PDT) Received: from stoup.. ([2602:ae:1598:4c01:c13a:d73:4f88:3654]) by smtp.gmail.com with ESMTPSA id b8-20020aa78708000000b0064d27a28451sm5796111pfo.100.2023.05.23.06.53.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 06:53:49 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 32/52] exec-all: Widen TranslationBlock pc and cs_base to 64-bits Date: Tue, 23 May 2023 06:53:02 -0700 Message-Id: <20230523135322.678948-33-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230523135322.678948-1-richard.henderson@linaro.org> References: <20230523135322.678948-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x432.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=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 makes TranslationBlock agnostic to the address size of the guest. Use vaddr for pc, since that's always a virtual address. Use uint64_t for cs_base, since usage varies between guests. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- include/exec/exec-all.h | 4 ++-- accel/tcg/cpu-exec.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 8c8526d9f8..58ac1a91c2 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -519,7 +519,7 @@ struct TranslationBlock { * Unwind information is taken as offsets from the page, to be * deposited into the "current" PC. */ - target_ulong pc; + vaddr pc; /* * Target-specific data associated with the TranslationBlock, e.g.: @@ -528,7 +528,7 @@ struct TranslationBlock { * s390x: instruction data for EXECUTE, * sparc: the next pc of the instruction queue (for delay slots). */ - target_ulong cs_base; + uint64_t cs_base; uint32_t flags; /* flags defining in which context the code was generated */ uint32_t cflags; /* compile flags */ diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index bc0e1c3299..9fe07c31fb 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -302,7 +302,7 @@ static void log_cpu_exec(target_ulong pc, CPUState *cpu, { if (qemu_log_in_addr_range(pc)) { qemu_log_mask(CPU_LOG_EXEC, - "Trace %d: %p [" TARGET_FMT_lx + "Trace %d: %p [%08" PRIx64 "/" TARGET_FMT_lx "/%08x/%08x] %s\n", cpu->cpu_index, tb->tc.ptr, tb->cs_base, pc, tb->flags, tb->cflags, lookup_symbol(pc));