From nobody Sun Nov 16 04:02:32 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=1743724268; cv=none; d=zohomail.com; s=zohoarc; b=m0WzNOT8rykoQO1xZJm4Uv15YBlt/mRFLKsF7BjvvmGXasRNsEUtULO2Q8GqmbxZX70renO9ZJAj+p1rWr0wmZYswRwNxiPHUOUB6bZu3w7vHj5pZd2+jBLAxoeQVevXeavVtl7BKDb005B96fLY8kySPz+8u4D/RdCJarlz6CU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1743724268; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Dx4NIP+q6gK1PYGs8UG7pypdnmjUfZxa4IekdB6BGgc=; b=joWshf9qx4AXiYRGYyBdIsym2wfW0ghJ9OFKzhdfeWVjQJrU7Ita+YWSgsd6N6F00Wr8xshtPPc0V7HFyDKQEbumoPKsyYnj7DcVI6HnoK9nNmJq4EPTWWPNtt9RktfD47LA+/jRjGHKk2nxjsVhJaJN/2R8iLqIv2vM9DPNywY= 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 1743724268023651.2985102425838; Thu, 3 Apr 2025 16:51:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u0UJU-0000bw-00; Thu, 03 Apr 2025 19:49:36 -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 1u0UJR-0000bV-Vm for qemu-devel@nongnu.org; Thu, 03 Apr 2025 19:49:33 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u0UJM-0000PH-VO for qemu-devel@nongnu.org; Thu, 03 Apr 2025 19:49:30 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-43cf848528aso10991845e9.2 for ; Thu, 03 Apr 2025 16:49:26 -0700 (PDT) Received: from localhost.localdomain (184.170.88.92.rev.sfr.net. [92.88.170.184]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39c301a76cesm2969306f8f.37.2025.04.03.16.49.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Apr 2025 16:49:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743724165; x=1744328965; 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=Dx4NIP+q6gK1PYGs8UG7pypdnmjUfZxa4IekdB6BGgc=; b=NF6zbHKDyPPBVCYsbfWUhZA7grba/DnEr0WsaLlg+zogqvweXJFNi9NyfCckEZs2UB 0WMqolRXfPtdyWdTUGykbznBlJPTQrglmwDeCM9ydp7u0Pg9MAHW365iPEPS0R2SiJCn Ob3W4KkdcCK0E+c6ASGKyEL0ZXf21HPOr1GzStVt/anJntAJ1f+RaC9z3swcg7ZHlqp4 /o6g6FtywvEivrQSpWbe4p/oOmg40HfmUdl3lr7esFxxrImYSnjthNjWiiKPux0Ni6Ck dtIWGuLPDLQ6s+3M/rhiknP1cDq6Ma3efEL3+wX+rgPVwscX99C4rrE6b610P27EzJWs x+sA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743724165; x=1744328965; 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=Dx4NIP+q6gK1PYGs8UG7pypdnmjUfZxa4IekdB6BGgc=; b=UEv33pWFR+B3Fvt/oFP41tynEkKcFja/fL62A7PGudhlRpDyQ3aUHbL5wT8PTvx0vL YgOloPbT8ufpJla4UCIXL0+bSjJJe9M48x5R53EA+adoYzI0ik8o7D/IDP5wMN4VKw0s 81WU7gYfreh++0ytpzUolbr1uTIn29h4xX3afIYnGUNW1+ochuNGoiljDqijRJfS3Nxb vtxf4lUjTT/p9X/alakf1GdmnLgK/ApzDYY868hOm7XU4d2RhWEaNvhQu6iVkY0n0Hvw rNGzJZ07JmHOg/FkG1XII0G6+K8LHBJj3Ufb3QDMMsAp7w8fbmX1B4igJYELIy0bb+F6 U1og== X-Gm-Message-State: AOJu0YwX9P6xLbanMWNTO2rW0sUo/FNLPzCfcNgWKMNldFGji4+ic1Ul rjuSHJ7crMyrFio+/aLtKc5aSQrg9f6YKvURsYht2mpukoAKt48AvBT2oUXtuKnm0KLjKM3dmaW K X-Gm-Gg: ASbGnctJGTNVp12sTXOxP/yZrn8S/W5Im9PkFZ2otwnhi4wwjQ320Kj8Zyk8wa/wzzW B5LuVRdaE2jx3QYzQFdjnaw3sZOLPdnVDKWcGIEO7VJiggRafMpZK5eU3x2tN2uCJ3fg/fGXZET Av2dztWFFm7kpWra0Xto2PUgsnmS4UnIi4PUOGmXyYf/fAfbnBgTNWwEhoMLl3yLWegFyrg/ATS pZvi4jre4mdE+E+uUQKA5J7miEKZOGNb3atpaSlRYpJCnvr0IRKRfW/Tj4kpnO1b+74P0qDYLj6 fApSC2qYScQOTKUWKSZn31pcD0sCnwnnMF91ymC2MVIjwcpBKOJP236Of7cDGydf7m6uT/5iygj mu/ZnrJN2dR1yXcMaJ6s= X-Google-Smtp-Source: AGHT+IEDEkkt/TosMfwTARFIzEOm7d8erqQBc8FSCNXwXHdU0PFAxSnP4+0M4Bh9g9wY50uot8/UxA== X-Received: by 2002:a05:600c:4503:b0:43c:f78d:82eb with SMTP id 5b1f17b1804b1-43ecf8eb2bbmr7242435e9.15.1743724165091; Thu, 03 Apr 2025 16:49:25 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Markus Armbruster , Richard Henderson , Pierrick Bouvier Subject: [RFC PATCH-for-10.1 01/19] qemu: Introduce TargetInfo API in 'target_info.h' Date: Fri, 4 Apr 2025 01:48:56 +0200 Message-ID: <20250403234914.9154-2-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250403234914.9154-1-philmd@linaro.org> References: <20250403234914.9154-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1743724269155019000 Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- meson.build | 9 +++++++++ include/exec/poison.h | 1 + include/qemu/target_info-impl.h | 21 +++++++++++++++++++++ include/qemu/target_info.h | 18 ++++++++++++++++++ target_info-stub.c | 23 +++++++++++++++++++++++ target_info.c | 16 ++++++++++++++++ 6 files changed, 88 insertions(+) create mode 100644 include/qemu/target_info-impl.h create mode 100644 include/qemu/target_info.h create mode 100644 target_info-stub.c create mode 100644 target_info.c diff --git a/meson.build b/meson.build index bcb9d39a387..de9c9dacd35 100644 --- a/meson.build +++ b/meson.build @@ -3262,6 +3262,9 @@ host_kconfig =3D \ =20 ignored =3D [ 'TARGET_XML_FILES', 'TARGET_ABI_DIR', 'TARGET_ARCH' ] =20 +target_info =3D [ +] + default_targets =3D 'CONFIG_DEFAULT_TARGETS' in config_host actual_target_dirs =3D [] fdt_required =3D [] @@ -3368,6 +3371,9 @@ foreach target : target_dirs config_target_data.set(k, v) endif endforeach + if target not in target_info + config_target_data.set('TARGET_INFO_STUB_NEEDED', 1) + endif config_target_data.set('QEMU_ARCH', 'QEMU_ARCH_' + config_target['TARGET_BASE_ARCH'].= to_upper()) config_target_h +=3D {target: configure_file(output: target + '-config-t= arget.h', @@ -3807,6 +3813,9 @@ endif common_ss.add(pagevary) specific_ss.add(files('page-target.c', 'page-vary-target.c')) =20 +specific_ss.add(files('target_info-stub.c')) +common_ss.add(files('target_info.c')) + subdir('backends') subdir('disas') subdir('migration') diff --git a/include/exec/poison.h b/include/exec/poison.h index bc422719d80..00aedc41d82 100644 --- a/include/exec/poison.h +++ b/include/exec/poison.h @@ -38,6 +38,7 @@ #pragma GCC poison TARGET_BIG_ENDIAN #pragma GCC poison TCG_GUEST_DEFAULT_MO #pragma GCC poison TARGET_HAS_PRECISE_SMC +#pragma GCC poison TARGET_INFO_STUB_NEEDED =20 #pragma GCC poison TARGET_LONG_BITS #pragma GCC poison TARGET_FMT_lx diff --git a/include/qemu/target_info-impl.h b/include/qemu/target_info-imp= l.h new file mode 100644 index 00000000000..b340e192fce --- /dev/null +++ b/include/qemu/target_info-impl.h @@ -0,0 +1,21 @@ +/* + * QEMU binary helpers + * + * Copyright (c) Linaro + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef QEMU_TARGET_INFO_IMPL_H +#define QEMU_TARGET_INFO_IMPL_H + +#include "qemu/target_info.h" + +struct BinaryTargetInfo { + + /* runtime equivalent of TARGET_INFO_STUB_NEEDED definition */ + bool is_stub; + +}; + +#endif diff --git a/include/qemu/target_info.h b/include/qemu/target_info.h new file mode 100644 index 00000000000..fab3f3153ea --- /dev/null +++ b/include/qemu/target_info.h @@ -0,0 +1,18 @@ +/* + * QEMU binary helpers + * + * Copyright (c) Linaro + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef QEMU_TARGET_INFO_H +#define QEMU_TARGET_INFO_H + +typedef struct BinaryTargetInfo BinaryTargetInfo; + +const BinaryTargetInfo *target_info(void); + +bool target_info_is_stub(void); + +#endif diff --git a/target_info-stub.c b/target_info-stub.c new file mode 100644 index 00000000000..d683a05977d --- /dev/null +++ b/target_info-stub.c @@ -0,0 +1,23 @@ +/* + * QEMU target info stubs + * + * Copyright (c) Linaro + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "qemu/target_info-impl.h" + +#ifdef TARGET_INFO_STUB_NEEDED + +static const BinaryTargetInfo target_info_stub =3D { + .is_stub =3D true, +}; + +const BinaryTargetInfo *target_info(void) +{ + return &target_info_stub; +} + +#endif /* TARGET_INFO_STUB_NEEDED */ diff --git a/target_info.c b/target_info.c new file mode 100644 index 00000000000..cb17d29b86d --- /dev/null +++ b/target_info.c @@ -0,0 +1,16 @@ +/* + * QEMU legacy binary helpers + * + * Copyright (c) Linaro + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "qemu/target_info-impl.h" +#include "qemu/target_info.h" + +bool target_info_is_stub(void) +{ + return target_info()->is_stub; +} --=20 2.47.1 From nobody Sun Nov 16 04:02:32 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=1743724226; cv=none; d=zohomail.com; s=zohoarc; b=frX2pJ9SH3saPQnYPGMPYs8hO6p6S1O3Rc9gnfM3y3YXcDofInKkKFFvECzvajhWLZv9XD97Mh9gvyPxKXWJpawX4qevzjVvrhTSMZfhO7KsEW3vsQex/kU60h1sY90QAIcS3SOSZVljFdOntQcYmgMcgVpdjTj+UyM8j7COt70= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1743724226; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=dr1ajPlH6JN6hTaMKguRfw4hYb+PXW8/xQ7f19VH6vQ=; b=FZAOWFBSGT30mXkfQCGO6zDek0CegbviWzdiV1FcO+AS8JeYJVdAh/eBcIl5z2dt1SzwuCBB3j4zDgWY4XT+K5Z0PTlqiXNBJrRvQ8kgVJLzXRjcj5lNURHTVpKNX+mX5ndEuw6bN9oIKyodpklYQC25MsdAzFMrADcumWEWSWc= 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 1743724226818437.318255213174; Thu, 3 Apr 2025 16:50:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u0UJV-0000cD-Rv; Thu, 03 Apr 2025 19:49:37 -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 1u0UJU-0000c4-5E for qemu-devel@nongnu.org; Thu, 03 Apr 2025 19:49:36 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u0UJR-0000Pu-P4 for qemu-devel@nongnu.org; Thu, 03 Apr 2025 19:49:35 -0400 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-3913d129c1aso1009832f8f.0 for ; Thu, 03 Apr 2025 16:49:33 -0700 (PDT) Received: from localhost.localdomain (184.170.88.92.rev.sfr.net. [92.88.170.184]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39c30226bbfsm3015600f8f.90.2025.04.03.16.49.29 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Apr 2025 16:49:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743724171; x=1744328971; 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=dr1ajPlH6JN6hTaMKguRfw4hYb+PXW8/xQ7f19VH6vQ=; b=ybjZSfaAwHgTReE0hqs/O/Ug9MVE3WHMJMIJMPFJseiDp5pJKViLE8aimOmNsbzxNg TQoAggxuRnMoI423HxH+Xhbia8cuxN1HpinnYIQpWN1ZOy5kvIWsuw/12Ppy9pCURyMV UVHXsdiTrH3qA8Yafv/ctVaaG9v2P9irBnbbKS9jS5UF/w5/Vzpnm/yGTztUVgk0yvPj XOsK18zUNyJL8fisoC9dd2dOxpe9prbgJdd9EXVoaADzUs2CZ8fLduP6NbTyi4g3synP gQjIJM4vwsUHpgvyJEytNJcT4rBdWPOrMsDlwU/IxmuIijUtOPZZyOa5Ce0zL67ovTKD a8UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743724171; x=1744328971; 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=dr1ajPlH6JN6hTaMKguRfw4hYb+PXW8/xQ7f19VH6vQ=; b=UfBd8OPS96xWH7OxAV+QwixN0fDyFQM2tXylpoPFBN9IOTig2mGPa8Qq/CLQvjEQp9 VilNks5tYYwjNyDJpv7pGeMR5raKnE/JNOUahXlsuP81cNKy4Q5nA93HQ8kKuin/9lMC Gn++B1BsLyBWU79ViQp7e5FNwBfGhgXVZedXVAosLiwIkdjnbXi5dSQzvSXQsxVPy6ZT 4r0tdwGUHslir95v5Z4gM93BHhAEHN0DcZHXoxEMojj1UBu+2Gm5wMjetIRob8+l3ijT qiao1EZfZRp1WOmKEMsOZ57o6xed5w/WTo8P6dOZfWygHC2TUevqe4nh1HsOrrJ8cb01 rKfQ== X-Gm-Message-State: AOJu0YzQQAZ9KVZt/+7Ul3uPqz62MZbugmrgeZVlDhGYEBneXhKv99Pj bUAB28HpOl/H+B8SfqCRJa0omOpnmEbmXaclzLFQEbq0I1u+zCd3T6I5i3qzhx4V0IW1X7dP8g6 x X-Gm-Gg: ASbGncuPeUlmJQryAkzozHB1x0zus0o8OUBuKbk6eFgIXARIv5DhrhYCGkRXLFyqM/e BECVrHPcjlWant/AtPuq/8x9+6hD9vdIVnjeG2C6aybQLKcDG+sA0BszAoERbEiBIlZa8Q/hs9/ CEMgddLKHcfmiMcH0a0KMdU92xHtIeYR1XF/dlFxLUUoqIHriqtcRwQEhDvYH1ZJHgB2glsh1K6 nsk2g7AmYGda7AxLHwMoYMPiojrEVkBOOYhwDUU1MYOOVvPvShRl1gq8OGQtxuD4XJqML98dJF8 wISNENdPXt9Hf3zDJjC2fxXDhkqOsafdj7RTkr49YN4BxPtBabcXbZJg5WV4p4rDMGaIPLsIkiH NT1seXMthMZ3GlLGiYT5d7cpjBr7ZyQ== X-Google-Smtp-Source: AGHT+IEJdc/oUH88yGHT8LqEBHVAe0pCN/7RQh88SANiYQxIYFQ3+DnMRvR49xggiIkExgwvV8DS1Q== X-Received: by 2002:a5d:6da6:0:b0:39c:2673:4f10 with SMTP id ffacd0b85a97d-39c2e651726mr5597399f8f.23.1743724171656; Thu, 03 Apr 2025 16:49:31 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Markus Armbruster , Richard Henderson , Pierrick Bouvier Subject: [RFC PATCH-for-10.1 02/19] qemu: Convert target_name() to TargetInfo API Date: Fri, 4 Apr 2025 01:48:57 +0200 Message-ID: <20250403234914.9154-3-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250403234914.9154-1-philmd@linaro.org> References: <20250403234914.9154-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1743724229567019100 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier --- include/hw/core/cpu.h | 2 -- include/qemu/target_info-impl.h | 3 +++ include/qemu/target_info.h | 2 ++ cpu-target.c | 5 ----- hw/core/machine-qmp-cmds.c | 1 + plugins/loader.c | 2 +- system/vl.c | 2 +- target_info-stub.c | 1 + target_info.c | 5 +++++ 9 files changed, 14 insertions(+), 9 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 5b645df59f5..9d9448341d1 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -1115,8 +1115,6 @@ bool cpu_exec_realizefn(CPUState *cpu, Error **errp); void cpu_exec_unrealizefn(CPUState *cpu); void cpu_exec_reset_hold(CPUState *cpu); =20 -const char *target_name(void); - #ifdef COMPILING_PER_TARGET =20 extern const VMStateDescription vmstate_cpu_common; diff --git a/include/qemu/target_info-impl.h b/include/qemu/target_info-imp= l.h index b340e192fce..00bb746572b 100644 --- a/include/qemu/target_info-impl.h +++ b/include/qemu/target_info-impl.h @@ -16,6 +16,9 @@ struct BinaryTargetInfo { /* runtime equivalent of TARGET_INFO_STUB_NEEDED definition */ bool is_stub; =20 + /* runtime equivalent of TARGET_NAME definition */ + const char *const name; + }; =20 #endif diff --git a/include/qemu/target_info.h b/include/qemu/target_info.h index fab3f3153ea..5b8f17a15a3 100644 --- a/include/qemu/target_info.h +++ b/include/qemu/target_info.h @@ -15,4 +15,6 @@ const BinaryTargetInfo *target_info(void); =20 bool target_info_is_stub(void); =20 +const char *target_name(void); + #endif diff --git a/cpu-target.c b/cpu-target.c index c99d208a7c4..3f82d3ea444 100644 --- a/cpu-target.c +++ b/cpu-target.c @@ -165,8 +165,3 @@ bool target_words_bigendian(void) { return TARGET_BIG_ENDIAN; } - -const char *target_name(void) -{ - return TARGET_NAME; -} diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c index 3130c5cd456..6701e210f54 100644 --- a/hw/core/machine-qmp-cmds.c +++ b/hw/core/machine-qmp-cmds.c @@ -19,6 +19,7 @@ #include "qapi/qobject-input-visitor.h" #include "qapi/type-helpers.h" #include "qemu/uuid.h" +#include "qemu/target_info.h" #include "qom/qom-qobject.h" #include "system/hostmem.h" #include "system/hw_accel.h" diff --git a/plugins/loader.c b/plugins/loader.c index 7523d554f03..36a4e88d4db 100644 --- a/plugins/loader.c +++ b/plugins/loader.c @@ -29,7 +29,7 @@ #include "qemu/xxhash.h" #include "qemu/plugin.h" #include "qemu/memalign.h" -#include "hw/core/cpu.h" +#include "qemu/target_info.h" #include "exec/tb-flush.h" =20 #include "plugin.h" diff --git a/system/vl.c b/system/vl.c index c17945c4939..d8a0fe713c9 100644 --- a/system/vl.c +++ b/system/vl.c @@ -40,6 +40,7 @@ #include "qemu/help_option.h" #include "qemu/hw-version.h" #include "qemu/uuid.h" +#include "qemu/target_info.h" #include "system/reset.h" #include "system/runstate.h" #include "system/runstate-action.h" @@ -79,7 +80,6 @@ #include "hw/block/block.h" #include "hw/i386/x86.h" #include "hw/i386/pc.h" -#include "hw/core/cpu.h" #include "migration/cpr.h" #include "migration/misc.h" #include "migration/snapshot.h" diff --git a/target_info-stub.c b/target_info-stub.c index d683a05977d..db61a335908 100644 --- a/target_info-stub.c +++ b/target_info-stub.c @@ -13,6 +13,7 @@ =20 static const BinaryTargetInfo target_info_stub =3D { .is_stub =3D true, + .name =3D TARGET_NAME, }; =20 const BinaryTargetInfo *target_info(void) diff --git a/target_info.c b/target_info.c index cb17d29b86d..6b44ea9fc0e 100644 --- a/target_info.c +++ b/target_info.c @@ -14,3 +14,8 @@ bool target_info_is_stub(void) { return target_info()->is_stub; } + +const char *target_name(void) +{ + return target_info()->name; +} --=20 2.47.1 From nobody Sun Nov 16 04:02:32 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=1743724336; cv=none; d=zohomail.com; s=zohoarc; b=cIZoiYji6gkOdwoJkNAxJ8x7zj6KnrdJ9y79ChFhxSFsLOvQKOlNtzVUCFczGY9BDttxrRS66Ncg/NWBatDcf2+4oNNFdSkYAFk2zlrHWCOtvj7XHzgOabzlbohswLVT348s1J+qBxmotxv93PfHqgIzJL77oATT7cOJqqXCLPk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1743724336; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=C0ep8yRGHXOIWXj4vAOUVPYwAcqcNEFgoSYnOV75PYE=; b=NQio0E/g+YT6iGS8dc2Uhj+pe1HPkj4NZZRJsRcpOMJ2TsQ+z11/ugV+Y5qrC2LjqVwOhkidb0mQx7Nr6lpAv5fd91gPmo/7yAOE3LvnGLVwaWEs/N6/yrjBWDJDQ4UEHnZ/dvzQJqQFHsB83qp8PhUbDmy/4BXgK8rs3hrpe7g= 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 1743724336515289.63370172338387; Thu, 3 Apr 2025 16:52:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u0UJc-0000cu-1O; Thu, 03 Apr 2025 19:49: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 1u0UJY-0000cg-OG for qemu-devel@nongnu.org; Thu, 03 Apr 2025 19:49:40 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u0UJX-0000Qx-3k for qemu-devel@nongnu.org; Thu, 03 Apr 2025 19:49:40 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-43cfb6e9031so12473295e9.0 for ; Thu, 03 Apr 2025 16:49:38 -0700 (PDT) Received: from localhost.localdomain (184.170.88.92.rev.sfr.net. [92.88.170.184]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39c301a9da1sm2903124f8f.22.2025.04.03.16.49.36 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Apr 2025 16:49:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743724177; x=1744328977; 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=C0ep8yRGHXOIWXj4vAOUVPYwAcqcNEFgoSYnOV75PYE=; b=pSTaIbcbzl9ZKMqyGykW6fIguwkOOE5HdT3IianBvUQKLRAZD6AMAhpacxKP/8BKYU qIDS7xsTCjicYAywtHwfZKVISB+cGKLs2VwXIZ4s7lAFCYhNkELDuijmCseYuc5pAqlw 8J1Pt9kcFG7ERZ+GV/DOzg9UiKTUmREg6IxgsaNBA6IVQCMGLKdb8ishlNsJ6Nn6NdcX c/PH6g+wahxPUzfkmySGA7FCCvAI1N+wgDS5uToKYM2sOsfRHKOJ6unTDYFUkWGglOuC 4VHl8TIfqeX05PH8dnBrC7TOzlTN28+dBeyCmPDZC2/P+QmN9C5osFnkuiCzSnP1Xkjg XeAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743724177; x=1744328977; 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=C0ep8yRGHXOIWXj4vAOUVPYwAcqcNEFgoSYnOV75PYE=; b=ANp2CQxzmejMtLFDUR+vJQ/IG9cPmt6Dx9qy2Rm9vubIH9Po5JCpLXBy/F3M08Myrw eYUw+WCunDMvulZDoIuze1iFMrw9QGimr70XTkMlIvioPejJlxJ9FEN8rAnL09scGAZz CeJlLLuTccT0hJk3xBhQO4yZI4JZmTDyRQlQBPSRHFqryz1QPiPzs/36xGSNtbWuIf6q PLM7o3KQm10qT6peBqK69j5g+TwnPd8QkbyONXZEhvdxuF2nR4KhXFgAjGYPapj2otZt THmw3mRtU5uk2PJAP7f51K/6zVWnzh7K9PF+MirwEgw4uWL4Y3WNuyg+NZXxW8269Tqa 39ig== X-Gm-Message-State: AOJu0YyuzGNiXpkMdLkOrrx8RVuDkg50GWEiTasmNHD8tNRqUuICEmHy why6YjKhnI0LPEsDd6Wq9SBmAR7bFGXGlFKIn6fRv84TyamSvpveEUJ1JX/PNSJ3aDHJRRgNtpQ E X-Gm-Gg: ASbGnctOc3hv3JAqBZyrrG5FFMyuYFLMrRrkG2i5+mhpdJ2LmwUc1eO8L+yfM98m61j QD1R/ZH2L6sQZsOhFu6UkTTe5LW2w5yk9GaTpL0ls2bMkupypMisQ9eeqfEsmLbnkMpFE5QVyIs KK9fr1UlT3dkYJuR8OtGuGyE6nou91yipnmo8u7vU1aNNQMg+NEHVMGP69UxpsXcq2wLYBWyobY sbc6H9vTz3PUu+e8/ioVsUo2ocIY/SXC7OKKJ6cEPQLr6QfJv/hOCCDpePLpv85rncej5V/9P5z dlRCZhaZkTJ4F1NblbbSavF5+3Pbz2dG4+oDq4KGTokqJbRdE66zyQJfIlYss4ieRD1aofD0rqY qELW/m7FphtTPKPoUFxY= X-Google-Smtp-Source: AGHT+IECrfbvudhCb0PsPXvzL5GgXBfXlHKDKK1yYhWZfxUJgBCsodMcZioGLnrhayFw/j8Eb/QNsw== X-Received: by 2002:a05:600c:1d29:b0:43c:fbe2:df3c with SMTP id 5b1f17b1804b1-43ecf9c7c26mr6622225e9.26.1743724177281; Thu, 03 Apr 2025 16:49:37 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Markus Armbruster , Richard Henderson , Pierrick Bouvier Subject: [RFC PATCH-for-10.1 03/19] qemu: Factor target_system_arch() out Date: Fri, 4 Apr 2025 01:48:58 +0200 Message-ID: <20250403234914.9154-4-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250403234914.9154-1-philmd@linaro.org> References: <20250403234914.9154-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1743724337317019000 Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/qemu/target_info-impl.h | 4 ++++ include/qemu/target_info.h | 4 ++++ hw/core/machine-qmp-cmds.c | 6 ++---- target_info-stub.c | 1 + target_info.c | 12 ++++++++++++ 5 files changed, 23 insertions(+), 4 deletions(-) diff --git a/include/qemu/target_info-impl.h b/include/qemu/target_info-imp= l.h index 00bb746572b..0cec211e362 100644 --- a/include/qemu/target_info-impl.h +++ b/include/qemu/target_info-impl.h @@ -10,6 +10,7 @@ #define QEMU_TARGET_INFO_IMPL_H =20 #include "qemu/target_info.h" +#include "qapi/qapi-types-machine.h" =20 struct BinaryTargetInfo { =20 @@ -19,6 +20,9 @@ struct BinaryTargetInfo { /* runtime equivalent of TARGET_NAME definition */ const char *const name; =20 + /* related to TARGET_ARCH definition */ + SysEmuTarget system_arch; + }; =20 #endif diff --git a/include/qemu/target_info.h b/include/qemu/target_info.h index 5b8f17a15a3..6ca36dae8a3 100644 --- a/include/qemu/target_info.h +++ b/include/qemu/target_info.h @@ -9,6 +9,8 @@ #ifndef QEMU_TARGET_INFO_H #define QEMU_TARGET_INFO_H =20 +#include "qapi/qapi-types-machine.h" + typedef struct BinaryTargetInfo BinaryTargetInfo; =20 const BinaryTargetInfo *target_info(void); @@ -17,4 +19,6 @@ bool target_info_is_stub(void); =20 const char *target_name(void); =20 +SysEmuTarget target_system_arch(void); + #endif diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c index 6701e210f54..9e2dd348c06 100644 --- a/hw/core/machine-qmp-cmds.c +++ b/hw/core/machine-qmp-cmds.c @@ -36,8 +36,7 @@ CpuInfoFastList *qmp_query_cpus_fast(Error **errp) MachineState *ms =3D MACHINE(qdev_get_machine()); MachineClass *mc =3D MACHINE_GET_CLASS(ms); CpuInfoFastList *head =3D NULL, **tail =3D &head; - SysEmuTarget target =3D qapi_enum_parse(&SysEmuTarget_lookup, target_n= ame(), - -1, &error_abort); + SysEmuTarget target =3D target_system_arch(); CPUState *cpu; =20 CPU_FOREACH(cpu) { @@ -137,8 +136,7 @@ TargetInfo *qmp_query_target(Error **errp) { TargetInfo *info =3D g_malloc0(sizeof(*info)); =20 - info->arch =3D qapi_enum_parse(&SysEmuTarget_lookup, target_name(), -1, - &error_abort); + info->arch =3D target_system_arch(); =20 return info; } diff --git a/target_info-stub.c b/target_info-stub.c index db61a335908..46a240ac66a 100644 --- a/target_info-stub.c +++ b/target_info-stub.c @@ -14,6 +14,7 @@ static const BinaryTargetInfo target_info_stub =3D { .is_stub =3D true, .name =3D TARGET_NAME, + .system_arch =3D -1, }; =20 const BinaryTargetInfo *target_info(void) diff --git a/target_info.c b/target_info.c index 6b44ea9fc0e..be4f19009b3 100644 --- a/target_info.c +++ b/target_info.c @@ -9,6 +9,7 @@ #include "qemu/osdep.h" #include "qemu/target_info-impl.h" #include "qemu/target_info.h" +#include "qapi/error.h" =20 bool target_info_is_stub(void) { @@ -19,3 +20,14 @@ const char *target_name(void) { return target_info()->name; } + +SysEmuTarget target_system_arch(void) +{ + SysEmuTarget system_arch =3D target_info()->system_arch; + + if (system_arch >=3D SYS_EMU_TARGET__MAX) { + system_arch =3D qapi_enum_parse(&SysEmuTarget_lookup, target_name(= ), -1, + &error_abort); + } + return system_arch; +} --=20 2.47.1 From nobody Sun Nov 16 04:02:32 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=1743724238; cv=none; d=zohomail.com; s=zohoarc; b=GpXlI8Ehz85A70XfZpT5I0v1zocuGu4LpjDlztn6Z5DVps21AQULB58A8h5PKMK3Cg3OXR64OQJMUeyBByMpp98dvBPZ2E+gZdyKsr+AsD6pF2MjuPYC0bDf9032UKKZub3DlpnAsUZNHZSUCSrWZVFAspYTrrOyx1nRnyu4kRA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1743724238; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=HvXkZVqpNEcQWld4uLHZD0xKtvIdCPqnGqYsj+ky1fo=; b=AiAJXB1tZZuO8jqvhn6ShM1t3//7ZjnrIRkZ1mn/CLI0Y49IBUuQKc9YcotdwmmMOs3kNto6coQln0yRpJF9XbUCknjt/9vWoDxhU0gf3LehETxJr8e571SKZgmeoRVyQZralZkr7YQ4nOnHff1oXZ2FfXr39zxyaPVt9ytHCpU= 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 1743724238931773.0270739883165; Thu, 3 Apr 2025 16:50:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u0UJi-0000dV-IX; Thu, 03 Apr 2025 19:49:50 -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 1u0UJg-0000dI-W9 for qemu-devel@nongnu.org; Thu, 03 Apr 2025 19:49:49 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u0UJe-0000RY-PS for qemu-devel@nongnu.org; Thu, 03 Apr 2025 19:49:48 -0400 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-39c1ee0fd43so1243767f8f.0 for ; Thu, 03 Apr 2025 16:49:46 -0700 (PDT) Received: from localhost.localdomain (184.170.88.92.rev.sfr.net. [92.88.170.184]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39c30226cf6sm2917081f8f.87.2025.04.03.16.49.41 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Apr 2025 16:49:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743724185; x=1744328985; 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=HvXkZVqpNEcQWld4uLHZD0xKtvIdCPqnGqYsj+ky1fo=; b=slI8isWncJywNxK8y4BI2RjTd5p0xiiXIFoAZnpJ1Vp3Qk7+ZnhLwBSCkWQKapifUY hrYOg1ZPXPtMVwtI4+E/Rn92MfFUwbu+qMp2EZbqQLpeC7KpOHBlKOAeu2rDPu8ldztZ mSuZ9QrkkLc/uwDrPlO7ua0yIaicta6VK+2R3Q1g+TAcQ9zWNmMLKXSYJndRxs+ueGVS IgW1x7rL5s+9+MIdlEFuzV7xXv+7MLTNVh7yvQm8yJ78c6jS0DPH7d1qvcJF/LwEsSPl Pe6rn7Vk2HYFTAFlG2IUvGYPBFb/h6ZgxLwVycd39PDLa0irCWX5z2A8bFNnTTLjRjUT 6MkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743724185; x=1744328985; 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=HvXkZVqpNEcQWld4uLHZD0xKtvIdCPqnGqYsj+ky1fo=; b=QjsvSfNf6vDA2LJziSMc+CmedgIBqz9V1pJx9pDRRv8JoWV6j/o0kOtZs+DGX1rWWv mEqYdLFKj+zbHR9oCxly9zm9o8HsQhzHsOP+4owqJEunHZt2JcMUFkdCBiNuxNgSS9y2 MmVtj0zkdoWxq1EBZVGBLZxiEaq9Ch5hC0hQKDK1v1yVto5FL/ktOZFyeQMjBMqo3UhX R63wxSyGLZUCwqbKEHQVhdhc7j4U9UT+nOXsbwN3DPRSY1q48nWzBJH0fl7nU9lKoY8C 0uEp2ZYirmlHjcQRQ7Xq+K3ENgw55IwP5tkG4QS28N2sca9L0nJVHuDkV4xlMSrZOVHC mw4A== X-Gm-Message-State: AOJu0YwaOoaHSHHy87ZVeP34dHpWc0cEa3TxCYhUkQpibX6V8XwAJSq5 DiD1SnjYEuPpqik0tTQuwnvIhak/QEs+2I68RfaId0zSdtiJfuNYwHB4pdVk13YR274L6/blSMS x X-Gm-Gg: ASbGnctQ9veEWgiTd7EMxlfXurvYDgkUKKabY0a9u6+5xXv6M48S0Q9LLUENn1TiqVr 57ZO9K+nwfKx1ov0kDJokfV77nkyXY1sPttGd42PO0qlQ2WJrB+TZnP5y5KOwg9EHdUnGAPga2S rj/bqkaGtOEkvwFpsKxl+6L8VGfC+fm3yeZE3D9/y1aWxewnkTmpy0jlfKwURZm0WhLjf1lZgvd wllJM5gE2PivPcsbHHPGZQDcZvQCdqS/kNHVzqEf+M1ko7yeGQAAAK5y3mixUWFqMJ123vmSzPU CmunsBfKjn499c4b/Oi4JSFFggPfLsC1ZJMSXOtz/SZ1Z9yHlj6OwhePGTmB1WasRq1AaQMVvBx 89rZfnAIuOPzFQfnsmrw= X-Google-Smtp-Source: AGHT+IGG1bpNcdwMMI9/IGjSjrA5MHp+h6IIbhprKWNSzJT9VI1jHpT4EYZa7e3tm4/PDAdtnDlNjQ== X-Received: by 2002:a05:6000:1848:b0:39c:16a0:fef4 with SMTP id ffacd0b85a97d-39cba9337ffmr954721f8f.24.1743724184660; Thu, 03 Apr 2025 16:49:44 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Markus Armbruster , Richard Henderson , Pierrick Bouvier Subject: [RFC PATCH-for-10.1 04/19] qemu: Convert target_words_bigendian() to TargetInfo API Date: Fri, 4 Apr 2025 01:48:59 +0200 Message-ID: <20250403234914.9154-5-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250403234914.9154-1-philmd@linaro.org> References: <20250403234914.9154-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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::42d; envelope-from=philmd@linaro.org; helo=mail-wr1-x42d.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1743724241081019000 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier --- include/exec/tswap.h | 13 +------------ include/qemu/target_info-impl.h | 4 ++++ include/qemu/target_info.h | 11 +++++++++++ cpu-target.c | 6 ------ hw/core/cpu-system.c | 2 +- hw/display/vga.c | 2 +- hw/virtio/virtio.c | 2 +- system/qtest.c | 1 + target_info-stub.c | 1 + target_info.c | 5 +++++ 10 files changed, 26 insertions(+), 21 deletions(-) diff --git a/include/exec/tswap.h b/include/exec/tswap.h index 84060a49994..415781b2bcc 100644 --- a/include/exec/tswap.h +++ b/include/exec/tswap.h @@ -9,18 +9,7 @@ #define TSWAP_H =20 #include "qemu/bswap.h" - -/** - * target_words_bigendian: - * Returns true if the (default) endianness of the target is big endian, - * false otherwise. Common code should normally never need to know about t= he - * endianness of the target, so please do *not* use this function unless y= ou - * know very well what you are doing! - */ -bool target_words_bigendian(void); -#ifdef COMPILING_PER_TARGET -#define target_words_bigendian() TARGET_BIG_ENDIAN -#endif +#include "qemu/target_info.h" =20 /* * If we're in target-specific code, we can hard-code the swapping diff --git a/include/qemu/target_info-impl.h b/include/qemu/target_info-imp= l.h index 0cec211e362..14566e4a913 100644 --- a/include/qemu/target_info-impl.h +++ b/include/qemu/target_info-impl.h @@ -10,6 +10,7 @@ #define QEMU_TARGET_INFO_IMPL_H =20 #include "qemu/target_info.h" +#include "qapi/qapi-types-common.h" #include "qapi/qapi-types-machine.h" =20 struct BinaryTargetInfo { @@ -23,6 +24,9 @@ struct BinaryTargetInfo { /* related to TARGET_ARCH definition */ SysEmuTarget system_arch; =20 + /* related to TARGET_BIG_ENDIAN definition */ + EndianMode endianness; + }; =20 #endif diff --git a/include/qemu/target_info.h b/include/qemu/target_info.h index 6ca36dae8a3..e84f16d1034 100644 --- a/include/qemu/target_info.h +++ b/include/qemu/target_info.h @@ -21,4 +21,15 @@ const char *target_name(void); =20 SysEmuTarget target_system_arch(void); =20 +/** + * target_words_bigendian: + * Returns true if the (default) endianness of the target is big endian, + * false otherwise. Note that in target-specific code, you can use + * TARGET_BIG_ENDIAN directly instead. On the other hand, common + * code should normally never need to know about the endianness of the + * target, so please do *not* use this function unless you know very well + * what you are doing! + */ +bool target_words_bigendian(void); + #endif diff --git a/cpu-target.c b/cpu-target.c index 3f82d3ea444..761c2d28645 100644 --- a/cpu-target.c +++ b/cpu-target.c @@ -159,9 +159,3 @@ void cpu_abort(CPUState *cpu, const char *fmt, ...) #endif abort(); } - -#undef target_words_bigendian -bool target_words_bigendian(void) -{ - return TARGET_BIG_ENDIAN; -} diff --git a/hw/core/cpu-system.c b/hw/core/cpu-system.c index 82b68b8927d..32700c49b43 100644 --- a/hw/core/cpu-system.c +++ b/hw/core/cpu-system.c @@ -24,7 +24,7 @@ #include "exec/cputlb.h" #include "system/memory.h" #include "exec/tb-flush.h" -#include "exec/tswap.h" +#include "qemu/target_info.h" #include "hw/qdev-core.h" #include "hw/qdev-properties.h" #include "hw/core/sysemu-cpu-ops.h" diff --git a/hw/display/vga.c b/hw/display/vga.c index b01f67c65fb..1883e03d3d8 100644 --- a/hw/display/vga.c +++ b/hw/display/vga.c @@ -26,7 +26,7 @@ #include "qemu/units.h" #include "system/reset.h" #include "qapi/error.h" -#include "exec/tswap.h" +#include "qemu/target_info.h" #include "hw/display/vga.h" #include "hw/i386/x86.h" #include "hw/pci/pci.h" diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 85110bce374..4ef56c183b2 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -20,7 +20,7 @@ #include "qemu/log.h" #include "qemu/main-loop.h" #include "qemu/module.h" -#include "exec/tswap.h" +#include "qemu/target_info.h" #include "qom/object_interfaces.h" #include "hw/core/cpu.h" #include "hw/virtio/virtio.h" diff --git a/system/qtest.c b/system/qtest.c index 523a0479959..6146a7bfdc0 100644 --- a/system/qtest.c +++ b/system/qtest.c @@ -29,6 +29,7 @@ #include "qemu/error-report.h" #include "qemu/module.h" #include "qemu/cutils.h" +#include "qemu/target_info.h" #include "qom/object_interfaces.h" =20 #define MAX_IRQ 256 diff --git a/target_info-stub.c b/target_info-stub.c index 46a240ac66a..c1a15f5cc12 100644 --- a/target_info-stub.c +++ b/target_info-stub.c @@ -15,6 +15,7 @@ static const BinaryTargetInfo target_info_stub =3D { .is_stub =3D true, .name =3D TARGET_NAME, .system_arch =3D -1, + .endianness =3D TARGET_BIG_ENDIAN ? ENDIAN_MODE_BIG : ENDIAN_MODE_LITT= LE, }; =20 const BinaryTargetInfo *target_info(void) diff --git a/target_info.c b/target_info.c index be4f19009b3..22796dda543 100644 --- a/target_info.c +++ b/target_info.c @@ -31,3 +31,8 @@ SysEmuTarget target_system_arch(void) } return system_arch; } + +bool target_words_bigendian(void) +{ + return target_info()->endianness =3D=3D ENDIAN_MODE_BIG; +} --=20 2.47.1 From nobody Sun Nov 16 04:02:32 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=1743724307; cv=none; d=zohomail.com; s=zohoarc; b=LjnvwUfL3gPWJmMZPwh5xw5v4vN0KystmyVIS3chHudcVnzIqip64w4j2sQQbcwI/z0vUDMWKOZ6p3yRZ2TnHfhqpS2dbFb3F32G6yZUz6ZMLxaxqHXfn78tACr2DjzxRX3Zl6mgUMh6CnKwWMah1PNxWf5RbkCBA5ZC+6Ee/fw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1743724307; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+PyUW7pUGtdQFg0mGJcdbddKSlIReGI4v2OUa97+DAA=; b=mslHIODMn0IDs1oE8a2Ve5wk3Dl4a/lyfHtbLR0TycuTPImEan3fmCGqUBuXn9wveij3nVEE3uM1Jb81sifcQ0AsFEInoZeG1dPvStb88ShV/vvyWYW0E0Ww0Tkpl0/J8c0LoTYMbpZcjrjXACRDFe5oXHSHiMvzvb7K5pXZgFA= 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 174372430708720.305549162506736; Thu, 3 Apr 2025 16:51:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u0UJo-0000eL-3N; Thu, 03 Apr 2025 19:49:56 -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 1u0UJm-0000e4-6b for qemu-devel@nongnu.org; Thu, 03 Apr 2025 19:49:54 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u0UJk-0000Sf-K5 for qemu-devel@nongnu.org; Thu, 03 Apr 2025 19:49:53 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-43cf680d351so14686495e9.0 for ; Thu, 03 Apr 2025 16:49:52 -0700 (PDT) Received: from localhost.localdomain (184.170.88.92.rev.sfr.net. [92.88.170.184]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43ec1663046sm34887965e9.13.2025.04.03.16.49.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Apr 2025 16:49:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743724190; x=1744328990; 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=+PyUW7pUGtdQFg0mGJcdbddKSlIReGI4v2OUa97+DAA=; b=Z1bFKRhr5xqV6wahMD8DNZ0ADvgVz5oocGYjYlhoQ/n94ZDS/RBkoPxvfwGMam+d9V Xm5NMdALktSlg3sqUCgBvGPtsI0lvRXase8z/phT3mXtmu9ZekAF7sGI0qEF27TVVo+S xSlXauzlUKFbd1KUs1CJiX/3FvFXg8IVbGYmFpSZuf0PmTwXPNIH3db6Hd/mAz7Mv6KE 4J+DLy5G++RKfYzgMaayy8qEgvwjB6vbTcbo/+xuB8xjossxeINI2T3L2+QjKoKeQQjg 5+gOceXBvs2bR9PvYIbJMbok3ivjjncGCI5zw0dBeQRLKsvNSNoprktBSNDkP4pjeki5 I7Jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743724190; x=1744328990; 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=+PyUW7pUGtdQFg0mGJcdbddKSlIReGI4v2OUa97+DAA=; b=hqXRtBqq82phUzeH5xRwW2qw5zdEz88qAWvALg0t78tRLZdHrs1qX5NcVPDVetbSRh bDe9pj+BWC8w2xcyfYZnBiQN92/VB0FH520OvIQuiSKEjT0FXbx7h5wez5xelv8gbqwr 48qscB885ranhfSvkb6Kcy2AvOzPu9uHufzEscMS4xkcnrfP3DriVu0TsD7sVX0niy49 bZwlnAf4wnNvQrk2jx9kMisxyp/e9aqHWZTijaS7HJJuOXPRqhEVoNSmv1NLXAs0UTJc Hg7z2IOK12zPYRmma7Bs5xCZreZGCoxopUPoJijPmP+16GeFsVHZnsyxZIDZJ5dsslSr k8FA== X-Gm-Message-State: AOJu0YwCLUi9jjajUjoBJO9LZqPIevQoutnXnEslxpN+nHGomX2eRTyx RK7YzYRU2FazSPqXVIVzQHN7qFD7AD0PtwogYP0Sq1RotH/B2aixUWJTZlF3u00qw8GjT7VAsB2 s X-Gm-Gg: ASbGncuPCYR75ayHaKmWdveXBG0Jkf+RHmCIIq1Q3qPgG06uShdVkbWA0FZp//5Rrip b5ADLMb97BmxTL0kPlbWNbr69iIEDqMUkMwMaWE2BjoxbLjA8848fLKLNLVKmziA0YaWUDgc7m3 HH9yzG5jWcy/39j1KL28z32meRSVCK4rjdrTLp0P9Nsn2lQ4AfpTTQThETdD3PbAARVQg/Ni02+ WERbB+42DygIV5dkzfr1PK7BklmoSSwEa4/gXW1s+doKrDxbVRChG4dAz2/RfDhrOMT8Lay4m55 yGYKJdZZmzeyUlDn3/Fuiog1LT/0mjuaYHu9OXZaA2yR9MdrAPmgXr9w2RcaC4PGF7xj8YgZ3kV pcUodygHokzGiZUn/ffc= X-Google-Smtp-Source: AGHT+IHM9D9L28psTSkzvUhTw9HfoNOBAz0mGzP1zV24uzdFTZ2kPAAVNnZhqi/vrKI5xGBeI11+DA== X-Received: by 2002:a05:6000:2211:b0:391:952:c74a with SMTP id ffacd0b85a97d-39c2e610f88mr4782528f8f.8.1743724190564; Thu, 03 Apr 2025 16:49:50 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Markus Armbruster , Richard Henderson , Pierrick Bouvier Subject: [RFC PATCH-for-10.1 05/19] qemu: Introduce target_long_bits() Date: Fri, 4 Apr 2025 01:49:00 +0200 Message-ID: <20250403234914.9154-6-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250403234914.9154-1-philmd@linaro.org> References: <20250403234914.9154-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1743724309443019100 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier --- include/qemu/target_info-impl.h | 3 +++ include/qemu/target_info.h | 2 ++ target_info-stub.c | 1 + target_info.c | 5 +++++ 4 files changed, 11 insertions(+) diff --git a/include/qemu/target_info-impl.h b/include/qemu/target_info-imp= l.h index 14566e4a913..8fa585f8138 100644 --- a/include/qemu/target_info-impl.h +++ b/include/qemu/target_info-impl.h @@ -27,6 +27,9 @@ struct BinaryTargetInfo { /* related to TARGET_BIG_ENDIAN definition */ EndianMode endianness; =20 + /* runtime equivalent of TARGET_LONG_BITS definition */ + unsigned long_bits; + }; =20 #endif diff --git a/include/qemu/target_info.h b/include/qemu/target_info.h index e84f16d1034..66c43b329cc 100644 --- a/include/qemu/target_info.h +++ b/include/qemu/target_info.h @@ -32,4 +32,6 @@ SysEmuTarget target_system_arch(void); */ bool target_words_bigendian(void); =20 +unsigned target_long_bits(void); + #endif diff --git a/target_info-stub.c b/target_info-stub.c index c1a15f5cc12..a5374caed6c 100644 --- a/target_info-stub.c +++ b/target_info-stub.c @@ -16,6 +16,7 @@ static const BinaryTargetInfo target_info_stub =3D { .name =3D TARGET_NAME, .system_arch =3D -1, .endianness =3D TARGET_BIG_ENDIAN ? ENDIAN_MODE_BIG : ENDIAN_MODE_LITT= LE, + .long_bits =3D TARGET_LONG_BITS, }; =20 const BinaryTargetInfo *target_info(void) diff --git a/target_info.c b/target_info.c index 22796dda543..2fd32931e13 100644 --- a/target_info.c +++ b/target_info.c @@ -36,3 +36,8 @@ bool target_words_bigendian(void) { return target_info()->endianness =3D=3D ENDIAN_MODE_BIG; } + +unsigned target_long_bits(void) +{ + return target_info()->long_bits; +} --=20 2.47.1 From nobody Sun Nov 16 04:02:32 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=1743724331; cv=none; d=zohomail.com; s=zohoarc; b=G1bw0KFtrja7Fs7hOtpSuxpYa/P2PQWMIyOSDwWLSK13GlEeQfrXuHrGSIzpO8gtTlpIx9k7f9HgB0l1pHtbjjf4Ep0LIbM9TgfaYNVFSefBbX7cTwkQmWzLtgI0Ie1RTGNlHx0dQmSEQPzVUD+REg+Tgc6RTuUxVYc2dFmAFsg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1743724331; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=mgkLDZ47lJdUOfhv84ZtqSryce3s2ehUhrQmnYvG1gU=; b=lHLDaojLgOnqYXzGKfmM7tcIrXzFr4zqdJBfcXj7QK037KJOJtLyh5Cp4mg809AeaSPzGfeVO/iuHaIghaZ4b4sSAG/TnIgB2t8oI74Rd45YFCmUKCPR5riqHDsOrRN8ZoDYrdc1d1u2xl5TX39JiNa4YezdJzNxVWWOo6Cv2vE= 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 1743724331852223.03068766623323; Thu, 3 Apr 2025 16:52:11 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u0UJt-0000f2-9q; Thu, 03 Apr 2025 19:50:01 -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 1u0UJs-0000ej-9Y for qemu-devel@nongnu.org; Thu, 03 Apr 2025 19:50:00 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u0UJq-0000TG-Fz for qemu-devel@nongnu.org; Thu, 03 Apr 2025 19:49:59 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-43cf05f0c3eso9179015e9.0 for ; Thu, 03 Apr 2025 16:49:57 -0700 (PDT) Received: from localhost.localdomain (184.170.88.92.rev.sfr.net. [92.88.170.184]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43ec147c9dbsm35295975e9.0.2025.04.03.16.49.55 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Apr 2025 16:49:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743724196; x=1744328996; 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=mgkLDZ47lJdUOfhv84ZtqSryce3s2ehUhrQmnYvG1gU=; b=B18YblHoc7coTxxKHryrzOKiQgh4vH5mhZsCBRbYJuT6gsfBNFyXs4HiW0ZjAfmMJu PjYA9SRM+060r+uf79T2WpR44hbHR06pVlSdoPCj9n6cluRJqk5ZCuezlKZIBBSY+9sF FC9GA6gYN0hUJhnyJgiyTNACjaV0buynTlR11pGCkR8Fm5JhyK5PVsS/0zdvAivkpCmy iv2tJdlZgPpp4iHXtSRTXVpD2Ye4yuu1vQ4PbqmTvUBxoV0Qn9fjDiAAu5KUfU8ijGFN 5onTVY8UqUiPCVtXXLjxufWX8FSarSHtwjYZ38sinIP5T+vvL7TkSsulJKfD8geNb8J+ mlTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743724196; x=1744328996; 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=mgkLDZ47lJdUOfhv84ZtqSryce3s2ehUhrQmnYvG1gU=; b=LWPPXESRZWo9yHsr6ckh6lZp+2t95LhLKz1How5qVbGTSSJtLPauLozTNYMDeGXfB7 lsZQ34TYhTuJuqVpbdB6Lk4d5QtFuXdCDsH7bY1BiI6cAQXYjaApEFWlY1170Kh3onQ1 LJW4b9/DxJtS2uU693Ab+ZtasZzy0uxUWVx4CysQITPZTbkHzwek/E6rgbP6KvBGEc8W SV4GKwVHPZEYNyfAvx/UKljISIY1LDYM2vv2Vyk8cb+jSf0vB7XZ+Jb5UNRktGb3lv+d hfAch6nzYqi3MSBW5vN4o1Nu1ePdDbt7BvIchb5m5blFV6uo3mYZ2z7JW7jvCgGNu8BL kblA== X-Gm-Message-State: AOJu0YxUcO4uDjsxxycmi/V/Zq0H0jzdahJqz45b5Y8DdiJK1cuhlUMD A97Xvvsf/P/aZnF6sgaIvqn4HrBnLcP2AY5qKceHyy5H/26KQNyZFTV7syQNcS9zVywCiMQ9wYZ x X-Gm-Gg: ASbGncu+BbB7xIHbsVarOtyxbqImxAxezrwWqnNbk0DtyZyYv4npSrPGBQ5iKHrZJ+j WS1mSAeaS1lU+cppZxu7257x4ErSRK4JVz/hTbACPWYqduFVoz2EY1s1RdDFXhTeAsE+SuiE18k KkJe9MG/3PlBKf8SVr4RMp8eiL5WbXSHZ+A4czT13CeKdpac7/cxhiB3A4XD20fxyAzqQxFTN1Y 1fLoxBUQyG/iujLFrZyzhJbrcH9Q9BAbvB1GuJnEBAlfIwQEOSC+6/GVdT4sTTLN9Uhe/2QEedL HWl9E2YjnWrtTQrkZd5VwvE8oQK8D5Ik5Ezy3Gn3h2Y3QKgnLFXz8xWrUuYCFA1nuBgVgS8NypX 7+2SvR9TVpqa1KS6hdgs= X-Google-Smtp-Source: AGHT+IGQaRD6bk+aKugk47ByDk+zkSEEaCeKRFLhA+IN/wEQ5NSkMDnoj6DDZaPsPOSUs+1vJPPeng== X-Received: by 2002:a05:600c:3b13:b0:43c:f050:fed3 with SMTP id 5b1f17b1804b1-43ed0bde8a8mr4685965e9.11.1743724196405; Thu, 03 Apr 2025 16:49:56 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Markus Armbruster , Richard Henderson , Pierrick Bouvier Subject: [RFC PATCH-for-10.1 06/19] target/tricore: Replace TARGET_LONG_BITS -> target_long_bits() Date: Fri, 4 Apr 2025 01:49:01 +0200 Message-ID: <20250403234914.9154-7-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250403234914.9154-1-philmd@linaro.org> References: <20250403234914.9154-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1743724333466019100 Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/tricore/translate.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/tricore/translate.c b/target/tricore/translate.c index 7cd26d8eaba..ad959f3b0a1 100644 --- a/target/tricore/translate.c +++ b/target/tricore/translate.c @@ -24,6 +24,7 @@ #include "tcg/tcg-op.h" #include "accel/tcg/cpu-ldst.h" #include "qemu/qemu-print.h" +#include "qemu/target_info.h" =20 #include "exec/helper-proto.h" #include "exec/helper-gen.h" @@ -5922,6 +5923,7 @@ static void decode_rr_logical_shift(DisasContext *ctx) { uint32_t op2; int r3, r2, r1; + unsigned long_bits =3D target_long_bits(); =20 r3 =3D MASK_OP_RR_D(ctx->opcode); r2 =3D MASK_OP_RR_S2(ctx->opcode); @@ -5937,7 +5939,7 @@ static void decode_rr_logical_shift(DisasContext *ctx) break; case OPC2_32_RR_CLO: tcg_gen_not_tl(cpu_gpr_d[r3], cpu_gpr_d[r1]); - tcg_gen_clzi_tl(cpu_gpr_d[r3], cpu_gpr_d[r3], TARGET_LONG_BITS); + tcg_gen_clzi_tl(cpu_gpr_d[r3], cpu_gpr_d[r3], long_bits); break; case OPC2_32_RR_CLO_H: gen_helper_clo_h(cpu_gpr_d[r3], cpu_gpr_d[r1]); @@ -5949,7 +5951,7 @@ static void decode_rr_logical_shift(DisasContext *ctx) gen_helper_cls_h(cpu_gpr_d[r3], cpu_gpr_d[r1]); break; case OPC2_32_RR_CLZ: - tcg_gen_clzi_tl(cpu_gpr_d[r3], cpu_gpr_d[r1], TARGET_LONG_BITS); + tcg_gen_clzi_tl(cpu_gpr_d[r3], cpu_gpr_d[r1], long_bits); break; case OPC2_32_RR_CLZ_H: gen_helper_clz_h(cpu_gpr_d[r3], cpu_gpr_d[r1]); --=20 2.47.1 From nobody Sun Nov 16 04:02:32 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=1743724267; cv=none; d=zohomail.com; s=zohoarc; b=T1dQ6Ym3l09rhM9t1cXfDkcj9zsLSiZDTO4kduyAS8a3xJoPAQw1HdN7lTX+a9rr8Bwo+UaPHM+yrfa+i1+6AwscwSOOcJpfizE7vtW21i9iZkc4kntMhbIU37EN2CnS7fC77yrrQoCNrFstx2dOpHEmEP4TQIioiUTZ/Jj58fo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1743724267; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=zdkIZVCk0oK1AHydxn4CXLts02MNjyPOTlWUooOm/tw=; b=XsKmR4xKOtD0kQcLyKRaxlFYBWH1Ge/xJwvB+z1qiswdhVk/btvrOpTRI9hZlmsyvXLS87AvPCeZ2MjOJ5jkOKv7OIhLZGxM7f8/w5EvvA1vb7ejUBIkjDNqy+EpYyd2cQ60NMBSoRgyv4dxWLvmMUFidYGRXxUw/SUvCtk+X9M= 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 1743724267512415.3816307449796; Thu, 3 Apr 2025 16:51:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u0UK3-0000u5-6u; Thu, 03 Apr 2025 19:50:11 -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 1u0UK0-0000k6-06 for qemu-devel@nongnu.org; Thu, 03 Apr 2025 19:50:08 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u0UJx-0000VE-L2 for qemu-devel@nongnu.org; Thu, 03 Apr 2025 19:50:07 -0400 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-3995ff6b066so810785f8f.3 for ; Thu, 03 Apr 2025 16:50:05 -0700 (PDT) Received: from localhost.localdomain (184.170.88.92.rev.sfr.net. [92.88.170.184]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43ec3174cf0sm32222245e9.0.2025.04.03.16.50.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Apr 2025 16:50:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743724204; x=1744329004; 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=zdkIZVCk0oK1AHydxn4CXLts02MNjyPOTlWUooOm/tw=; b=abfsmUeeBqROTADd5ddB16yN5Bn0HBLa3Hnxk5HeN9tQIPsEmjMHQQtCT4sGrgd2iV LgTpXB2rodemD5jM6T/OadrJFso+JpPORTlb6vtliEISTyD2K/gOAa7tchUp6P/x+BW7 qTzCyNAWxgu563w6Ch7GaJa6QtkFkZDWbQC3jS3ui1cV2CZznrXobpK8VDkewh9n1o2l EF3RgG87G1cwCGERgcCVqBXG2yWoj72Mowxj2a6JLty+MBOXqzxKtFslW22RYg0shY/c gXtfRADjNZ2fCItaQEBtCXVVGAKd83zjhX6QYlbbTGr4W9YAx/Uq7oOakvD9HxCJEv85 L+PQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743724204; x=1744329004; 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=zdkIZVCk0oK1AHydxn4CXLts02MNjyPOTlWUooOm/tw=; b=r9LWLGXiKEdBZh4IZgNWJ9cf5iBziihgb5kKsIKKyMcLwUPdU5HyOlomYn4pMBTMke VzovnmwY+pexXMtk3DtD3yvBoNYJSp16h7b3aEcg2yr6ER5+cTpkmi3OBuhj7+USEepn GWcNLoTReoyoZb7Z0MC0Ofxks46oUukdmsAJnGjMnmrjC3jqJvBFrm2HVvQr5jpcw8W6 9okuZxho0FImz/9iWFhhd+pluITZ2cx5g/UCKJUnGEd5UfdltttCGTF/WTrzYMegL0KU +nzRBsfcXraaBWAWjVLbixlDEwaOqioXrhuv5q1orQXHE6VSw4Kl+m2NdqH/9m9LDHkB jmXA== X-Gm-Message-State: AOJu0YzHk4fpIQVJTVZ/L7FShoai/A35RWGYAM+oOTGcvnX4OEEBOCQn d4CW8B4NvOZG/AtjU2+9uv+LR/xSIIPhFNPpSS/rzY8ZuzrgJCKGUyhBbe4ZOYrGXicJEfRhr0D j X-Gm-Gg: ASbGncvCjMTYk6SoLPEFv868E9bBw55GPoIWpNTz0UGv1Wpbp7AiP0F+oKyfOR/kCFN hqr6F3fNhZsB0bBfR0/Hf+eoSlbhjtUyiUxdRGUv2Tkn4Tbq3R6/XiS1xvjfW2Z4EUdzWGxVl+8 FHy1jJLzPCWwjpFsL1E0IPqhjcc+a4ULBeKURixa3gjzkTC5wJC1wKcp5EyJkcDyUO1WwfZr5QX AKRT4hn9pBCcpN7LA1sSarNGHq8CdXA9vX5bJ6EJ7mW/NAWK17spBJ+I4KnGSApJs6CVisMLb0X 7fMb/z6AnPhHnUI7d7/6NQQzJYjw7zw0WN+4kHX9W5amqovyu5MovPEe9dTe6Q4Aplnb6n6zsCz pFYCCWHfIbZJrSOX/CBk= X-Google-Smtp-Source: AGHT+IGJc7xf48j7MctoqfOOUopvibIJsAcYZUdY+TDZCXDR6W+Sp2SZdRgUpKo5a6+BPy5NCfzH8A== X-Received: by 2002:a05:6000:220b:b0:39c:2692:4259 with SMTP id ffacd0b85a97d-39cb35981fdmr991805f8f.21.1743724203828; Thu, 03 Apr 2025 16:50:03 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Markus Armbruster , Richard Henderson , Pierrick Bouvier Subject: [RFC PATCH-for-10.1 07/19] target/hppa: Replace TARGET_LONG_BITS -> target_long_bits() Date: Fri, 4 Apr 2025 01:49:02 +0200 Message-ID: <20250403234914.9154-8-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250403234914.9154-1-philmd@linaro.org> References: <20250403234914.9154-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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::430; envelope-from=philmd@linaro.org; helo=mail-wr1-x430.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1743724269340019000 Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/hppa/mem_helper.c | 3 ++- target/hppa/translate.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c index 554d7bf4d14..03cd103f284 100644 --- a/target/hppa/mem_helper.c +++ b/target/hppa/mem_helper.c @@ -19,6 +19,7 @@ =20 #include "qemu/osdep.h" #include "qemu/log.h" +#include "qemu/target_info.h" #include "cpu.h" #include "exec/exec-all.h" #include "exec/cputlb.h" @@ -101,7 +102,7 @@ static void hppa_flush_tlb_ent(CPUHPPAState *env, HPPAT= LBEntry *ent, =20 tlb_flush_range_by_mmuidx(cs, ent->itree.start, ent->itree.last - ent->itree.start + 1, - HPPA_MMU_FLUSH_MASK, TARGET_LONG_BITS); + HPPA_MMU_FLUSH_MASK, target_long_bits()); =20 /* Never clear BTLBs, unless forced to do so. */ is_btlb =3D ent < &env->tlb[HPPA_BTLB_ENTRIES(env)]; diff --git a/target/hppa/translate.c b/target/hppa/translate.c index 14f38333222..81f535589cf 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -18,6 +18,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/target_info.h" #include "cpu.h" #include "qemu/host-utils.h" #include "exec/exec-all.h" @@ -3731,7 +3732,7 @@ static bool trans_shrp_imm(DisasContext *ctx, arg_shr= p_imm *a) t2 =3D load_gpr(ctx, a->r2); if (a->r1 =3D=3D 0) { tcg_gen_extract_i64(dest, t2, sa, width - sa); - } else if (width =3D=3D TARGET_LONG_BITS) { + } else if (width =3D=3D target_long_bits()) { tcg_gen_extract2_i64(dest, t2, cpu_gr[a->r1], sa); } else { assert(!a->d); --=20 2.47.1 From nobody Sun Nov 16 04:02:32 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=1743724292; cv=none; d=zohomail.com; s=zohoarc; b=YBcDIc8qQxTA7ENuW1DqoqmVyTxmO5U+TIVPh+BLy9F7AXaQzpf/x2nTNrv6DQ0NpgrMnhHfFPhkdmeTj+ecdXbWluu8pmyYGAOyA+RnQaeipUN7G1lklfFGVzy4DLTfuVQEuGUEkRyaNSu0Woj07PeSFjreu8mnbbegVuOXBj0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1743724292; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=F4hQtsRqLsOAfmfIygYHr5yTvJJXu3lpTgjRUryOvbU=; b=QaitOFLAEraOsrpjE7iUcmvGueVA5DlZHBJMg+fZCquR73IattG19Ihhlu8AYL7sYST8NiEnakP5WsZK86sIOsTVtr1ZLaE19Go6sxN+SQq7UkSqXwOWoK9YBhlO/pkjuIGBr/StiQhmC5TSgtSfZiEVGiJ8Rd5e0ajsl4ayNn4= 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 1743724292599373.47333219682866; Thu, 3 Apr 2025 16:51:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u0UK8-0001Cy-Gx; Thu, 03 Apr 2025 19:50:16 -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 1u0UK5-00014F-In for qemu-devel@nongnu.org; Thu, 03 Apr 2025 19:50:13 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u0UK3-0000gr-Mx for qemu-devel@nongnu.org; Thu, 03 Apr 2025 19:50:13 -0400 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-39c1ee0fd43so1243951f8f.0 for ; Thu, 03 Apr 2025 16:50:11 -0700 (PDT) Received: from localhost.localdomain (184.170.88.92.rev.sfr.net. [92.88.170.184]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39c301b816csm2968052f8f.57.2025.04.03.16.50.08 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Apr 2025 16:50:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743724209; x=1744329009; 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=F4hQtsRqLsOAfmfIygYHr5yTvJJXu3lpTgjRUryOvbU=; b=vWhmwXnBRb9XRw9XPjZoe1l0ymrDprgPxL0lGn/bJ2+1YlGygL7AfEqJ4/uJboTHNJ hmw/A6/hW+7d7YRSstBBTeau4rAHkT8XGX1sw/fH+f7U30BmxCjZAVkjVL/RgNYDPrTV ryHgewR48Yiu5KadCmLNd99M/eNVkkusJDERMOaA545BigF8PkmFfg3pVeuxDYocNI/V d0WHHdZKQrU31DeRymyYopAUuTyKgRa0mDuKQLVeVr4stHjqQSrdlo5J6/d1QPCdIAfe 11K6muiIf/Fv1tJtpJIxZ1RwOkueYH+ueVYLKzSe2TRUIlYe/TsKRaLMFNbvpYKnqr2/ tOSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743724209; x=1744329009; 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=F4hQtsRqLsOAfmfIygYHr5yTvJJXu3lpTgjRUryOvbU=; b=aO1BdO2mpAvhGrII/fq295QW4zMzzFC+uSxwbiwvCde38qo0/meBh/fi/cEE0YA/f9 tV/sqjWXVbaX4AfL2pIazxgFE08NNicZT9WQXxsH1xt+0tPkeY6QDQ6mGutfAfE4XmUY z8bEthzioWHnTh05MuqZLkICHKtX8YdgW/JBbgJB+ERkwMH847f2uldjYUguoiL8tPzu TbjeVYjNHtte9VTlR5VgTyWg0VLcuwk+ugjTaOzWn5/aibwTfjYmwsJlsSMeKCOwYw+5 am7doio/OK6cn9+E2AqKEXqEtJdIlOuN45CFHRT2ro99yctePTtzv32GRkbtRejYX27/ Huog== X-Gm-Message-State: AOJu0YwQMgIY1b1cgfFAGBLNxa2FDKTXqUUEGp9GtZ6UiuQEkC8o2C5j nDLUBEt6WX9yDXYbdr+Mc59eVMhmxvm0wmaQdgQof1UcaAa3D/31TexAM/UbJkCJ+fec4MFuWwq s X-Gm-Gg: ASbGnctU3oBRpb8W7um+Ufl5rT2uoIrVtiDSFr+/ovWuUZU6f4IjKqhkNG4EHKwAiJ4 utatLKeOc7GVwva7EcdnG/LXr0oGUurq0Ar5pyo6OTl1bh80JwoJaJTkSk0Wbf6tdORF13IcBwh QM8VFODA4JQj4yJpgCBTkosOF6Mk70uTs8utzDyc+f3QPR60XJkwXVetLs2KDXG1V20VuFw+Kh+ iH2uBT8tojaGtI82olhYlcrR8S7+SFwKZsh6qyibykSVZKWo9eEoDyN/4WgXLtNcLQ3TT8NFXv4 /wg7UfiOQZ14vIlA2QfjWRhtZwbs1Wa7mbudr2ratyT/guwyNO0fVNg+Dxo9zr+S3CeEvtF19Lu 8C1MsWDNqPEJixKvtRwlXhREaR/OIKA== X-Google-Smtp-Source: AGHT+IHgo84CqX39MHLOljzDfCIs/gYPnZSVlSftyCKU3RiHgkB0JxR2VO2oTfQ4WXzOz6k2V9ziyA== X-Received: by 2002:a05:6000:40c7:b0:391:40bd:621e with SMTP id ffacd0b85a97d-39cba9827c6mr852409f8f.44.1743724209677; Thu, 03 Apr 2025 16:50:09 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Markus Armbruster , Richard Henderson , Pierrick Bouvier Subject: [RFC PATCH-for-10.1 08/19] target/riscv: Replace TARGET_LONG_BITS -> target_long_bits() Date: Fri, 4 Apr 2025 01:49:03 +0200 Message-ID: <20250403234914.9154-9-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250403234914.9154-1-philmd@linaro.org> References: <20250403234914.9154-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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::42d; envelope-from=philmd@linaro.org; helo=mail-wr1-x42d.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1743724294344019100 Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/riscv/riscv-iommu.c | 3 ++- hw/riscv/riscv_hart.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/riscv/riscv-iommu.c b/hw/riscv/riscv-iommu.c index 65411b3e4c0..37563b2102f 100644 --- a/hw/riscv/riscv-iommu.c +++ b/hw/riscv/riscv-iommu.c @@ -26,6 +26,7 @@ #include "migration/vmstate.h" #include "qapi/error.h" #include "qemu/timer.h" +#include "qemu/target_info.h" =20 #include "cpu_bits.h" #include "riscv-iommu.h" @@ -393,7 +394,7 @@ static int riscv_iommu_spa_fetch(RISCVIOMMUState *s, RI= SCVIOMMUContext *ctx, if (pass =3D=3D S_STAGE && va_len > 32) { target_ulong mask, masked_msbs; =20 - mask =3D (1L << (TARGET_LONG_BITS - (va_len - 1))) - 1; + mask =3D (1L << (target_long_bits() - (va_len - 1))) - 1; masked_msbs =3D (addr >> (va_len - 1)) & mask; =20 if (masked_msbs !=3D 0 && masked_msbs !=3D mask) { diff --git a/hw/riscv/riscv_hart.c b/hw/riscv/riscv_hart.c index a55d1566687..667d3b0a507 100644 --- a/hw/riscv/riscv_hart.c +++ b/hw/riscv/riscv_hart.c @@ -21,6 +21,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "qemu/module.h" +#include "qemu/target_info.h" #include "system/reset.h" #include "system/qtest.h" #include "qemu/cutils.h" @@ -72,7 +73,7 @@ static void csr_call(char *cmd, uint64_t cpu_num, int csr= no, uint64_t *val) ret =3D riscv_csrr(env, csrno, (target_ulong *)val); } else if (strcmp(cmd, "set_csr") =3D=3D 0) { ret =3D riscv_csrrw(env, csrno, NULL, *(target_ulong *)val, - MAKE_64BIT_MASK(0, TARGET_LONG_BITS)); + MAKE_64BIT_MASK(0, target_long_bits())); } =20 g_assert(ret =3D=3D RISCV_EXCP_NONE); --=20 2.47.1 From nobody Sun Nov 16 04:02:32 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=1743724255; cv=none; d=zohomail.com; s=zohoarc; b=AnOswIGwT8HMRDDMS/+P36jdLBYuPuxIYD/vTvQxBL2WJQuKh17v4t6VaIvnQtnPEFwX9aXReLPVl1V7Ult6jcEtBiiFBhyTRQ4zIXh2cYof80MRFD4t1idk4T6hgXFiPs1XxDLhspL5Ork/v+yJfoOrBKOPN06hKafvrafRJvo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1743724255; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=NDF3v2bQG3D1D/TAN/dJYz9MV3sitzpGTqOBdLUJDgo=; b=buvaVMJ1yHBzoASXn78p7UurOSAUsNFet9zP2QFz2uI/7Nb3Vd+zZZLstlnJ6miAJAbBigv/+uvwSH8Ap1uOGP7O37HrBznuSv/cjtquBi7YN9mlBRtKvsNdL8/lEvEVPuhCr+1dwAwNkeHXIctyJ7fe8v6SHjhvoLFm0jNF7KY= 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 1743724255401429.6441975934978; Thu, 3 Apr 2025 16:50:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u0UKF-0001V6-16; Thu, 03 Apr 2025 19:50:23 -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 1u0UKB-0001ND-20 for qemu-devel@nongnu.org; Thu, 03 Apr 2025 19:50:19 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u0UK9-0000hJ-7b for qemu-devel@nongnu.org; Thu, 03 Apr 2025 19:50:18 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-43d0c18e84eso7108195e9.3 for ; Thu, 03 Apr 2025 16:50:16 -0700 (PDT) Received: from localhost.localdomain (184.170.88.92.rev.sfr.net. [92.88.170.184]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39c30226f2bsm2980657f8f.96.2025.04.03.16.50.13 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Apr 2025 16:50:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743724215; x=1744329015; 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=NDF3v2bQG3D1D/TAN/dJYz9MV3sitzpGTqOBdLUJDgo=; b=sczgrsPaxlXTm63KzPiXNcxxA2uVgNDjbDusMx/qF++Xs0JCDyH4NHiXXkORX6YKZ+ ghemcSwgp/98jWv5HQ3hqJCHxx3u8h+py85KuyPlUfcxLLbdv6NPLYli4tHB+3AmVGRv pvsZsFakkxONewGlvyrZHJooOgr5f5yUcuOJmFjllJ3XEl4sjDfJSlFM9KuGqZcIIewL SlXYcYbCocJ/ps8eXlU8wbwot3T3fkVgGlnLeRLNOL9pa+TXX/4CXDWlmNKyd+wOCdiz KS71OglZwl4/4K+ZcRvD4IeC4X/2m8r82w788TM9Qi1jcyHFFFKwJDUN4Osrw6m/y2zX SYgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743724215; x=1744329015; 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=NDF3v2bQG3D1D/TAN/dJYz9MV3sitzpGTqOBdLUJDgo=; b=bKNw/gTa5W8xLh333SV8Rt9kDMjfUj0+ZCgsYHbLw0zi5L/K4bDbuyJpFtwMVUp3na QeugAMjoM/g0z3xJMczVM1WRXQFjNIvS5eb3BWhThuVJZ17mQHQ5Cq41YKfpftOKLWg5 zekAIK6YFpCtv0Mo5aqBCHCDEvBlPBBhutF/7zb9vRBCMKi0x5lLtusJQKMcIoGbWlkM dwY21Mzd64Vq6xaJuYSosgsIo2FTzYpaqaGka724oE78CEiSgxbbN9uB+/xBg53OrMYL jpE332FM+accPdJpTrDeUX207k4zV88v120pt/J9p2XKbpDdLhv+UtjGrmTO3fOJ20K8 kkPQ== X-Gm-Message-State: AOJu0YwUmrCst+O36WrG6ieU1CZ/dtFMpSV8e2TJUUhMAPRtByFeIKRq FkDjToH2JzNIj6H0x7RZpFIGwhEsqPG5Yu1uZdhyesRDU2ioZoxWU5GCeZh17Ru9V6CQSjTirSj + X-Gm-Gg: ASbGncuaICY9qjRf5Ah91aroWqbAAzQhATk5OqI3lImOdh8bWx5cPJIvc1B5DIJ2K1b 5zWfpr+ojV9XC1WxLfypNeDbVBMluSoI9qBLGQ9PJWVQ98FYzLAi23B4TF7mw+0Q6QKhEPc6e4R mw34tg2vwCM+CMxiLuCxiaTjt62Co0Fi+Yi9kugDBSntrT3qNe+eWExo1AIETAALaE+ASvU5gzJ PlqTeKQzxXMfMo/pFi4j2isfCiSA0il5WFyHdJB5t4pcoIuJrFq2RsAsHUqVynqP/laBQYeNNXI yTsDx/DMtonkC8W0xN0Bb/o7UwElQv8b4k8B72xCwDhKzut4ZG74kvoNWWQ/ky5Om4P027xqLyB HyJ2dGuVHvSPXKnHieNQ= X-Google-Smtp-Source: AGHT+IH6VzX2CqKWpfEPEV+geA0SbkppmehUfV8m2k1croxwKzPuZNzifpmxYAYV2SmJY9Htfaj0UQ== X-Received: by 2002:a05:600c:3548:b0:43d:77c5:9c1a with SMTP id 5b1f17b1804b1-43ed0b5e285mr4871085e9.4.1743724215280; Thu, 03 Apr 2025 16:50:15 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Markus Armbruster , Richard Henderson , Pierrick Bouvier Subject: [RFC PATCH-for-10.1 09/19] qemu: Introduce target_cpu_type() Date: Fri, 4 Apr 2025 01:49:04 +0200 Message-ID: <20250403234914.9154-10-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250403234914.9154-1-philmd@linaro.org> References: <20250403234914.9154-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1743724257114019000 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier --- include/qemu/target_info-impl.h | 3 +++ include/qemu/target_info.h | 2 ++ target_info-stub.c | 2 ++ target_info.c | 5 +++++ 4 files changed, 12 insertions(+) diff --git a/include/qemu/target_info-impl.h b/include/qemu/target_info-imp= l.h index 8fa585f8138..d6d671a03c0 100644 --- a/include/qemu/target_info-impl.h +++ b/include/qemu/target_info-impl.h @@ -30,6 +30,9 @@ struct BinaryTargetInfo { /* runtime equivalent of TARGET_LONG_BITS definition */ unsigned long_bits; =20 + /* runtime equivalent of CPU_RESOLVING_TYPE definition */ + const char *const cpu_resolving_type; + }; =20 #endif diff --git a/include/qemu/target_info.h b/include/qemu/target_info.h index 66c43b329cc..407ce328e85 100644 --- a/include/qemu/target_info.h +++ b/include/qemu/target_info.h @@ -34,4 +34,6 @@ bool target_words_bigendian(void); =20 unsigned target_long_bits(void); =20 +const char *target_cpu_type(void); + #endif diff --git a/target_info-stub.c b/target_info-stub.c index a5374caed6c..7d21675d4c0 100644 --- a/target_info-stub.c +++ b/target_info-stub.c @@ -8,6 +8,7 @@ =20 #include "qemu/osdep.h" #include "qemu/target_info-impl.h" +#include "cpu.h" =20 #ifdef TARGET_INFO_STUB_NEEDED =20 @@ -17,6 +18,7 @@ static const BinaryTargetInfo target_info_stub =3D { .system_arch =3D -1, .endianness =3D TARGET_BIG_ENDIAN ? ENDIAN_MODE_BIG : ENDIAN_MODE_LITT= LE, .long_bits =3D TARGET_LONG_BITS, + .cpu_resolving_type =3D CPU_RESOLVING_TYPE, }; =20 const BinaryTargetInfo *target_info(void) diff --git a/target_info.c b/target_info.c index 2fd32931e13..4ad205636c2 100644 --- a/target_info.c +++ b/target_info.c @@ -41,3 +41,8 @@ unsigned target_long_bits(void) { return target_info()->long_bits; } + +const char *target_cpu_type(void) +{ + return target_info()->cpu_resolving_type; +} --=20 2.47.1 From nobody Sun Nov 16 04:02:32 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=1743724331; cv=none; d=zohomail.com; s=zohoarc; b=PC9BvyvmWc4cxTTs2QRe/JlqjQaAN6fbJhxgGEpdGY6gu0DHEAt8dtwu0vIxdVnIGRKMoP0aeVQJ2n9i9e5S9unnvgNPjpLNm4lcU721wpRuoe3d5SsqHFesqTK70BcdT7Auad4wJBvBUlHVlsP2TcUA2Wf6PFjOoJmIchfXXjM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1743724331; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=rr+hpT8SboGgKuB5nhv/jFygpXGU6aBbobklx4SUFWw=; b=lRRESmxSxB7PpyqP+h3Bmhvw7AR7LKKnbEZHDP2U+p45ydbYA56k3UtZXZPZYXwQiFeFBlXbxL983/jYASILMCLp1Q0YWyLzi1ZvW6XA49MP7lEmOjPl8hOVnWaWx2vCwWf0KYj/ffqTQWMpJxmrpcgjeZkHBMPXE7lQoj7/xbE= 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 1743724331507737.8670635397161; Thu, 3 Apr 2025 16:52:11 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u0UKf-0001u5-Uj; Thu, 03 Apr 2025 19:50:51 -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 1u0UKH-0001YE-8p for qemu-devel@nongnu.org; Thu, 03 Apr 2025 19:50:26 -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 1u0UKE-0000i6-U4 for qemu-devel@nongnu.org; Thu, 03 Apr 2025 19:50:24 -0400 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-3912fdddf8fso1631661f8f.1 for ; Thu, 03 Apr 2025 16:50:22 -0700 (PDT) Received: from localhost.localdomain (184.170.88.92.rev.sfr.net. [92.88.170.184]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39c301b6778sm2882577f8f.46.2025.04.03.16.50.19 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Apr 2025 16:50:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743724221; x=1744329021; 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=rr+hpT8SboGgKuB5nhv/jFygpXGU6aBbobklx4SUFWw=; b=GBPdCz47tSqLLzNhPA0YlAfuFnNWVbFkN+3EOBoorb+aONSB9Y+JazDovtxqjdxO98 hFYe8LDtTLe+6xuI9bebcVFxzOlxro3+CWyRgR5yCFEyN2f5uG/yDizyMT0KtWC3b0Ak ORba1vVjXPq8Kl6gJYrwf7f5bia/uEYBY9Ba/Tuu35QcXFOjVu9IRMcJbM7y0OVdVtbr bEB8fg/B+CYZs0uN+k2euY6TPhTz3gUnPz4//OmNvIu5bggrc9M22gw0j3016wjzRR45 z799nvZLlJ+/5rFXcrl7y9/F4Oo4NYyfLHS5ZdezgH7nAf4ffTe7T5u+Neq2wj+qaE03 oI3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743724221; x=1744329021; 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=rr+hpT8SboGgKuB5nhv/jFygpXGU6aBbobklx4SUFWw=; b=K+12i8DP9ozjKaXWccuou5mb6LVeCUhuYJURriGgCXowSkdpx/1iCe0eVdGnYVxc60 xv9f5pq2dmF2IkQ5boFEZozBj0Qv7V7u5FG32ABo6K5yUOdBj0GDFqso8BdpTG5VL6kf I0OWQNLeTicwMX49XyNKQTGeLubFKHoT63qlVV0MssmqFAD8p2lp4jm/rKbs5zFUrY8X gMOIaJkR0Ee0y/vg7MCuBHiLTDQDISMXAUlhz1BdU+XPfnH3xMnVrO53P+an+R99/O5G vm9ML74rdsMCRyvglu5h2pm4S0AnehR1i4nSOg+O32SjL9bC+oRb1v24pp7ComAC6+0k Pqvg== X-Gm-Message-State: AOJu0Yz0hMUq4kuP+G9C7OMzF7SAM/KESg4I/H4nYfOUyLjzVkn/P5dE OOTmHKmPSn5QKuzR2LEy3nQpcEImbH+BozgBUnOHx6R1+Ku17drlVaQB9OzBijGAag4a66yMXUz v X-Gm-Gg: ASbGncvdekWfGgshq8mDsbZpfQVtHHLkGhtx3VBrZWHXlnm9TM/Y9ek7HEHwZNoApbw HbU8XuBhfdrI2p9UhXOGrzH23tWHrJPyyWWtiwwxMLynL0bxnYrxbG1FdKJOMpbgUwkkoDnO1KJ mV/icX2JfVr9qlAsgF002SMD9rw96zll2dPwpFPlzPSn8yCnjS21hIDGWS2mC7UJ1WMu4ypDL+9 lf7fdtzXrgBPoAkdzrcYPJuyDhlF6EK78uL1nVHnkEhPitfQoOsyOreBKkXB+JYm85RYMOC+mA1 KTGvFmTgZfRGszomjrrqg4YQ70zAFW796ugr1hTsWGB65S3cQzkn8gxJL8ARFRt5dF5Q/UsA4d2 PHCapUERYrV+pFEPHUxg= X-Google-Smtp-Source: AGHT+IErolKrSX6KteIIjPQvPP6tDPcjVLPEAsDHZBYwF/hwTghiPYF+NzqLQDpdEuJXmfO2p9EPGQ== X-Received: by 2002:a05:6000:2509:b0:39c:12ce:1112 with SMTP id ffacd0b85a97d-39c2e651984mr5182101f8f.21.1743724220803; Thu, 03 Apr 2025 16:50:20 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Markus Armbruster , Richard Henderson , Pierrick Bouvier Subject: [RFC PATCH-for-10.1 10/19] cpus: Replace CPU_RESOLVING_TYPE -> target_cpu_type() Date: Fri, 4 Apr 2025 01:49:05 +0200 Message-ID: <20250403234914.9154-11-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250403234914.9154-1-philmd@linaro.org> References: <20250403234914.9154-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=philmd@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 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: 1743724333490019100 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier --- cpu-target.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cpu-target.c b/cpu-target.c index 761c2d28645..01b0064b91f 100644 --- a/cpu-target.c +++ b/cpu-target.c @@ -22,6 +22,7 @@ #include "qapi/error.h" #include "qemu/error-report.h" #include "qemu/qemu-print.h" +#include "qemu/target_info.h" #include "system/accel-ops.h" #include "system/cpus.h" #include "exec/cpu-common.h" @@ -37,7 +38,7 @@ QEMU_BUILD_BUG_ON(offsetof(ArchCPU, env) !=3D sizeof(CPUS= tate)); =20 char *cpu_model_from_type(const char *typename) { - const char *suffix =3D "-" CPU_RESOLVING_TYPE; + g_autofree char *suffix =3D g_strdup_printf("-%s", target_cpu_type()); =20 if (!object_class_by_name(typename)) { return NULL; @@ -63,7 +64,7 @@ const char *parse_cpu_option(const char *cpu_option) exit(1); } =20 - oc =3D cpu_class_by_name(CPU_RESOLVING_TYPE, model_pieces[0]); + oc =3D cpu_class_by_name(target_cpu_type(), model_pieces[0]); if (oc =3D=3D NULL) { error_report("unable to find CPU model '%s'", model_pieces[0]); g_strfreev(model_pieces); @@ -92,7 +93,7 @@ static void cpu_list_entry(gpointer data, gpointer user_d= ata) =20 void list_cpus(void) { - CPUClass *cc =3D CPU_CLASS(object_class_by_name(CPU_RESOLVING_TYPE)); + CPUClass *cc =3D CPU_CLASS(object_class_by_name(target_cpu_type())); =20 if (cc->list_cpus) { cc->list_cpus(); --=20 2.47.1 From nobody Sun Nov 16 04:02:32 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=1743724337; cv=none; d=zohomail.com; s=zohoarc; b=MhZHFYpVBheSYadIOyIV7RQz8B/1CK8vVsuxoNxgQisfLlpTnSXr+yQYYKSm6OOg03GoiH7r+4PZXvXDp+9vVZEhAhjfBvYRdM+79aIKXjKvY+qXh3v3JnDU7ANKS9tkbm6w4lIMcp84qHen8ywiT8VP0rYeD7YmYSPYTgyWXRc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1743724337; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=0ViYtgj7vvi4iKxNJjOBDXGos3WgZtYMTvrMpDjjoLI=; b=PwwFEmxYHo+33/nlPkPXiK6eI8ShXRl6ZDRjItwSpT5t4yD0rWUe2h3UUGxFsgAXuacT2uRi1VSRZnaNK7ZkCqBr+wh/3rVdzEK/fW4PgSuwzftjm3IMRqd6KLXxEN62j4+i5vtuf/U9BNoWf6LJevOvXGIOwhWpE4OJjFl9BF0= 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 174372433767856.53884138707349; Thu, 3 Apr 2025 16:52:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u0UKn-00027S-0P; Thu, 03 Apr 2025 19:50:57 -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 1u0UKP-0001kq-6N for qemu-devel@nongnu.org; Thu, 03 Apr 2025 19:50:39 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u0UKM-0000j7-UO for qemu-devel@nongnu.org; Thu, 03 Apr 2025 19:50:32 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-43cf034d4abso15455455e9.3 for ; Thu, 03 Apr 2025 16:50:27 -0700 (PDT) Received: from localhost.localdomain (184.170.88.92.rev.sfr.net. [92.88.170.184]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39c2fe9875dsm2952781f8f.0.2025.04.03.16.50.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Apr 2025 16:50:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743724226; x=1744329026; 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=0ViYtgj7vvi4iKxNJjOBDXGos3WgZtYMTvrMpDjjoLI=; b=xb2Z9jb1yfmTfXQjif2q6Sk/hODa0CN6YFAKG8iVT7k90sFlu0gBOm36gS4X8AYCz8 ObAwakA4T/npMF0mr2UReLBWg098OAjKtNChS+AL6u7dlfME0S9sbJ6+4Zvd10pQEvl+ o/G6HBDzyZCYEGJeB5pzwOJKswUpiPy2lz6O8L499BSYPEFAG6O/VTtmnrujBNJYhnz0 oDT0wnuKbIGyTvFBLSXqbk+yb9ervs3PhRT8ybH81VQaf+QeHUQcabRESSTAWG6uHPzt 4Fq8uMAwhKY6Rh5ZahSt78MyJjGEy3FsfuYSGt7ekCDmTBOY1KPvIn4Gohir3kkOD+Ql LQ6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743724226; x=1744329026; 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=0ViYtgj7vvi4iKxNJjOBDXGos3WgZtYMTvrMpDjjoLI=; b=GjBUZdQ21SLoxJz6FpKeR0ncM4+D9geTsCSv58N8QAu7+LYOgQtO5rHShldNcSQqvY 84k8ZWHomVuAxua2lngmjdlI9e0fxoHECKbsI1Fqrh3w6fifqydj7Jqw3dVdE56LVUEy t1b8nO00DQonMM9Bzno89QWGGuFyTQfvU21ll5yVtEvQyzRJj3xDrdC3/736t7oBQt1D RU/r6+LYQ56fa0sM3hkHciEraDBlSlLJwGXQnwdn5Lsj1r5yvFnie0QRKKaEP0KaV9L7 BQ3ofUNENXsYyLbl9q+otB9hwuyH0ORmvYmbGYuZ+xrMnmXTvUpIj+hMWMF6c35vIysC 6jLQ== X-Gm-Message-State: AOJu0Ywb5F+1X7Obix9whc5C76PgoUToJ3+t6aMSKYqcAhz3fcDSKwAz O2LF6jdnFasncm0EOZJP0s9bOGa2vUclFJo6wdSlhz31u+Xg60WIZbCI3mXOZfSWJAXFORP48bs e X-Gm-Gg: ASbGnct6vicImPsWhkzGTvJgavLWeLp5nbzz9E5xGuG404dKXg5KtHllFIaL1aRqZ/K Y2S6Uz78+ttPUGEl5TCBpPmXSabrdL+r1feVEjOsAVd7XTxttCwavoM3vckEqx2CNZ9jrPAHD4E UBwIp+06RDfKtJb/bkEb9CW1rf/Wt+S5wuTFt29/yu7EVADgLMTr+sQZGnVyeyQadc4gfc2I0RG WCyFB44r6P9b0zs6fPfxycDwNzPWw6HIoNBQc7cMG0aEgntrvaV3peDPKURDePfAqmnCNDkS0Sm 9DCRNNO42kzkAspVcMDKxr/bQ53OIp5PVvcBh6aK1UTfEKrDnV7loH+ho58dIQ3yjoooElOxQM9 qwRrWj0iBKc+2dG+eSOs= X-Google-Smtp-Source: AGHT+IGAcWpIGxzcpj43YaWnwcMM51cGpcNCuzPhdAUhLKBItT74fPKJ1RjkHsY1gKRjKBFTafhxZA== X-Received: by 2002:a05:600c:3494:b0:43d:4686:5cfb with SMTP id 5b1f17b1804b1-43ecfa0672cmr7561775e9.27.1743724226482; Thu, 03 Apr 2025 16:50:26 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Markus Armbruster , Richard Henderson , Pierrick Bouvier Subject: [RFC PATCH-for-10.1 11/19] accel/tcg: Replace CPU_RESOLVING_TYPE -> target_cpu_type() Date: Fri, 4 Apr 2025 01:49:06 +0200 Message-ID: <20250403234914.9154-12-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250403234914.9154-1-philmd@linaro.org> References: <20250403234914.9154-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1743724339238019000 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier --- accel/tcg/tcg-all.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c index bf27c5c0fb3..a13cb39644f 100644 --- a/accel/tcg/tcg-all.c +++ b/accel/tcg/tcg-all.c @@ -35,6 +35,7 @@ #include "qapi/qapi-types-common.h" #include "qapi/qapi-builtin-visit.h" #include "qemu/units.h" +#include "qemu/target_info.h" #if defined(CONFIG_USER_ONLY) #include "hw/qdev-core.h" #else @@ -44,7 +45,6 @@ #include "accel/tcg/cpu-ops.h" #include "internal-common.h" #include "cpu-param.h" -#include "cpu.h" =20 =20 struct TCGState { @@ -73,7 +73,7 @@ bool qemu_tcg_mttcg_enabled(void) =20 static void mttcg_init(TCGState *s) { - CPUClass *cc =3D CPU_CLASS(object_class_by_name(CPU_RESOLVING_TYPE)); + CPUClass *cc =3D CPU_CLASS(object_class_by_name(target_cpu_type())); bool mttcg_supported =3D cc->tcg_ops->mttcg_supported; =20 if (s->mttcg_enabled =3D=3D ON_OFF_AUTO_AUTO) { --=20 2.47.1 From nobody Sun Nov 16 04:02:32 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=1743724275; cv=none; d=zohomail.com; s=zohoarc; b=X/j6SDrBhvTr1JOq17qIvWROuAyqWmkRlbvr7Kwi0LI9Q8odA2eSYkM0JNrIzNw5FBrQUDIwa0kkIeO7ezcq50dIUEKNwch6nzsnAmH6kTdWk3kWAHaLH+6oD43//WvKSAjySt7VRwFW6DF0ajEU/Jx7MbRqUeLrXxP0tlG9PgY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1743724275; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=PjLhp4LZOvkpDq4jQIYUOR+57wmLdvndO6f3N6bUc2k=; b=HIWEOHlv4qrCrt6k1a50a1BsIBEfI4fv5cQwThwHM2aspk6oOlco7eduLvC5op5YR2p+y7aBy+VloFaFM2uqj+AnlWuCG1y6fwbl9l835EtvWYun4oHTgyw7Ggymna1iOdqoWj0QGKRDDgifTDtVGH9ed/1I8Vb7cuqhMrxysIg= 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 1743724275463780.1159410133873; Thu, 3 Apr 2025 16:51:15 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u0UKq-0002Fx-4Y; Thu, 03 Apr 2025 19:51:00 -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 1u0UKS-0001lA-1q for qemu-devel@nongnu.org; Thu, 03 Apr 2025 19:50:40 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u0UKP-0000k0-Tt for qemu-devel@nongnu.org; Thu, 03 Apr 2025 19:50:35 -0400 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-3913958ebf2so1047868f8f.3 for ; Thu, 03 Apr 2025 16:50:33 -0700 (PDT) Received: from localhost.localdomain (184.170.88.92.rev.sfr.net. [92.88.170.184]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39c301a7225sm2963060f8f.26.2025.04.03.16.50.30 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Apr 2025 16:50:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743724232; x=1744329032; 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=PjLhp4LZOvkpDq4jQIYUOR+57wmLdvndO6f3N6bUc2k=; b=T3N3FYBC8v8lz0bcjwSeKUBsDHTwoLHz27f4XLXoVdRrowUPEx45fyU2pYn/zyAzF9 5HyHm/Oz3xWxQE2ANMeV8fUFT3TmnZVlHUkO2EgKPT07ymJqf2EHlCcRY/T9nzgS1q9M yN2Qibn2svcG6a2SqPlmUu4mkOspU4exwQ3kvd08Pk0pxW8OAc5ESafdElU0XHwgFdWy zdVvKfDuKnsLU2WThD/5Os7Ns0qUrTVhLclbUCz923jLIR9uvg2kFzqkrKbk4XWoJG5X feiTIqk3IE1ESX3IEw/jQYhtYP34KnDLxSVkXqcSYjdluTgtN0KCkgvyrtAAaJV5gH/x GVmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743724232; x=1744329032; 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=PjLhp4LZOvkpDq4jQIYUOR+57wmLdvndO6f3N6bUc2k=; b=o21CVDmZOr928ro9xrxyOl1Khlhfe1qJTuXB5ZxAkzwSKKgxgxSDUIkjymsDGJPhMQ omcGuDuIIF6reQnIbhm3LOz/8M30V6P/nLrzL3Psy2mkCS9XOCZetyyiYX+IayObIvlk 6ql1wYEQA8geB5nBL+4l5MKuiSmtNVY+ybJjTX9IpCAwTy52n7JeVWSLZnk7eorXYpyz XAU2kXat/CjgwYKYFIsKDGJnSbLJaCjSowUiMTuFyVVZq2y4fMoiG1OeCNzBtQvcPHYz Oj33albN8MWC8zlFpgyN/7YEUa2nsXNnjUBMxk8/i9mCSmeOA+wNqgl4qDyUcXKzgvCL Dhkw== X-Gm-Message-State: AOJu0YwZH/Vm44K/tFVs+fSYI+v1iRx3s/m0DiHRQX9+a9scsGDdVpGk iUdrax0tqjSTEJHJ2pUs9akVLE+KnJyhQSmazLFqltspUzTqofM6bcRAk0G+CmtsoPCDXXKsqle a X-Gm-Gg: ASbGncui4UqnoH+eb6aHzQbtSHvvGLBU+of4o7Gf7BILOftWW2PglVukyVJ7B1gLzLE SzdnFGfjTeffxcdItm1DWZ+zlzRk4ee6RFgmMl0ly/j8p30p4kiNoD8gvHVpzyS4Fy2ShWbeQNZ 5p+Xl6LyTF+hyaInOBSqYu6hBkTkeisb+is9Zp5a7RV5gQiv2ahcxvcOx3e0d5CR/6uHkQYAmWH BO2uGXT6kiUvbUuI3aTw/1sqCg4GHTPFH4TVhACvM2CQ34BpjNJYsB02xpR53sziktfmeR23L4N XnolPrBJAjAClIMo9ZPkFwaG7z7poQLeTOQ6Y4PWkDvnhGvtZKOszSXu7JQqhqJF9it9P3dCahl o3a4hru2wlCatRWoiphM= X-Google-Smtp-Source: AGHT+IEhDmIXlSSU4qni49h/F5hbufBNGdD4meJb1tkY+fSvV2h3tueGAzbi2uDh0Px9KuP7byNiUw== X-Received: by 2002:a05:6000:2481:b0:39c:f0d:9146 with SMTP id ffacd0b85a97d-39cba9368b5mr855120f8f.45.1743724231967; Thu, 03 Apr 2025 16:50:31 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Markus Armbruster , Richard Henderson , Pierrick Bouvier Subject: [RFC PATCH-for-10.1 12/19] cpus: Move target-agnostic methods out of cpu-target.c Date: Fri, 4 Apr 2025 01:49:07 +0200 Message-ID: <20250403234914.9154-13-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250403234914.9154-1-philmd@linaro.org> References: <20250403234914.9154-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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::432; envelope-from=philmd@linaro.org; helo=mail-wr1-x432.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1743724277329019000 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier --- cpu-target.c | 78 +------------------------------------------- hw/core/cpu-common.c | 74 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+), 77 deletions(-) diff --git a/cpu-target.c b/cpu-target.c index 01b0064b91f..20db5ff3108 100644 --- a/cpu-target.c +++ b/cpu-target.c @@ -19,94 +19,18 @@ =20 #include "qemu/osdep.h" #include "cpu.h" -#include "qapi/error.h" -#include "qemu/error-report.h" -#include "qemu/qemu-print.h" -#include "qemu/target_info.h" #include "system/accel-ops.h" #include "system/cpus.h" #include "exec/cpu-common.h" -#include "exec/tswap.h" #include "exec/replay-core.h" #include "exec/log.h" -#include "accel/accel-cpu-target.h" +#include "hw/core/cpu.h" #include "trace/trace-root.h" =20 /* Validate correct placement of CPUArchState. */ QEMU_BUILD_BUG_ON(offsetof(ArchCPU, parent_obj) !=3D 0); QEMU_BUILD_BUG_ON(offsetof(ArchCPU, env) !=3D sizeof(CPUState)); =20 -char *cpu_model_from_type(const char *typename) -{ - g_autofree char *suffix =3D g_strdup_printf("-%s", target_cpu_type()); - - if (!object_class_by_name(typename)) { - return NULL; - } - - if (g_str_has_suffix(typename, suffix)) { - return g_strndup(typename, strlen(typename) - strlen(suffix)); - } - - return g_strdup(typename); -} - -const char *parse_cpu_option(const char *cpu_option) -{ - ObjectClass *oc; - CPUClass *cc; - gchar **model_pieces; - const char *cpu_type; - - model_pieces =3D g_strsplit(cpu_option, ",", 2); - if (!model_pieces[0]) { - error_report("-cpu option cannot be empty"); - exit(1); - } - - oc =3D cpu_class_by_name(target_cpu_type(), model_pieces[0]); - if (oc =3D=3D NULL) { - error_report("unable to find CPU model '%s'", model_pieces[0]); - g_strfreev(model_pieces); - exit(EXIT_FAILURE); - } - - cpu_type =3D object_class_get_name(oc); - cc =3D CPU_CLASS(oc); - cc->parse_features(cpu_type, model_pieces[1], &error_fatal); - g_strfreev(model_pieces); - return cpu_type; -} - -static void cpu_list_entry(gpointer data, gpointer user_data) -{ - CPUClass *cc =3D CPU_CLASS(OBJECT_CLASS(data)); - const char *typename =3D object_class_get_name(OBJECT_CLASS(data)); - g_autofree char *model =3D cpu_model_from_type(typename); - - if (cc->deprecation_note) { - qemu_printf(" %s (deprecated)\n", model); - } else { - qemu_printf(" %s\n", model); - } -} - -void list_cpus(void) -{ - CPUClass *cc =3D CPU_CLASS(object_class_by_name(target_cpu_type())); - - if (cc->list_cpus) { - cc->list_cpus(); - } else { - GSList *list; - - list =3D object_class_get_list_sorted(TYPE_CPU, false); - qemu_printf("Available CPUs:\n"); - g_slist_foreach(list, cpu_list_entry, NULL); - g_slist_free(list); - } -} - /* enable or disable single step mode. EXCP_DEBUG is returned by the CPU loop after each instruction */ void cpu_single_step(CPUState *cpu, int enabled) diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index 9064dd24f82..6d0788331c7 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -25,6 +25,9 @@ #include "qemu/log.h" #include "qemu/main-loop.h" #include "qemu/lockcnt.h" +#include "qemu/error-report.h" +#include "qemu/qemu-print.h" +#include "qemu/target_info.h" #include "exec/log.h" #include "exec/gdbstub.h" #include "system/tcg.h" @@ -152,6 +155,21 @@ ObjectClass *cpu_class_by_name(const char *typename, c= onst char *cpu_model) return NULL; } =20 +char *cpu_model_from_type(const char *typename) +{ + g_autofree char *suffix =3D g_strdup_printf("-%s", target_cpu_type()); + + if (!object_class_by_name(typename)) { + return NULL; + } + + if (g_str_has_suffix(typename, suffix)) { + return g_strndup(typename, strlen(typename) - strlen(suffix)); + } + + return g_strdup(typename); +} + static void cpu_common_parse_features(const char *typename, char *features, Error **errp) { @@ -183,6 +201,33 @@ static void cpu_common_parse_features(const char *type= name, char *features, } } =20 +const char *parse_cpu_option(const char *cpu_option) +{ + ObjectClass *oc; + CPUClass *cc; + gchar **model_pieces; + const char *cpu_type; + + model_pieces =3D g_strsplit(cpu_option, ",", 2); + if (!model_pieces[0]) { + error_report("-cpu option cannot be empty"); + exit(1); + } + + oc =3D cpu_class_by_name(target_cpu_type(), model_pieces[0]); + if (oc =3D=3D NULL) { + error_report("unable to find CPU model '%s'", model_pieces[0]); + g_strfreev(model_pieces); + exit(EXIT_FAILURE); + } + + cpu_type =3D object_class_get_name(oc); + cc =3D CPU_CLASS(oc); + cc->parse_features(cpu_type, model_pieces[1], &error_fatal); + g_strfreev(model_pieces); + return cpu_type; +} + bool cpu_exec_realizefn(CPUState *cpu, Error **errp) { if (!accel_cpu_common_realize(cpu, errp)) { @@ -359,3 +404,32 @@ static void cpu_register_types(void) } =20 type_init(cpu_register_types) + +static void cpu_list_entry(gpointer data, gpointer user_data) +{ + CPUClass *cc =3D CPU_CLASS(OBJECT_CLASS(data)); + const char *typename =3D object_class_get_name(OBJECT_CLASS(data)); + g_autofree char *model =3D cpu_model_from_type(typename); + + if (cc->deprecation_note) { + qemu_printf(" %s (deprecated)\n", model); + } else { + qemu_printf(" %s\n", model); + } +} + +void list_cpus(void) +{ + CPUClass *cc =3D CPU_CLASS(object_class_by_name(target_cpu_type())); + + if (cc->list_cpus) { + cc->list_cpus(); + } else { + GSList *list; + + list =3D object_class_get_list_sorted(TYPE_CPU, false); + qemu_printf("Available CPUs:\n"); + g_slist_foreach(list, cpu_list_entry, NULL); + g_slist_free(list); + } +} --=20 2.47.1 From nobody Sun Nov 16 04:02:32 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=1743724314; cv=none; d=zohomail.com; s=zohoarc; b=Dr7u4lKpi0bVWd02HDNRZtmzBcFo8/VDYP0SCfy52RXTZO/zgoRlM4iB327pX6nJRujVDPeYPT0lGkjS1YWBvgk7c2gtwbPtaJqtPRWSFyT7wSVfx3yRMmvFhP1RdedJIx4aYkqVhISrnTO2s9dJheRdY5ZXzN6UgH9yAH40Q9o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1743724314; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=W7HWbrR6pSrG3MMm4hLTyMzjRQ5jngvWPZkeMnLWwj4=; b=RnpB//lowt8+AodtQwGxZJ+QdCxh68CYZyD1QbMyMLZDFlEPGKl9x3+A9l2G66oroiOhzHWVDfVgTiKp3NLF5yRzmPTx2T/XYQVFq6+/km6MqxKioENL+7DtwMmK6lYl13qA91WZJxr5IXcwDA4aUsQS1JgKDFyaJ5ap2NAt4UI= 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 174372431447383.17213421078748; Thu, 3 Apr 2025 16:51:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u0UKs-0002LY-Ch; Thu, 03 Apr 2025 19:51:02 -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 1u0UKZ-0001ti-JY for qemu-devel@nongnu.org; Thu, 03 Apr 2025 19:50:46 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u0UKY-0000lC-30 for qemu-devel@nongnu.org; Thu, 03 Apr 2025 19:50:43 -0400 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-39c1ee0fd43so1244140f8f.0 for ; Thu, 03 Apr 2025 16:50:40 -0700 (PDT) Received: from localhost.localdomain (184.170.88.92.rev.sfr.net. [92.88.170.184]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39c300968cfsm3012407f8f.16.2025.04.03.16.50.36 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Apr 2025 16:50:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743724239; x=1744329039; 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=W7HWbrR6pSrG3MMm4hLTyMzjRQ5jngvWPZkeMnLWwj4=; b=aPxd1UBs26e5nbNnm70Ky2ASu7Gfth5bn2pnwSAM0nhOngQ8zp8xmmygWDyOl3nFjF qEmFdLFV00JKF8Q7NHlVJ/8ld1fXyX3PaM4rz1d9JTvIJMjEE6W+SlJU9o5xDVfVjzCo Mnh//qX6ucdhGKsXq/dsyd/kz1QdTE+I+yCy7P4jZyRj7ssOzIgcZ6Wd8UrwoTH1mS59 NZ9kbZAyzJpR9/WoGLLnPjGaGzOsgu76K2x++YuyD4PfkuNN4iH3qWjSOfIwPiLM/YNo nLnMVn6UUKwk2leJJo81SBk05aKgnoWEVBUf2xzV5rzEifcRcfFMapnYBnqBk3CRH5gj 1hDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743724239; x=1744329039; 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=W7HWbrR6pSrG3MMm4hLTyMzjRQ5jngvWPZkeMnLWwj4=; b=jG/5dHJC9dA7lUBm/imqaR1dywM2J3MJDaezRs8JJHEutOMpipRo5HM/ThqsCknLa/ ATZR+eMvz3jUzR5xBWFdrboN3ZI1N4afrb2JzRy3pX1Lnz/8a+VWTrAvpykHXj2Zz91b 9/s3r1Z4dEQTsOHsvA7XrbmRxHC93Wrfvv57/jFsICp3kyLrk0hk35dK9O9MRwsTbyVg jKbriSVrKeJyftXgV4daqifnWAUji5Zcm4axoWTWu0LpYORzkqR+WE89XgrSRxonTjMw xMVtUTYYvMHyvz1cEmgqSY+leEWNWA+kf2ZKDIMh+oaERsrEh+Q3Ki5KXaGGTEpVUY8i 0vKg== X-Gm-Message-State: AOJu0Ywn1neXvHG5OUQD7n/0IE6tNOqzbDQe4eZ4uamPtlz43ENwbrHp f0SzHRjOzjzLPyXss28gzTr+9Qn6a6goeplyCzXaFTNjoRSncr7zhTTiq377+5SlBw+kMMWV2FB 8 X-Gm-Gg: ASbGncs8N+pe3/lzDEsXK7F/6FRqc22kudZN6a757erR3GuRWqQzHCEKSYMK3i1AiQS rsJhKCeBJeRc35fgF1GGeLC7/2fEZ8TMmzIel6qjV0BSB0AS+YajMxNoXFQfMoCvyWqb+Jjo1Yf G/VQIEaoj/bxd7tVlXbhPWY/Q3bZUn730vYZmo/NPdbQTbmuQTWVLbzqbYWI8M2PaKATuMEYS6f x2IIYOyHGKsTAqL3C0yh0OJWhdR3SsfAYgXRPr4kojLKC/sSGqFpmKeAX51xg5dPwCqUEXyZeFI EMD6yK6hK/S4m+IUdo0FUsLPro8pZeX+uoQykYlHPKnMCJvdQx85iwwC+tTwh4/QzeldCVAIcwj 4PO0bx2LiCbBJ1+Voqu8= X-Google-Smtp-Source: AGHT+IHPurURK90gNwzkCULqNdfv7zWleFIwaCrH4RDDVFIXOeQLpuoL1xkRenVm6eqCGBu1CBqm7g== X-Received: by 2002:a05:6000:381:b0:39c:1257:cc27 with SMTP id ffacd0b85a97d-39cbbcb3b96mr712222f8f.58.1743724239372; Thu, 03 Apr 2025 16:50:39 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Markus Armbruster , Richard Henderson , Pierrick Bouvier Subject: [RFC PATCH-for-10.1 13/19] accel: Replace CPU_RESOLVING_TYPE -> target_cpu_type() Date: Fri, 4 Apr 2025 01:49:08 +0200 Message-ID: <20250403234914.9154-14-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250403234914.9154-1-philmd@linaro.org> References: <20250403234914.9154-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1743724315172019000 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier --- accel/accel-target.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/accel/accel-target.c b/accel/accel-target.c index 33a539b4cbb..9e9e70be876 100644 --- a/accel/accel-target.c +++ b/accel/accel-target.c @@ -25,6 +25,7 @@ =20 #include "qemu/osdep.h" #include "qemu/accel.h" +#include "qemu/target_info.h" =20 #include "cpu.h" #include "accel/accel-cpu-target.h" @@ -88,17 +89,18 @@ static void accel_init_cpu_interfaces(AccelClass *ac) const char *ac_name; /* AccelClass name */ char *acc_name; /* AccelCPUClass name */ ObjectClass *acc; /* AccelCPUClass */ + const char *cpu_resolving_type =3D target_cpu_type(); =20 ac_name =3D object_class_get_name(OBJECT_CLASS(ac)); g_assert(ac_name !=3D NULL); =20 - acc_name =3D g_strdup_printf("%s-%s", ac_name, CPU_RESOLVING_TYPE); + acc_name =3D g_strdup_printf("%s-%s", ac_name, cpu_resolving_type); acc =3D object_class_by_name(acc_name); g_free(acc_name); =20 if (acc) { object_class_foreach(accel_init_cpu_int_aux, - CPU_RESOLVING_TYPE, false, acc); + cpu_resolving_type, false, acc); } } =20 --=20 2.47.1 From nobody Sun Nov 16 04:02:32 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=1743724318; cv=none; d=zohomail.com; s=zohoarc; b=TBzTOe4CyCrURVYpYtqgtKk3SfPOx4f60OGMYezDdKoh1ri3f0n42D39qOk0XeJHpZ2qHWfYjdw1J+hBSYRbcCaLTP/ADQCKUEgbvYcPreV18JLHUUuY/P2FvswCjRL86VxbF4csvqIeSFMxrKM8dkfkjmT+BbSbTLEG2B+mfQ0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1743724318; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+2uao2k1sdjL3VI7mV563IZyOj/L1mksZ9hBUjnLJkk=; b=lhV8M3PhuB+64PLrmvtXxsg9OnnN3ByGuXOwBY8eI+ktEofdCxNRv5KDHxvLn0xdRzBSLm6fiY82euqzxYIPRRPEdEtaaxJGhiudMwYrDHoUvgEzulJBwWSDjo4eqqaxoUFUhfL4yeFrJ4NTRoi+E24QxOSKKxobwcLHtJC+LnA= 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 1743724318983879.2070527224383; Thu, 3 Apr 2025 16:51:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u0UKq-0002G4-5I; Thu, 03 Apr 2025 19:51:00 -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 1u0UKf-00022V-7p for qemu-devel@nongnu.org; Thu, 03 Apr 2025 19:50:50 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u0UKd-0000mI-5z for qemu-devel@nongnu.org; Thu, 03 Apr 2025 19:50:48 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-43cebe06e9eso9311075e9.3 for ; Thu, 03 Apr 2025 16:50:46 -0700 (PDT) Received: from localhost.localdomain (184.170.88.92.rev.sfr.net. [92.88.170.184]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43ec3429f67sm31959885e9.7.2025.04.03.16.50.43 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Apr 2025 16:50:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743724245; x=1744329045; 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=+2uao2k1sdjL3VI7mV563IZyOj/L1mksZ9hBUjnLJkk=; b=Je9PHBBdCAEYDCzIc8DYowlwhTwJ6+mWiJn46EMlkaKXZTs88Mz3WpJemOdbCd5Z7V YyaqW7t2C7UpuZKT0M9GfqoW+xXy4K5dHWcgLtGXW0RKEziDLSp9VTprYOqfg86ADkHx gaH3ifWgL1i7aOU6szMIU+X4m4oCKB65zRp/UBJC35o4zrkwnt+uSZWAYdOmAvvkxx+e 0OsV5we/0sdd8aH/5AzTYAnsVrv/U58GLuLncQLEeeob+SCUP2Fv8rHRCPK4S69VpYcM 0ZI+SukLvztznm0+Z+lE5Ow0vN1A7bipErEG55H4VJFZOyJh2/HvjqJ/yXnEweYMdLlb 1p3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743724245; x=1744329045; 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=+2uao2k1sdjL3VI7mV563IZyOj/L1mksZ9hBUjnLJkk=; b=BXdS6g4ZUInqCFKKRmbUU3FMtMk/W+rTp66qauQtPV15zHpuHpEEUeRZNZaMGYomNn Tf75XE7MqfHIu21UQ5BOdaSYeq3CEVXHuKijoqNXyWfOazChF5iQish0NR+q5Fvt5AbO ENHwu++fykVQNE9JyanxU7ZMLlXaczLFv3x2MJMKh4krKGuznST+ndKYqFhNJuDtybQB JSMMuv5enVrF+UtjBHDav2ScQ2iyH34zLFMfVLJ3Sw9HahoPsuFxkOPyc8x4gbvc7MnK +wju7VTaK3FZz0O80TRLxpWFnd24CaI+dNK4TPEXsLlI0WqGZhFnTuhzDpcqDVzIntTJ C1Xg== X-Gm-Message-State: AOJu0Yygn5K5Nj+0qUQqENvhE3m9BoVysQE9XWqy87QAS8RUgU9omiHp wBPiaq16Bp1zsylyTzY6Vf4OQheLsWIgidLpLTDGpYRHTeHVkaFcKwAlzMoCp/9hqUHdPc7ehGl b X-Gm-Gg: ASbGncvndywcYvaio1YZbQo88pReNu5BWZMsEH4d46WJ3ZqCnPc9KEHlIxoRhl032lx gmLiaIO4xCTKYQmxU+XuCQeo+c1NzIR0cvnhYauNcf+SGFloqS3vCbBBTTFnOJ/YzJ3B5Wz4Hby A45RQ8t6qnn+TGWWuezwqrYR6AycsOKYcCSLbTAQ4LWQLQdLTMs3EiwqAAadNnyJmvG5bXTT+I9 swUaTo+pil6wuxABZKKqEOkO0qMFbiTp+/K2K4tezox7rcfsC71Vl8gL6S2ttXdWkpwVZ1f6Ejc d0pBKqBj48KK3bWiqlcXqxcLYK5gwAP6d1JQTcmZcBwX2LRb7WyNmSwOVVGr5q6VIcihgCiNIr6 Um32Eug2UF6BAMHBn4oA= X-Google-Smtp-Source: AGHT+IHK6IPgNBuL5/cUvbP4Jx404h21BJEIDiIxhGxIzsLcoiwaOSdvJD0YgJb/BkH9ZPXjT/dl8Q== X-Received: by 2002:a5d:584c:0:b0:391:10c5:d1a9 with SMTP id ffacd0b85a97d-39cb35a99e3mr787759f8f.31.1743724245150; Thu, 03 Apr 2025 16:50:45 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Markus Armbruster , Richard Henderson , Pierrick Bouvier Subject: [RFC PATCH-for-10.1 14/19] accel: Implement accel_init_ops_interfaces() for both system/user mode Date: Fri, 4 Apr 2025 01:49:09 +0200 Message-ID: <20250403234914.9154-15-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250403234914.9154-1-philmd@linaro.org> References: <20250403234914.9154-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1743724319212019000 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier --- accel/{accel-system.h =3D> accel-internal.h} | 8 ++++---- accel/accel-system.c | 4 ++-- accel/accel-target.c | 10 ++-------- accel/accel-user.c | 6 ++++++ 4 files changed, 14 insertions(+), 14 deletions(-) rename accel/{accel-system.h =3D> accel-internal.h} (56%) diff --git a/accel/accel-system.h b/accel/accel-internal.h similarity index 56% rename from accel/accel-system.h rename to accel/accel-internal.h index 2d37c73c97b..03426aa21ee 100644 --- a/accel/accel-system.h +++ b/accel/accel-internal.h @@ -1,5 +1,5 @@ /* - * QEMU System Emulation accel internal functions + * QEMU accel internal functions * * Copyright 2021 SUSE LLC * @@ -7,9 +7,9 @@ * See the COPYING file in the top-level directory. */ =20 -#ifndef ACCEL_SYSTEM_H -#define ACCEL_SYSTEM_H +#ifndef ACCEL_INTERNAL_H +#define ACCEL_INTERNAL_H =20 -void accel_system_init_ops_interfaces(AccelClass *ac); +void accel_init_ops_interfaces(AccelClass *ac); =20 #endif /* ACCEL_SYSTEM_H */ diff --git a/accel/accel-system.c b/accel/accel-system.c index 5df49fbe831..a0f562ae9ff 100644 --- a/accel/accel-system.c +++ b/accel/accel-system.c @@ -29,7 +29,7 @@ #include "system/accel-ops.h" #include "system/cpus.h" #include "qemu/error-report.h" -#include "accel-system.h" +#include "accel-internal.h" =20 int accel_init_machine(AccelState *accel, MachineState *ms) { @@ -63,7 +63,7 @@ void accel_setup_post(MachineState *ms) } =20 /* initialize the arch-independent accel operation interfaces */ -void accel_system_init_ops_interfaces(AccelClass *ac) +void accel_init_ops_interfaces(AccelClass *ac) { const char *ac_name; char *ops_name; diff --git a/accel/accel-target.c b/accel/accel-target.c index 9e9e70be876..6fa5c3ef04e 100644 --- a/accel/accel-target.c +++ b/accel/accel-target.c @@ -29,10 +29,7 @@ =20 #include "cpu.h" #include "accel/accel-cpu-target.h" - -#ifndef CONFIG_USER_ONLY -#include "accel-system.h" -#endif /* !CONFIG_USER_ONLY */ +#include "accel-internal.h" =20 static const TypeInfo accel_type =3D { .name =3D TYPE_ACCEL, @@ -106,10 +103,7 @@ static void accel_init_cpu_interfaces(AccelClass *ac) =20 void accel_init_interfaces(AccelClass *ac) { -#ifndef CONFIG_USER_ONLY - accel_system_init_ops_interfaces(ac); -#endif /* !CONFIG_USER_ONLY */ - + accel_init_ops_interfaces(ac); accel_init_cpu_interfaces(ac); } =20 diff --git a/accel/accel-user.c b/accel/accel-user.c index 22b6a1a1a89..7d192306a65 100644 --- a/accel/accel-user.c +++ b/accel/accel-user.c @@ -9,6 +9,12 @@ =20 #include "qemu/osdep.h" #include "qemu/accel.h" +#include "accel-internal.h" + +void accel_init_ops_interfaces(AccelClass *ac) +{ + /* nothing */ +} =20 AccelState *current_accel(void) { --=20 2.47.1 From nobody Sun Nov 16 04:02:32 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=1743724344; cv=none; d=zohomail.com; s=zohoarc; b=D3sq9rJW+yXs8aFfKWMHI82e4oy6tomwgpzOdVCscgIhrYqy9Jp9zwoFho3ouGdnyHdUkNKEk4/hjdwIo7IQIjK1Z4QcTq3YRU1GjedWhLck+aGi2At11ZDuwAKauyzdAN85h2+okfeM/NVv89Fn5o85rtsA4D+dEDoAXdaUZ34= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1743724344; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=xYzlqi0+Jcd0Far/f+KTH2pwTyoIqbv8wkla1ahOpxo=; b=aDHUgMDBtWjqiC3xpc9Rv+EOrQfjDI4TpCaq70LXKGl57ih4a8vtksJEk9RBI93iLXXZlq6+SZ1qvClR2mKQR8yIG3Di72Rreba9CiD/v5GaCVo+q1/zSf+xj7GRricrHrLur5/SuMrk6qaLgG7t4r1fOE1VdZJd3bQuEn9oDw0= 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 1743724344455436.1819810514039; Thu, 3 Apr 2025 16:52:24 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u0UKv-0002cB-7I; Thu, 03 Apr 2025 19:51: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 1u0UKk-000268-IE for qemu-devel@nongnu.org; Thu, 03 Apr 2025 19:50:55 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u0UKj-0000mx-0u for qemu-devel@nongnu.org; Thu, 03 Apr 2025 19:50:54 -0400 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-3996af42857so1747726f8f.0 for ; Thu, 03 Apr 2025 16:50:52 -0700 (PDT) Received: from localhost.localdomain (184.170.88.92.rev.sfr.net. [92.88.170.184]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39c3020d980sm2999728f8f.61.2025.04.03.16.50.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Apr 2025 16:50:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743724251; x=1744329051; 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=xYzlqi0+Jcd0Far/f+KTH2pwTyoIqbv8wkla1ahOpxo=; b=uAJ6PbHY+vw5/ZtcsVWRLszFrSUBlm2dD1/49lD9/5EtxFbEZd+Fqy/bYVPv6dIXv+ txC4AnFYPRlqg9NxP52YN/2qNiSDs6s/EnY+JNTMw/nFd0ZWSFCVZbdpz+XZeXqShW/i HWSuUKnPTCwmsPgAbvw7KqmEtyfrG0hVnABJG24Adfy3kBH5JmAVcoPQ8oawnYYQLLBS inq918KyHTiQUYtmc2tFTE/U43/37DA5E2ReX80lYRKODixlrABTXRVvKiomiKs6G79C BUiFa6h/ej9xIkx9h1hq1ss5gGngpro1Fu6SA88IkjzWOxTPp5NyFfwGdQdXb8hExdj9 knew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743724251; x=1744329051; 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=xYzlqi0+Jcd0Far/f+KTH2pwTyoIqbv8wkla1ahOpxo=; b=mTJMdX69VM2bPuZRizR6lhm1+QEhC88Yi9Hea/ZTTGzTq5Uqb8z/nZiAzt6FYbco91 zqpo/cypoA9xgzIeEqERMILJC/5t1WompJ3HJic2Tpxu6JnAqG621zZZ27/+bkyfpU4g ljIY6IJYqF3/ei5yU9ogNPvcncYjPnvqI9GYFQviVvWjfBH1/bVB7Yp5AsNy7QG9biP9 YkmpL6AHpySpuBuO6IoyD5IniADBn4Cte3JugX6juiOEctdLQTPjD4QAe91xGWgn7AOW 2eUCsbzouSsZ4PU3RtnDLH41aLqu+h9DFxW/0Z9RxOs8+MDXPGIYyr1usaslXGbP3vDB +kZA== X-Gm-Message-State: AOJu0YwCpjHH45BzFbGcnkn2dusMd5A7DioZSrd6jv5sXGkbbU1o0zwl i7893QGv7D7FCSFS4+swX9QzdojkLQuovceh/gEsMW7AMCBwrzupqa1gN8Mm8jsMujqZmIGe8y1 L X-Gm-Gg: ASbGnctfSglmzwVt3iS8JpvYGA27JQfpQNejcord0mPW606YOZIQhPg+5ygx1mOnGBA Cqd5APQIRO2PvsWNlx2Sieheym8Wb0KqsnBywP4pej1GLaIGFVS5Lwy5Bp5OLMwrhL1VbPu66i0 7q9xqNgNRtVB457taJF4QXB3v/cCoXgL6jJGHNj1sa1dgTe04siTmrsbe+HHzTYod0NWoVJVEge cvv876uCN5zw8Qpp8wxDZe61KS5J9q+5nTkNcLBGIamPTZSt3vD2tzMimE+bJBRZORffF81xoHU czwHR/bgO+naGC0WwNfqPSB45IpKjr0O1TiLBjc5Ok8Y9K2cj+kO23wQBU/OWnngXkyvk4xDihp T/MvYhYmqP4sWwiGIfj6bgjoYBiCUcg== X-Google-Smtp-Source: AGHT+IHH8xgE0ZABsN+SmEvJf0Pebyy7lN9FyHpwBM251BV5j9CPsSGQKKfHmEgm4ozQamxpQl2p7Q== X-Received: by 2002:a5d:5847:0:b0:39a:c9ae:9eea with SMTP id ffacd0b85a97d-39cb35aecc6mr838393f8f.10.1743724251102; Thu, 03 Apr 2025 16:50:51 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Markus Armbruster , Richard Henderson , Pierrick Bouvier Subject: [RFC PATCH-for-10.1 15/19] accel: Include missing 'qemu/accel.h' header in accel-internal.h Date: Fri, 4 Apr 2025 01:49:10 +0200 Message-ID: <20250403234914.9154-16-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250403234914.9154-1-philmd@linaro.org> References: <20250403234914.9154-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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::435; envelope-from=philmd@linaro.org; helo=mail-wr1-x435.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1743724345503019100 In file included from ../../accel/accel-target.c:29: ../../accel/accel-internal.h:13:32: error: unknown type name 'AccelClass' 13 | void accel_init_ops_interfaces(AccelClass *ac); | ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier --- accel/accel-internal.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/accel/accel-internal.h b/accel/accel-internal.h index 03426aa21ee..d3a4422cbf7 100644 --- a/accel/accel-internal.h +++ b/accel/accel-internal.h @@ -10,6 +10,8 @@ #ifndef ACCEL_INTERNAL_H #define ACCEL_INTERNAL_H =20 +#include "qemu/accel.h" + void accel_init_ops_interfaces(AccelClass *ac); =20 #endif /* ACCEL_SYSTEM_H */ --=20 2.47.1 From nobody Sun Nov 16 04:02:32 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=1743724352; cv=none; d=zohomail.com; s=zohoarc; b=hliUI7T/kUFEJUqobpbETXhHywIhh57djFQwbc3JzpAoqt4up8hZyilynNsqwc0CBLIhrbLYdfP0RioWxsm0oFFPj5YnUEOdBWnQQ5LIH0ZwffoGZjnU/EtzGfjij1ZO+e5f1KLfQObSiWho5+uo31Q6lzMP0W/owBwHelBwh9w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1743724352; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=tt83rZuXJ2P2CGUhlOB2w3nk8Oq8J5HbWrTGgOM9cNo=; b=aUkKhRHiEHw98KLZdWBZ4CLyaZ5PuAqZhbGMbala4SZKaKOrsIDxE9Cw7rFySsyAcnJj80P9ihTJSMXDujnMQZZoxoaCzU5YER1fdgLOPP/GWPfA1ycbvsJpnH8Sx4rzX2bvVx9sr+W9tcYqo7IeVsIM9EUOLDKsGtF/UqicVuI= 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 1743724352944152.63981902150488; Thu, 3 Apr 2025 16:52:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u0UKx-0002mU-QZ; Thu, 03 Apr 2025 19:51:07 -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 1u0UKs-0002NY-3e for qemu-devel@nongnu.org; Thu, 03 Apr 2025 19:51:02 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u0UKq-0000oJ-DH for qemu-devel@nongnu.org; Thu, 03 Apr 2025 19:51:01 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-43cf0d787eeso14216065e9.3 for ; Thu, 03 Apr 2025 16:50:59 -0700 (PDT) Received: from localhost.localdomain (184.170.88.92.rev.sfr.net. [92.88.170.184]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39c30096889sm2927727f8f.2.2025.04.03.16.50.55 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Apr 2025 16:50:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743724258; x=1744329058; 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=tt83rZuXJ2P2CGUhlOB2w3nk8Oq8J5HbWrTGgOM9cNo=; b=zwr9tp/PaGONxw6Mgf2kGo51aSTxa9VqP56S9eNgpJzIN+ylBG2/HpFXbot/zTK+mw 6XA/Cbs7S7Bfft4vu0C6HAVTTIfoJCL1jPebEdipsIr95Ic5ScjgiPjKl3jkuNd37miY uBKVyESGo1tImsWC8A40vC9QWpBh68sjHH2mlX63Utabe7m1bmZCYBd4MDJabvPQbrVZ p1a31TYw2PdEWwcD0Luey2NcIeH/9nd78VVn8P7MSBIZzS6g5OKqFNfLu6DsvdQ7zuVJ oWdPzHWICN9MQFBMLriAlorgOGHq3tpXweCmznEwDbpS5OoVBEjnA5fH6QpKDAzAGlrz Cbkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743724258; x=1744329058; 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=tt83rZuXJ2P2CGUhlOB2w3nk8Oq8J5HbWrTGgOM9cNo=; b=eTAuPouwIb4V0KHsKc9XDdA2mC3+mvFhqdtcta6jmKMaN3avo5Ue5Hw2gFyoM78N5i MUaooMDfq3FYfmrvJO5W8br244T5MjFgHl8P4U0OrdaqdUKIqtQIZX+I70KmdbE5KTsZ JH1HmfjJzL4BJS4GmT5Vj3qbybx5bkKkiBivjcymBINytO92uPs2swz8RzWIhC0P4Q65 WA7I0FcjO5ZrC4rV4E5x8vnUsRA0itxFVwT7Aore3myBaw6GHPvvko9FFt9RKkaPmuid NjHhnzynGqGPvt/d0K5btuNfTFj5QGwfGhgBKn06AyRTve/hPiF1yOr06q4DVVEjjdCs xQOw== X-Gm-Message-State: AOJu0YwLIIPfpZvzqQauKcLZ/pHunLyqiIWumuQzUeRfYdx66Wy/IFie sZV6kaCVv5zJztLLSx0duvGJg45Mv9dVnmyPT7I+vQYZxIwfbj8ihOsRzZyKHGiy+XWo6yPKb9d K X-Gm-Gg: ASbGncsztbuMNgNJYFuRH4HQMHtXd5ioPQXkNmF4ilEAyJYJPSFFnLjG00Joh46nzF5 FjIaOaYji02lz9cJ8qxeGi5F/hlMgaMHP4Yab1cMUPUr0jqJqusKPgN9hq5PCgfiaaAajqNE48P M2Hxa4DdpPvtT/XAOOtFo3TE10Wvv8q2N39ZXdociE45iKU5OEtP66B8c3+CdPjmW60uLGAmuUC dB0Unjs0K0/OkNv/ssqMXxiG0jRozINWk/8keeQizsCjicQrPy4lFETUbDhEK0Y+KOR0WcnA2uJ J3XPT9LGOtbskNHozvSzg6wvL41AKNqEiKMzuceWVW2LcZ/QM4EZQ3ePS19QI/aZEkjeSLOHqhC GAiUONjg5KMeR4Yb+uBI= X-Google-Smtp-Source: AGHT+IEeBTRAIwOV8EHnXBMSLabygT1G9AHFpz9wef62Ze7/gbASL9kWKhLYbuM3hQjk22xXEFayKQ== X-Received: by 2002:a05:600c:4f0c:b0:43d:aed:f7de with SMTP id 5b1f17b1804b1-43ed0d98ffbmr3255405e9.21.1743724258408; Thu, 03 Apr 2025 16:50:58 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Markus Armbruster , Richard Henderson , Pierrick Bouvier Subject: [RFC PATCH-for-10.1 16/19] accel: Make AccelCPUClass structure target-agnostic Date: Fri, 4 Apr 2025 01:49:11 +0200 Message-ID: <20250403234914.9154-17-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250403234914.9154-1-philmd@linaro.org> References: <20250403234914.9154-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1743724353273019000 Include missing "hw/core/cpu.h" header in "accel/accel-cpu.h" to avoid: include/accel/accel-cpu-target.h:39:28: error: unknown type name 'CPUClass' 39 | void (*cpu_class_init)(CPUClass *cc); | ^ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier --- include/accel/accel-cpu-target.h | 12 +----------- include/accel/accel-cpu.h | 23 +++++++++++++++++++++++ accel/accel-target.c | 1 - 3 files changed, 24 insertions(+), 12 deletions(-) create mode 100644 include/accel/accel-cpu.h diff --git a/include/accel/accel-cpu-target.h b/include/accel/accel-cpu-tar= get.h index 37dde7fae3e..6feb344e29b 100644 --- a/include/accel/accel-cpu-target.h +++ b/include/accel/accel-cpu-target.h @@ -21,21 +21,11 @@ */ =20 #include "qom/object.h" +#include "accel/accel-cpu.h" #include "cpu.h" =20 #define TYPE_ACCEL_CPU "accel-" CPU_RESOLVING_TYPE #define ACCEL_CPU_NAME(name) (name "-" TYPE_ACCEL_CPU) -typedef struct AccelCPUClass AccelCPUClass; DECLARE_CLASS_CHECKERS(AccelCPUClass, ACCEL_CPU, TYPE_ACCEL_CPU) =20 -typedef struct AccelCPUClass { - /*< private >*/ - ObjectClass parent_class; - /*< public >*/ - - void (*cpu_class_init)(CPUClass *cc); - void (*cpu_instance_init)(CPUState *cpu); - bool (*cpu_target_realize)(CPUState *cpu, Error **errp); -} AccelCPUClass; - #endif /* ACCEL_CPU_H */ diff --git a/include/accel/accel-cpu.h b/include/accel/accel-cpu.h new file mode 100644 index 00000000000..9e7eede7c3c --- /dev/null +++ b/include/accel/accel-cpu.h @@ -0,0 +1,23 @@ +/* + * Accelerator interface, specializes CPUClass + * + * Copyright 2021 SUSE LLC + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef ACCEL_CPU_H +#define ACCEL_CPU_H + +#include "qom/object.h" +#include "hw/core/cpu.h" + +typedef struct AccelCPUClass { + ObjectClass parent_class; + + void (*cpu_class_init)(CPUClass *cc); + void (*cpu_instance_init)(CPUState *cpu); + bool (*cpu_target_realize)(CPUState *cpu, Error **errp); +} AccelCPUClass; + +#endif /* ACCEL_CPU_H */ diff --git a/accel/accel-target.c b/accel/accel-target.c index 6fa5c3ef04e..769a90230bf 100644 --- a/accel/accel-target.c +++ b/accel/accel-target.c @@ -27,7 +27,6 @@ #include "qemu/accel.h" #include "qemu/target_info.h" =20 -#include "cpu.h" #include "accel/accel-cpu-target.h" #include "accel-internal.h" =20 --=20 2.47.1 From nobody Sun Nov 16 04:02:33 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=1743724336; cv=none; d=zohomail.com; s=zohoarc; b=NF+Ca9dRRrr5MkRM96z3zMNpChBkRqcDy2m9YKUmwLgmOreDpJrhbLD/fJuhFS4TguwK0/0GxgYwnp4SSTCLRhmG92f0qRcLrotyMICFVnqDAHyRn+8ENBJZrr8h0v3UwWiSfWvnGKWE/WaU61fnq/dlPOTAaIQbSApjlg0/hlw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1743724336; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=LHI9FfBHfNNt6d2GHyCNA9IUMx30aclMNhMOJHynnN4=; b=Jm9r673xx4Ns5ogop8RH1dFyXMY8eC5RpIitZs6+0epoDMwj1eYb8IvVh3F6YYjbddlfR1IIj+yxtW7SzFYBlNcsFC+VSIFR+LbxS8MUnaVCb+ztP5jin4AzbFIRBHeBfogszoKu0gsH+mJnBNKSVtWZPH2s2zYCJtbvkFFxpUU= 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 1743724336749237.56022047278998; Thu, 3 Apr 2025 16:52:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u0UL3-0003KW-OE; Thu, 03 Apr 2025 19:51:13 -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 1u0UKz-000336-RC for qemu-devel@nongnu.org; Thu, 03 Apr 2025 19:51:10 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u0UKx-0000pM-L8 for qemu-devel@nongnu.org; Thu, 03 Apr 2025 19:51:09 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-43cf680d351so14689145e9.0 for ; Thu, 03 Apr 2025 16:51:07 -0700 (PDT) Received: from localhost.localdomain (184.170.88.92.rev.sfr.net. [92.88.170.184]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39c300968c4sm2999981f8f.9.2025.04.03.16.51.02 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Apr 2025 16:51:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743724265; x=1744329065; 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=LHI9FfBHfNNt6d2GHyCNA9IUMx30aclMNhMOJHynnN4=; b=Gg18yEAH7e877bX9WGbqlPTrywrNlOSjPjEvmcvh7VQ28VUZD8uC1WHzjw+QVZ7PgI 0w3QAwO53HIYIRH0b0+jhcoX8xqHoJi3czymQGLPpvP4BEbcDwwuQp7HV0dUIJTo6Ftg H4BgWfeeMTz+xA+0/BPgdXopqBtwhvQ+plFJPYg/YNeFLcXGJVjK767u/5HbgxxxR8sI wgv0F82qfjR7s6HhEAn9E3rKEtQB5TNz7ENjB1ZBTahTwnOC72PzsjKOrXdg3csNBCrB 8Ycv4AFhY1SAGUptzOWZGZvIkgfv8cPRDLVUkPOG6vPetWVrLF7bobB+HNXhuJ64vodV MRHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743724265; x=1744329065; 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=LHI9FfBHfNNt6d2GHyCNA9IUMx30aclMNhMOJHynnN4=; b=rLxmdzITISvwDuoFKh7eiZ4YZJE/Wr2mvjVFn4VHQEOewN1KJLpBC6v4ZtvRjN9dTB LGzzaUI9GepO3+2anv/avMZGiLDEQW+8jYrMxweJnLvL6xFYqabVE3DvYx5Wy1qIDLV8 l4TUNpi2F8PkIVF6l6ebYo95IR+484yghj1n4mBFxlKcE5LrADdWo4CgueSphU5iysLg GQMmTsLXElis3uFU9/xKimKYTi8ICKfnDPdKahnvm/jUiKMyrtyCCRMz3v5AbshFr8jD wXs0qqHXOplYw7EDG/OnwNYsV0M+s7Gf2Ud2EMAeqazAZMnWDaSjUoydq1ty00Fyz6Oc btoA== X-Gm-Message-State: AOJu0YyE3OPuT99e4aQwR8vEN9n0WSjXWJRfNtJvJIQQ1QHROk6cikBe aW50vgfVhjMPeTM74POamshM9jVHLK3tR++ciaUix542bWTaTK3tHqi3A2SPMXoNqqLYb+wYBF/ i X-Gm-Gg: ASbGncsiH1H4/7MyRGBsjnpCMg8hsH0A70yxAOY3atjP6vpHLT4VdoiyFkfAUKzTGRN Kv2dv9oCvvd9glHYveJ9s6UNMwJpFo4LTlFj8lNMHmrhsFfDRerb/c9qcnzwDbcaer6bWmedqPa h8LMwtmAzPphncpO0FPkLBWw0EYB5LrBm+rCOlgYXPdSEgGeXUjGSeVKVH34C1RSmak77pxq3ST jRgK0TkpDS0WsUqI5y4KUuRx/W+CTBHS3u1lTS7w6cRoomcnvesOZt64GKWu/uouA7kmp20vEbQ 6YjQjlrkSWBNuVFtBVmLJMQePi37vqlC/9aQsLs8aMPB2UZ/DrRkgGehNuNDx/q5cHocMb5ua91 XpOmrwq3dL2p3oOKRacc= X-Google-Smtp-Source: AGHT+IFwmBjwvR4D+ddltqDgiwC4CAXPCcL4AGk7x55yazsi16N0uPNlsRWM9mN5zrgpebnpDsQTPw== X-Received: by 2002:a05:6000:2211:b0:391:952:c74a with SMTP id ffacd0b85a97d-39c2e610f88mr4784201f8f.8.1743724265173; Thu, 03 Apr 2025 16:51:05 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Markus Armbruster , Richard Henderson , Pierrick Bouvier Subject: [RFC PATCH-for-10.1 17/19] accel: Move target-agnostic code from accel-target.c -> accel-common.c Date: Fri, 4 Apr 2025 01:49:12 +0200 Message-ID: <20250403234914.9154-18-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250403234914.9154-1-philmd@linaro.org> References: <20250403234914.9154-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1743724337311019000 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier --- accel/accel-common.c | 142 +++++++++++++++++++++++++++++++++++++++++++ accel/accel-target.c | 129 --------------------------------------- accel/meson.build | 1 + 3 files changed, 143 insertions(+), 129 deletions(-) create mode 100644 accel/accel-common.c diff --git a/accel/accel-common.c b/accel/accel-common.c new file mode 100644 index 00000000000..f505461fc88 --- /dev/null +++ b/accel/accel-common.c @@ -0,0 +1,142 @@ +/* + * QEMU accel class, components common to system emulation and user mode + * + * Copyright (c) 2003-2008 Fabrice Bellard + * Copyright (c) 2014 Red Hat Inc. + * + * SPDX-License-Identifier: MIT + */ + +#include "qemu/osdep.h" +#include "qemu/accel.h" +#include "qemu/target_info.h" +#include "accel/accel-cpu.h" +#include "accel-internal.h" + +/* Lookup AccelClass from opt_name. Returns NULL if not found */ +AccelClass *accel_find(const char *opt_name) +{ + char *class_name =3D g_strdup_printf(ACCEL_CLASS_NAME("%s"), opt_name); + AccelClass *ac =3D ACCEL_CLASS(module_object_class_by_name(class_name)= ); + g_free(class_name); + return ac; +} + +/* Return the name of the current accelerator */ +const char *current_accel_name(void) +{ + AccelClass *ac =3D ACCEL_GET_CLASS(current_accel()); + + return ac->name; +} + +static void accel_init_cpu_int_aux(ObjectClass *klass, void *opaque) +{ + CPUClass *cc =3D CPU_CLASS(klass); + AccelCPUClass *accel_cpu =3D opaque; + + /* + * The first callback allows accel-cpu to run initializations + * for the CPU, customizing CPU behavior according to the accelerator. + * + * The second one allows the CPU to customize the accel-cpu + * behavior according to the CPU. + * + * The second is currently only used by TCG, to specialize the + * TCGCPUOps depending on the CPU type. + */ + cc->accel_cpu =3D accel_cpu; + if (accel_cpu->cpu_class_init) { + accel_cpu->cpu_class_init(cc); + } + if (cc->init_accel_cpu) { + cc->init_accel_cpu(accel_cpu, cc); + } +} + +/* initialize the arch-specific accel CpuClass interfaces */ +static void accel_init_cpu_interfaces(AccelClass *ac) +{ + const char *ac_name; /* AccelClass name */ + char *acc_name; /* AccelCPUClass name */ + ObjectClass *acc; /* AccelCPUClass */ + const char *cpu_resolving_type =3D target_cpu_type(); + + ac_name =3D object_class_get_name(OBJECT_CLASS(ac)); + g_assert(ac_name !=3D NULL); + + acc_name =3D g_strdup_printf("%s-%s", ac_name, cpu_resolving_type); + acc =3D object_class_by_name(acc_name); + g_free(acc_name); + + if (acc) { + object_class_foreach(accel_init_cpu_int_aux, + cpu_resolving_type, false, acc); + } +} + +void accel_init_interfaces(AccelClass *ac) +{ + accel_init_ops_interfaces(ac); + accel_init_cpu_interfaces(ac); +} + +void accel_cpu_instance_init(CPUState *cpu) +{ + if (cpu->cc->accel_cpu && cpu->cc->accel_cpu->cpu_instance_init) { + cpu->cc->accel_cpu->cpu_instance_init(cpu); + } +} + +bool accel_cpu_common_realize(CPUState *cpu, Error **errp) +{ + AccelState *accel =3D current_accel(); + AccelClass *acc =3D ACCEL_GET_CLASS(accel); + + /* target specific realization */ + if (cpu->cc->accel_cpu + && cpu->cc->accel_cpu->cpu_target_realize + && !cpu->cc->accel_cpu->cpu_target_realize(cpu, errp)) { + return false; + } + + /* generic realization */ + if (acc->cpu_common_realize && !acc->cpu_common_realize(cpu, errp)) { + return false; + } + + return true; +} + +void accel_cpu_common_unrealize(CPUState *cpu) +{ + AccelState *accel =3D current_accel(); + AccelClass *acc =3D ACCEL_GET_CLASS(accel); + + /* generic unrealization */ + if (acc->cpu_common_unrealize) { + acc->cpu_common_unrealize(cpu); + } +} + +int accel_supported_gdbstub_sstep_flags(void) +{ + AccelState *accel =3D current_accel(); + AccelClass *acc =3D ACCEL_GET_CLASS(accel); + if (acc->gdbstub_supported_sstep_flags) { + return acc->gdbstub_supported_sstep_flags(); + } + return 0; +} + +static const TypeInfo accel_types[] =3D { + { + .name =3D TYPE_ACCEL, + .parent =3D TYPE_OBJECT, + .class_size =3D sizeof(AccelClass), + .instance_size =3D sizeof(AccelState), + .abstract =3D true, + }, +}; + +DEFINE_TYPES(accel_types) diff --git a/accel/accel-target.c b/accel/accel-target.c index 769a90230bf..7fd392fbc4a 100644 --- a/accel/accel-target.c +++ b/accel/accel-target.c @@ -24,135 +24,7 @@ */ =20 #include "qemu/osdep.h" -#include "qemu/accel.h" -#include "qemu/target_info.h" - #include "accel/accel-cpu-target.h" -#include "accel-internal.h" - -static const TypeInfo accel_type =3D { - .name =3D TYPE_ACCEL, - .parent =3D TYPE_OBJECT, - .class_size =3D sizeof(AccelClass), - .instance_size =3D sizeof(AccelState), - .abstract =3D true, -}; - -/* Lookup AccelClass from opt_name. Returns NULL if not found */ -AccelClass *accel_find(const char *opt_name) -{ - char *class_name =3D g_strdup_printf(ACCEL_CLASS_NAME("%s"), opt_name); - AccelClass *ac =3D ACCEL_CLASS(module_object_class_by_name(class_name)= ); - g_free(class_name); - return ac; -} - -/* Return the name of the current accelerator */ -const char *current_accel_name(void) -{ - AccelClass *ac =3D ACCEL_GET_CLASS(current_accel()); - - return ac->name; -} - -static void accel_init_cpu_int_aux(ObjectClass *klass, void *opaque) -{ - CPUClass *cc =3D CPU_CLASS(klass); - AccelCPUClass *accel_cpu =3D opaque; - - /* - * The first callback allows accel-cpu to run initializations - * for the CPU, customizing CPU behavior according to the accelerator. - * - * The second one allows the CPU to customize the accel-cpu - * behavior according to the CPU. - * - * The second is currently only used by TCG, to specialize the - * TCGCPUOps depending on the CPU type. - */ - cc->accel_cpu =3D accel_cpu; - if (accel_cpu->cpu_class_init) { - accel_cpu->cpu_class_init(cc); - } - if (cc->init_accel_cpu) { - cc->init_accel_cpu(accel_cpu, cc); - } -} - -/* initialize the arch-specific accel CpuClass interfaces */ -static void accel_init_cpu_interfaces(AccelClass *ac) -{ - const char *ac_name; /* AccelClass name */ - char *acc_name; /* AccelCPUClass name */ - ObjectClass *acc; /* AccelCPUClass */ - const char *cpu_resolving_type =3D target_cpu_type(); - - ac_name =3D object_class_get_name(OBJECT_CLASS(ac)); - g_assert(ac_name !=3D NULL); - - acc_name =3D g_strdup_printf("%s-%s", ac_name, cpu_resolving_type); - acc =3D object_class_by_name(acc_name); - g_free(acc_name); - - if (acc) { - object_class_foreach(accel_init_cpu_int_aux, - cpu_resolving_type, false, acc); - } -} - -void accel_init_interfaces(AccelClass *ac) -{ - accel_init_ops_interfaces(ac); - accel_init_cpu_interfaces(ac); -} - -void accel_cpu_instance_init(CPUState *cpu) -{ - if (cpu->cc->accel_cpu && cpu->cc->accel_cpu->cpu_instance_init) { - cpu->cc->accel_cpu->cpu_instance_init(cpu); - } -} - -bool accel_cpu_common_realize(CPUState *cpu, Error **errp) -{ - AccelState *accel =3D current_accel(); - AccelClass *acc =3D ACCEL_GET_CLASS(accel); - - /* target specific realization */ - if (cpu->cc->accel_cpu - && cpu->cc->accel_cpu->cpu_target_realize - && !cpu->cc->accel_cpu->cpu_target_realize(cpu, errp)) { - return false; - } - - /* generic realization */ - if (acc->cpu_common_realize && !acc->cpu_common_realize(cpu, errp)) { - return false; - } - - return true; -} - -void accel_cpu_common_unrealize(CPUState *cpu) -{ - AccelState *accel =3D current_accel(); - AccelClass *acc =3D ACCEL_GET_CLASS(accel); - - /* generic unrealization */ - if (acc->cpu_common_unrealize) { - acc->cpu_common_unrealize(cpu); - } -} - -int accel_supported_gdbstub_sstep_flags(void) -{ - AccelState *accel =3D current_accel(); - AccelClass *acc =3D ACCEL_GET_CLASS(accel); - if (acc->gdbstub_supported_sstep_flags) { - return acc->gdbstub_supported_sstep_flags(); - } - return 0; -} =20 static const TypeInfo accel_cpu_type =3D { .name =3D TYPE_ACCEL_CPU, @@ -163,7 +35,6 @@ static const TypeInfo accel_cpu_type =3D { =20 static void register_accel_types(void) { - type_register_static(&accel_type); type_register_static(&accel_cpu_type); } =20 diff --git a/accel/meson.build b/accel/meson.build index 5eaeb683385..52909314bfa 100644 --- a/accel/meson.build +++ b/accel/meson.build @@ -1,3 +1,4 @@ +common_ss.add(files('accel-common.c')) specific_ss.add(files('accel-target.c')) system_ss.add(files('accel-system.c', 'accel-blocker.c')) user_ss.add(files('accel-user.c')) --=20 2.47.1 From nobody Sun Nov 16 04:02:33 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=1743724303; cv=none; d=zohomail.com; s=zohoarc; b=PAv0IFWehoyp9yvpBRJxfuHKuHmdQksLJoJ7dUkUjerMPMm/oDMouA09UJvJvOUULiMC2vZbrUb6jqtaIYznOcws6YExzP1ZJNx5sTTznEpcTIfgOzcEpY3QdRP/Z0NQfK71MZCDHYtBxk9BSPAu9+CFKX2xEboPbXnyoLppEW4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1743724303; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=jKGy8JhI6ob8SfyVJdxSCkVoOViZwD5dSl2Ral6vICI=; b=nNvGv5e4qXr6+F6vmLVavqXusVcceBcMRY5lbmGiALsRKfmUXPnUGLqwZlEVRP2b7SwP/aR7YHRw+4r8Gm/nYHYUn4yenhTg6flLswlPS9piQ9UmnSpHBFiv47x9hVn/EMLllAD8NEOIc0dY6YgO1K0y6ozPVL4pByVzQN8xOqI= 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 1743724303151643.8773923061173; Thu, 3 Apr 2025 16:51:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u0UL7-0003fd-3L; Thu, 03 Apr 2025 19:51:17 -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 1u0UL4-0003SJ-AI for qemu-devel@nongnu.org; Thu, 03 Apr 2025 19:51:14 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u0UL2-0000q7-HH for qemu-devel@nongnu.org; Thu, 03 Apr 2025 19:51:14 -0400 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-39141ffa9fcso1691082f8f.0 for ; Thu, 03 Apr 2025 16:51:12 -0700 (PDT) Received: from localhost.localdomain (184.170.88.92.rev.sfr.net. [92.88.170.184]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39c3009680dsm2926099f8f.7.2025.04.03.16.51.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Apr 2025 16:51:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743724271; x=1744329071; 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=jKGy8JhI6ob8SfyVJdxSCkVoOViZwD5dSl2Ral6vICI=; b=fCj6JkODrrWg6U3mAdAb/2LVvYNSZndTloORReq2PoHcyrTMLbVv+H/BAsR3AzqzpT hF3KVZm+00Jyo96zSm7Kd+fZS7jAjt6GwLDktgwFL6OfIs8GOjyoVcZUFDGGVNiX7PYV EnQwFG1tiVX5XZNiD+eIDoxNHTxNvhAMjVeDDFiGRceDlHJWUhORMifKxBaq7a0vaqx/ flTsI5xmasPRH+18LbWsXob72wdpa/BRPRYLmL61Dr+w4lm2NJFgYRnfibZgKtJbTH0Z KYhCzjsfC8W3nI77TtNeo7fZSqKxrAC21nkAwL2rflpRY4KTNLhFSGNNiS2JbptsxnIw Z2aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743724271; x=1744329071; 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=jKGy8JhI6ob8SfyVJdxSCkVoOViZwD5dSl2Ral6vICI=; b=NKSwmOKTjoBK78ckuRnb44IW0dg7zHJj7EnSB3RZPgvxhPYyhiuBMerEU43cU+iUEl V3mlw39fG4j2xHALi0pVIRe4QG+4uNoFdOAEPoqiIxh6Jq+J5MqPJaCNCdu1xbDCg1a6 zvb2UVoAMDsK1+R59/ip+UE+PyMAhcPObyfTybbBy5qCas3k9iU2cQW2IGmQLwuwZjmM 7VmdT2ZAZClqbNGNvmy2VlV5OP28JvxMK8qa0Zf9RksrjusT0/bywmb2i5nTQGOkKK5x isfBpdwfN+wU13hGiCOqIcoN8H3l7QruEILLOexpbmvWE/46HTpvB9y5w5L0dFuATKlg Zk/Q== X-Gm-Message-State: AOJu0YxD/OMfu6vRxJXEp8p8s/638weisjObHZDzSNFwaoBSImqhoVfl hGK2fmRXVxoOdCqbyZGpWpF8dZNfQZLcMxaHwlgeSu5NQPsgOVJm56Mt6Qh1BS0S671Ay6xsww3 N X-Gm-Gg: ASbGncuSEfuYn1atMmJdVWfx2FILaFR4j9lWTtWHzeFzaHiEZYHqgMz2VS24KpqiWr0 3imXCJE+9LSxHKj5pZqfDYfOg/ayviv3krnpgZf2BTHyE9DNkLVKyycMZirnC7tTnbTTS8pYuO0 HUZiftY3l2/+R/YuRkCxXKmTDn4noVLCEW45MOxOi+e8em5c4xxL+K0oktoh4cmXkZVRjAfDcmX yoNAF7+fjOvUCq3bDxyheetRkhx4S4p80nC3scoX4jwI7rRGsXr8nqb/+zlnqXqW/7XUTZ0l9+G xExAb03Y+POgzJhbgPC9nowmZUAPPUrSlDS0KoRDQjE1bHilzaiLGNa7A0HLep2MkOpijQSruua tFtk3V33uZyGwC92tL7A= X-Google-Smtp-Source: AGHT+IH9pYQ/eycg0+3qeoIp0S8wBU4sHQanJq6spe9WlrHk4bgELL3vuGU3HHdx6sMTYfmyeV8ebA== X-Received: by 2002:a05:6000:40c9:b0:391:48d4:bd02 with SMTP id ffacd0b85a97d-39cb35ac875mr821882f8f.29.1743724270746; Thu, 03 Apr 2025 16:51:10 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Markus Armbruster , Richard Henderson , Pierrick Bouvier Subject: [RFC PATCH-for-10.1 18/19] qemu: Prepare per-binary QOM filter via TYPE_BINARY_PREFIX Date: Fri, 4 Apr 2025 01:49:13 +0200 Message-ID: <20250403234914.9154-19-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250403234914.9154-1-philmd@linaro.org> References: <20250403234914.9154-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1743724305436019100 Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- meson.build | 1 + include/hw/boards.h | 1 + include/qemu/target_info-qom.h | 14 ++++++++++++++ target_info-qom.c | 15 +++++++++++++++ 4 files changed, 31 insertions(+) create mode 100644 include/qemu/target_info-qom.h create mode 100644 target_info-qom.c diff --git a/meson.build b/meson.build index de9c9dacd35..b93253166c8 100644 --- a/meson.build +++ b/meson.build @@ -3815,6 +3815,7 @@ specific_ss.add(files('page-target.c', 'page-vary-tar= get.c')) =20 specific_ss.add(files('target_info-stub.c')) common_ss.add(files('target_info.c')) +system_ss.add(files('target_info-qom.c')) =20 subdir('backends') subdir('disas') diff --git a/include/hw/boards.h b/include/hw/boards.h index 02f43ac5d4d..b1bbf3c34d4 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -7,6 +7,7 @@ #include "system/hostmem.h" #include "system/blockdev.h" #include "qapi/qapi-types-machine.h" +#include "qemu/target_info-qom.h" #include "qemu/module.h" #include "qom/object.h" #include "hw/core/cpu.h" diff --git a/include/qemu/target_info-qom.h b/include/qemu/target_info-qom.h new file mode 100644 index 00000000000..c87d47acf66 --- /dev/null +++ b/include/qemu/target_info-qom.h @@ -0,0 +1,14 @@ +/* + * QEMU binary helpers + * + * Copyright (c) Linaro + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef QEMU_TARGET_INFO_QOM_H +#define QEMU_TARGET_INFO_QOM_H + +#define TYPE_LEGACY_BINARY_PREFIX "legacy-binary-" + +#endif diff --git a/target_info-qom.c b/target_info-qom.c new file mode 100644 index 00000000000..6970b95ee0b --- /dev/null +++ b/target_info-qom.c @@ -0,0 +1,15 @@ +/* + * QEMU legacy binary helpers + * + * Copyright (c) Linaro + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "qemu/target_info-qom.h" + +static const TypeInfo target_info_types[] =3D { +}; + +DEFINE_TYPES(target_info_types) --=20 2.47.1 From nobody Sun Nov 16 04:02:33 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=1743724340; cv=none; d=zohomail.com; s=zohoarc; b=Q0e9LHcaN163x3130HD4i8+i8XtoE14lRsgDWKSEvyhYQAwUEHV7XArPtIRbmfWA7xLNK71J7Ah5HaTPM2piUpozOI2b41aHsiB3+ovtEUGsYzvK54n/d46wZPfVcWF6UP3cZd/DllP584NNrMuLmEuMNKafxpmVKJSGniBmFZ0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1743724340; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=s9D7OVdkybNmWN2++NNfk6FW5LKGK74MGZPvn0u97ZU=; b=iROSGew2wWgcKBRtFrN11I44hQGMUxa64ApLAZzEkuaLcA8DVGj76tygSKv119cJj4+wngLopYIW9JHXvxN+QCe6gn7NanRdCq0l/45BJgaQiStgx3ZrLEpRXmlvmESeIEwFZODpC4M+T7seFAZvtpzH8Awx6u3RmQNaly3gGLw= 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 1743724340383570.0825722872208; Thu, 3 Apr 2025 16:52:20 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1u0ULC-00049G-MI; Thu, 03 Apr 2025 19:51:22 -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 1u0UL9-0003vi-VS for qemu-devel@nongnu.org; Thu, 03 Apr 2025 19:51:20 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u0UL8-0000qz-Ag for qemu-devel@nongnu.org; Thu, 03 Apr 2025 19:51:19 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-43690d4605dso10148175e9.0 for ; Thu, 03 Apr 2025 16:51:17 -0700 (PDT) Received: from localhost.localdomain (184.170.88.92.rev.sfr.net. [92.88.170.184]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39c301a67a1sm2918546f8f.24.2025.04.03.16.51.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 03 Apr 2025 16:51:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743724276; x=1744329076; 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=s9D7OVdkybNmWN2++NNfk6FW5LKGK74MGZPvn0u97ZU=; b=hbCX75dGzV61rvsaqORDQlXql59mPdvHBd9bXleksi4qlHwQWkeQE2jb8R6ve7BzYI up+jR91Vh8JVVsAYmsLws2mh0xTS5rPFxebeqVIpIawPPE8shOds4VjyGm2QJL/iTw9i N7aaOdYrtgqZMnOxNozUQ45xJ2an/HD933ZQZ1pz5quaN0C27UXxUId1d9mUW/eUNCqQ 6N/JwO4iFzn8fhqOEI5DDrexXcUGDmLKFvfW7FL/LX2XG/NHXxS88zgoCQPI6HZXBnfu dqnGVikn7L0sFv5HZpLtn2mc6MlI51FH6TftGUGpipVO9S+E83K+1YRG+EOzYNUY1Pla I3Aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743724276; x=1744329076; 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=s9D7OVdkybNmWN2++NNfk6FW5LKGK74MGZPvn0u97ZU=; b=lGHq/WHHa+bcUGAzzIXwRytMcvOuXrFqwCkDO7UgVoD6yYWhRHBdZH6+E3T3DkGd4X 3vN9Txa8yV2Dcouakr4efohiABvOjq87vcgSDGrmBomD8YcHPs6y3gqlKI7ehmrzkPG6 EpbPyvWyqYtxFPPMucQoujzLJEdoZkjhv3sRPdo0c3SxxpD/o9Mxu89tLelD+xsHM7FS VKRkWd8J8bST7Cwd2rmXGIn/sysbGHBGR6t0fB87jxklS0odDuFXmcr+ARvpwXr8nyUW OQ1Papnoms4eJW5abItQBNFYIBv7AekzDwD2QyzcLyzWbE+wpntenH0R2WhYTNBjzjm1 nInQ== X-Gm-Message-State: AOJu0YyVWFQQZHxqygHQx6VpJ8V2uc83V4BF9lnRi32j6mzXFXB7WyfN TenkWZPIdfdb4Xf328PGi8bEPbEoykLqv0pQVHa9WJfR9KVOt4pDVpDXwl+zW9PzJhxvx4ePpMv A X-Gm-Gg: ASbGncsnWkgcsLjTQkCjoYdhNp9TUkCsLN5pKGdVWHinuX1zmOM1XAcmqV50xFotvnR 15X3pTzrGuhwr4q/CclasIF2hhwRQK8hUyrNXWFg8JIeh/XDQxKJTIPX8h94dbQVqwjTXcu816L z1tS5TO5EDvdkvXlc2sZtHnn8PrvLrdQuEJf3B6Kha7sdG6a19UNZKV4f0qpbRYLsCfhWR8FvIA RTBbx2a/iS8/C9f8R8VUYUJerlVJJy1VRq7bD5rPC6LgrA9Z5WtXZmckZaXP6EoLExsRbpZBHVX 49xGBSFPYx7PzxgzccyyDBsTotn4V2Eet1cb6wLFdiiDIOh5JQ9HuWo9TtHHFtgRHMqIeNY4gS1 fKluesiYJeOYMW+EQkws= X-Google-Smtp-Source: AGHT+IGQzFOPVd9EfblnjuoEmyq1WBRQCz9jGnAsvNTRikdtxoigS6IWtlOwtCWoUW5IeHoP9dQbew== X-Received: by 2002:a05:6000:220b:b0:39c:2692:4259 with SMTP id ffacd0b85a97d-39cb35981fdmr993481f8f.21.1743724276616; Thu, 03 Apr 2025 16:51:16 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Markus Armbruster , Richard Henderson , Pierrick Bouvier Subject: [RFC PATCH-for-10.1 19/19] system/vl: Filter machine list for binary using machine_binary_filter() Date: Fri, 4 Apr 2025 01:49:14 +0200 Message-ID: <20250403234914.9154-20-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250403234914.9154-1-philmd@linaro.org> References: <20250403234914.9154-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1743724341218019000 Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- system/vl.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/system/vl.c b/system/vl.c index d8a0fe713c9..554f5f2a467 100644 --- a/system/vl.c +++ b/system/vl.c @@ -27,6 +27,8 @@ #include "qemu/datadir.h" #include "qemu/units.h" #include "qemu/module.h" +#include "qemu/target_info.h" +#include "qemu/target_info-qom.h" #include "exec/cpu-common.h" #include "exec/page-vary.h" #include "hw/qdev-properties.h" @@ -833,14 +835,29 @@ static bool usb_parse(const char *cmdline, Error **er= rp) /***********************************************************/ /* machine registration */ =20 +static char *machine_binary_filter(void) +{ + if (target_info_is_stub()) { + return NULL; + } + return g_strconcat(TYPE_LEGACY_BINARY_PREFIX, + "qemu-system-", target_name(), NULL); +} + static MachineClass *find_machine(const char *name, GSList *machines) { GSList *el; + g_autofree char *binary_filter =3D machine_binary_filter(); =20 for (el =3D machines; el; el =3D el->next) { MachineClass *mc =3D el->data; =20 if (!strcmp(mc->name, name) || !g_strcmp0(mc->alias, name)) { + if (binary_filter && !object_class_dynamic_cast(el->data, + binary_filter)= ) { + /* Machine is not for this binary: fail */ + return NULL; + } return mc; } } @@ -1563,6 +1580,7 @@ static void machine_help_func(const QDict *qdict) g_autoptr(GSList) machines =3D NULL; GSList *el; const char *type =3D qdict_get_try_str(qdict, "type"); + g_autofree char *binary_filter =3D machine_binary_filter(); =20 machines =3D object_class_get_list(TYPE_MACHINE, false); if (type) { @@ -1577,6 +1595,12 @@ static void machine_help_func(const QDict *qdict) machines =3D g_slist_sort(machines, machine_class_cmp); for (el =3D machines; el; el =3D el->next) { MachineClass *mc =3D el->data; + + if (binary_filter && !object_class_dynamic_cast(el->data, + binary_filter)) { + /* Machine is not for this binary: skip */ + continue; + } if (mc->alias) { printf("%-20s %s (alias of %s)\n", mc->alias, mc->desc, mc->na= me); } --=20 2.47.1