From patchwork Fri Nov 15 15:20:50 2024 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: 843498 Delivered-To: patch@linaro.org Received: by 2002:adf:9bcc:0:b0:382:184f:390f with SMTP id e12csp898755wrc; Fri, 15 Nov 2024 07:22:34 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXzwpXxZy81OZvk8rPaqnYV0KqPp0TOcikqSHZhBTUfjZ2jkU85RsQiciKZoYnl8BNcK7745Q==@linaro.org X-Google-Smtp-Source: AGHT+IEty6fmU2dIJvYJoFF4+tMYMe0R9fmTeuYWswm9BDyU8LFx/oDGZ4pOLVOV8q4EWytUni1l X-Received: by 2002:ac8:57cb:0:b0:463:5a70:4cb8 with SMTP id d75a77b69052e-46363e0580cmr40865561cf.17.1731684154531; Fri, 15 Nov 2024 07:22:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1731684154; cv=none; d=google.com; s=arc-20240605; b=SQ22K9NTv3p7h0SXFv0775yfm+zP/ly00DT+iO8FNgu3za1+5Gp10NTg8o57XcWqC/ 7hg4ZThjrkhWyJeD0QRp3zcrUsDFC5fio1KKxCZwlNipM7gPzlUP3f4NF8dAryjr19Rd QMy4NW5gGJQNgR55+RauKpz+bwvqUojRnLG6QTCYYEUDYuRNrNnaqfltaEHrN6ji2dxo hYnwSdrwGgHm8RVzxwCgLuSOqqSc+HnVfhYO+M2SSFAvx1uNYFS/j1cKjXcqjzzl6huk qUjKbjJx7YTbadvB0mcAHsIBzVKZUbaiKWZR6QFbLXzSiuncEYVkVONP/nUAdZ2k24RU o6aQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=u5wTkh/tztyRKNsfUcuDCaLezbrFiqbSDF32QCsIdnM=; fh=ZXDWg7hKG7Hj19AbRuutTLw+Zvn/B9RsGUUw/YagpFI=; b=AbAQBOSW3/NyS5dOB3kY0HgNe9Pu97d08m8VFiebxFxxnFmdPD2cu2bPE0quX7R00F UkXttLoJJ0ILI7FcFl5ObDGGJ8uOscVBMAzPHTTyZy5OpLSPmA6TfGzNBj68+PGb82tr pcsmwW2S9K6EJ3NU93Ng89RChajRor/QswHxlQ9F3xM9zPhDBC8fsVmB+NMYbFP3lbTI Dfgr0oiBN5SDKBWAcTtHIxUeSfH+LfAZtwF4HejO3tb1eUaYSRs+l5QB4J8IJO+PfxFa N1AMR0NzZr/Vs02VNYA4JlnC0Lv73R60b2p8/u1Ll0CwDa+hWCMBAyS4efjoocfyvZgw we7w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lTJLxhxo; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-4635a9cb266si36777981cf.179.2024.11.15.07.22.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Nov 2024 07:22:34 -0800 (PST) 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=lTJLxhxo; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tBy8i-0002ga-0s; Fri, 15 Nov 2024 10:21:40 -0500 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 1tBy8f-0002Wu-QZ for qemu-devel@nongnu.org; Fri, 15 Nov 2024 10:21:37 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tBy8e-000485-26 for qemu-devel@nongnu.org; Fri, 15 Nov 2024 10:21:37 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-43168d9c6c9so16090545e9.3 for ; Fri, 15 Nov 2024 07:21:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1731684092; x=1732288892; darn=nongnu.org; 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=u5wTkh/tztyRKNsfUcuDCaLezbrFiqbSDF32QCsIdnM=; b=lTJLxhxoldrbF3mcvntkIDDDmt2DAPDfZuZgPLYKoVYqN0WGkf6/EHJyjjsFEAlxZb SKZZkhSWR2258yoiTdwiYbN+tHk+lHo7sGdityBF2CLtwu175wz6wrgs1BG/jyK9niq3 Ns0z89k4wxzx3Gh1SKZ60kpvyvTOAFju86NWAicQgT7ZXpcwg6cKSYJDoZorAWh5laZ1 5MfF0JPJRZeJ4hWBYZrA9PdnKrf/3zv5H+t9vGMs2QayMxrPUELny9pxFuAKvasnueu9 eSq9a16+uT/3Wx4MbVC79KsmyfW2hCpFoeTPAkjfOULoncusKdIMcPZP62xJf4hI6uMG HP/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731684092; x=1732288892; 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=u5wTkh/tztyRKNsfUcuDCaLezbrFiqbSDF32QCsIdnM=; b=IR35S5K3JjyRJKwXXVYjuvDqYuaSvi45G/ALjb7wEoycoTVZLm7wg/t6RUQqG0WgSA vAKXHsTNznl7PmwIRA+zpKInMeQTS8L6LD9ixenVxUd373ZNH3f0995KWKEcgR8XvMet 3eXwalyg7SHhkGd5PZZ2fNHr0/fbmyvbUX9huK9HlzWWxcFYn4v06bdrDR8JRiJpgR5C cZWfAbwLfdTNAetWiUm2ZtLjdHvnXbBbvuD0Xqs/Nb6tAZWiImuqnUAOGhXox1M3u/kM 3U1LIGZLnB1eNXxIowx11mn5sxfB0YkugXANVO2ML9RV+Y5z5h11HS0a8nEcv/1b8/Hf liXQ== X-Gm-Message-State: AOJu0YxHNqaX8VnzGrEs48PpzDsPGFKANZq6Kle0O7gdahwFUxQ3CUW9 tqPkMb+Xc03qro0UM4n870RjUHHHWojphx9FFRZ6zXkrIO0I+yEens1jAxAQtX+yBs+2lEZIreB R X-Received: by 2002:a05:600c:1387:b0:42c:b45d:4a7b with SMTP id 5b1f17b1804b1-432df78a971mr24952685e9.25.1731684092591; Fri, 15 Nov 2024 07:21:32 -0800 (PST) Received: from localhost.localdomain ([176.187.214.209]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-432da24459bsm61825705e9.6.2024.11.15.07.21.31 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 15 Nov 2024 07:21:31 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= Subject: [PATCH 07/10] accel/tcg: Reduce log_pc() declaration scope Date: Fri, 15 Nov 2024 16:20:50 +0100 Message-ID: <20241115152053.66442-8-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241115152053.66442-1-philmd@linaro.org> References: <20241115152053.66442-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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 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 log_pc() is only used in cpu-exec.c, move it there. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Peter Maydell Reviewed-by: Richard Henderson --- accel/tcg/internal-target.h | 10 ---------- accel/tcg/cpu-exec.c | 10 ++++++++++ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/accel/tcg/internal-target.h b/accel/tcg/internal-target.h index fe109724c6..750b3706b1 100644 --- a/accel/tcg/internal-target.h +++ b/accel/tcg/internal-target.h @@ -71,16 +71,6 @@ G_NORETURN void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr); bool tb_invalidate_phys_page_unwind(tb_page_addr_t addr, uintptr_t pc); -/* Return the current PC from CPU, which may be cached in TB. */ -static inline vaddr log_pc(CPUState *cpu, const TranslationBlock *tb) -{ - if (tb_cflags(tb) & CF_PCREL) { - return cpu->cc->get_pc(cpu); - } else { - return tb->pc; - } -} - /** * tcg_req_mo: * @type: TCGBar diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 033f5fab10..73bc9f00f7 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -433,6 +433,16 @@ const void *HELPER(lookup_tb_ptr)(CPUArchState *env) return tb->tc.ptr; } +/* Return the current PC from CPU, which may be cached in TB. */ +static inline vaddr log_pc(CPUState *cpu, const TranslationBlock *tb) +{ + if (tb_cflags(tb) & CF_PCREL) { + return cpu->cc->get_pc(cpu); + } else { + return tb->pc; + } +} + /* Execute a TB, and fix up the CPU state afterwards if necessary */ /* * Disable CFI checks.