From patchwork Mon Jun 26 15:39:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 696465 Delivered-To: patch@linaro.org Received: by 2002:adf:e885:0:0:0:0:0 with SMTP id d5csp3300481wrm; Mon, 26 Jun 2023 08:48:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4KySXqQkb3JUHEdVZNloGcrl7FiNS/nPWlQZf17wLBYR3iKJsesxqE+lQyzfwqHXxH5H7o X-Received: by 2002:a05:620a:450d:b0:75b:23a0:e7ce with SMTP id t13-20020a05620a450d00b0075b23a0e7cemr38158996qkp.47.1687794480793; Mon, 26 Jun 2023 08:48:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687794480; cv=none; d=google.com; s=arc-20160816; b=i9CHZ4nIr+oYaTjiedU6s796GHMAb35cwveCjT72xXXzIMx2AI8G0lsMBd92ZwrmLM iQ91maDIH5hgWNqNSgNATKOtRjtENRCb7YkPcI9JSXhA/igf88pnWxIPmuK6ZCsrZvbY kLboQVUymZumwbmoIInOacg6RtpkFWDcWiQsTgSbfzOTBpNBvCU2HuhNRIG8cvaEF40N 9SsA7Xh59rWkpo/M1MSaxzAr4vBWLkYRhheDMBg1KyWyahDWJ1cC1f7fgmNLY3WlhYKM abQZLk0/weL69KB3/EYlMcWBdpIDRpyjKKizmGKc3jPlmA3YVQD/w09sjWCdrGssZUC4 N1yA== 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=HG5rz65U57sVq58UVLRV5u9TWpEQiOWql+ZKzfQsiSQ=; fh=l3rThTWYtfg9kQ3pwkdseR7wGfUMT6wsJF5cqMswxYY=; b=c7h70uymjJ/hc0ng77mDLl4VtkhK80n9i5H7Q9W5EWg328WimsySV/kea1Lb7fGmVS aVJyMRBTHyOol8MMa3nLieHAAj/El0vkuLeQcvftst+T8EO/YUtfzyiEuIoJHcEGY1ld PJL73Vf8pRRqjpuIy66vdIstVxNaCrIYMIKpy4tqONB8Jt1dZ7bJA94wXas971u1+x23 Rah25bT16c1xfEdzYDbwDM465jNKfPGPjxI7nJxPVAVxBLahXnTAE4Fq/j9znxgVg3Td ElWwct65BAz1dznq5zvMTUgPTZ8qbet/N76ScYByOyVV7ENWDboIxfmTp6TQSxewI8RK KVSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=f+AaW4as; 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 uw7-20020a05620a4d8700b007594108539esi2058606qkn.125.2023.06.26.08.48.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 26 Jun 2023 08:48:00 -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=f+AaW4as; 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 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) 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-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) 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) 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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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) } 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; /* * 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; } -static TranslationBlock *tb_htable_lookup(CPUState *cpu, target_ulong pc, - target_ulong cs_base, uint32_t flags, +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, } /* 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 *cpu, target_ulong pc, return tb; } -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)); @@ -323,7 +323,7 @@ static void log_cpu_exec(target_ulong pc, CPUState *cpu, } } -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, target_ulong pc, return false; } -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 = log_pc(cpu, last_tb); + vaddr pc = 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, } static inline void cpu_loop_exec_tb(CPUState *cpu, TranslationBlock *tb, - target_ulong pc, - TranslationBlock **last_tb, int *tb_exit) + vaddr pc, TranslationBlock **last_tb, + int *tb_exit) { int32_t insns_left;