From patchwork Wed Jan 24 07:56:06 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: 765622 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:10c4:b0:337:62d3:c6d5 with SMTP id b4csp1993163wrx; Tue, 23 Jan 2024 23:57:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IEY5o9vwiLMNa4TPVZijL5fQU9q1eTiunZv3HhiOG4VqezqjuAl+B+EmYq4gElLyScw56mc X-Received: by 2002:a05:620a:4485:b0:783:b7a5:c29b with SMTP id x5-20020a05620a448500b00783b7a5c29bmr81522qkp.66.1706083035171; Tue, 23 Jan 2024 23:57:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706083035; cv=none; d=google.com; s=arc-20160816; b=oXhRqImbBvU+2JqIJuuvIFMrF3wNDZ2k1BYJDUYIQ1yNWdb1iBGRwiXx707nZaJ2H+ gn2rUN4kUPORQPrU9sk0RrV/cDwEmjwJNaPOOibmEpoB624IIQyeJcEimnRSopY9CQvz XFMgZ7RwJTtKXHnx6xnI23oZsG2yrh4XYjMAZR6rXBOXn0G3gf9a5u2dZSTn/o0ASja0 t5iW0J+XJ+FSL6Nn5CgHiEi0f7t5Yv6Sv/42zLW61g5sSVXom+B1R04jPgcmhm+aZAdi DpABW1w7YAIjvfyvn4j0Zw4He5pHTQe+A7CsmH4EcwRQIptLfl6OQGDA+Lr7Z35jFYvz fi1A== 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=hGEZ+UuvywEJsfyGGnlTWqRmH+qv3Bs4CRVZRGITqsY=; fh=B50oqVc00OWaVdizTqYR6m8+DZOaWemCvxBHsGRcQPg=; b=qiY1bqKHeMp2cY08Z/BJTbofy3sP7teUJKNQdnFTUMx9/w5x9VAVbiwB/ryRA/Bvcl Gn64kmQ5ivvjP4BQvLEGSztuMcReh9hYgyvKXKwulRW6PJOJQzX42UmnT0tkwFFBU2Ux R0jaslh7q3JCTWfDPG+bSUoz+ayNxSMwhsZjN9c/DxWezQ/Rhbz/MhJZRcrHvaIF7oMc l7Uxyl44CO4Il5c57tsAmPIa8rB9lyVrPw2EkXQGjYbw2ZHiwUuhwy5GnlMUZ/re8idn I2w15gd0Fd5WwH0+2bFfF+EMzzq7fpM6U1BvgtvkxGAJRIkqVVoEXgsFnjULk2xUTNN1 RGDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vORECSnx; 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 b28-20020a05620a04fc00b00783b14a9eacsi1697612qkh.140.2024.01.23.23.57.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Jan 2024 23:57:15 -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=vORECSnx; 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 1rSY7T-0001S7-He; Wed, 24 Jan 2024 02:56:23 -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 1rSY7S-0001Rl-8H for qemu-devel@nongnu.org; Wed, 24 Jan 2024 02:56:22 -0500 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSY7P-0005ST-M1 for qemu-devel@nongnu.org; Wed, 24 Jan 2024 02:56:22 -0500 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-a3082d450adso312069666b.1 for ; Tue, 23 Jan 2024 23:56:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706082978; x=1706687778; 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=hGEZ+UuvywEJsfyGGnlTWqRmH+qv3Bs4CRVZRGITqsY=; b=vORECSnxiN7LOZfyCygpaLV5zOFahBtHgieiPedPKBsFmPbBaQ6tTNpzWq857tT6Vi LzL6PiQ62eOsbrMOlxmG5nfyiAr63FwiDbu/9wth4CfQtAVJTCQWe+KUn7uBGjKm/bzT /p82vCNvvRcaCHNtuvpYRNqrsmkQERqPuZ3hoXsEmumLxV12kcOfA/qOC3bgkc9twyoY C29l6pF79HqGMGRorhyEgakYMnepRcYTub+HV1iG9yGrTMdZnQZIfBvDJX5TourJ+eaG jp2iRlXOAPb+PHOWtDlap5L9mFFUjkIGwAy4pDPqD5MgJfURNY1t+TX86XYn56roRFpC ew7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706082978; x=1706687778; 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=hGEZ+UuvywEJsfyGGnlTWqRmH+qv3Bs4CRVZRGITqsY=; b=hcp1wfvSO/l1C00lqHumR6h2QcGQrxBI3rWjkr+y488ptgzfq7AFHgCgTPhA4jDvsE EbVs2lBDHGKQPUYLc6yfrXnQDvaUngVLCzQlnr5M1iKp0wPoxYqVATn2MG/Pe2lXO5Vx n87Id3hNWZx99IoNZWWyjQ2zrsGz5SyBCRVjQlzutgqr1q8IBBX+Z/NC2Tcdt/l7jhku PPwomeCdoy05ZNPIex2TI12iKrgR6fGWkEtnldHkVxrEqS5mryLJeBlztNEtOJ4C1VWO pl4tVaik0RTqfGbB3I6EqZY8OYNLsekoJzjNlXE1v6GoMYs9DOcvvSfwGjkqTUUQs3wx fqCg== X-Gm-Message-State: AOJu0YzfhpIR6hVyxvszk6tt0TZXcgHpCjXNvdotrxAitxqz+BLG1zeL KZNe6dvJlU2Tuew8NHaxqIQLpG6lyM/BdU8ZkI981Eql0JFEkqquv7We3yCCR3A75ZBy9Jxb9OX A X-Received: by 2002:a17:907:d309:b0:a31:35c2:9238 with SMTP id vg9-20020a170907d30900b00a3135c29238mr116943ejc.107.1706082977941; Tue, 23 Jan 2024 23:56:17 -0800 (PST) Received: from m1x-phil.lan (lgp44-h02-176-184-8-67.dsl.sta.abo.bbox.fr. [176.184.8.67]) by smtp.gmail.com with ESMTPSA id cu15-20020a170906ba8f00b00a2ec877d3a6sm8212455ejd.167.2024.01.23.23.56.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 23 Jan 2024 23:56:17 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Paolo Bonzini , Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Xu , David Hildenbrand Subject: [PATCH v5 1/4] target: Make qemu_target_page_mask() available for *-user Date: Wed, 24 Jan 2024 08:56:06 +0100 Message-ID: <20240124075609.14756-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240124075609.14756-1-philmd@linaro.org> References: <20240124075609.14756-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::636; envelope-from=philmd@linaro.org; helo=mail-ej1-x636.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: Ilya Leoshkevich Currently qemu_target_page_mask() is usable only from the softmmu code. Make it possible to use it from the *-user code as well. Make use of it in perf.c. Signed-off-by: Ilya Leoshkevich Message-ID: <20231208003754.3688038-2-iii@linux.ibm.com> Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- accel/tcg/perf.c | 3 ++- system/physmem.c | 5 ----- target/target-common.c | 10 ++++++++++ target/meson.build | 2 ++ 4 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 target/target-common.c diff --git a/accel/tcg/perf.c b/accel/tcg/perf.c index cd1aa99a7e..ba75c1bbe4 100644 --- a/accel/tcg/perf.c +++ b/accel/tcg/perf.c @@ -10,6 +10,7 @@ #include "qemu/osdep.h" #include "elf.h" +#include "exec/target_page.h" #include "exec/exec-all.h" #include "qemu/timer.h" #include "tcg/tcg.h" @@ -335,7 +336,7 @@ void perf_report_code(uint64_t guest_pc, TranslationBlock *tb, /* FIXME: This replicates the restore_state_to_opc() logic. */ q[insn].address = gen_insn_data[insn * start_words + 0]; if (tb_cflags(tb) & CF_PCREL) { - q[insn].address |= (guest_pc & TARGET_PAGE_MASK); + q[insn].address |= (guest_pc & qemu_target_page_mask()); } else { #if defined(TARGET_I386) q[insn].address -= tb->cs_base; diff --git a/system/physmem.c b/system/physmem.c index cc68a79763..5e66d9ae36 100644 --- a/system/physmem.c +++ b/system/physmem.c @@ -3431,11 +3431,6 @@ size_t qemu_target_page_size(void) return TARGET_PAGE_SIZE; } -int qemu_target_page_mask(void) -{ - return TARGET_PAGE_MASK; -} - int qemu_target_page_bits(void) { return TARGET_PAGE_BITS; diff --git a/target/target-common.c b/target/target-common.c new file mode 100644 index 0000000000..903b10cfe4 --- /dev/null +++ b/target/target-common.c @@ -0,0 +1,10 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +#include "qemu/osdep.h" + +#include "cpu.h" +#include "exec/target_page.h" + +int qemu_target_page_mask(void) +{ + return TARGET_PAGE_MASK; +} diff --git a/target/meson.build b/target/meson.build index a53a60486f..dee2ac47e0 100644 --- a/target/meson.build +++ b/target/meson.build @@ -19,3 +19,5 @@ subdir('sh4') subdir('sparc') subdir('tricore') subdir('xtensa') + +specific_ss.add(files('target-common.c')) From patchwork Wed Jan 24 07:56:07 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: 765623 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:10c4:b0:337:62d3:c6d5 with SMTP id b4csp1993179wrx; Tue, 23 Jan 2024 23:57:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IEBa+a7RKqWN4fVwxXvUmhgCLxE0NoHxsy2MzuFteINmyEsncTIQbZwU+mJ/8xC6fIBBmMk X-Received: by 2002:a05:622a:1052:b0:42a:5ad0:526f with SMTP id f18-20020a05622a105200b0042a5ad0526fmr1078553qte.128.1706083042268; Tue, 23 Jan 2024 23:57:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706083042; cv=none; d=google.com; s=arc-20160816; b=Boo6eugf9yrmaTmKiiuYHEbW5wEUW17W8KIuvo2nry7v/y8JvfLIwjI7RBYXMcthB2 wdaROYQiuZfkQPR9TBsiX8dzukXIZFx0U18oHeP99N0vtPCqcGJ7oyDU/fP6gNGHuL5v 9doKMIwpVlpQTV917UIe8D0tMyICuIXp+fD97kQxx1qiBdrvmcKp1rFPXJ0GqPEVykow aW0vhXbVGIVSPCbza3Kodrd6sRXosNjwU1E9nMG9sklMLk56QgsqBu6OaMfOAkO4LIsH oxcA57EMDEkwCQnby3LovUBeZ0RPzZEAhNaA52nhLM72U7pvZHQrlzHoValGNXUgzA12 gARQ== 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=6Drmyx0qOiBJ43sKodMFw/w/dHE5bFgKE64dzRkcfNQ=; fh=gHzvNH+WnbQB64KCr0AUnCYaI0U0xtxKJ+NqKEVRr9w=; b=xBnY+vfj4gb+ce0ES3rOH1L4FEx8k8dWS3pZ8e0ylQ/G1wTPJyPHt/O6Dg46/DaO7d e1kk6VGK8JzK/lvoOlhfJR0XOmWi6QcRTDxq6UM4rF24JFDToPDvAHnsORmyDf5N5qMO wRfwd2KLfbkjIXu5JmiBp1sEOBtGZlBmoM/1fq0J4pOqddo4F0IOhGK/JKS7otba8IQI vqLAv6KAUJN0CprSbrvyXj6AvX+HvIvzdqVYHwGcqTMpEGU4Kj+7NK+vyNxjD6uME1n8 E7eBPkaUR/gK1ojNIAVj9bO69juyQErYIHr+EeROX4fLuYVZuc/XxLIj9wplhCpRmJwr NkWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ivr8NvxF; 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 o13-20020ac87c4d000000b0042a3c36f800si6725724qtv.457.2024.01.23.23.57.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Jan 2024 23:57:22 -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=Ivr8NvxF; 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 1rSY7b-0001SU-3Q; Wed, 24 Jan 2024 02:56:31 -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 1rSY7W-0001SH-Sj for qemu-devel@nongnu.org; Wed, 24 Jan 2024 02:56:26 -0500 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSY7V-0005Sj-Bc for qemu-devel@nongnu.org; Wed, 24 Jan 2024 02:56:26 -0500 Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-55a8fd60af0so4390194a12.1 for ; Tue, 23 Jan 2024 23:56:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706082984; x=1706687784; 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=6Drmyx0qOiBJ43sKodMFw/w/dHE5bFgKE64dzRkcfNQ=; b=Ivr8NvxFdNyxe9zIYlg8y3HCo/4CYMAb04NjFJy5vssEC0rcuz63QH3zMNC9nU68sw jVtOAm3atgrfqlBwSb25S7aqoVHFU+rAA5l/yd1Dgco5IxVJn21JLwFqF8TVgW3LbWJp 2l3Zzw6imSJQkQMInF2iM4MN32d7CpmyaZ6c1/ulK4xlh05wS2vUdU+7+3aWSHhrOzhr M9K7okqLwtlvHru+/UAd0sFK5harHx+5sNNlpw0quhYAIe0Fygu0a5lIDeRRpysI/nCp Ti8Y4Q5cnmJJCDmNJdLkRUq7PcNIHgT6rJs5axXv/oMB7MTx77f6YcvOvbYjjPAr9JK7 YI6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706082984; x=1706687784; 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=6Drmyx0qOiBJ43sKodMFw/w/dHE5bFgKE64dzRkcfNQ=; b=IqekxSB3yCtAhGpE1bPIl0N3U0DjjaqIeCGf1mDy9z3KGqLOr68EOvmgx1OjpeD5pu sj9H0B/gkxi2J5NrBhJHoUT0vT4OGjosWpNnwXZz01zqSOpfqpIgcLSlwjebTckkQfNa rgwSaRLVPQhQbNmgFXIkhTbjZZmb2QaUWfUM5bXgKMstLn2f24wCBNTI7zp35Iw5xDES SOVGJ4cK+davsYqVYWu5v9p5gdtjQoBVeoAJXjqBbb/Lck4F1ye5AfANKrjRHdxyE5+o NAKxehjCiVg0hmnt+TL0/X3bj1UX4nCKoJf9uGm0lYS2XGM/eeU7yUxyEsrmCPPoumW7 KXmg== X-Gm-Message-State: AOJu0YygGjR3PUEJl41ghQ+s/qz8OXJ5RrpvS8byFJ+JNzJZZBg140cX XtawQ3d3kfg5vA8jvnKD/4uzMa1NBAHB+G9psUm1COsD/xkrKmtN/2z46DW7AqgIplyKc+cwrsH o X-Received: by 2002:a17:907:8b95:b0:a31:10c3:ecae with SMTP id tb21-20020a1709078b9500b00a3110c3ecaemr233942ejc.64.1706082983578; Tue, 23 Jan 2024 23:56:23 -0800 (PST) Received: from m1x-phil.lan (lgp44-h02-176-184-8-67.dsl.sta.abo.bbox.fr. [176.184.8.67]) by smtp.gmail.com with ESMTPSA id a13-20020a170906274d00b00a2b608ad048sm15118462ejd.28.2024.01.23.23.56.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 23 Jan 2024 23:56:23 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Paolo Bonzini , Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v5 2/4] tcg: Make tb_cflags() usable from target-agnostic code Date: Wed, 24 Jan 2024 08:56:07 +0100 Message-ID: <20240124075609.14756-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240124075609.14756-1-philmd@linaro.org> References: <20240124075609.14756-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::536; envelope-from=philmd@linaro.org; helo=mail-ed1-x536.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: Ilya Leoshkevich Currently tb_cflags() is defined in exec-all.h, which is not usable from target-agnostic code. Move it to translation-block.h, which is. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Ilya Leoshkevich Message-ID: <20231208003754.3688038-3-iii@linux.ibm.com> Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- include/exec/exec-all.h | 6 ------ include/exec/translation-block.h | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index df3d93a2e2..ce36bb10d4 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -459,12 +459,6 @@ int probe_access_full_mmu(CPUArchState *env, vaddr addr, int size, #endif -/* Hide the qatomic_read to make code a little easier on the eyes */ -static inline uint32_t tb_cflags(const TranslationBlock *tb) -{ - return qatomic_read(&tb->cflags); -} - static inline tb_page_addr_t tb_page_addr0(const TranslationBlock *tb) { #ifdef CONFIG_USER_ONLY diff --git a/include/exec/translation-block.h b/include/exec/translation-block.h index e2b26e16da..48211c890a 100644 --- a/include/exec/translation-block.h +++ b/include/exec/translation-block.h @@ -145,4 +145,10 @@ struct TranslationBlock { /* The alignment given to TranslationBlock during allocation. */ #define CODE_GEN_ALIGN 16 +/* Hide the qatomic_read to make code a little easier on the eyes */ +static inline uint32_t tb_cflags(const TranslationBlock *tb) +{ + return qatomic_read(&tb->cflags); +} + #endif /* EXEC_TRANSLATION_BLOCK_H */ From patchwork Wed Jan 24 07:56:08 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: 765624 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:10c4:b0:337:62d3:c6d5 with SMTP id b4csp1993210wrx; Tue, 23 Jan 2024 23:57:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IEqgDzpdEMjvaOdQWsMcEyu3MeIGjE/8sWHJ2MsiJ+ZRNzhoC/ZIG7vyiuXgqmS8tKabseg X-Received: by 2002:a05:6214:250e:b0:67f:f68:ab47 with SMTP id gf14-20020a056214250e00b0067f0f68ab47mr1932651qvb.111.1706083047331; Tue, 23 Jan 2024 23:57:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706083047; cv=none; d=google.com; s=arc-20160816; b=pwzwiz06QsaLdgMNAfiO2vjkGLJC9LNHDybCAzAg8AXKYTRqT0ZLmZlgaVf5kmR+V9 9N/B6KeIzrIUIVpfknjWzYXn5FmCwHUE/4pnQFMsC1GzcNSoVvNjxysLB6Dgm48Bt7H4 c475rdldyGpaKehXAUq6boSQ6zAQykYqCxa+elypdIaWfNV/nH7XDKXIj8xrkZOkAmpO eJb8eCxONhhnFZzyuLFELS+NefBLRhjfQJ2NQFL6yUU1EWnfC9MlJfeKh+bmu7kJhBjt to5BTBbWxpGH86J2d53oKNzeTiX5mFCsG5F6G292qsQb60prmBSUIgTDk1So6+6Hz8Q1 gksA== 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=9UAFRNBO2Tg6jJU15Vu5X8vfpHirwIVtsoqw3WJyHnU=; fh=HDCH6Wrx22G+vD4DfiuO44w5uMhpyLGE1aX3STpChIs=; b=HV71UviMPX7KCFyM6DynIXXe23HXT/LgAohVwiREheCwVAacl3A3jjqaBoFvtafUpp MTWp4PQPGu+rPaPwwdgSIDexsuR4zuDtqr61L+wdND7nJ7h7TueAEiia9VIa+MegCpiX r4WYchjl2b3KlW8uv852oTTzysKUCLln/pHwora4+oIaLRDhrm+4bJ1RD6VUslbG6X4+ eGeQdO26DupRXcPKYbIC8Xzffm1cT0U7/tt84O5uLFO3Ag6qyx94eISoadSmKW3wStaQ 2/8L+GXy9iwHAKSDDBFytY3LkYeZ77JZTdwjxQ7eBTWHaiTZmJLg89zlZ2YCwAfCbGrM T5kA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TzhirdQc; 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 g30-20020a0caade000000b006846c97c980si9711681qvb.579.2024.01.23.23.57.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Jan 2024 23:57:27 -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=TzhirdQc; 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 1rSY7g-0001WY-Ay; Wed, 24 Jan 2024 02:56:36 -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 1rSY7d-0001Vw-Mb for qemu-devel@nongnu.org; Wed, 24 Jan 2024 02:56:34 -0500 Received: from mail-lj1-x22d.google.com ([2a00:1450:4864:20::22d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSY7c-0005TA-4h for qemu-devel@nongnu.org; Wed, 24 Jan 2024 02:56:33 -0500 Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2cf205dc075so3504761fa.2 for ; Tue, 23 Jan 2024 23:56:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706082989; x=1706687789; 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=9UAFRNBO2Tg6jJU15Vu5X8vfpHirwIVtsoqw3WJyHnU=; b=TzhirdQcnd3OuB9y7bAlT+MuaM5EWgRbcLRBUxDPE9W2+XSsL8IkkHSDJ9Mgk6lZHd 23lnLBbTBUwHjOaGbfhMjOu4cziJjCEVjquH5tK371NzqzV2ozRUIZdtUSc5KA8dwFir JwpnELd5SWP+PrrX3lhbHi25BjWNWJ033FIyjjR+QJBG/k5yCtMBdA3BvRhaS6/qodB4 Bpa1KHFE5x1L3qVJKH78HDSiif7NQfRpoaeiE3DZnt+5NQ7VFOk1mbYxAk3KTd02Rgxh ffeQZwhvuh5Gc1iUGtQQAqjjlxHncuFHSQgWt8/qMRsFDyWHXxuMg9kHt5ri8Ei3wT3p Zd3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706082989; x=1706687789; 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=9UAFRNBO2Tg6jJU15Vu5X8vfpHirwIVtsoqw3WJyHnU=; b=kF33Oa4BrPDtMcXvj14KZ/QlW3cG7xYGYiKE8+GSA3exhyMWw9o9IHpA8Zf0viAi1x /Mv9cy2U7rxhabOXKhhg18tIFawgbHC5Hb8XRqKlOqFDtxxq35YaYCpXE8zoAg/0XJ0z m5p7YnzUznqGGXWk54pzRJM4iMm324gpYLfXJBQg1wkMv0Bvv2ql+B6Mgwub0Fe9aTBp vj6+WCxTavznErTezHH10XXStxZBEUqKnFW9fS9A4Sd9jd2jl0fGMHCFK4WWy84UOLBv MCOEs5SuoqAJWgblHoVGVFUgomNiEHTEudDiuiAKxux10caKoPX2D7MgUXYdYpMA2QTd Z3Vw== X-Gm-Message-State: AOJu0YyL/JaGhtkmKxsm5TwbQvA3EX/4BtYKXEknErnPh7TtpI8pgZ2v RjavH/k3wvQMgGzoSLBTKwFGa4o84cWTtdw4YeTn2X2VSx2gnV0l/JV5qFawraMeyLoTb2E076u y X-Received: by 2002:a2e:9f10:0:b0:2cf:1b2b:6a75 with SMTP id u16-20020a2e9f10000000b002cf1b2b6a75mr551515ljk.22.1706082989046; Tue, 23 Jan 2024 23:56:29 -0800 (PST) Received: from m1x-phil.lan (lgp44-h02-176-184-8-67.dsl.sta.abo.bbox.fr. [176.184.8.67]) by smtp.gmail.com with ESMTPSA id er25-20020a056402449900b0055a829811ddsm5279952edb.48.2024.01.23.23.56.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 23 Jan 2024 23:56:28 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Paolo Bonzini , Ilya Leoshkevich , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= Subject: [PATCH v5 3/4] accel/tcg: Remove #ifdef TARGET_I386 from perf.c Date: Wed, 24 Jan 2024 08:56:08 +0100 Message-ID: <20240124075609.14756-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240124075609.14756-1-philmd@linaro.org> References: <20240124075609.14756-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::22d; envelope-from=philmd@linaro.org; helo=mail-lj1-x22d.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: Ilya Leoshkevich Preparation for moving perf.c to tcg/. This affects only profiling guest code, which has code in a non-0 based segment, e.g., 16-bit code, which is not particularly important. Suggested-by: Richard Henderson Signed-off-by: Ilya Leoshkevich Reviewed-by: Alex Bennée Message-ID: <20231208003754.3688038-4-iii@linux.ibm.com> Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- accel/tcg/perf.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/accel/tcg/perf.c b/accel/tcg/perf.c index ba75c1bbe4..68a46b1b52 100644 --- a/accel/tcg/perf.c +++ b/accel/tcg/perf.c @@ -337,10 +337,6 @@ void perf_report_code(uint64_t guest_pc, TranslationBlock *tb, q[insn].address = gen_insn_data[insn * start_words + 0]; if (tb_cflags(tb) & CF_PCREL) { q[insn].address |= (guest_pc & qemu_target_page_mask()); - } else { -#if defined(TARGET_I386) - q[insn].address -= tb->cs_base; -#endif } q[insn].flags = DEBUGINFO_SYMBOL | (jitdump ? DEBUGINFO_LINE : 0); } From patchwork Wed Jan 24 07:56:09 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: 765621 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:10c4:b0:337:62d3:c6d5 with SMTP id b4csp1993109wrx; Tue, 23 Jan 2024 23:57:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IG5NR4T3mP20kEKVuxxa0GMVj54fzZgjuuN3mjWx2qkd2qNFJ82Rocv1wO54cnDJ7aZX9I4 X-Received: by 2002:a05:620a:28c8:b0:783:3015:2e8b with SMTP id l8-20020a05620a28c800b0078330152e8bmr9154669qkp.103.1706083021726; Tue, 23 Jan 2024 23:57:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706083021; cv=none; d=google.com; s=arc-20160816; b=EivRGrIxV7bPxavyF1Vo4ATG+wQVPGQOL+mifSUdD3Fc3K3dHPr8oi37CfSRmdy3py PCz59dttWR0Ary58Un2VrL93V+oYc5mMeFgAQkjSTn9au+fVb1WoiZReHXn+Qk4DAPtg bIhnyyBtHi2x1wQKkyVLGA7dOfOVUo3c//co4gNJwEDYEGzNI4YvHlAVwYHYXeAX62bU +mbsZrUM2W7PkfO6DHEM6T1pb+hcJY/rTindQhMN/YJhOnfXSkr7ltMyQ/2QNEcnarvd A6dvN+q3sXeeCxJIIUVTU7Xkjmu+O5D8nXTVCe3R1osUuavOy49aihUkRiHKgPXBv6r0 WSiA== 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=prVP50+y3lyE2N1LPnQRqeEggvTqD8gqLUeNHLmJDyg=; fh=SubIbHT39NLrN/0wzrRMBUuMl+aNuFoMYC+5VqXDNW4=; b=x6z+mFl5X1W0vMhZEhlZ+83Kl5f59wUK25B2eRTF/zxINmnq0Nasz1ClvbG47ycsUL FB7EgHd6fqz8UM0Uh5UrN2hcXIB7QUM4bx+f1ohQcK/oPxkLkNlrhZpY7lOpGIZghfXZ Pq7Gj9voXxpAyEfgLgZT7HbjOwqinF0i5Fr64qWFLZU6d9I/OqRvnV1OjfBPAFrpiscS UlmZ35zLpdJe6rspDvlXuV9PW20LJzfsHH5Q9iInB0MTU7OOp5WtTOUIIZdyWNOeVUCv 0pjk4sEuH6pW0965b0bS2Zv521K8QdCYLZxx136/ZFK3w1jAIJ55fw7Q3H7P+aJCEY1y wpJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nQRqEQTz; 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 z8-20020a05620a08c800b00781214ba84bsi9527171qkz.508.2024.01.23.23.57.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Jan 2024 23:57:01 -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=nQRqEQTz; 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 1rSY7o-0001df-0u; Wed, 24 Jan 2024 02:56:44 -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 1rSY7j-0001Z5-1t for qemu-devel@nongnu.org; Wed, 24 Jan 2024 02:56:40 -0500 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSY7g-0005Ur-WA for qemu-devel@nongnu.org; Wed, 24 Jan 2024 02:56:38 -0500 Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-a31092083acso62205366b.3 for ; Tue, 23 Jan 2024 23:56:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706082995; x=1706687795; 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=prVP50+y3lyE2N1LPnQRqeEggvTqD8gqLUeNHLmJDyg=; b=nQRqEQTz4S2r/v8wQjdX42JGYpkO+Z5x4jpj/6mN0P4P5bi1cDyJKHXt9M2CwXAY/f zTXMAQzeXjE8uMc59rlsnNjlZ09LKn2IkRpM0ovbqUABTAejTx5B0br/qa/y4qE317kP wfJ6ORcnI529aaO2GNRapVgcF6lg23E2Dg0Cttpi32ObCeRwm4qKAtLFkLWnSkT5d7uP XT3fS+tYhTUwU0KU+d3aWGu43xRtpc8wfDes6J6b+/rjx3QcZ9kSJLaKhr3Ck3CxKfpb bsfiJLhRX5tulczKb+lXpmcUxh+RhbCKNagaUW718DJusCXveizDhdDPlsND1WcnIqvA OWBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706082995; x=1706687795; 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=prVP50+y3lyE2N1LPnQRqeEggvTqD8gqLUeNHLmJDyg=; b=awPIDSnXXjqMxrzSfDksdWx8xh7hMxMU9W2NURK8npGN30liCm5L6fU+/ENSJLISdg ZCfm9k+gYkiRVtOnOXFWFhLOb1Z2Qch1np7XqiSqfd0YzBUcuCngF83mJibTDOi36UUH WF7xlQO9AYuQftSUDQ3TDKnrTMmEYP8XhmQDzTX/ebaJE+s+AcWp8/talPKMsDFPC7SJ CvIvhOOA2tigEiSQ8pWhF9I1qhC7gVSk1PqoC1WBV1p2ViVzK0EnoVNmKfpo1ASwOfFk 2eiC8cEGZHKMUIe8gT0uX0KXZK6LyMsCXObXfkIAeyOKDF6LYS7XzYWWLMR8pih8oIJ9 yxxA== X-Gm-Message-State: AOJu0YzF+33vogr75p78/5QhRSp6y6Xs3V/VelxiLcNucW8aSLDXlh7Z ZQjoXF8mM1icTsGG5+0pyxs8WA7LHph6++JWYtVKG4ti16uwPtVkC2V1JNAmzr7eSlj6867H2Yk l X-Received: by 2002:a17:907:1250:b0:a30:ebfd:581c with SMTP id wc16-20020a170907125000b00a30ebfd581cmr491505ejb.78.1706082994823; Tue, 23 Jan 2024 23:56:34 -0800 (PST) Received: from m1x-phil.lan (lgp44-h02-176-184-8-67.dsl.sta.abo.bbox.fr. [176.184.8.67]) by smtp.gmail.com with ESMTPSA id vx6-20020a170907a78600b00a311a360433sm395865ejc.143.2024.01.23.23.56.33 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 23 Jan 2024 23:56:34 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Paolo Bonzini , Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Laurent Vivier Subject: [PATCH v5 4/4] accel/tcg: Move perf and debuginfo support to tcg Date: Wed, 24 Jan 2024 08:56:09 +0100 Message-ID: <20240124075609.14756-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240124075609.14756-1-philmd@linaro.org> References: <20240124075609.14756-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=philmd@linaro.org; helo=mail-ej1-x630.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: Ilya Leoshkevich tcg/ should not depend on accel/tcg/, but perf and debuginfo support provided by the latter are being used by tcg/tcg.c. Since that's the only user, move both to tcg/. Suggested-by: Philippe Mathieu-Daudé Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Ilya Leoshkevich Message-ID: <20231208003754.3688038-5-iii@linux.ibm.com> Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- {accel/tcg => tcg}/debuginfo.h | 4 ++-- {accel/tcg => tcg}/perf.h | 4 ++-- accel/tcg/translate-all.c | 2 +- hw/core/loader.c | 2 +- linux-user/elfload.c | 2 +- linux-user/exit.c | 2 +- linux-user/main.c | 2 +- system/vl.c | 2 +- {accel/tcg => tcg}/debuginfo.c | 0 {accel/tcg => tcg}/perf.c | 2 +- tcg/tcg.c | 2 +- accel/tcg/meson.build | 4 ---- tcg/meson.build | 5 +++++ 13 files changed, 17 insertions(+), 16 deletions(-) rename {accel/tcg => tcg}/debuginfo.h (96%) rename {accel/tcg => tcg}/perf.h (95%) rename {accel/tcg => tcg}/debuginfo.c (100%) rename {accel/tcg => tcg}/perf.c (99%) diff --git a/accel/tcg/debuginfo.h b/tcg/debuginfo.h similarity index 96% rename from accel/tcg/debuginfo.h rename to tcg/debuginfo.h index f064e1c144..858535b5da 100644 --- a/accel/tcg/debuginfo.h +++ b/tcg/debuginfo.h @@ -4,8 +4,8 @@ * SPDX-License-Identifier: GPL-2.0-or-later */ -#ifndef ACCEL_TCG_DEBUGINFO_H -#define ACCEL_TCG_DEBUGINFO_H +#ifndef TCG_DEBUGINFO_H +#define TCG_DEBUGINFO_H #include "qemu/bitops.h" diff --git a/accel/tcg/perf.h b/tcg/perf.h similarity index 95% rename from accel/tcg/perf.h rename to tcg/perf.h index f92dd52c69..c96b5920a3 100644 --- a/accel/tcg/perf.h +++ b/tcg/perf.h @@ -4,8 +4,8 @@ * SPDX-License-Identifier: GPL-2.0-or-later */ -#ifndef ACCEL_TCG_PERF_H -#define ACCEL_TCG_PERF_H +#ifndef TCG_PERF_H +#define TCG_PERF_H #if defined(CONFIG_TCG) && defined(CONFIG_LINUX) /* Start writing perf-.map. */ diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 1737bb3da5..1c695efe02 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -63,7 +63,7 @@ #include "tb-context.h" #include "internal-common.h" #include "internal-target.h" -#include "perf.h" +#include "tcg/perf.h" #include "tcg/insn-start-words.h" TBContext tb_ctx; diff --git a/hw/core/loader.c b/hw/core/loader.c index e7a9b3775b..b8e52f3fb0 100644 --- a/hw/core/loader.c +++ b/hw/core/loader.c @@ -62,7 +62,7 @@ #include "hw/boards.h" #include "qemu/cutils.h" #include "sysemu/runstate.h" -#include "accel/tcg/debuginfo.h" +#include "tcg/debuginfo.h" #include diff --git a/linux-user/elfload.c b/linux-user/elfload.c index cf9e74468b..62120c7615 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -21,7 +21,7 @@ #include "qapi/error.h" #include "qemu/error-report.h" #include "target_signal.h" -#include "accel/tcg/debuginfo.h" +#include "tcg/debuginfo.h" #ifdef TARGET_ARM #include "target/arm/cpu-features.h" diff --git a/linux-user/exit.c b/linux-user/exit.c index 50266314e0..1ff8fe4f07 100644 --- a/linux-user/exit.c +++ b/linux-user/exit.c @@ -17,7 +17,7 @@ * along with this program; if not, see . */ #include "qemu/osdep.h" -#include "accel/tcg/perf.h" +#include "tcg/perf.h" #include "gdbstub/syscalls.h" #include "qemu.h" #include "user-internals.h" diff --git a/linux-user/main.c b/linux-user/main.c index c9470eeccf..74b2fbb393 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -54,7 +54,7 @@ #include "signal-common.h" #include "loader.h" #include "user-mmap.h" -#include "accel/tcg/perf.h" +#include "tcg/perf.h" #ifdef CONFIG_SEMIHOSTING #include "semihosting/semihost.h" diff --git a/system/vl.c b/system/vl.c index 788d88ea03..60fd1e56b6 100644 --- a/system/vl.c +++ b/system/vl.c @@ -96,7 +96,7 @@ #endif #include "sysemu/qtest.h" #ifdef CONFIG_TCG -#include "accel/tcg/perf.h" +#include "tcg/perf.h" #endif #include "disas/disas.h" diff --git a/accel/tcg/debuginfo.c b/tcg/debuginfo.c similarity index 100% rename from accel/tcg/debuginfo.c rename to tcg/debuginfo.c diff --git a/accel/tcg/perf.c b/tcg/perf.c similarity index 99% rename from accel/tcg/perf.c rename to tcg/perf.c index 68a46b1b52..de34248d92 100644 --- a/accel/tcg/perf.c +++ b/tcg/perf.c @@ -11,7 +11,7 @@ #include "qemu/osdep.h" #include "elf.h" #include "exec/target_page.h" -#include "exec/exec-all.h" +#include "exec/translation-block.h" #include "qemu/timer.h" #include "tcg/tcg.h" diff --git a/tcg/tcg.c b/tcg/tcg.c index e2c38f6d11..eeff4c1d51 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -55,7 +55,7 @@ #include "tcg/tcg-ldst.h" #include "tcg/tcg-temp-internal.h" #include "tcg-internal.h" -#include "accel/tcg/perf.h" +#include "tcg/perf.h" #ifdef CONFIG_USER_ONLY #include "exec/user/guest-base.h" #endif diff --git a/accel/tcg/meson.build b/accel/tcg/meson.build index c15ac9ac8f..46f7d53eeb 100644 --- a/accel/tcg/meson.build +++ b/accel/tcg/meson.build @@ -16,10 +16,6 @@ tcg_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_false: files('user-exec-stub.c')) if get_option('plugins') tcg_ss.add(files('plugin-gen.c')) endif -tcg_ss.add(when: libdw, if_true: files('debuginfo.c')) -if host_os == 'linux' - tcg_ss.add(files('perf.c')) -endif specific_ss.add_all(when: 'CONFIG_TCG', if_true: tcg_ss) specific_ss.add(when: ['CONFIG_SYSTEM_ONLY', 'CONFIG_TCG'], if_true: files( diff --git a/tcg/meson.build b/tcg/meson.build index 5afdec1e1a..8251589fd4 100644 --- a/tcg/meson.build +++ b/tcg/meson.build @@ -22,6 +22,11 @@ if get_option('tcg_interpreter') tcg_ss.add(files('tci.c')) endif +tcg_ss.add(when: libdw, if_true: files('debuginfo.c')) +if host_os == 'linux' + tcg_ss.add(files('perf.c')) +endif + tcg_ss = tcg_ss.apply({}) libtcg_user = static_library('tcg_user',