From nobody Thu Apr 10 00:20:10 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1687794480; cv=none; d=zohomail.com; s=zohoarc; b=OqxTcMm33KUokgTIhDvcGQQMSAiqGyGyaF+K+EDSEL8EK5NVVuuQb4tZmZU7/kqOYgp6++6riiY65YGPyuvvsSILiau6TzZF3lFUPVIGA1w3+1KcvfgAFLCD3RDt++KNFMol8EkbswofB0ja4S1U4meWprvo4YRJeUh75s9l15g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1687794480; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=HG5rz65U57sVq58UVLRV5u9TWpEQiOWql+ZKzfQsiSQ=; b=SejK2/zfNRlplRAQrNsyWUifWZ7FAoQsaEDy8j1gGOJsTmIV2UopgvL7n8JXSRneOp3DZEkgzzSBLeFTtkoXLweLGBHNZaVyCBDKVxgrhmlHutieQr7MuS7Pa5KaNizKU5MOwBDNw8Yt1D+hQsIlxxtrOFbmF5o2qUTZzios0Jc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1687794480235748.1726982736692; Mon, 26 Jun 2023 08:48:00 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qDoKu-0001kK-VW; Mon, 26 Jun 2023 11:41:05 -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 1qDoJp-0000HO-8b for qemu-devel@nongnu.org; Mon, 26 Jun 2023 11:39:57 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qDoJk-0002o9-Lr for qemu-devel@nongnu.org; Mon, 26 Jun 2023 11:39:56 -0400 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-313f18f5295so1388475f8f.3 for ; Mon, 26 Jun 2023 08:39:51 -0700 (PDT) Received: from localhost.localdomain ([139.47.42.170]) by smtp.gmail.com with ESMTPSA id t1-20020adfe441000000b00313f45f74a8sm2164178wrm.103.2023.06.26.08.39.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jun 2023 08:39:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687793990; x=1690385990; 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=HG5rz65U57sVq58UVLRV5u9TWpEQiOWql+ZKzfQsiSQ=; b=f+AaW4ascJw8x06Rp787solyLQSHPozmdX53zKXcx3A04gUqTOeGMN1dkAYpexSaUE Tymo9IyyB0B2lrwi2ACdnjlgCvkdRaqJdw0GIpoZ9r0KfQ+roIci2kcOqTj23qXuP1O7 MXUWEqVfGAc6PiN9eO+SjAtBPmu9i7R1+8FAIqWBGaa35uWNMihIHbzrx0wcJQkq71cb oM9F4EXtyxNHNC3mhwIZE2HTok8vtKEBuumynzIL6CkeY2RsUHqwJN9cQ79JV6g0mS1E PxyJck/VHuv9oolD4k8XScf4qYMUgG48pEMAl3wddAz0GM84W3r40hiBSBXtwlESQAtc Cyyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687793990; x=1690385990; 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=HG5rz65U57sVq58UVLRV5u9TWpEQiOWql+ZKzfQsiSQ=; b=UeIVdnXAE68MZJwFLvvQqYt0WeaNBzyFg5BIomXXdMeEjY/xSbQGILq/b1TtEcffib ZsU4CeRVsA+ZrjyNPb36FMxI58OcwIDkbCrM8ScAoYzkZe8Gfu3SPsDAeEObSVF/0V7n wu+o2zZoK/iNWzEcWkI2MZI9SJ2dfrgDwknebyzNzFgVhjpfB5+HlQWaa2QyOKqF0Bjt aSncZaxkuByWinNNnlDtz79I4bmLXXKyTryT2BujK7zuDYKI+nYbMt5M8D4N0K1H7h9V gfR0NtxhNJE3T1Rxr9mg0F0w+dVQSI2Os2dMC+ZOxp37fMyP5r/hdmYte+LlBBoN2+Rf aNPg== X-Gm-Message-State: AC+VfDyn2WGm79Vb6pa9Cuj8OqdywIhYPBcs6N9Dor3M9omSAkO/bkXD FK89Q2m8pB8Y24sAk0Pzh16o0sKmbXvGF4pLHOg0T2F4 X-Google-Smtp-Source: ACHHUZ5SxM1D/tYVf+yv+KaWdz23sBBs5Sh/Iw+blVZy6zluZPbzuVrdUR6Un1Io8v5VZBdIH1tK4Q== X-Received: by 2002:a5d:6982:0:b0:313:e591:94ec with SMTP id g2-20020a5d6982000000b00313e59194ecmr6431523wru.67.1687793990324; Mon, 26 Jun 2023 08:39:50 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Anton Johansson Subject: [PULL 06/22] accel/tcg/cpu-exec.c: Widen pc to vaddr Date: Mon, 26 Jun 2023 17:39:29 +0200 Message-Id: <20230626153945.76180-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230626153945.76180-1-richard.henderson@linaro.org> References: <20230626153945.76180-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=richard.henderson@linaro.org; helo=mail-wr1-x429.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1687794481180100001 Content-Type: text/plain; charset="utf-8" From: Anton Johansson Signed-off-by: Anton Johansson Reviewed-by: Richard Henderson Message-Id: <20230621135633.1649-7-anjo@rev.ng> Signed-off-by: Richard Henderson --- accel/tcg/cpu-exec.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 4d952a6cc2..ba1890a373 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -169,8 +169,8 @@ uint32_t curr_cflags(CPUState *cpu) } =20 struct tb_desc { - target_ulong pc; - target_ulong cs_base; + vaddr pc; + uint64_t cs_base; CPUArchState *env; tb_page_addr_t page_addr0; uint32_t flags; @@ -193,7 +193,7 @@ static bool tb_lookup_cmp(const void *p, const void *d) return true; } else { tb_page_addr_t phys_page1; - target_ulong virt_page1; + vaddr virt_page1; =20 /* * We know that the first page matched, and an otherwise valid= TB @@ -214,8 +214,8 @@ static bool tb_lookup_cmp(const void *p, const void *d) return false; } =20 -static TranslationBlock *tb_htable_lookup(CPUState *cpu, target_ulong pc, - target_ulong cs_base, uint32_t f= lags, +static TranslationBlock *tb_htable_lookup(CPUState *cpu, vaddr pc, + uint64_t cs_base, uint32_t flags, uint32_t cflags) { tb_page_addr_t phys_pc; @@ -238,9 +238,9 @@ static TranslationBlock *tb_htable_lookup(CPUState *cpu= , target_ulong pc, } =20 /* Might cause an exception, so have a longjmp destination ready */ -static inline TranslationBlock *tb_lookup(CPUState *cpu, target_ulong pc, - target_ulong cs_base, - uint32_t flags, uint32_t cflags) +static inline TranslationBlock *tb_lookup(CPUState *cpu, vaddr pc, + uint64_t cs_base, uint32_t flags, + uint32_t cflags) { TranslationBlock *tb; CPUJumpCache *jc; @@ -292,13 +292,13 @@ static inline TranslationBlock *tb_lookup(CPUState *c= pu, target_ulong pc, return tb; } =20 -static void log_cpu_exec(target_ulong pc, CPUState *cpu, +static void log_cpu_exec(vaddr pc, CPUState *cpu, const TranslationBlock *tb) { if (qemu_log_in_addr_range(pc)) { qemu_log_mask(CPU_LOG_EXEC, "Trace %d: %p [%08" PRIx64 - "/" TARGET_FMT_lx "/%08x/%08x] %s\n", + "/%" VADDR_PRIx "/%08x/%08x] %s\n", cpu->cpu_index, tb->tc.ptr, tb->cs_base, pc, tb->flags, tb->cflags, lookup_symbol(pc)); =20 @@ -323,7 +323,7 @@ static void log_cpu_exec(target_ulong pc, CPUState *cpu, } } =20 -static bool check_for_breakpoints_slow(CPUState *cpu, target_ulong pc, +static bool check_for_breakpoints_slow(CPUState *cpu, vaddr pc, uint32_t *cflags) { CPUBreakpoint *bp; @@ -389,7 +389,7 @@ static bool check_for_breakpoints_slow(CPUState *cpu, t= arget_ulong pc, return false; } =20 -static inline bool check_for_breakpoints(CPUState *cpu, target_ulong pc, +static inline bool check_for_breakpoints(CPUState *cpu, vaddr pc, uint32_t *cflags) { return unlikely(!QTAILQ_EMPTY(&cpu->breakpoints)) && @@ -485,10 +485,10 @@ cpu_tb_exec(CPUState *cpu, TranslationBlock *itb, int= *tb_exit) cc->set_pc(cpu, last_tb->pc); } if (qemu_loglevel_mask(CPU_LOG_EXEC)) { - target_ulong pc =3D log_pc(cpu, last_tb); + vaddr pc =3D log_pc(cpu, last_tb); if (qemu_log_in_addr_range(pc)) { - qemu_log("Stopped execution of TB chain before %p [" - TARGET_FMT_lx "] %s\n", + qemu_log("Stopped execution of TB chain before %p [%" + VADDR_PRIx "] %s\n", last_tb->tc.ptr, pc, lookup_symbol(pc)); } } @@ -882,8 +882,8 @@ static inline bool cpu_handle_interrupt(CPUState *cpu, } =20 static inline void cpu_loop_exec_tb(CPUState *cpu, TranslationBlock *tb, - target_ulong pc, - TranslationBlock **last_tb, int *tb_ex= it) + vaddr pc, TranslationBlock **last_tb, + int *tb_exit) { int32_t insns_left; =20 --=20 2.34.1