From nobody Thu May 28 00:44:48 2026 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=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1777522858; cv=none; d=zohomail.com; s=zohoarc; b=gnGyqNI2B3qQIxLWQTWQ8hC1KgkvD8pQnurmYYcpPpWL6rWj5D3t6yTPvCCmkz9pMjW1YQBqSnxoSzUCSQhGEkeBQSRLrYyWNa7G0i5AAh2u1H0MKVT+p4fzqMm1vtNE2wHOGJ/G4xmPPoVhDk2yHaeaEQPTwaaUSJU/JoMx+R4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777522858; 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=+xrv2vsliFNoIqj07DnW57E7l3t4q1oodc/gcjFqRpA=; b=NqtP28wcBJnlUVmjdK5a0owDJ9hutpRn6hmcROl12/Hn74yiasgPeLTQaSq3oFtfYSRdUDhvG8JykH/IBIST13419ezX1K8G0CxdxD8Pj38hI5mt3JXeGdluSjPtyymIVltUup0W8jWJz65LVjqA9V1tiYdwxpZMn0ZrgGru/TA= 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777522858645983.095713459114; Wed, 29 Apr 2026 21:20:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wIItS-0006Tn-Dr; Thu, 30 Apr 2026 00:20:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wIItN-0006ON-Te for qemu-devel@nongnu.org; Thu, 30 Apr 2026 00:20:51 -0400 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wIItM-0001ry-7T for qemu-devel@nongnu.org; Thu, 30 Apr 2026 00:20:49 -0400 Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 63TKbLdD2855826 for ; Thu, 30 Apr 2026 03:56:34 GMT Received: from mail-dl1-f72.google.com (mail-dl1-f72.google.com [74.125.82.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dukrp2kqj-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 30 Apr 2026 03:56:34 +0000 (GMT) Received: by mail-dl1-f72.google.com with SMTP id a92af1059eb24-12c21dbc9c1so1841568c88.0 for ; Wed, 29 Apr 2026 20:56:34 -0700 (PDT) Received: from hu-pbouvier-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-12de32173acsm7159443c88.5.2026.04.29.20.56.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Apr 2026 20:56:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= +xrv2vsliFNoIqj07DnW57E7l3t4q1oodc/gcjFqRpA=; b=FaNY2e6vL5zzUKL5 kjGBwz7IU10Xu5i7Wnu/a5FlD/+BwK+MCOtNMAHDHuTtCPTqedrHyhhcjIEEbkbL 2V9YjfyWoMRNI/K18C1EsDpE+dJP8I8oW/dxa9xfovh93GjK+ZlQjZgTc1BcK16A muIfhlhrw4E9cCyv1INqj59dV7zKY7/pUAHt2S8MyiWpetI7xqnvgMQw8jQBWcTU auAq4HTX/HrlnmZzt3jTTMtLL1+YX8jZLUzRZyr7lGJ70ewNsLZHzHs6qUAuaxuz CykA2PPmXCT+PSp1Y/1j/M19sLiMKQWPQjzpYMWC2MEBdHHlNwl94Ik94C49ai6+ MueE9g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1777521393; x=1778126193; 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=+xrv2vsliFNoIqj07DnW57E7l3t4q1oodc/gcjFqRpA=; b=SIWmsolEg1JwEB0TOU9PHL44j5wqLYXPaLd8jxN8y5xHgk46HUUXXU5a+PhecYSnSQ WR9ZOWSOGZfhmHo9Wq3xvX2KtkmLFJOLmMdw5Ea5PrPA6mPKQZV72h6wqFEVgQ8ELuj+ LNlO4eRpWqRkRBbSCC322GDEHrAEYouvxxjPiS/dxjabrvRcx8h8R0BXfI4UgVTVZN6V 3jRlJO2v1MxUUQsI+TUjn/XtCOVesZWHLuXjG6JO5HIrO/yahd7wGsudbkF88ZmvdhwU +600D5C3iljD1SMQOzNgZG43vIaSlrl8NtSg/C3iP0LFvuGwNYf8PgCdpgKSVrPVbBMs JUjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777521393; x=1778126193; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=+xrv2vsliFNoIqj07DnW57E7l3t4q1oodc/gcjFqRpA=; b=ruOWkBloWyyYz0cjS1jC2nUVuroTOdK+Z6RNh2hn3DqBe5AcBSTzeGJLQ9zr2A7/0/ K7qjU+WCVhJ4afB46O0tDsBzf2sP2dLUaMiwgo1nfvvMbb7fZEe87m/MilMNE6pb5SKj m6lOfm+UXzq/jmS3xS63Mkh4E84mcXovinoL5BjE3HUpb/O2y2vGJEcGWPqJmAMlnkh2 6EzOR3Ei6pokuCswq4sAyVFqca1/v5Zpzdxovn/JstnbL0LLsE1B/bNU2sxUoRDnFe5J /D8vdZj4voFQqM4hiiJkT85kHWErIf3EcbrojPVagX12ASnfKwsp4FdNX88GXQOgcX9N gtUg== X-Gm-Message-State: AOJu0YyW6GnPYkx5mOca0KjpOozYGZ7HT/KvPcXMALcierLg00gu4QAl 7MUOPtGOSOnrH+0L+S2WvIHx8WmEfoWpErErBb01A/Y03IafU28PqItJvlw7h/x40iBeXnAtWhP PK28sfrtN8+32qY/nb/xF9/w/Fvyxlehr/cWABBXzFnvOTGi0TeHx3eqKVlkb/AMQ2nL+ X-Gm-Gg: AeBDietBln1OlWsJ8dEeZKt9UTjJbxIzzDAsiLulQI6UAYBdFI+Iq2fnPdOb2PGgfpm yhAzVkPMktZ/cON7fy1lgYGdsO0Fcxv+jPe2ukLtjgBKqOaZSLO15uAbXzt6oapu/dsz7aofEbU Z4PU9g7B4k3QUj+MXStAKFsUvExhhEF7KCztsEI++amyupKvMBc12O3p6ajuk+VUdilrYh67yOw A6ypmOuxmOqRzg3ZdZjxGIgXC6wLSp4xLtq+fRMRe6zocbhyo7P3r20a2qMsBx4P3GZ2ckxkfVA gDs478p4lVTi5RUo81GxxSNAvvpeBe5FrbRqr0J33ztCBL7GhyVGvA/9PcoD0w2/8pqssyqdqy7 HpFOo7siQeP4t4bk32eVSBFctSC6BYA7eHSQUvT/ueYjn55HMFkbroQcZPxihy2o49cWMz0asIp JNa/8kxcNtkwDsmxcC X-Received: by 2002:a05:7022:318:b0:128:bc19:813d with SMTP id a92af1059eb24-12deacadc37mr591915c88.27.1777521393508; Wed, 29 Apr 2026 20:56:33 -0700 (PDT) X-Received: by 2002:a05:7022:318:b0:128:bc19:813d with SMTP id a92af1059eb24-12deacadc37mr591907c88.27.1777521393004; Wed, 29 Apr 2026 20:56:33 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Markus Armbruster , Anton Johansson , marcandre.lureau@redhat.com, Paolo Bonzini , Max Filippov , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 1/7] target-info: extract target_info() definition in target-info-init.h Date: Wed, 29 Apr 2026 20:56:20 -0700 Message-ID: <20260430035626.3511676-2-pierrick.bouvier@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260430035626.3511676-1-pierrick.bouvier@oss.qualcomm.com> References: <20260430035626.3511676-1-pierrick.bouvier@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-ORIG-GUID: xqZf_5xw4_FjJzOw1qou22WR-7SJGCqE X-Proofpoint-GUID: xqZf_5xw4_FjJzOw1qou22WR-7SJGCqE X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDMwMDAzNiBTYWx0ZWRfX65woEPAXW8yw 2Z/tWGu342DqoMkwkPf/nGOKcdhv75m+Y9ZGtO9mNsgVa7xajfiGn/pYWjCVzae2qekMcGBom+W j/jcffvjU5rZdOcpPk243aJnlhcp/JubSFdJ7rl96ENqgfwInzr7AVR790kXnhZ6xzrIIWjmeH/ GARdiwB1Uo8UC0a6a4tfMX+dBlV82xDOJ8ujwnEzrpuclDcMhjkCO4zcTvxhDK6TOBNAeIuEVRK qip6MtDoz0hvCyRT/9X2QCYBWO25wvgsdhw3VfK4QzelCqaXK8YYUAuN2al4KWRm7vybh+rwtpT iKj3IFNP0WReueJLWlG2tp/YFNzAcB0mOWFHtcbpGJc9W9/V0st9YWTLQRk1QgNdAIfBiUS/9EA 58GT23iAd+oNEoKpCpuXp3hjw1BC9EMLuw6tDMe91oIF64qAcMQetgAC1wRZavROZ+xrUDBtceQ VCL82zEWt+mFfc1+Dkw== X-Authority-Analysis: v=2.4 cv=WoQb99fv c=1 sm=1 tr=0 ts=69f2d2f2 cx=c_pps a=bS7HVuBVfinNPG3f6cIo3Q==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=IkcTkHD0fZMA:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=20KFwNOVAAAA:8 a=EUspDBNiAAAA:8 a=090slgBn3MrHMI8nANcA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=vBUdepa8ALXHeOFLBtFW:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-30_01,2026-04-28_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 phishscore=0 adultscore=0 impostorscore=0 lowpriorityscore=0 priorityscore=1501 spamscore=0 suspectscore=0 bulkscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2604300036 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=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.168.131; envelope-from=pierrick.bouvier@oss.qualcomm.com; helo=mx0a-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: qemu development 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 @qualcomm.com) X-ZM-MESSAGEID: 1777522860412154100 This allows us to prepare next commits, which will introduce qom registration for system mode. Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Pierrick Bouvier --- configs/targets/aarch64-softmmu.c | 6 ++---- configs/targets/arm-softmmu.c | 6 ++---- include/qemu/target-info-init.h | 20 ++++++++++++++++++++ target-info-stub.c | 6 ++---- 4 files changed, 26 insertions(+), 12 deletions(-) create mode 100644 include/qemu/target-info-init.h diff --git a/configs/targets/aarch64-softmmu.c b/configs/targets/aarch64-so= ftmmu.c index 82ccb575759..75d95b0e743 100644 --- a/configs/targets/aarch64-softmmu.c +++ b/configs/targets/aarch64-softmmu.c @@ -8,6 +8,7 @@ =20 #include "qemu/osdep.h" #include "qemu/target-info-impl.h" +#include "qemu/target-info-init.h" #include "hw/arm/machines-qom.h" #include "target/arm/cpu-qom.h" #include "target/arm/cpu-param.h" @@ -23,7 +24,4 @@ static const TargetInfo target_info_aarch64_system =3D { .page_bits_init =3D TARGET_PAGE_BITS_LEGACY, }; =20 -const TargetInfo *target_info(void) -{ - return &target_info_aarch64_system; -} +target_info_init(target_info_aarch64_system) diff --git a/configs/targets/arm-softmmu.c b/configs/targets/arm-softmmu.c index 18940e51e55..73546fa5737 100644 --- a/configs/targets/arm-softmmu.c +++ b/configs/targets/arm-softmmu.c @@ -8,6 +8,7 @@ =20 #include "qemu/osdep.h" #include "qemu/target-info-impl.h" +#include "qemu/target-info-init.h" #include "hw/arm/machines-qom.h" #include "target/arm/cpu-qom.h" #include "target/arm/cpu-param.h" @@ -23,7 +24,4 @@ static const TargetInfo target_info_arm_system =3D { .page_bits_init =3D TARGET_PAGE_BITS_LEGACY, }; =20 -const TargetInfo *target_info(void) -{ - return &target_info_arm_system; -} +target_info_init(target_info_arm_system) diff --git a/include/qemu/target-info-init.h b/include/qemu/target-info-ini= t.h new file mode 100644 index 00000000000..9be06d8523a --- /dev/null +++ b/include/qemu/target-info-init.h @@ -0,0 +1,20 @@ +/* + * QEMU target info initialization + * + * Copyright (c) Qualcomm + * + * SPDX-License-Identifier: GPL-2.0-or-later + * + * This file is included by each file defining a TargetInfo structure and = is + * responsible for registering it. + */ + +#ifndef TARGET_INFO_DEF_H + +#define target_info_init(ti_var) \ +const TargetInfo *target_info(void) \ +{ \ + return &ti_var; \ +} + +#endif /* TARGET_INFO_DEF_H */ diff --git a/target-info-stub.c b/target-info-stub.c index f5896a72621..af7cdc5e67a 100644 --- a/target-info-stub.c +++ b/target-info-stub.c @@ -9,6 +9,7 @@ #include "qemu/osdep.h" #include "qemu/target-info.h" #include "qemu/target-info-impl.h" +#include "qemu/target-info-init.h" #include "hw/core/boards.h" #include "cpu.h" #include "exec/page-vary.h" @@ -40,7 +41,4 @@ static const TargetInfo target_info_stub =3D { #endif }; =20 -const TargetInfo *target_info(void) -{ - return &target_info_stub; -} +target_info_init(target_info_stub) --=20 2.43.0 From nobody Thu May 28 00:44:48 2026 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=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1777523029; cv=none; d=zohomail.com; s=zohoarc; b=Uv5xWlwVs3t1eIAKhRDpI3WcYiJWxETktD2hQf/w+n14HDi4xPzNWxQm4Ws9TAZwVxJOO2by0ntlTGi9XTW+o93gM1DsuQZOxWBfVGcssMW0KnabdCbXdBRnTqBKXqFMGsnHzjlJ4zhlqxAQfZ+3Wo5uyDiiKO/yHrtq5VLHouA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777523029; h=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=xfLeX6nDP2/hjLdoKs0SPJ5/YVK0jgrqpGAQdDj4cIQ=; b=Wk1DvM5DcslOAND1Nmbo706RzwvaOQbFz2saf425JKlZobILzuPFjLSeVnMag3npXu7ceES6Wwh7/Ujr6/CN8+4kX5KZB2OZeoHwrHDb57B8uLlFgjeEs+YgVNVeUupJ1P65rD5QKlMIAroAZqmeQqV0bD1TEYMUt/+lOZKCIXQ= 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777523029017455.1051644397345; Wed, 29 Apr 2026 21:23:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wIIw1-0007K7-0u; Thu, 30 Apr 2026 00:23:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wIIw0-0007Jw-16 for qemu-devel@nongnu.org; Thu, 30 Apr 2026 00:23:32 -0400 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wIIvy-0002F3-74 for qemu-devel@nongnu.org; Thu, 30 Apr 2026 00:23:31 -0400 Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 63TKbLCw1809063 for ; Thu, 30 Apr 2026 03:56:35 GMT Received: from mail-dl1-f69.google.com (mail-dl1-f69.google.com [74.125.82.69]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4duj6tb04y-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 30 Apr 2026 03:56:35 +0000 (GMT) Received: by mail-dl1-f69.google.com with SMTP id a92af1059eb24-12dbf4f678eso2193358c88.0 for ; Wed, 29 Apr 2026 20:56:35 -0700 (PDT) Received: from hu-pbouvier-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-12de32173acsm7159443c88.5.2026.04.29.20.56.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Apr 2026 20:56:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=xfLeX6nDP2/ hjLdoKs0SPJ5/YVK0jgrqpGAQdDj4cIQ=; b=G9wuj7rjzq+U71GY7nH2E3TasjZ TgHw5brOlW2RRKz28a+lwuPGhfN4DeM5ZOsMfMSQg5EQjjDU2uHC0Kr12KZsthaY 72nhvLCWivFIc4DMCEL5wicyAZooQprp7CARDqzXUGahevd3RYG1nc//s6p7xQhm mAwg5rLAPlrga79oYujzzZ7iL1VvVUIw5y1bwuq9kJxyk8nsIpmuc8RxJl09S0Zn npSq0i6rtFn7qlvD8YUF+VItbXCHQ3yFo2rjrF7ca36WBgWvXdcvAg3A/hy7gBat 6uVL9GQBJkHJYtFmTnJ0L6oCxXxklXJdJLtncRPhemk8e9NK5w4LIJVSc3Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1777521394; x=1778126194; 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=xfLeX6nDP2/hjLdoKs0SPJ5/YVK0jgrqpGAQdDj4cIQ=; b=YLJP1vOvqXZ80vV5sMi9JjwXzyz3gLWCTFiMjgofjm2XxVsudNWZcTCJMBPnVJVMLY ZEAyGuDmsVGPPVX3U9reTeQXPQ2VowqTufzEmMyxN+Zy8iPCBSCKfuuiqfg7C5j5B/+4 AHgyhaHn03vWE2t/mo21ScEn5QDWRsCHua/I98gKhKj4T/R8e2Xsby8b0+w/SnjdxY4v ZCzqkmT8a4HO366WY2ksOXi3zRKQdkU75w/wi24cMSvGmtUWNghcZnikQ1MDA63cFTjU rKKfvzNqfNp214NaMLUfyTHBJoi0TAbjRsrpzZD/suSdigMRrr/LSDYfHGZmutt0u/ww 8koQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777521394; x=1778126194; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=xfLeX6nDP2/hjLdoKs0SPJ5/YVK0jgrqpGAQdDj4cIQ=; b=a0rmmFe68T25w3f0Fdx24ygl+gnHsiUawogaZh0KWbp5/61pi1t5qq9B1e2Jh20Jpe 7hbW2WkHo2S3XZZve4ifqQqJjFsYWQiRGW/N5GXP8ZqZOlz+hCj9zEAm/3InQvk+OdD2 ErmH8IFAyg1Bnge5ZR9ao3y7dHZVPsIRpvSvu/4deIPz1nq3HSY28N5LmfaNWpGdpDoF u/Zo00aAY899FcLel3Oko1N694hrlaVrK2a9qvGrUONvQg8o+9FXC/yxzZMB/nXS+/sJ zhnFztL8pQFOPZEC99+Ol1QWrkYw3LZs+IRcZmpDD7BTOUzu2vgWt/fipNnpuMRbxjFk Fgqg== X-Gm-Message-State: AOJu0YyMplZMI6Gv1CasXgpbHA+PCBT4ApAt2mYz1WxXM1q4JWru95Lz XNjSteZAZJwFSK4spbeKFXlRn1+uiesPra0OjCYH13Q4iJvL3e2YzZiEwNwUsmvgz4GfGFUCK7x HwtK+UkfphezShzPkv1I2RYRyqTSfXSapWJV+ILQZY9x9KbS7V4en33bpKfa47n9bU6NW X-Gm-Gg: AeBDiev6c7F0HYOncpT1gv+ZRL+A/vit+9qqOSNEmcCbiRuWTt8ZXX0bC2ZNCxkUMGS PAp8GSUEYFVJiMiOVu643jSZOYIhb2J1YXvzvgDJRTnztkxT+U3Jir2LujmaIBA3j1HXo66V4Fe EaKt8j6Byd+dY27z2BbpJSZtdc7+N1pgP30ARHs/3UjA645xOqsKptzErrLwpfKPSLl9XByBRsb XJtqKi5DU9jSxLcHdsgbzhGZSJuVhpUdjX+nmDLXnEIDiMIDHU+Gwa3WK8XxiZQ4Zl2QrLhc+9p S5jBzBTf+P1kpEWxmDbY9NaT0sglrDIa3f3jGcm+SZa1wmYJepDyrlOhZe06hrEmOfYXMUYwGGa LQk24LrnSi2Cq6iY91Oy6r6yf77ZfBpWa1HzX97c940+banTyhzheLBBL6+uZJgFkGZcMrt8mPR 9SdixH1p0RG2KRK8E2 X-Received: by 2002:a05:7022:986:b0:11b:ec5f:1c37 with SMTP id a92af1059eb24-12deb01bca8mr649428c88.18.1777521394422; Wed, 29 Apr 2026 20:56:34 -0700 (PDT) X-Received: by 2002:a05:7022:986:b0:11b:ec5f:1c37 with SMTP id a92af1059eb24-12deb01bca8mr649416c88.18.1777521393912; Wed, 29 Apr 2026 20:56:33 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Markus Armbruster , Anton Johansson , marcandre.lureau@redhat.com, Paolo Bonzini , Max Filippov , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 2/7] target-info: introduce TargetInfo in QOM Date: Wed, 29 Apr 2026 20:56:21 -0700 Message-ID: <20260430035626.3511676-3-pierrick.bouvier@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260430035626.3511676-1-pierrick.bouvier@oss.qualcomm.com> References: <20260430035626.3511676-1-pierrick.bouvier@oss.qualcomm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: 7UOZkDwVkLN8nBxHmm9GvHK_VMpf_CnX X-Authority-Analysis: v=2.4 cv=KcHidwYD c=1 sm=1 tr=0 ts=69f2d2f3 cx=c_pps a=kVLUcbK0zfr7ocalXnG1qA==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=YMgV9FUhrdKAYTUUvYB2:22 a=EUspDBNiAAAA:8 a=957eaOmehK1HrViG9FMA:9 a=vr4QvYf-bLy2KjpDp97w:22 X-Proofpoint-ORIG-GUID: 7UOZkDwVkLN8nBxHmm9GvHK_VMpf_CnX X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDMwMDAzNiBTYWx0ZWRfX8mc6aC9z15tw wxKWo+/zzRbWMNEnaK7AujnpNcZquuc0XXSdC0kQa38tmRxUYHvqmNmf/XvQ81vSe72XVc7Pgay 3S28u7KrWT17b9W5ddrzkswoldkzL74JTlGsBHeIxVBv6MDKAVUoh15mg72CL55z4VC2xjMgVK2 AQYDHrYA5Sg8d+WXjROU0cIUXxblp00ppMRolvYbXbPl+CgI8AwRMbAvzOpV6QcjEwBPaBEtlsi +N2WJGkkQzT41av/drybz0csHZeqcetuQThaLFEFscSt7UKIyA5sYdQW4KZPWcPiSV1O3YGy4gh RiZfjh5nKJsxbfdJh40Mj2Grw/u/TCKRyhbwwA77JIsiIZRWlpmr//dP1WpzVBSebGFNw2Kj/EK FOetOW6l7SrmVG1YDcgKpjVSOZAYGCj9HRcvZdiXoTlPncjxSLJWxghlYaxUl0AkafVwX+UaJlT TV+/hp542a4fRj5qd0A== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-30_01,2026-04-28_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 spamscore=0 phishscore=0 bulkscore=0 suspectscore=0 malwarescore=0 lowpriorityscore=0 clxscore=1015 adultscore=0 priorityscore=1501 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2604300036 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=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.168.131; envelope-from=pierrick.bouvier@oss.qualcomm.com; helo=mx0a-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: qemu development 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 @qualcomm.com) X-ZM-MESSAGEID: 1777523031599158500 Content-Type: text/plain; charset="utf-8" For the single-binary, we want to be able to retrieve at runtime the current target among the different ones available. A consequence is that we can't rely on existing target_info() definition since it will create a conflict once more than one target is available. To solve this, we add TargetInfo in QOM, with this hierarchy. We define one class "target-info-X" per target, that inherits from abstract class "target-info". Using concrete vs abstract class ensure we can easily filter "target-info-X" from all QOM types. Associated TargetInfo is directly set through class initialization, without relying on any instance. For user mode, we simply define target_info() like it was done previously. In this patch, we keep the same definition for system-mode also, and it will be replaced in next commits. Signed-off-by: Pierrick Bouvier --- include/qemu/target-info-init.h | 49 +++++++++++++++++++++++++++++++++ include/qemu/target-info-qom.h | 28 +++++++++++++++++++ target-info-qom.c | 10 +++++++ 3 files changed, 87 insertions(+) create mode 100644 include/qemu/target-info-qom.h diff --git a/include/qemu/target-info-init.h b/include/qemu/target-info-ini= t.h index 9be06d8523a..1e52ad62820 100644 --- a/include/qemu/target-info-init.h +++ b/include/qemu/target-info-init.h @@ -10,11 +10,60 @@ */ =20 #ifndef TARGET_INFO_DEF_H +#define TARGET_INFO_DEF_H =20 +#ifdef CONFIG_USER_ONLY + +/* + * User mode does not support multiple targets in the same binary, so just + * define target_info(). + */ #define target_info_init(ti_var) \ const TargetInfo *target_info(void) \ { \ return &ti_var; \ } =20 +#else /* CONFIG_USER_ONLY */ + +#include "qemu/target-info-qom.h" +#include "qom/object.h" + +#define TYPE_TARGET_INFO_TARGET TYPE_TARGET_INFO"-"TARGET_NAME + +typedef struct TargetInfoQomTarget { + TargetInfoQom parent; +} TargetInfoQomTarget; + +typedef struct TargetInfoQomTargetClass { + TargetInfoQomClass parent_class; +} TargetInfoQomTargetClass; + +OBJECT_DECLARE_TYPE(TargetInfoQomTarget, TargetInfoQomTargetClass, TARGET_= INFO_TARGET) + +#define target_info_init(ti_var) = \ +const TargetInfo *target_info(void) = \ +{ = \ + return &ti_var; = \ +} = \ + = \ +static void target_info_qom_class_init(ObjectClass *oc, const void * data)= \ +{ = \ + TargetInfoQomTargetClass *klass =3D TARGET_INFO_TARGET_CLASS(oc); = \ + klass->parent_class.target_info =3D &ti_var; = \ +} = \ + = \ +static const TypeInfo target_info_qom_target_type_info[] =3D { = \ +{ = \ + .name =3D TYPE_TARGET_INFO_TARGET, = \ + .parent =3D TYPE_TARGET_INFO, = \ + .instance_size =3D sizeof(TargetInfoQomTarget), = \ + .class_size =3D sizeof(TargetInfoQomTargetClass), = \ + .class_init =3D target_info_qom_class_init, = \ + .abstract =3D false, = \ +} }; = \ +DEFINE_TYPES(target_info_qom_target_type_info) + +#endif /* CONFIG_USER_ONLY */ + #endif /* TARGET_INFO_DEF_H */ diff --git a/include/qemu/target-info-qom.h b/include/qemu/target-info-qom.h new file mode 100644 index 00000000000..585995c7ad0 --- /dev/null +++ b/include/qemu/target-info-qom.h @@ -0,0 +1,28 @@ +/* + * QEMU target info QOM types + * + * Copyright (c) Qualcomm + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef QEMU_TARGET_INFO_QOM_H +#define QEMU_TARGET_INFO_QOM_H + +#include "qemu/target-info-impl.h" +#include "qom/object.h" + +#define TYPE_TARGET_INFO "target-info" + +typedef struct TargetInfoQom { + Object parent_obj; +} TargetInfoQom; + +typedef struct TargetInfoQomClass { + ObjectClass parent_class; + const TargetInfo *target_info; +} TargetInfoQomClass; + +OBJECT_DECLARE_TYPE(TargetInfoQom, TargetInfoQomClass, TARGET_INFO) + +#endif /* QEMU_TARGET_INFO_QOM_H */ diff --git a/target-info-qom.c b/target-info-qom.c index 7fd58d24818..5ce29f80301 100644 --- a/target-info-qom.c +++ b/target-info-qom.c @@ -7,10 +7,20 @@ */ =20 #include "qemu/osdep.h" +#include "qapi/error.h" #include "qom/object.h" +#include "qemu/target-info-impl.h" +#include "qemu/target-info-qom.h" #include "hw/arm/machines-qom.h" =20 static const TypeInfo target_info_types[] =3D { + { + .name =3D TYPE_TARGET_INFO, + .parent =3D TYPE_OBJECT, + .instance_size =3D sizeof(TargetInfoQom), + .class_size =3D sizeof(TargetInfoQomClass), + .abstract =3D true, + }, { .name =3D TYPE_TARGET_ARM_MACHINE, .parent =3D TYPE_INTERFACE, --=20 2.43.0 From nobody Thu May 28 00:44:48 2026 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=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1777523358; cv=none; d=zohomail.com; s=zohoarc; b=XmefFREgVThhrMJZrv4Fq4o6ILBfIDAVOcsT0FEQeGFTCmM/Rds40ufszBrBgDp/UGX48Es6vfCPsHMhjQSEjdvleWLOYQxphzvndNF/oJWxtD7ON+XtA6c6XQyrrVxiq4FB3kRUPL393/Kx4C1CVXJq4zG8+9J6Q09T4/a0ahs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777523358; h=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=tSmPencAU5o10CcjukLavzqfOdGbkNhhQxdywYnluD8=; b=AnhKBJahdjXh6inIrGh1Y9+MBGqiE60sPeta5qbm3tRTSVG1LtwZuKq7jhBtt3osa6076s3Jto1pXZL16R6cz9mGQXFR1+1kcAFnBXcKgXnviKqUYMgLOFpoGNlxMl+LCmz+zrPfwklcY00bRagrsWczIMgx6RzL3/g9j6WKebU= 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777523358429177.05914037371656; Wed, 29 Apr 2026 21:29:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wIJ1F-0000BH-Nf; Thu, 30 Apr 2026 00:28:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wIJ1D-0000Au-Ds for qemu-devel@nongnu.org; Thu, 30 Apr 2026 00:28:55 -0400 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wIJ1B-0003Hg-B9 for qemu-devel@nongnu.org; Thu, 30 Apr 2026 00:28:54 -0400 Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 63TKb9rb2533833 for ; Thu, 30 Apr 2026 03:56:36 GMT Received: from mail-dy1-f200.google.com (mail-dy1-f200.google.com [74.125.82.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dupe91ucr-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 30 Apr 2026 03:56:36 +0000 (GMT) Received: by mail-dy1-f200.google.com with SMTP id 5a478bee46e88-2eaf70f3b5fso590595eec.0 for ; Wed, 29 Apr 2026 20:56:36 -0700 (PDT) Received: from hu-pbouvier-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-12de32173acsm7159443c88.5.2026.04.29.20.56.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Apr 2026 20:56:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=tSmPencAU5o 10CcjukLavzqfOdGbkNhhQxdywYnluD8=; b=Kze2fZKN/xu2ErTO1LagsP9QzQZ N3bKYPuysyE6Sb6CjLVVdTRP7w99iKKUDWmpMBhEO/Ff6d9n01GGN2/JBiSh3kNq ih4Bsllccn052WmUf3mlrQMNxcqPXc1d1IPIqlwjne13oMphk8e1aHSOh/U+aAqd 2i0wDBd83n6m5Kl4wgMR+Kg80jw5a+ARuP1m7VdkJnwDV06VxJh2fUVavlr5bNjp bIafpvmN/zr7MBYM3B7N7BWRuiqgaD6ngqyIKCrw5wBHUVod+wW1vtEi6z0t8X0W 6jtAG8uxD7tX7GI29j+hVmDtXJCibiWjDxGChci7Jyxy7XT2XBfpmykr+iQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1777521395; x=1778126195; 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=tSmPencAU5o10CcjukLavzqfOdGbkNhhQxdywYnluD8=; b=H1EUg5yreGeGTrddoLsA1gnvKgjXUWJfeIImq6WtMINDm//klo6NqGROAslMEVKa5t 3YU3wU5jRnAuHhGL/AHrk7Jgk0/dMPhXVpx9RECeTd9tj7tUfd6T8jsRbC3vOdMiA+dN JyAmu4hxdFIkod6XFXj4KuSg+vBTOKSgsE4gZ6164OX3wqYtHByNADTUI7g+6NUw01MS 5nj2TSknNNOIZP99KAdh6nb8oN+4bfVMXxZh70qdu9qR9gsP/MR76NEqxxNiEWKzVUi6 00xWQOUmiGxYb8eglcOXg+HbvlELBlHyILTYAaOvEreHuBJlC3N0renpQq4pz1pyCYEI YP2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777521395; x=1778126195; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=tSmPencAU5o10CcjukLavzqfOdGbkNhhQxdywYnluD8=; b=L5qaVFFpdG9KhVI1Yilsdsgu0GgcUFzOFj6GJjzZ30sDdWJFG1ZD7wvsJ9Xj8zp2pS dChc/sr5iq0WAWkIHisp7rwxjwO0O43RtgT9xMo905PYPXea5mPjgz1zFXQjpZxSMTnz HYuKxc54tnsEPwjKs6vrz6icmhF9vMaSXLWwZOUBrTo9JO59j8laFW1xTAcBFab/JZsr 1cV1oyEViCHBV/j1Ck9S3bF9DRy+cJpfRR09iULhCt3V4fj36jKE3IfQqP/S4JGs1huD TAPJGUA6+iqTDATjn2wZ60u2jyKALzTbDJREyynODn/cBgm7kcKXTkuUXKuVNhRcui36 Ga+g== X-Gm-Message-State: AOJu0YwUvzX7M0eS1iIoMdrMTi4gC9In93kDAozeW11Q8DE+xf8uPQui QQdHv3aQEoruDI5WERIfs6TfmmtwqvwqgyaOyl3BqwdedFGCwu65cPT325vIhcKrWmD2s/cUUE7 9/kzQtpnYp0z/+AZ7Mg5lRMMsliNV4vvFUTR1mCuxp1uPUq88FPWbTdUAo1tboQO82JzE X-Gm-Gg: AeBDietZ0OaCuIY6RqJzih7C5onWRMTj48ZzHphV5Ui57K0CRH8hCYW3hG3K/XFNGFE fkq1keRnF6uH7pIekS8YMzCgBkQP0TVuWqzuzpDAHJMHpWlhSt1/MEh/BXWpZd+sjYH83+Hxfmf SQ/mdcE1qbp/nZh6KH8EYUQ+ZLXKfqDZaBpX60ZKLjLJ8dqc7zEygJyBeGcTFxRojIwkG9Mmrk6 wRw9YTFxha9ZawKEzMtlrKnUXED4CBUfLZOgqRd6+NMagQyYqGT/2WcVIjdEnlFJcU9xo4JZ4Qs Ghm5UkPmNPsRitC2EG5WvGuePl0/84WVDQ+3XO7tmnxVqY/IgEqxDYGvJB9yssoF6EGkbpJrFqM l2ECa7Pbi6HUqkLyhq6US0r73T+bJs7D8x3kXqULdnejcfAqcSLr+coJ4vPYWxuoOO6DkZQ71KI x7pvz7rENgqUGvBTIT X-Received: by 2002:a05:7022:394:b0:12b:ed30:5a32 with SMTP id a92af1059eb24-12deac47e60mr632558c88.5.1777521395115; Wed, 29 Apr 2026 20:56:35 -0700 (PDT) X-Received: by 2002:a05:7022:394:b0:12b:ed30:5a32 with SMTP id a92af1059eb24-12deac47e60mr632545c88.5.1777521394629; Wed, 29 Apr 2026 20:56:34 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Markus Armbruster , Anton Johansson , marcandre.lureau@redhat.com, Paolo Bonzini , Max Filippov , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 3/7] qom/object: register OBJECT and INTERFACE QOM types before main Date: Wed, 29 Apr 2026 20:56:22 -0700 Message-ID: <20260430035626.3511676-4-pierrick.bouvier@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260430035626.3511676-1-pierrick.bouvier@oss.qualcomm.com> References: <20260430035626.3511676-1-pierrick.bouvier@oss.qualcomm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: kedrjNvLj1YdCKLU2KVs-xXsQezn1bOb X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDMwMDAzNiBTYWx0ZWRfXxcMfzaGsueJv Vyaoio3lSsjopb1n6efR3b2Kj8T41s4VRmNqBu7vBnQB+R6t570VFe07mUawseluXtm1kjzHR4m hDc5kZdLm2ECycFDpYkE2R62A/78XFmLz+ASrgCnL6JRaRdn0aRIJqZo7ARiLXGTxq/q/323RsR iMqmfvuyb0xuXaskJVT49HLv3oyJMtTsVKTmeJpCh+3fP6jRBM0AyfAVC+xJ7xUsva8SVylMRQu XmA220pZyz79Q6k39FV78+IQvrZ1rCa+96ovUP0PIH+J9Ib1udUYBDz//PmBbdiXqMKwv+DVKKq wtr4nSwXXv6CJCLUUuvWqOJ+Aqdn8W4pHuSb7GBc5BM1IATtD8C8j1PNtPJKy0DXhdG656nUV/M U7J8ASgMaB+724h28vxn3P+XIvZTR2tIc+7D4UXQCxlDZ+Y1EOQ9lI0T8U4M/9nLXQx9v1jcO5J RDzu9E0uIl4GeiX9Qjg== X-Proofpoint-ORIG-GUID: kedrjNvLj1YdCKLU2KVs-xXsQezn1bOb X-Authority-Analysis: v=2.4 cv=PvmjqQM3 c=1 sm=1 tr=0 ts=69f2d2f4 cx=c_pps a=PfFC4Oe2JQzmKTvty2cRDw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=rJkE3RaqiGZ5pbrm-msn:22 a=EUspDBNiAAAA:8 a=VDdTCajPACCFXhBZtZ0A:9 a=6Ab_bkdmUrQuMsNx7PHu:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-30_01,2026-04-28_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 lowpriorityscore=0 adultscore=0 impostorscore=0 spamscore=0 clxscore=1015 priorityscore=1501 bulkscore=0 phishscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2604300036 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=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.180.131; envelope-from=pierrick.bouvier@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: qemu development 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 @qualcomm.com) X-ZM-MESSAGEID: 1777523361464154101 Content-Type: text/plain; charset="utf-8" Those types are special, as they are the base of all other QOM types. In next commit, we'll introduce an extra step in module initialization for target-info-* types. However, those types depend on TYPE_OBJECT, which is only registered at MODULE_INIT_QOM step. To avoid having to introduce another step, and modify all code calling module_call_init(MODULE_INIT_QOM), we simply register those base types directly in the static constructor, before anything else. Signed-off-by: Pierrick Bouvier --- qom/object.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/qom/object.c b/qom/object.c index f981e270440..a5d268d0722 100644 --- a/qom/object.c +++ b/qom/object.c @@ -2839,7 +2839,7 @@ static void object_class_init(ObjectClass *klass, con= st void *data) NULL); } =20 -static void register_types(void) +static void __attribute__((constructor)) register_types(void) { static const TypeInfo interface_info =3D { .name =3D TYPE_INTERFACE, @@ -2857,5 +2857,3 @@ static void register_types(void) type_interface =3D type_register_internal(&interface_info); type_register_internal(&object_info); } - -type_init(register_types) --=20 2.43.0 From nobody Thu May 28 00:44:48 2026 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=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1777523549; cv=none; d=zohomail.com; s=zohoarc; b=nGsEbcdL7TE2cpHnjYrsjNUA+gkXVxoJe/OhdTqg/lyx5YHtPCGU+zgJM7NdK27ufSZ/i7VgwBkIcmvVvHgQCu2rnqgLlOmsxNiObTZiTiAPJaqhufvhjh9Ksxr50rcQVZ06alBzQwBRJC8wHfNepR3ilC8lsouA2Umvujv25Cs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777523549; h=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=gfYChwZhf1U05Zl89Fjt1DlwgN7a8x+03Xmf8Mj5g1c=; b=N8Cr468p7W0ON63f62S3XWv1smhbHdITRr2HZThZe/9LM01rKHH8YdgJ3ojWyQHMeHk81MRJuBqjnq+wl1TRnhT88Vv89b8gfG/Jh7zKhjFkpRNh6oe788CzVkXzIgvXazg+60WHSZ0oH1LNk+bzWa907aNBdotwmkYCQr2x9j0= 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777523549974671.8960463604407; Wed, 29 Apr 2026 21:32:29 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wIJ4X-0001By-HG; Thu, 30 Apr 2026 00:32:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wIJ4S-0001BY-8L for qemu-devel@nongnu.org; Thu, 30 Apr 2026 00:32:16 -0400 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wIJ4Q-0004KP-Cy for qemu-devel@nongnu.org; Thu, 30 Apr 2026 00:32:15 -0400 Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 63TKbTGi3992973 for ; Thu, 30 Apr 2026 03:56:37 GMT Received: from mail-dl1-f70.google.com (mail-dl1-f70.google.com [74.125.82.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4duhx93264-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 30 Apr 2026 03:56:36 +0000 (GMT) Received: by mail-dl1-f70.google.com with SMTP id a92af1059eb24-12c35f2c09dso640266c88.0 for ; Wed, 29 Apr 2026 20:56:36 -0700 (PDT) Received: from hu-pbouvier-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-12de32173acsm7159443c88.5.2026.04.29.20.56.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Apr 2026 20:56:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=gfYChwZhf1U 05Zl89Fjt1DlwgN7a8x+03Xmf8Mj5g1c=; b=kM/dy37nlqdJt63ffFO7xXsk5GE AXW1Gy5SrjGwpipKCHNOltNhNGz0FhRQxBu4IVAuxmsWJ8bfM0kgIgv4jSwJfVQ8 9ahBv3/TeF2IX32ftXExLHygdoPI1aF6Mzjhlc/UI1cWGv4TkG+TjLGXfubxTp18 gBjPOzTT77RTmCggiOA5F6aCYIgEeFcWKzz7ExX9yoBU9IuD6uZrs+d19S9WxRXg 9t4KzhWlcNbSGt+6FwzVB+/r2Z7U8jRtTewTufi2r4CldfynASBAmJHfz910+KPC IEKODbyei8O4VIfp5Sp/ZhBOcvsw62S6qyXqYisIgBXMO6VZteSJ/0hkk5A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1777521396; x=1778126196; 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=gfYChwZhf1U05Zl89Fjt1DlwgN7a8x+03Xmf8Mj5g1c=; b=JGj/hSeeYXf6ZtKs3QAmNiE/FPCgim7oG16dFpFM/B4el0MNwIsSOWEndDb5a6Z54z KppeW5W/zPjH6F+yFvIZqTDyc1zgun7a7pgz8vhtW0aCn82ix4R7CUesr/XO2PlScdX+ LFKhBYUKjFRID2UwBzg/2Mf9EmH1aNgit90cVFZpE5ioPEnE6Ywu0+Pr04IGNrg/hX2P qYIDMwf6CYMBFuIcyCE5VS74jh0rH3P24XWQtMjbi2OlIxb9JPTEseaelrmzWXvZ2rc2 9Q2SOPLojmhNGpbH/zpcw3Zg3oTjj6xuSctTFmmOcFJdlzx26bYfJvxxFvSjzX/JL1KI Z5Ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777521396; x=1778126196; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=gfYChwZhf1U05Zl89Fjt1DlwgN7a8x+03Xmf8Mj5g1c=; b=s+x7BUFPwSJ39PPCJ3EJOzdiHUscBFrmLse1ZX4gvFTlMDka1S+G6lJihxqqZLQebs au6r9QMY0hFrSvlQgzRX0PcBZUGD4r9VQ65+VGSjZU68X0CeHqnnMssRzZJqaG0lFmsT LnEjRpJXvlapGkIwVKZSin0ckga8YXHz3iF/X1Tazu4IAhCdM4FjgiWv8OUjeRhTQzQS hjUkR4BpufD4VYSaVBn8ZPkOzFtO3+6jY2tB+pNhSuHk1C6SBm5U1EfPLIUn9dmPyOD7 6Q/sH31L37dlwwjLu0pEYWqWAK4dDZAukAS4tlzZfzFv29homwq+KUIWi50gAcTFc4Ux QiMQ== X-Gm-Message-State: AOJu0YxC9tvzEA03bf1v62Rac3E0sPBd+RGMw5EZqVpGilGOjEUVYrkm BTwWSD5wTjQy3FWojT1WtZXx5JcHLjR8R8+Fg6pqs30JhvnJOD78BP0xATLIVDkpWKHOeOiYZor k9StP8u94+vsayhpr8Y1vASzwdMOLlnS3TLXha3NKYbogKxcB+Y+9NYq88pxevrmm/Z9h X-Gm-Gg: AeBDievou3VfAi/Murr34NsCct/I9/WHIDJdPYoAul6WEAjD5ZhF789lsAowHh9scqW dbDJ8/b1hVm7YCmZiKJuIyGuBpNVrgSzc9Z5GuHUtlnY2oGQ4wJLO/l4eOQeoXFwqzTI6GrlPVh v8kPVt+SuKynZXvap/+LujNtJz5OnhnnNEy6Iz9ES/eDJRMoTJbvT8KYLbEj9ZOjC8RoQoq+iY0 XAJq9k//6OD4Jpi3ulQmx0x0yoJtfzVtu+dU7cpG5fBhsqpK63L9C4LyMTNWIFIH1g1m4JA3QXK 74ICuEAAtpnbTh1CmWw6zczZpZPAp9gtp2DSGDU2hWkJdZn9fL1eTw5SGkHDFbJsYbwPlLRz/b6 yvBHR+3IwzXGzGFkKuUzQPQIqVArXV4j+8L63riV+/CZutgz7Qwt38iXiJjBIr7ebEEv7Om+Wz9 tH97CUYW8SIemBjzod X-Received: by 2002:a05:7022:4188:b0:12a:7181:2f1a with SMTP id a92af1059eb24-12deac4f47emr540084c88.5.1777521396000; Wed, 29 Apr 2026 20:56:36 -0700 (PDT) X-Received: by 2002:a05:7022:4188:b0:12a:7181:2f1a with SMTP id a92af1059eb24-12deac4f47emr540072c88.5.1777521395529; Wed, 29 Apr 2026 20:56:35 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Markus Armbruster , Anton Johansson , marcandre.lureau@redhat.com, Paolo Bonzini , Max Filippov , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 4/7] target/xtensa/core: register types using type_init Date: Wed, 29 Apr 2026 20:56:23 -0700 Message-ID: <20260430035626.3511676-5-pierrick.bouvier@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260430035626.3511676-1-pierrick.bouvier@oss.qualcomm.com> References: <20260430035626.3511676-1-pierrick.bouvier@oss.qualcomm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDMwMDAzNiBTYWx0ZWRfXzMZxoZA+Qb+1 T3eN5cykKsxwxEpUlcT2aIZ3Fexu+7nBmQHb1yuNBXJgfOGMdFod8+2QAtRYErBYZXhAXlcsznM TPSdN2M7LC+cjs42IMX4x+VUvdXALX8UPmukfW3e9A/vyl2XbDLLpwq12JBw3eWLqAkQb4KQltI Y43KJVVMkml35Z0veqBcj53ZhI46O8K0q+XwFZK9h0DEY/Hl0O/qpxQ5bRfBCtMq69J2d0uqcBX dMUq+VRXs3lBDOSO8aJCbwCCi6RTPCtJDixoNB//res8haV67xbxU7VfYZ447Pv9EZzK5TNSQ6r X1aKtr5emGcL2ldWKsC45OFyvVZU/lt15yXiRCZH9OI5nG1AX6Lytol6PdVCTkwypC7YTwNV+rG v9w68FuutWar+tDMwWeOltxhqCV9vLX0AzYkZgNOh786D14l1rUbv5rtnOhtOb3yD/LKIb4u89U Vdh9rImJ8UD+f9JCEcA== X-Proofpoint-ORIG-GUID: 3qfgwHqHDfBbSwPEhemWCIWg31p8O9wP X-Authority-Analysis: v=2.4 cv=O5oJeh9W c=1 sm=1 tr=0 ts=69f2d2f5 cx=c_pps a=SvEPeNj+VMjHSW//kvnxuw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=Um2Pa8k9VHT-vaBCBUpS:22 a=EUspDBNiAAAA:8 a=4x8i1Y_ebu9NQW6KHmAA:9 a=Kq8ClHjjuc5pcCNDwlU0:22 X-Proofpoint-GUID: 3qfgwHqHDfBbSwPEhemWCIWg31p8O9wP X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-30_01,2026-04-28_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 clxscore=1015 adultscore=0 phishscore=0 suspectscore=0 impostorscore=0 bulkscore=0 priorityscore=1501 lowpriorityscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2604300036 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=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.168.131; envelope-from=pierrick.bouvier@oss.qualcomm.com; helo=mx0a-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: qemu development 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 @qualcomm.com) X-ZM-MESSAGEID: 1777523551548158500 Content-Type: text/plain; charset="utf-8" Instead of using a static constructor, delay registering those types until we call module_init(MODULE_INIT_QOM). This is not yet a problem, but since we will start initializing target-info types before any other, without this patch qemu-system-xtensa* fails with: Type 'dsp3400-xtensa-cpu' is missing its parent 'xtensa-cpu' Signed-off-by: Pierrick Bouvier Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- target/xtensa/overlay_tool.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target/xtensa/overlay_tool.h b/target/xtensa/overlay_tool.h index 701c00eed20..b9eaffa4871 100644 --- a/target/xtensa/overlay_tool.h +++ b/target/xtensa/overlay_tool.h @@ -451,13 +451,14 @@ =20 #if TARGET_BIG_ENDIAN =3D=3D (XCHAL_HAVE_BE !=3D 0) #define REGISTER_CORE(core) \ - static void __attribute__((constructor)) register_core(void) \ + static void register_core(void) \ { \ static XtensaConfigList node =3D { \ .config =3D &core, \ }; \ xtensa_register_core(&node); \ - } + } \ + type_init(register_core) #else #define REGISTER_CORE(core) #endif --=20 2.43.0 From nobody Thu May 28 00:44:48 2026 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=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1777523038; cv=none; d=zohomail.com; s=zohoarc; b=bN8xarEJZ+/swd5Zi2UNGHGPxdhKaOpQ6SkvyDqmx5JSRJMZVFRUXWejelDiMYDxO3OPTeAqHoBfBnaZvUVM76b0a4p9Iuw0ZRqpaNro936MXith9/WwgKKq2qwSWA44O5LxDpjS3D+bhOLOagYTX/BLdM7cn/bUsikGjHab6mY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777523038; h=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=IFcxnBKVAgB1MK7c4GA0GzJHutJaaZT1qBsCJEhah18=; b=iQSZqNaB5fl/VCYq9rVP6UqivbyYNOtO8KDvnLWYLuyfhFgDRCgsAYNA3PYYbxr9LaneRcSjuKAtya22ke/v+UGWiEPm0brV0ZJVQXmXkFZKJ/E5l6QPfN13Be3gjD1jnZ12lsikrgmkD7dWzggz6KYg92Ta/3xY5Yg7Phr13g0= 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777523038774156.17841297890357; Wed, 29 Apr 2026 21:23:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wIIwH-0007QN-GE; Thu, 30 Apr 2026 00:23:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wIIwF-0007Nv-6E for qemu-devel@nongnu.org; Thu, 30 Apr 2026 00:23:47 -0400 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wIIwD-0002GJ-Fp for qemu-devel@nongnu.org; Thu, 30 Apr 2026 00:23:46 -0400 Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 63TNvMaZ3733700 for ; Thu, 30 Apr 2026 03:56:38 GMT Received: from mail-dl1-f70.google.com (mail-dl1-f70.google.com [74.125.82.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4duv3x8p5k-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 30 Apr 2026 03:56:38 +0000 (GMT) Received: by mail-dl1-f70.google.com with SMTP id a92af1059eb24-12dece274b1so269650c88.1 for ; Wed, 29 Apr 2026 20:56:38 -0700 (PDT) Received: from hu-pbouvier-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-12de32173acsm7159443c88.5.2026.04.29.20.56.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Apr 2026 20:56:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=IFcxnBKVAgB 1MK7c4GA0GzJHutJaaZT1qBsCJEhah18=; b=CSYBgWJcVRJRjODKgKxYUicDkfw QYZyVRMA+M00Rszlk7t5BPVx2DKjLbqIFWkz13A6yz6XFgkGlQCvMgYwTnokBp0f 2ErsCF/o2VJGmb72KDKoxAEucj0z5aytJk9ocXSOk0UxL2qse6NNte1y3OQq8wF4 sqbgdfmg+e4+Yn+tjC/91kT+FfxRw2UVVqJ9mTJZejfUYNkhUb/eyP248Qw2ByOa l3nwFy0dh+WnQLko6Cv+lua1cQR5RSqjQAm7yrseW5Gh+9YFSGvGu3htYmmQ9wER 6seNTVyy66WwkAVjiu4eBk12WwVH6ZlK10LwOE5c2jZ+CqrKixNM9D98uSQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1777521397; x=1778126197; 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=IFcxnBKVAgB1MK7c4GA0GzJHutJaaZT1qBsCJEhah18=; b=XldI9drCiLw/xG9dGwynnmxPEJazYEUNV9yjzpxorVV3v3qqK9CTvb7pEPoBS0FbIQ NmfYrj6EoYIj3gGc3TAq/nyAnfAl7iCcVATLNu0ZkNpto4902rWmUBy6Y9+WkRW53vpT e1jVQRASYndNcRu1bp0TgDuesIIugctRmq0dd2r5EFwmubu7yW/jAjZMkGZ3BuV1WAo1 Sin9gWuUXTdGonFR+a545/cLem1xYDOBBYsFwtGlXE7KTFabmgDA/guWM8Uah/P2WfK/ B5ZMdBU5HbW9SQBT+sJt+pF/i5mAtpSISuo6E1MVtIAqyufoCrVZ/YoLYMYeyBhhRqpL Doow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777521397; x=1778126197; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=IFcxnBKVAgB1MK7c4GA0GzJHutJaaZT1qBsCJEhah18=; b=GeARzPHbP0S6GZ9Twx1TSaLNMRjmdTxuF2J2Hk9F8Id/SWDo9qFnBodlKWH+8clKmN 8RVRt41FzK6MkECWuxVAO3n5hLjZ0hGmBzm/L1WoZq1hEZIiT0vyftXHnNt/oyIhUoVA Lkp7nP6amiTvFS9CqeL9AX+fUnThLACJ6G1/LYRu6rlp1+G72KGOoniNrudj/Pkatmg1 CvvWxeXNwWg1yNj07ZQcgMW0oYkK7DGnxFOPKt0LI0VlXGciD2iUaNz/2VC3FbWJ+ust 2aySpsRqfFmnDS7a+itzzf30qLiP5Rc/mRdRxCH8J5EsaFGkO5x2z/xvVI1Amec6+3/q UwSA== X-Gm-Message-State: AOJu0Ywpoc449wVTQ51BIcghAOpuyLoWWpe828LXHObOA0hNVAOH6aJf Q26pRCgi0ecYkhj3eMiVEUMAKuHMpLOpypRsfWaBOjgXojj9Uk39/yxOcJOXRsQx7gAvxMOKx3g rRVlxM6NnbYMn9N9tCQB1bC0xtxp93aMP1S6Uf35F+h4862oC69ex1JObUc0NU+IdmYB+ X-Gm-Gg: AeBDievBmemQyF48xrQmDbWCD5RukDjq+PUwtrI9xUiHebRy16gsb4mDcs++OaV8NT/ S60oud3+1EazHtWfhDRPUHrepuq5KUIX94Fm5ooEfwcRKn5iQVHuG9l4d8IpQSMzm9iHRgcnFpM FBkfh5Q8EGIItMXq01BI/AV2qaWVpXznNfqU77HwiS3nrfrFsCjCLODD3wE/i6cRKCg2YjJH17O yCyoHQgHoOaA8xBzoZZU0AUJffe/rbT6RGnvp2pwQH125K0DFAfI4ilCbhT1oaCQGtOwy1A2FaK UNn+LpsVP93DJ1u/lCSzeCELau/zasIqkkbgCYRRKouXIraTq3ujqAXjW389cdyxtMaXGxC4z/W QwiQIKHcPArhpjQuVQlifBrpxNSs189Jxs1AECAWEA1vaf0nLmLKwr6PbEG7x1rQFFxKffG9IlW nbImQ/iO9o050x2uQL X-Received: by 2002:a05:7022:ea32:b0:128:d23d:81aa with SMTP id a92af1059eb24-12deace029bmr507811c88.27.1777521396942; Wed, 29 Apr 2026 20:56:36 -0700 (PDT) X-Received: by 2002:a05:7022:ea32:b0:128:d23d:81aa with SMTP id a92af1059eb24-12deace029bmr507793c88.27.1777521396444; Wed, 29 Apr 2026 20:56:36 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Markus Armbruster , Anton Johansson , marcandre.lureau@redhat.com, Paolo Bonzini , Max Filippov , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 5/7] system/vl: register target info types first in qom Date: Wed, 29 Apr 2026 20:56:24 -0700 Message-ID: <20260430035626.3511676-6-pierrick.bouvier@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260430035626.3511676-1-pierrick.bouvier@oss.qualcomm.com> References: <20260430035626.3511676-1-pierrick.bouvier@oss.qualcomm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDMwMDAzNiBTYWx0ZWRfXzOhNw39crr/k IvOBZGdIucLc6we7eYLCEDK9hDCXf7Y8w28r/NPKBvD16hsT/nMZYKAv5zM3F2ZKWfsedLGconb /NOpb6hBbtyjxA/HQ+ovFk39SeLrsj1Isk01Al6p99XcGypd9b26QJapGTJOzbJT6tlKfGUnR8i nrOftN6btd7Ty5ZjJ08IuxWZHm3hcwwjMxu8zdydyE8Jbg+wSz+A7+qjQm7tK+WDcOc3tN+qSIP xMGrJuz5od41HGUuTbTkQxH9G+5i1ro++CcLMrFT5icoCYBgPXcIV+tk/2ArogUCn9e+K+DJHvx nNOw6kqwuCs3GPYZd20Ki7Yd/9bwJxgTXZ0EMnltLzvkJ20Nb2hA6obYB6Ks08SM5RWL2aiz402 YGEnu4wxbH8B4mzywhXrqlaU27Tg9KK1bIL58bwgXSwCjvs8E2etZQDaqwmnP7ipAOnQkd8Krwn IF0GdmzmtKfJrAlSOjQ== X-Authority-Analysis: v=2.4 cv=Oc2oyBTY c=1 sm=1 tr=0 ts=69f2d2f6 cx=c_pps a=SvEPeNj+VMjHSW//kvnxuw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=3WHJM1ZQz_JShphwDgj5:22 a=EUspDBNiAAAA:8 a=2T1URBfsDFyyNY1JCakA:9 a=Kq8ClHjjuc5pcCNDwlU0:22 X-Proofpoint-GUID: EivZTAzCmZpbRVdjdPPd6k7X748LWSCu X-Proofpoint-ORIG-GUID: EivZTAzCmZpbRVdjdPPd6k7X748LWSCu X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-30_01,2026-04-28_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 spamscore=0 lowpriorityscore=0 phishscore=0 suspectscore=0 impostorscore=0 bulkscore=0 malwarescore=0 priorityscore=1501 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2604300036 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=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.180.131; envelope-from=pierrick.bouvier@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: qemu development 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 @qualcomm.com) X-ZM-MESSAGEID: 1777523040965154100 Content-Type: text/plain; charset="utf-8" We will introduce detection of target from QOM, so we need to make sure those types are registered. As well, it ensure no other types are registered yet, so we can safely call object_class_get_list. Signed-off-by: Pierrick Bouvier --- include/qemu/module.h | 1 + include/qemu/target-info-init.h | 17 +++++++++++++---- system/vl.c | 3 +++ target-info-qom.c | 18 +++++++++++------- 4 files changed, 28 insertions(+), 11 deletions(-) diff --git a/include/qemu/module.h b/include/qemu/module.h index 9885ac9afb3..fccf017bf9e 100644 --- a/include/qemu/module.h +++ b/include/qemu/module.h @@ -43,6 +43,7 @@ typedef enum { MODULE_INIT_MIGRATION, MODULE_INIT_BLOCK, MODULE_INIT_OPTS, + MODULE_INIT_TARGET_INFO, MODULE_INIT_QOM, MODULE_INIT_TRACE, MODULE_INIT_XEN_BACKEND, diff --git a/include/qemu/target-info-init.h b/include/qemu/target-info-ini= t.h index 1e52ad62820..859451c672e 100644 --- a/include/qemu/target-info-init.h +++ b/include/qemu/target-info-init.h @@ -12,6 +12,14 @@ #ifndef TARGET_INFO_DEF_H #define TARGET_INFO_DEF_H =20 +#define DEFINE_TARGET_INFO_TYPE(info) = \ +static void do_qemu_init_target_info(void) = \ +{ = \ + type_register_static(&info); = \ +} = \ +module_init(do_qemu_init_target_info, MODULE_INIT_TARGET_INFO) + +#ifdef COMPILING_PER_TARGET #ifdef CONFIG_USER_ONLY =20 /* @@ -53,17 +61,18 @@ static void target_info_qom_class_init(ObjectClass *oc,= const void * data) \ klass->parent_class.target_info =3D &ti_var; = \ } = \ = \ -static const TypeInfo target_info_qom_target_type_info[] =3D { = \ -{ = \ +static const TypeInfo target_info_qom_target_type_info =3D { = \ .name =3D TYPE_TARGET_INFO_TARGET, = \ .parent =3D TYPE_TARGET_INFO, = \ .instance_size =3D sizeof(TargetInfoQomTarget), = \ .class_size =3D sizeof(TargetInfoQomTargetClass), = \ .class_init =3D target_info_qom_class_init, = \ .abstract =3D false, = \ -} }; = \ -DEFINE_TYPES(target_info_qom_target_type_info) +}; = \ + = \ +DEFINE_TARGET_INFO_TYPE(target_info_qom_target_type_info) =20 #endif /* CONFIG_USER_ONLY */ +#endif /* COMPILING_PER_TARGET */ =20 #endif /* TARGET_INFO_DEF_H */ diff --git a/system/vl.c b/system/vl.c index 0e1fc217b4f..dce1170203f 100644 --- a/system/vl.c +++ b/system/vl.c @@ -2888,6 +2888,9 @@ void qemu_init(int argc, char **argv) =20 os_setup_limits(); =20 + /* ensure target-info types are registered before selecting target */ + module_call_init(MODULE_INIT_TARGET_INFO); + module_init_info(qemu_modinfo); module_allow_arch(target_name()); =20 diff --git a/target-info-qom.c b/target-info-qom.c index 5ce29f80301..ba2c7923760 100644 --- a/target-info-qom.c +++ b/target-info-qom.c @@ -10,17 +10,11 @@ #include "qapi/error.h" #include "qom/object.h" #include "qemu/target-info-impl.h" +#include "qemu/target-info-init.h" #include "qemu/target-info-qom.h" #include "hw/arm/machines-qom.h" =20 static const TypeInfo target_info_types[] =3D { - { - .name =3D TYPE_TARGET_INFO, - .parent =3D TYPE_OBJECT, - .instance_size =3D sizeof(TargetInfoQom), - .class_size =3D sizeof(TargetInfoQomClass), - .abstract =3D true, - }, { .name =3D TYPE_TARGET_ARM_MACHINE, .parent =3D TYPE_INTERFACE, @@ -32,3 +26,13 @@ static const TypeInfo target_info_types[] =3D { }; =20 DEFINE_TYPES(target_info_types) + +static const TypeInfo target_info_parent_type =3D { + .name =3D TYPE_TARGET_INFO, + .parent =3D TYPE_OBJECT, + .instance_size =3D sizeof(TargetInfoQom), + .class_size =3D sizeof(TargetInfoQomClass), + .abstract =3D true, +}; + +DEFINE_TARGET_INFO_TYPE(target_info_parent_type) --=20 2.43.0 From nobody Thu May 28 00:44:48 2026 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=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1777524100; cv=none; d=zohomail.com; s=zohoarc; b=LdpPjqH6DQt/U+DQRsMMM6AQ/8BDarO598ctTp1vgznYmdCW2A6MT8OaZAPNz37jYec7k7zz1Y4GCWNFSJ1Q2jLGBBTdEC8GCSzM4mWOnA5iVq5glK1CpB9zBEHFDywbD2Ix70U8I/0qMDiLAWYsVIvBJqtUS8wHvqV78LB/S2c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777524100; 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=RiVU/WTlRr3z497hKz8kbA0vmcn0TrtrN+apFOVls3A=; b=FCiT+F9ehrn8FDkI33sMwWScJIcgC2LHPEPXGVYC3M6QGVzwZNFt79XzAKS4V2TIFGE4Bl6tiaY0TYRMHOxRUeZUYW8kIwYwQTPg7sqGaY89iSun+1Y/ETUQ4sNnKlQ0//e6nD+hAjDDmOIdFAcH3wcZpSPLEDJoOpcsXd5rjkk= 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777524100247120.0356140854276; Wed, 29 Apr 2026 21:41:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wIJDA-0002dP-DI; Thu, 30 Apr 2026 00:41:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wIJD5-0002cC-Jr for qemu-devel@nongnu.org; Thu, 30 Apr 2026 00:41:11 -0400 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wIJD2-0006mq-K3 for qemu-devel@nongnu.org; Thu, 30 Apr 2026 00:41:10 -0400 Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 63TNefiP832062 for ; Thu, 30 Apr 2026 03:56:39 GMT Received: from mail-dy1-f200.google.com (mail-dy1-f200.google.com [74.125.82.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4duuvb0q2r-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 30 Apr 2026 03:56:39 +0000 (GMT) Received: by mail-dy1-f200.google.com with SMTP id 5a478bee46e88-2c16233ee11so745897eec.1 for ; Wed, 29 Apr 2026 20:56:38 -0700 (PDT) Received: from hu-pbouvier-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-12de32173acsm7159443c88.5.2026.04.29.20.56.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Apr 2026 20:56:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= RiVU/WTlRr3z497hKz8kbA0vmcn0TrtrN+apFOVls3A=; b=E7eWh7dsanOkBP3l eUMbZjt3npGHbgratNQ5NImRUUe4f+Y8pAQRU7S91Jo2EfY0Wp22OHeLqCeR3g1R bZgPkQrjFGBPU8jKxFZKkrLUmSuhRvrIAgRGQC/aJe5KIoBuk9jO7qk3tqXNB+pt lk2018BUUH5MuFMs8aRoUaapzW8LgU6On8Kz7X/MufwMxTocmGgVaXYbvO2flAXG iYQTrtVgDWulGuOI4DPEPiSqnu08rmzNFynT7LCjIIPYh/5D62ii8hceUMJGEDl4 H4trhhK/ua8/bTwokn41Gvn0SA2Xu2LhD40mRDYi/k8a081sI0eXLwVK9R82IiQj GrVcTw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1777521398; x=1778126198; 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=RiVU/WTlRr3z497hKz8kbA0vmcn0TrtrN+apFOVls3A=; b=I0cx07eDDa/1cUW4qPqQdT2VO/tLMEQG2+yurQzDn8eVNuE7XbQWDpQCOKODY/wK+y noVWS28BkjZxkOfvNg6/z9Y2oJSRm8NwiWkDVOLLaydFAyOLVSeNjXSU0d0fvpgQgTig fyFawv/nJ9RlZDZsvlRrSqR6qMukJFq4M5BFMUdJMQF3ofpDeq9I687ald7oIcUKkDmA 9mTiRiQ2IYtNJpK9Q7uMg9c6CBufdGK6jGcdQMgee3/DMPBToyBA+rGRHmUnhP8fDYq2 rrsjyd4DxYRCihc/oXrQ7hU/quyvNGS89IoXgbo3JSKnhlQ1DHLw6a18v8rKzmaB0oDL wX4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777521398; x=1778126198; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=RiVU/WTlRr3z497hKz8kbA0vmcn0TrtrN+apFOVls3A=; b=b0vBAXMGQWB5uAXSvHBYajbhZn7NBWzzMqbLWsDQipM1dq2tzuD4k4Ais5kX5VJB44 DqBF3tx806JOfRTBXYHVd6KLHi/TYRIreMCOtTpxHEqh8q+Gb9lfsaEJYkLOzoKFsh8y 2V98yDOo0rMG2QNFfY9YPGE2Yy3/3gm9K98m+jiSgtHBSmRD5Di4gWAOVAJ8mtqUkQoa uQJNjB6U1XwkJoE79mavVjp/P0kfGh96O5elX3ilYcdfXrGbw42rQv09W3tslit2Hu21 ZRzdjO8no4Keun6UmsT72VVNW46x3T3IxIFog2VBx4RKXCalB6r9gU0R4ZdhKipP0awS calg== X-Gm-Message-State: AOJu0Yycm3N0nY3UPNThoGA7hHHv2lKaQbLgOY5Aa6a0DcrHeebidzuw cht94zzMbY4IP06qmzzPUfqE19vhDoJRVggF0xa6xCGxDWKWHZsS6ltxV2kNMVpXbmF2UwdUecN aJBgXqJOY+VR5gKkoZtfv5LMSUcoTT/nXprkMKSubzS8vVHLj0O03ekNejgcJWmkvot6g X-Gm-Gg: AeBDievJhnBdgIhfmYIZDMwwt6bTZndU/d8v1qcfAU0/0UTOLa5BYJcKcMV8zx3qtvL IHOZK8P9UgsSues5fJiB5nJlXjvtZ5/r7QDUVr2/TUCTj8cBa3r+iK/zVOa3Jv1klvug8y/GmBP 7g5KI4tT1BS7AbUoYtxWfBK0sgPiaZAFjT+Ums962f2xgnopi0co9vz2YYP6K9HtOuK1f38IJZF b0pOpoLXmx9G18Fg7sKUot5aHmhBC4UHFjZV2OUOveSE9XKSII5m/DaqRV1V4UxY0Z7r8noJPPY /+Q0u6DxpeNg/R5MguvNOFO7646FkNc1L0Iv5uH/j9E7U0oerdvlw5oWXB2O+30f33r3jXMpkHT CxB9+NSCytf/iuvQX3PbW8IALBs4Lq3IiGI0RwCs1cDeh5D0CMLqAXzC2gtvMEKvN+TPAoIVaxt nfq89xWdrMf1pAUDxY X-Received: by 2002:a05:7022:1603:b0:12d:c3fb:14a7 with SMTP id a92af1059eb24-12deac8fc66mr641864c88.18.1777521397834; Wed, 29 Apr 2026 20:56:37 -0700 (PDT) X-Received: by 2002:a05:7022:1603:b0:12d:c3fb:14a7 with SMTP id a92af1059eb24-12deac8fc66mr641851c88.18.1777521397267; Wed, 29 Apr 2026 20:56:37 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Markus Armbruster , Anton Johansson , marcandre.lureau@redhat.com, Paolo Bonzini , Max Filippov , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 6/7] target-info-qom: detect target from QOM Date: Wed, 29 Apr 2026 20:56:25 -0700 Message-ID: <20260430035626.3511676-7-pierrick.bouvier@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260430035626.3511676-1-pierrick.bouvier@oss.qualcomm.com> References: <20260430035626.3511676-1-pierrick.bouvier@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: JFnj3U-8AZ9GesKpdWkKgaCApLPsnWC_ X-Proofpoint-ORIG-GUID: JFnj3U-8AZ9GesKpdWkKgaCApLPsnWC_ X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDMwMDAzNiBTYWx0ZWRfXzVyGj5oXiuwS syx51PmdqahWHXtU167n9tl1SQiJmKUBqH6J6kfHrq9B57MHZ71OiFMoNNiV3Rs5hh2wMk+l647 zz9ZpbvXQLJ0Vio8k6fd3DtF7MxKts988Xvl0QPuXN+iMXh+zLWHU8LkdXjEI5DhpkFcUXyLs7+ MLR6cq+IIQ/+cM3p8yVGeX72kxWteHmqP6bEBmsN1C62xwKwuOu1sS2KMyjnDi9VxWVMmgIS9QJ JPNXs0dzeoh4rpmhcZ8hR7epfDR762Zkf7z0OwX63DMCJQNMV2yFnzYNWhgmLi0hGMq/6JD3huU +SYwHDdyBMMN/waojOQvjjoVC9G9kJHTmt27DyXPQqvVBZq33r4W3LJSOjeokpTADs1Gid/KKHV gpIKhqipspyzftpZX7yIGMIczt5GEGaybUAMyVM8KiSCmuAUTUgeWDO3d1jfL1GD2pPHA6k3Lca rtt81oAYmE9UnsJWC+Q== X-Authority-Analysis: v=2.4 cv=V+JNF+ni c=1 sm=1 tr=0 ts=69f2d2f7 cx=c_pps a=PfFC4Oe2JQzmKTvty2cRDw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=IkcTkHD0fZMA:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=gowsoOTTUOVcmtlkKump:22 a=20KFwNOVAAAA:8 a=EUspDBNiAAAA:8 a=0wc84GFNkZAXjcWhtbQA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=6Ab_bkdmUrQuMsNx7PHu:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-30_01,2026-04-28_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 spamscore=0 suspectscore=0 malwarescore=0 bulkscore=0 lowpriorityscore=0 impostorscore=0 adultscore=0 priorityscore=1501 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2604300036 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=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.180.131; envelope-from=pierrick.bouvier@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: qemu development 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 @qualcomm.com) X-ZM-MESSAGEID: 1777524102956154100 For now, we expect only one target to be available at runtime. This will change with the single-binary and we'll detect which one to use dynamically. Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Pierrick Bouvier --- include/qemu/target-info-qom.h | 2 ++ system/vl.c | 2 ++ target-info-qom.c | 16 ++++++++++++++++ 3 files changed, 20 insertions(+) diff --git a/include/qemu/target-info-qom.h b/include/qemu/target-info-qom.h index 585995c7ad0..91be415ed33 100644 --- a/include/qemu/target-info-qom.h +++ b/include/qemu/target-info-qom.h @@ -25,4 +25,6 @@ typedef struct TargetInfoQomClass { =20 OBJECT_DECLARE_TYPE(TargetInfoQom, TargetInfoQomClass, TARGET_INFO) =20 +void target_info_qom_set_target(void); + #endif /* QEMU_TARGET_INFO_QOM_H */ diff --git a/system/vl.c b/system/vl.c index dce1170203f..f98fa030d08 100644 --- a/system/vl.c +++ b/system/vl.c @@ -28,6 +28,7 @@ #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/core/qdev-properties.h" @@ -2890,6 +2891,7 @@ void qemu_init(int argc, char **argv) =20 /* ensure target-info types are registered before selecting target */ module_call_init(MODULE_INIT_TARGET_INFO); + target_info_qom_set_target(); =20 module_init_info(qemu_modinfo); module_allow_arch(target_name()); diff --git a/target-info-qom.c b/target-info-qom.c index ba2c7923760..9d1f50ffcab 100644 --- a/target-info-qom.c +++ b/target-info-qom.c @@ -36,3 +36,19 @@ static const TypeInfo target_info_parent_type =3D { }; =20 DEFINE_TARGET_INFO_TYPE(target_info_parent_type) + +static const TargetInfo *target_info_ptr; + +void target_info_qom_set_target(void) +{ + g_autoptr(GSList) targets =3D object_class_get_list(TYPE_TARGET_INFO, = false); + + size_t num_found =3D g_slist_length(targets); + if (num_found !=3D 1) { + error_setg(&error_fatal, num_found =3D=3D 0 ? + "no target-info is available" : + "more than one target-info is available"); + } + + target_info_ptr =3D TARGET_INFO_CLASS(targets->data)->target_info; +} --=20 2.43.0 From nobody Thu May 28 00:44:48 2026 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=reject dis=none) header.from=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1777522805; cv=none; d=zohomail.com; s=zohoarc; b=A+T1V9vXynRRyDbYykPzPtKsoYyMktgFZumPyDtvskBq18gHxhDkonbrS+eLzMlWiBBAFHbupJjSrb5eTz5QKZ802wC4LAY9aq3V6a/EObAsQEoxqrwJ54nsQxy4uYlpFQjw541mbGs4vh+mEhZ+pzRR7RB+57dqKKfYCtZWJlU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1777522805; 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=5a9a6kWz7AaL1uWn7ELkEIPMK/peDJVgH4gBGXaMfws=; b=aMLzD/YbCOSbEGNuXA+XLiZnPZTsLLVYBDhYg6GiEf8OyRjqlixCEx+8A7FN3s9Xf8RM/Zy6JfgOQkW3Sr4AgEL8aVsIz1TIoywnU87Vri2LE27tVV+7T9OW06fylBl7QbNRmfdsMhCqyb+1sYAA6sV4j+XNK8PVkIOAufHkI2c= 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=reject dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1777522805003316.9722363877271; Wed, 29 Apr 2026 21:20:05 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wIIrx-0005c4-2S; Thu, 30 Apr 2026 00:19:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wIIrw-0005bq-9g for qemu-devel@nongnu.org; Thu, 30 Apr 2026 00:19:20 -0400 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wIIru-0001MK-Oi for qemu-devel@nongnu.org; Thu, 30 Apr 2026 00:19:19 -0400 Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 63TNvTVF3733909 for ; Thu, 30 Apr 2026 03:56:40 GMT Received: from mail-dl1-f70.google.com (mail-dl1-f70.google.com [74.125.82.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4duv3x8p5r-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 30 Apr 2026 03:56:40 +0000 (GMT) Received: by mail-dl1-f70.google.com with SMTP id a92af1059eb24-12c8ccc7593so773851c88.1 for ; Wed, 29 Apr 2026 20:56:40 -0700 (PDT) Received: from hu-pbouvier-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-12de32173acsm7159443c88.5.2026.04.29.20.56.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Apr 2026 20:56:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 5a9a6kWz7AaL1uWn7ELkEIPMK/peDJVgH4gBGXaMfws=; b=YFN0ArWp84iqA27H YqXQFifR16EA5nrufD+xykhR60lSRt80IfsjWIrt1MJ3saljfwsvIahjbJheNjeb /IgtnOf5z5HHxLzFt1Y7AiIQmPJ6bRs8QBZlhE4x2T5xUVePyYO9a5UQmH1SOBDN iY6cV/zVTsdR/xyS2yHNLUHQiGxmnvG+cgsK+NFzv/t5MgAG4mv5FGQlkiXxcAWl Inz1/B2FZBqXVIdG0mNZicdDIV6nWEpsd8bopLW4Uhw+ooGoLCM7HJ8wQLGNWbqL RKCbBZSYFWUtJU7WB09IS3QXdVVZnLcc7UDOw14imbBfNM2mJ+uSjKTNbWFBH3nG TFC2kg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1777521399; x=1778126199; 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=5a9a6kWz7AaL1uWn7ELkEIPMK/peDJVgH4gBGXaMfws=; b=btQPKe9ldMgHZo0MMIICNo9gbnWaF1KuT5zaj6JvjOm1CvEc5CYc8NYn3W4OBarx0a ciUobwxHq2LNy+MkbDMUwnKD9AfW86SSbccXFf05uvpPGBoboBsrxxCR9pWHvA/GJjo+ FevNgrUqVF78nLRhRr5JaI5hBDy+eQN42cEwhjGFfcnr63Gn0BHrE62sT9m5iy5Y3V/J XXMKRFZ6UEQNFu+emsxDTH4TguIpkS9+/aUIDv63xGWGjQcq/C1XMlOS37ZRuRwz8s8u tOayhY0S0BJXMqh5c6isb+18LaezXDZASEdwYuK5deRB5wIOTMhfr6L2a9P2LxWjtkIZ 36zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777521399; x=1778126199; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=5a9a6kWz7AaL1uWn7ELkEIPMK/peDJVgH4gBGXaMfws=; b=lKyWk+/oQmh6EBQg8z+nJsYoWrk9r3M0S1+7Gs0rTm/ToTzcx+qTwTZ9crrbmXQUe6 Yd6w5k2RIMhv1oFqUkQq64IldPx0mIC5FGg8odCLB/CayLnU29ESWbSNWcbBWz6cF5zI Xv92KCrJ/v0RVs1Ww7OxbOLFhJsnqMC4U964UEsePDh+KY/eeyi34UUNeYpdmjUrbvMw 6p/FRGZJNdq3q4BbYs77CyktZQy9M919SSdKLixt8J35SVXXDAA5yEfDZrNJ3OgU9jev bRYudyawQra9TxMB0Wc3ozkLRl/X0W2w7piPaz/DMSpvJB9aYYho10GZvgkwpS+ve2gx Dd9A== X-Gm-Message-State: AOJu0YzAuWkkUGzief7qpET2CZoUXsOZnuqDpW2d1cRk4/i0W8jr74DX jstkA30xHZc37qAnfd6yJZZfuATmT/YDLZlAQOHpg8wZ3o8EtsHG+8OaBCQwICwLW4a11t7OQfl 70MNDBCC1VQId1xit+U1bu97cVPaPdU6I0WXYPCdAdFpqKv7KCmYYctTl9ehGtJwKIbCt X-Gm-Gg: AeBDiesxt08VbFODnX+oHO3o2wPuupsDPoisfM3diAgHXjq2xnCUeoUmK2lCVgNfjw5 CV5Jr1f9RY0sCQqNjk0cCGd7N0pw6+GMDoNFT5a+sPJ3VW0IegiFRT6BMjOOawLZb2GuZ6jJ42y z5a9mvdHG3AoT1k81aANkFSJCLVCDE2y+qflrMkj0Dec5+rQhLZVL5Vhs/32vrwR0nw/idq0XOH kFTks8yPqThsSIM3jkhZSg5QCjRcj0TC0zifeXHHed62hkRP8A5ychNdq93KShey3A1PJSA0ugb T1JEZxJVvKw4wrYqbUlOCVS6tKp9UrJ8eQBVbDhoIErMtoAcAWKuZZaXDTIobY9aF4ZgoMIZiS1 j2x/vh7OVxSCw1DuxCwQHNhWyYL2f005NpwK/lkS2Af4gUmdSjkThy5qjAOwkZC9TNH79zZ9pw0 DFb8V8ppilxhfLytxw X-Received: by 2002:a05:7022:213:b0:12d:d27f:d817 with SMTP id a92af1059eb24-12deac77ba3mr615800c88.19.1777521399250; Wed, 29 Apr 2026 20:56:39 -0700 (PDT) X-Received: by 2002:a05:7022:213:b0:12d:d27f:d817 with SMTP id a92af1059eb24-12deac77ba3mr615790c88.19.1777521398726; Wed, 29 Apr 2026 20:56:38 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , Markus Armbruster , Anton Johansson , marcandre.lureau@redhat.com, Paolo Bonzini , Max Filippov , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 7/7] target-info: replace target_info() in system-mode Date: Wed, 29 Apr 2026 20:56:26 -0700 Message-ID: <20260430035626.3511676-8-pierrick.bouvier@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260430035626.3511676-1-pierrick.bouvier@oss.qualcomm.com> References: <20260430035626.3511676-1-pierrick.bouvier@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNDMwMDAzNiBTYWx0ZWRfX8qAXX4eiE+iv qdikZPyBZRNQ2UU+kXWJudQ373TsMJ176qIflOvra+RXSe8HDUhD+ZsZBpxtqlL6OasGCpDyXMa bSx+v2DhizQrTBpIdZV+UIhfnOlR1JB3zGlgMAWSrLpXsIym3rg/nPyg5ZyED+cOYXAUyPT6xgv L8iulz5DVTHzGigF8dpi/QFL8oXs6kZWjh5lJcSyoX8rCKIC6dBIYh3NSdaU0UGwSwGFN718qXs KOwHkTCWKRZGWpuotFP+JQvqT3n6BByqpoDfx+gWxV+I/Y7xP93XsWjVW76aQnVnHnK3oJrl61W d9uWKZ+K9HI3PMB1CfFpIILnqL+rh8GjXuQo9awn0Pk5IbrdvoyE3WjiF4q/5vp32OY9aRwFyog Cu/Ty5iaNmNs1w/8J0ghOXAXhZUOcsFVjm1XKYS6SFZjcL3iUb6tdGZmMSflQiYm89rgRV2zIaY nCpucLMZjHUstHLmPwQ== X-Authority-Analysis: v=2.4 cv=Oc2oyBTY c=1 sm=1 tr=0 ts=69f2d2f8 cx=c_pps a=SvEPeNj+VMjHSW//kvnxuw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=IkcTkHD0fZMA:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=3WHJM1ZQz_JShphwDgj5:22 a=20KFwNOVAAAA:8 a=EUspDBNiAAAA:8 a=Ar47GhOyGom1hrc3c0YA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=Kq8ClHjjuc5pcCNDwlU0:22 X-Proofpoint-GUID: fuqpb1rjZzl6tHc5IbFMnkIc0ECCEIhi X-Proofpoint-ORIG-GUID: fuqpb1rjZzl6tHc5IbFMnkIc0ECCEIhi X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-04-30_01,2026-04-28_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 spamscore=0 lowpriorityscore=0 phishscore=0 suspectscore=0 impostorscore=0 bulkscore=0 malwarescore=0 priorityscore=1501 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2604300036 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=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.180.131; envelope-from=pierrick.bouvier@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: qemu development 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 @qualcomm.com) X-ZM-MESSAGEID: 1777522807284158500 We now can use TargetInfo information available from QOM, and remove duplicated target_info() symbol. Reviewed-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Pierrick Bouvier --- include/qemu/target-info-init.h | 5 ----- target-info-qom.c | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/qemu/target-info-init.h b/include/qemu/target-info-ini= t.h index 859451c672e..a9efd8a1e40 100644 --- a/include/qemu/target-info-init.h +++ b/include/qemu/target-info-init.h @@ -50,11 +50,6 @@ typedef struct TargetInfoQomTargetClass { OBJECT_DECLARE_TYPE(TargetInfoQomTarget, TargetInfoQomTargetClass, TARGET_= INFO_TARGET) =20 #define target_info_init(ti_var) = \ -const TargetInfo *target_info(void) = \ -{ = \ - return &ti_var; = \ -} = \ - = \ static void target_info_qom_class_init(ObjectClass *oc, const void * data)= \ { = \ TargetInfoQomTargetClass *klass =3D TARGET_INFO_TARGET_CLASS(oc); = \ diff --git a/target-info-qom.c b/target-info-qom.c index 9d1f50ffcab..cc470b3b4d6 100644 --- a/target-info-qom.c +++ b/target-info-qom.c @@ -39,6 +39,11 @@ DEFINE_TARGET_INFO_TYPE(target_info_parent_type) =20 static const TargetInfo *target_info_ptr; =20 +const TargetInfo *target_info(void) +{ + return target_info_ptr; +} + void target_info_qom_set_target(void) { g_autoptr(GSList) targets =3D object_class_get_list(TYPE_TARGET_INFO, = false); --=20 2.43.0