From patchwork Fri Jun 30 20:36:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 13298728 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F1EDEEB64DA for ; Fri, 30 Jun 2023 20:39:02 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qFKs8-0008RD-IG; Fri, 30 Jun 2023 16:37:40 -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 1qFKs2-0008QD-Qf for qemu-devel@nongnu.org; Fri, 30 Jun 2023 16:37:34 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qFKrz-0006J1-DK for qemu-devel@nongnu.org; Fri, 30 Jun 2023 16:37:33 -0400 Received: from pps.filterd (m0353723.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35UKWlKI022943; Fri, 30 Jun 2023 20:37:30 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=9/m69YA6tsH4LPx4k8XYv1WB8IOJfs+3yhdBZmaA/tQ=; b=Q70W4yX2G8rx5TXOZ6HxHGyOVlGZyGnYfOtPvcBWw0ZP6poVZg4SDERlSZuzv0mFyAeJ ZqK+JcciAJg9MtKukjWEVyPIn/eoBHELcTwkrahTOq9SupFsxJCzL7xGPsBdJe0DYi0S tT4dNJcRuNLcQ5wmmbFKhO9dsI8UIYvmIJkRhTq75ggff5u8MatrH+jteI1QYoj+nJo8 EbE1ET4dvXHbS2V0JLitHl7CqAdIYhyBUCH3PKKKtc5RJEYvE3mtGGCEf5uVxQyG0QWm uvraW7p/hEkZfEB4LnXAY0b5rVpWR/N0g9ZsyLSd8soa9uEX8tcUs/BqekrCprr0X4oB yw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3rj66b83hv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 30 Jun 2023 20:37:29 +0000 Received: from m0353723.ppops.net (m0353723.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 35UKWn0j022957; Fri, 30 Jun 2023 20:37:29 GMT Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3rj66b83hb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 30 Jun 2023 20:37:29 +0000 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 35UJGgI1019375; Fri, 30 Jun 2023 20:37:27 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma06ams.nl.ibm.com (PPS) with ESMTPS id 3rdqre4e4a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 30 Jun 2023 20:37:27 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 35UKbOlj22676060 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Jun 2023 20:37:24 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C58BB20043; Fri, 30 Jun 2023 20:37:24 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3082B20040; Fri, 30 Jun 2023 20:37:24 +0000 (GMT) Received: from heavy.boeblingen.de.ibm.com (unknown [9.179.8.31]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 30 Jun 2023 20:37:24 +0000 (GMT) From: Ilya Leoshkevich To: Richard Henderson , Laurent Vivier Cc: Paolo Bonzini , Peter Xu , David Hildenbrand , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Ilya Leoshkevich Subject: [PATCH 1/4] target: Make qemu_softmmu_page_mask() available for *-user Date: Fri, 30 Jun 2023 22:36:38 +0200 Message-ID: <20230630203720.528552-2-iii@linux.ibm.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230630203720.528552-1-iii@linux.ibm.com> References: <20230630203720.528552-1-iii@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: H-fSV6UJK-5dXxzFY6MWNr4YavwGVD7_ X-Proofpoint-ORIG-GUID: 65rlFil5-teaY4OSP7UHw8l9WYUeUA12 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-06-30_12,2023-06-30_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 clxscore=1015 priorityscore=1501 mlxlogscore=999 malwarescore=0 spamscore=0 suspectscore=0 mlxscore=0 bulkscore=0 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306300179 Received-SPF: pass client-ip=148.163.158.5; envelope-from=iii@linux.ibm.com; helo=mx0b-001b2d01.pphosted.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Currently qemu_softmmu_page_mask() is usable only from the softmmu code. Make it possible to use it from the *-user code as wel. Signed-off-by: Ilya Leoshkevich --- softmmu/physmem.c | 5 ----- target/meson.build | 2 ++ target/target-common.c | 9 +++++++++ 3 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 target/target-common.c diff --git a/softmmu/physmem.c b/softmmu/physmem.c index bda475a719d..6bdd944fe88 100644 --- a/softmmu/physmem.c +++ b/softmmu/physmem.c @@ -3359,11 +3359,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/meson.build b/target/meson.build index a53a60486fc..dee2ac47e02 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')) diff --git a/target/target-common.c b/target/target-common.c new file mode 100644 index 00000000000..6868a1f490f --- /dev/null +++ b/target/target-common.c @@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +#include "qemu/osdep.h" + +#include "exec/exec-all.h" + +int qemu_target_page_mask(void) +{ + return TARGET_PAGE_MASK; +} From patchwork Fri Jun 30 20:36:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 13298724 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 45C55EB64DA for ; Fri, 30 Jun 2023 20:38:14 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qFKs9-0008RU-Ow; Fri, 30 Jun 2023 16:37:41 -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 1qFKs4-0008QZ-37 for qemu-devel@nongnu.org; Fri, 30 Jun 2023 16:37:36 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qFKs2-0006JO-HG for qemu-devel@nongnu.org; Fri, 30 Jun 2023 16:37:35 -0400 Received: from pps.filterd (m0353723.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35UKWlKJ022943; Fri, 30 Jun 2023 20:37:32 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=DfZpg3tRxwBY35ERCdfqAY9kHJIYHVo6ZGrIbknBsi0=; b=rrEIzzjm+8izGBOJc0fteCH3Toc+Csjmn7e/AHm9Of0UDNSwlfXycUoed/eM3cx+bclu I3wM+y7T0O0AxLuLjZEPMIfchTPMomI8nUjGVjnZlmyDp4FXHEV1pBGL8lPpUd7TDAlM lmKV6PawClRgrMVc+4YS7dzqJk0bDMNRiCTjHhZ+19dUYy/zOMD+8xnrejjh9PdmLhG6 eZyZWqblT+LGnOLe83yVanRnZcOKMZg7METDqjA+mEub5sZkJ34+uaMVhoP0cYR3TYU2 K+vIEaXsaDlF9YCZYFzhP4CEMiVXATlrf9UnpniKGmRqMxHf/k8Z3iE3eZwC/YM17i0H lA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3rj66b83jq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 30 Jun 2023 20:37:32 +0000 Received: from m0353723.ppops.net (m0353723.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 35UKXMeX023596; Fri, 30 Jun 2023 20:37:31 GMT Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3rj66b83j1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 30 Jun 2023 20:37:31 +0000 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 35UJvdgv018439; Fri, 30 Jun 2023 20:37:29 GMT Received: from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227]) by ppma03ams.nl.ibm.com (PPS) with ESMTPS id 3rdr454e16-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 30 Jun 2023 20:37:29 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay01.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 35UKbRKF17760988 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Jun 2023 20:37:27 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0C01120043; Fri, 30 Jun 2023 20:37:27 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6D7FF20040; Fri, 30 Jun 2023 20:37:26 +0000 (GMT) Received: from heavy.boeblingen.de.ibm.com (unknown [9.179.8.31]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 30 Jun 2023 20:37:26 +0000 (GMT) From: Ilya Leoshkevich To: Richard Henderson , Laurent Vivier Cc: Paolo Bonzini , Peter Xu , David Hildenbrand , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Ilya Leoshkevich Subject: [PATCH 2/4] tcg: Make tb_cflags() usable from target-agnostic code Date: Fri, 30 Jun 2023 22:36:39 +0200 Message-ID: <20230630203720.528552-3-iii@linux.ibm.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230630203720.528552-1-iii@linux.ibm.com> References: <20230630203720.528552-1-iii@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: e5Xwq1ZdBxcs8L_bgCSPbvRW3XoN9GsF X-Proofpoint-ORIG-GUID: 2UKPN2bpXrZxI-NR2iSIsWOl7V5EEEHU X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-06-30_12,2023-06-30_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 clxscore=1015 priorityscore=1501 mlxlogscore=999 malwarescore=0 spamscore=0 suspectscore=0 mlxscore=0 bulkscore=0 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306300179 Received-SPF: pass client-ip=148.163.158.5; envelope-from=iii@linux.ibm.com; helo=mx0b-001b2d01.pphosted.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 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. Signed-off-by: Ilya Leoshkevich Reviewed-by: Philippe Mathieu-Daudé --- 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 200c27eadfe..652fb9dc126 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -466,12 +466,6 @@ int probe_access_full(CPUArchState *env, vaddr addr, int size, CPUTLBEntryFull **pfull, uintptr_t retaddr); #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 5119924927e..7a7190bb30d 100644 --- a/include/exec/translation-block.h +++ b/include/exec/translation-block.h @@ -146,4 +146,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 Fri Jun 30 20:36:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 13298726 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2896DEB64DA for ; Fri, 30 Jun 2023 20:38:35 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qFKsA-0008Rj-KJ; Fri, 30 Jun 2023 16:37:42 -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 1qFKs4-0008Qr-Vh for qemu-devel@nongnu.org; Fri, 30 Jun 2023 16:37:38 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qFKs3-0006Je-HV for qemu-devel@nongnu.org; Fri, 30 Jun 2023 16:37:36 -0400 Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35UKGEnp032731; Fri, 30 Jun 2023 20:37:34 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=j/LsTh9U/GX7cYt3E4+35NtnX6ZqVqzrfDfGQCUrX5E=; b=Xy/9hE13HfV8ejOBL1pE+F4tRc/TykiOp3PQcOU58kRlfdMfrZIBT3z+1uB9STSW4+Nx e8fX6TMpr6xrZ09DpeLA0BrqwihD2neGkUB/b2hFdSDWmzzNEYU54Qm837tzlRAbxrjp Ei5ip6NqG9Av0MEOJkMIJfp35rCO9hqnUkhNRFqjdO0+FgidwqeAfdUyXUWMT3QXWNzp XjdcKaCV+kc0lnVKC8pCdSgIeoSbHd4A3TXCh1R+CDdgQX7a3ydrts+C57fHfR7gmI/h BAe0aJpzHrYWYW5CEjeBPBbBxVoqcTUL8xWHG4Yq5jFb6Fot19FLikeMXbL96IJY0lvH 2g== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3rj5xggh52-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 30 Jun 2023 20:37:33 +0000 Received: from m0356516.ppops.net (m0356516.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 35UKGNLU001078; Fri, 30 Jun 2023 20:37:33 GMT Received: from ppma06fra.de.ibm.com (48.49.7a9f.ip4.static.sl-reverse.com [159.122.73.72]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3rj5xggh4c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 30 Jun 2023 20:37:33 +0000 Received: from pps.filterd (ppma06fra.de.ibm.com [127.0.0.1]) by ppma06fra.de.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 35UJ6TVX024518; Fri, 30 Jun 2023 20:37:31 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma06fra.de.ibm.com (PPS) with ESMTPS id 3rdqre38ey-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 30 Jun 2023 20:37:31 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 35UKbTPH53412332 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Jun 2023 20:37:29 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5505320043; Fri, 30 Jun 2023 20:37:29 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AB3F220040; Fri, 30 Jun 2023 20:37:28 +0000 (GMT) Received: from heavy.boeblingen.de.ibm.com (unknown [9.179.8.31]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 30 Jun 2023 20:37:28 +0000 (GMT) From: Ilya Leoshkevich To: Richard Henderson , Laurent Vivier Cc: Paolo Bonzini , Peter Xu , David Hildenbrand , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Ilya Leoshkevich Subject: [PATCH 3/4] accel/tcg: Remove #ifdef TARGET_I386 from perf.c Date: Fri, 30 Jun 2023 22:36:40 +0200 Message-ID: <20230630203720.528552-4-iii@linux.ibm.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230630203720.528552-1-iii@linux.ibm.com> References: <20230630203720.528552-1-iii@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: eJmVDBsDr4nfbWHTYG7hdjO15nROpegx X-Proofpoint-ORIG-GUID: UK1CZ2eJjziBQbu0WWx0Qxuek8gQCk_Z X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-06-30_12,2023-06-30_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 impostorscore=0 lowpriorityscore=0 suspectscore=0 mlxlogscore=999 priorityscore=1501 spamscore=0 malwarescore=0 adultscore=0 phishscore=0 clxscore=1015 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306300179 Received-SPF: pass client-ip=148.163.158.5; envelope-from=iii@linux.ibm.com; helo=mx0b-001b2d01.pphosted.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 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 --- accel/tcg/perf.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/accel/tcg/perf.c b/accel/tcg/perf.c index cd1aa99a7ee..e2813e11806 100644 --- a/accel/tcg/perf.c +++ b/accel/tcg/perf.c @@ -336,10 +336,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 & 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 Fri Jun 30 20:36:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ilya Leoshkevich X-Patchwork-Id: 13298727 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 93FEEEB64DA for ; Fri, 30 Jun 2023 20:38:58 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qFKsC-0008S0-BU; Fri, 30 Jun 2023 16:37:44 -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 1qFKs9-0008RT-5P for qemu-devel@nongnu.org; Fri, 30 Jun 2023 16:37:41 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qFKs7-0006K8-1s for qemu-devel@nongnu.org; Fri, 30 Jun 2023 16:37:40 -0400 Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35UKGFem032741; Fri, 30 Jun 2023 20:37:37 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-type : content-transfer-encoding : mime-version; s=pp1; bh=34+aVeyEn69PEMdUZcBdwpxOwEAR6dGjVHWvLTAHTCI=; b=Sjc2Gt8dR/1eyy9yzVGNuLoJieYNqbRYj8U7TArPG7g49Q4NOubnuc4bEQuBaNcMunke Pooqwq55ZavwegIHx7hQ/wRdds7hvJnI0mt/UupTaXT9zxVrLtvls60/s9dgXIyxaPtR nT1InFuWZ5RmpIWh8VpFhXBT2XoG3/KAe9nFlE+uBVScamV5N5Xk1zV9R9n/zMSAl19n ST36Igva9GohoqJkDTzXyJWxD0ooWLjotbtL73qnnq3TVbrN2GjQWLi60X63p4u1K3NC P1Zw1AdReNSvyip3yb1GJqdDntcmMCwM9hZFJ6gpns+Q3Ma48snjqtP4v9bOcKek1Gb1 +Q== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3rj5xggh6n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 30 Jun 2023 20:37:37 +0000 Received: from m0356516.ppops.net (m0356516.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 35UKVcJZ019632; Fri, 30 Jun 2023 20:37:37 GMT Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3rj5xggh5s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 30 Jun 2023 20:37:36 +0000 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 35UJGwna024857; Fri, 30 Jun 2023 20:37:35 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma04ams.nl.ibm.com (PPS) with ESMTPS id 3rdr454dkk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 30 Jun 2023 20:37:34 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 35UKbWck62194138 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 30 Jun 2023 20:37:32 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A0B5C20043; Fri, 30 Jun 2023 20:37:32 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0F42820040; Fri, 30 Jun 2023 20:37:32 +0000 (GMT) Received: from heavy.boeblingen.de.ibm.com (unknown [9.179.8.31]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 30 Jun 2023 20:37:31 +0000 (GMT) From: Ilya Leoshkevich To: Richard Henderson , Laurent Vivier Cc: Paolo Bonzini , Peter Xu , David Hildenbrand , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Ilya Leoshkevich Subject: [PATCH 4/4] accel/tcg: Move perf and debuginfo support to tcg Date: Fri, 30 Jun 2023 22:36:41 +0200 Message-ID: <20230630203720.528552-5-iii@linux.ibm.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230630203720.528552-1-iii@linux.ibm.com> References: <20230630203720.528552-1-iii@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-GUID: ToG0MLzO1JYZP47uucTq_Bre_lKD_Mdj X-Proofpoint-ORIG-GUID: cTG2MCpLmgjWuD0Zrqv8AIpXb7vr_7Lt X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-06-30_12,2023-06-30_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 impostorscore=0 lowpriorityscore=0 suspectscore=0 mlxlogscore=999 priorityscore=1501 spamscore=0 malwarescore=0 adultscore=0 phishscore=0 clxscore=1015 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306300179 Received-SPF: pass client-ip=148.163.158.5; envelope-from=iii@linux.ibm.com; helo=mx0b-001b2d01.pphosted.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 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é Signed-off-by: Ilya Leoshkevich --- accel/tcg/meson.build | 2 -- 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 +- softmmu/vl.c | 2 +- {accel/tcg => tcg}/debuginfo.c | 0 {accel/tcg => tcg}/debuginfo.h | 4 ++-- tcg/meson.build | 3 +++ {accel/tcg => tcg}/perf.c | 4 ++-- {accel/tcg => tcg}/perf.h | 4 ++-- tcg/tcg.c | 2 +- 13 files changed, 16 insertions(+), 15 deletions(-) rename {accel/tcg => tcg}/debuginfo.c (100%) rename {accel/tcg => tcg}/debuginfo.h (96%) rename {accel/tcg => tcg}/perf.c (98%) rename {accel/tcg => tcg}/perf.h (95%) diff --git a/accel/tcg/meson.build b/accel/tcg/meson.build index 166bef173b8..083c9058391 100644 --- a/accel/tcg/meson.build +++ b/accel/tcg/meson.build @@ -12,8 +12,6 @@ tcg_ss.add(files( tcg_ss.add(when: 'CONFIG_USER_ONLY', if_true: files('user-exec.c')) tcg_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_false: files('user-exec-stub.c')) tcg_ss.add(when: 'CONFIG_PLUGIN', if_true: [files('plugin-gen.c')]) -tcg_ss.add(when: libdw, if_true: files('debuginfo.c')) -tcg_ss.add(when: 'CONFIG_LINUX', if_true: files('perf.c')) 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/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index d3d4fbc1a41..58d9bd5a69e 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -62,7 +62,7 @@ #include "tb-hash.h" #include "tb-context.h" #include "internal.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 8b7fd9e9e55..ad8d00440a7 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 9a2ec568b09..6900974c373 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 _ARCH_PPC64 #undef ARCH_DLINFO diff --git a/linux-user/exit.c b/linux-user/exit.c index 3017d28a3c3..122b9d904f1 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 dba67ffa362..3f65ca49db8 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/softmmu/vl.c b/softmmu/vl.c index b0b96f67fac..92922377210 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -97,7 +97,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/debuginfo.h b/tcg/debuginfo.h similarity index 96% rename from accel/tcg/debuginfo.h rename to tcg/debuginfo.h index f064e1c144b..858535b5da5 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/tcg/meson.build b/tcg/meson.build index c0252c41988..0800e1faae8 100644 --- a/tcg/meson.build +++ b/tcg/meson.build @@ -22,6 +22,9 @@ if get_option('tcg_interpreter') tcg_ss.add(files('tci.c')) endif +tcg_ss.add(when: libdw, if_true: files('debuginfo.c')) +tcg_ss.add(when: 'CONFIG_LINUX', if_true: files('perf.c')) + tcg_ss = tcg_ss.apply(config_host, strict: false) libtcg_user = static_library('tcg_user', diff --git a/accel/tcg/perf.c b/tcg/perf.c similarity index 98% rename from accel/tcg/perf.c rename to tcg/perf.c index e2813e11806..4a08fd9d259 100644 --- a/accel/tcg/perf.c +++ b/tcg/perf.c @@ -10,7 +10,7 @@ #include "qemu/osdep.h" #include "elf.h" -#include "exec/exec-all.h" +#include "exec/translation-block.h" #include "qemu/timer.h" #include "tcg/tcg.h" @@ -335,7 +335,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()); } q[insn].flags = DEBUGINFO_SYMBOL | (jitdump ? DEBUGINFO_LINE : 0); } 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 f92dd52c699..c96b5920a3f 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/tcg/tcg.c b/tcg/tcg.c index a0628fe4249..2afc5f2d0f7 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -54,7 +54,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