From nobody Sat May 30 17:45:18 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=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1778526436; cv=none; d=zohomail.com; s=zohoarc; b=Yth6u1uznCaUHLFYU5QO2i1not8htksMsHfe2flMQiK7H13xosEcVEsDcpNckohGvA8qoNYxMG5u6COvWqA6Dqz6FsuPCM/X142J/2KQ2vWlMYkjA28anR3EE52YsUdoWxnNDvdI8Cj/1vlOR6ycZi6ICPyFAmYyRDszKI6fJEo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778526436; 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=DmY7F2wQOdNNHZqSlt4US+jGj2nBqRNa2RTnZ8QtfS8=; b=AGuzuKyS9VcFXnaxOUpAp2YJCVeouWLQoXVYrUnlwZ2SzFDP+aD0wD2JVfxqK7GN/lQiITr0bOohbXdIuC3BDzNuLfj9FC9dfuwNJaWygBHJmyKoH6zlryNNVOXJ/NeCp50dqzUrmnpAQALkeXST+pwI1iR8v++HdXBBbndWlGY= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778526436018914.5623657269988; Mon, 11 May 2026 12:07:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wMVxz-0002Ks-97; Mon, 11 May 2026 15:07:02 -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 1wMVxi-0002JM-CM for qemu-devel@nongnu.org; Mon, 11 May 2026 15:06:43 -0400 Received: from mail-ot1-x32d.google.com ([2607:f8b0: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 1wMVxf-000869-LO for qemu-devel@nongnu.org; Mon, 11 May 2026 15:06:42 -0400 Received: by mail-ot1-x32d.google.com with SMTP id 46e09a7af769-7dcdd23fcdfso2521059a34.3 for ; Mon, 11 May 2026 12:06:39 -0700 (PDT) Received: from stoup.attlocal.net ([2600:381:c938:6375:e3e5:757d:3cef:3491]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7e367d8feb1sm7157011a34.23.2026.05.11.12.06.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 May 2026 12:06:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778526398; x=1779131198; 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=DmY7F2wQOdNNHZqSlt4US+jGj2nBqRNa2RTnZ8QtfS8=; b=biEBbcIwZfTer1QnlsrC8+Z0bQJ7FzFuOyBCZBtCQXoRVDqKsdyxb4gyyg1GXzAtqo d6IX3ye+MGxy2f5MN7NeC5qHcP19RVsz9HhDce0gt/RwmKusuV7sb/moAxlaDOlv/j++ 3QYZ9RK2ihb06A915TR/CZSF63eu40iXjEOiRR/auwVfvslf1HzZGqUGc0spkEPeyBqy a7T5pcXbJtCYgRX5bvtnceJZKSvSO/JrtwDMQKAJ0vIEKR6OGYAoqPB/JiuIqJwID+Nc OOpIXXv53MUsG96L/A2XFFpGxKzKNW5duu+PocXGgx18LXLN4uVjP0Hqblmi6V2UYA9Z mfuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778526398; x=1779131198; 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=DmY7F2wQOdNNHZqSlt4US+jGj2nBqRNa2RTnZ8QtfS8=; b=pGmX03k/Mu3lYMGVdw7XtEukRboqpg3accgQr608dMAtefyTYqyyVHhIybvQTQawt4 N++2n5ka6AGMZfvTBy3JLbpDNA32vHdqyYNx2FloCP/1gNcVSWUTU+P4uD2wDafMTuPt V3A45qxJgBBxER98dNUbZQzQk1oJFyQDyljyMSDJqi1HIyp4r+5ipdxEBjAzzjm4CpdM BsDGciUzn5dHCl7tD8XlxFxMo543v2uAa1XPIaEZHLVkqPMt5LIkd/Rn3CE9pIeKa43s NVQKdQ/wCz5/snx5zANZgCX0/vnRaMdgBiIVkoQUnuC71sRtwvzrezOyK/7N9WA7Mi2t hPVw== X-Gm-Message-State: AOJu0YxO0bSTDyx5rsSvp+Fifd4o1RM5uwpztYsocntLdD7eoSiYVsw1 Z9dU9PzegBTranYgCvU0iMptS32k6Mxubs7b9Tn3mwAXarpjtTJDS196m8Pu0xtUGAROqOvpNnn n8/9a X-Gm-Gg: Acq92OHbrkbvpDDoApXGArV7SzYKlXjims/DWumMKbfuUIi7qzMYRGIw+yM3ZmQEmDi XnXxdEDMi4Kxo/zEY0Y3bTErW8YA14VXtmXZl2ONXxNjQ9cZkBWFUmocrYhsnHhrkmEYYDKxSAe 1vson5Lc9sGcDi6dbI/UyYG1mLETMV7l+nBC8WkWqfeGVhxcX3wPlyLV03pSAyeVVggO+W3AV6B Gqsb9go6xL99YdhTeCBYfNW6RTmrWelyd90MrOoz+dtWV9R+/WgTznzZtMNvkbsyWLeFazQgm8R ZhjpDMj4Ny5a3vPcExA0Sry+XZn+iWMmQm445M/NG6ADf6XpIUCJbeWA8iMM6vpIstyl2ECQFuN JId+amy8lkHAIIwaMuEEZs0YiF6nsp0Han1EVH+Kjv4A//OXvhwdocZnaySXT7KEpbNJj/GJdWe Ftho19WQUgzY/LXRBZjj4PGq7fS9SnvLPcuJzips8ff8Q5xA== X-Received: by 2002:a05:6830:6d48:b0:7de:a17c:3716 with SMTP id 46e09a7af769-7e1df13142bmr15848868a34.28.1778526398248; Mon, 11 May 2026 12:06:38 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: pierrick.bouvier@oss.qualcomm.com, philmd@linaro.org Subject: [PATCH 1/5] meson: Build target-info-qom.c with -fno-lto Date: Mon, 11 May 2026 14:06:30 -0500 Message-ID: <20260511190634.472174-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260511190634.472174-1-richard.henderson@linaro.org> References: <20260511190634.472174-1-richard.henderson@linaro.org> MIME-Version: 1.0 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=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::32d; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-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: 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 @linaro.org) X-ZM-MESSAGEID: 1778526438795154100 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson --- meson.build | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index 5fbdc75a0f..9a804dc810 100644 --- a/meson.build +++ b/meson.build @@ -3852,20 +3852,24 @@ subdir('system') # without lto, not even the alias is required -- we simply use different # declarations in different compilation units. pagevary =3D files('page-vary-common.c') +tinfoqom =3D files('target-info-qom.c') if get_option('b_lto') - pagevary_flags =3D ['-fno-lto'] + nolto_flags =3D ['-fno-lto'] if get_option('cfi') - pagevary_flags +=3D '-fno-sanitize=3Dcfi-icall' + nolto_flags +=3D '-fno-sanitize=3Dcfi-icall' endif pagevary =3D static_library('page-vary-common', sources: pagevary + genh, - c_args: pagevary_flags) + c_args: nolto_flags) pagevary =3D declare_dependency(link_with: pagevary) + tinfoqom =3D static_library('target-info-qom', sources: tinfoqom + genh, + c_args: nolto_flags) + tinfoqom =3D declare_dependency(link_with: tinfoqom) endif common_ss.add(pagevary) system_ss.add(files('page-vary-system.c')) =20 common_ss.add(files('target-info.c')) -system_ss.add(files('target-info-qom.c')) +system_ss.add(tinfoqom) =20 subdir('backends') subdir('configs/targets') --=20 2.43.0 From nobody Sat May 30 17:45:18 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=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1778526445; cv=none; d=zohomail.com; s=zohoarc; b=nz6BFKp+XVk0660NTAFdxie746WZzOEYVfozBCtlG7WHVTfDyh4heNupOAMYwROzZoW8mAW+6fA89HNm49tKK3wrqW9G6pX2HMPaTTnsxDFRKO1ey0jsr6ZGRXQ2+43f2ETjcsSNCXYvrI7EtprO5GTDAurmoji9bAmbD03snUs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778526445; 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=POb/O+hM5Wokeidc3aROFh0k45r/qUp7jNKxBWzEiEw=; b=haIrRvpk7Uv/nfU46AdHU5n2fEokI/vUDlphY5wbqL0/zTUHO0Q0XOSkEWv1M565AH9i3e187YGwWpoTSsbfjdoVLMqph8PMxhw3vz0/TVr46iAR6EW44JSokDwYXM64nJdMi9jNIqxQDDGKnwwT9hM67mhxZ8oh8lIayLWZtBc= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778526445451787.6972456448983; Mon, 11 May 2026 12:07:25 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wMVy6-0002O4-Ti; Mon, 11 May 2026 15:07:06 -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 1wMVxj-0002JR-G2 for qemu-devel@nongnu.org; Mon, 11 May 2026 15:06:44 -0400 Received: from mail-oi1-x231.google.com ([2607:f8b0:4864:20::231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wMVxh-00086F-3p for qemu-devel@nongnu.org; Mon, 11 May 2026 15:06:43 -0400 Received: by mail-oi1-x231.google.com with SMTP id 5614622812f47-47c6f914617so2407544b6e.1 for ; Mon, 11 May 2026 12:06:40 -0700 (PDT) Received: from stoup.attlocal.net ([2600:381:c938:6375:e3e5:757d:3cef:3491]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7e367d8feb1sm7157011a34.23.2026.05.11.12.06.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 May 2026 12:06:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778526400; x=1779131200; 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=POb/O+hM5Wokeidc3aROFh0k45r/qUp7jNKxBWzEiEw=; b=loCHd7yoXeuGcxQwd2KQcQVyVfhKHvXMGNJs0bBGpzfVQ4a82fbGDpkc+nMO5VAVFv pQVUshCjommGBeluGz1DdbdriZ/czJ5OMH+QcAE5hmBbJJVWoSzGKwczm3/I3QNQixS/ Yrm8hn6sx2S+msuNPUosKwzx1CDPmyVRq7lgLyUyuqWrj7QgtW8SpYn6wQEkDmhXpwTI P4pHfLRt4gXNAuwrOLrkClj6amN98z+49M24tYxEQNK+7BWCJYNZA00q9spOK54qWTBW MVJjehT1Qc01oUy53ril5kzxXk/LjKRFOT3uqFlpjrg5tL1HN/Yb/xv5lZX9dMiU0ofq Cx5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778526400; x=1779131200; 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=POb/O+hM5Wokeidc3aROFh0k45r/qUp7jNKxBWzEiEw=; b=Go5sjla6jTRIhXWxDKXkD3f2eC/opv5UndeJ/NGCzQphuOTV10/hGnRYbVeFg3ULiv DR45DK2VQ+NIVtaXT57Ub87FxE08QuCVAgNPd9VdLpcWWlGbGTRoH+1UDp90zGzM2dLC uRtCXqIkBuHvtil04Ga58Fq4zPaFMMA5BdMUOaEXokvDUGqaEU9RBDTC3yzFX5MOdguj P3jR1HHrqZEyk4DufMqrr5Vk9T0+8ovjgsLw/ycScxTqQymIzY20noekr6xK5owyQtbG MoK9u0NmXeSC682w0oOOHEdRcACe2Gi3DTbTtwolwEllnpbS2yF/N3MnShezib9NiHbI vk7Q== X-Gm-Message-State: AOJu0YyFoOqkELBiEdbSZIQyUHWFsBGPRFFOP+jAyYZai75ouXS1Wnna tLsLYaIbP+z4FZBhiPgyTMyRQKFGEyWnP/48m1hV4wr5i0uompWWvaRLZii3Flb3xi7ecuOeOsR aYyxE X-Gm-Gg: Acq92OE+BfLu5O9KYqTNsjGDahkwOGZwGB4DZIzQG0bD0UIrRk1oRbVTTY/ShqgB5kj Hdkb25L7Y2i5x8ydd4eqZ3cEJUpOq3+4WfH9brxzYqljjtWdo3vmID1E3l3gRBwmMWP/TFckUh6 yzrx/T9ukBdVz32OXUlPOM7UDQUNqV9hHOlEvl2HzNMjT0C2HAZdAW5K1w+kyF3O9K/udGkmtvF iXBd9GBghnNoDcPSYoJykC7CHQFg3F0QwO57aObiPlwYE3m9UwNiSoeKGnvvbz9StUuZFmQ891Q VGR2z2iSnXHJjdEeq9VuhX7Fq+a6oZ+AT7Vk0vFRsjtQQoU1aabDb3he7+YXUZTm321T0OK9Bpk +qIyed+ZhQ8wrVY/jNLwoq7HnkVKY6Ve94qkYOyMcAxbX6ecdSaRNvn6fSW2lqCSW+Miaf2hU+W 0y/T8Q9nnQ71wZGwYlsU8H3M2qD8foJC03ucY7qZ1Ib+UCLz/8800xJPGU X-Received: by 2002:a05:6808:e3ce:b0:467:ee:7a2f with SMTP id 5614622812f47-4824a943eb0mr4632009b6e.28.1778526399575; Mon, 11 May 2026 12:06:39 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: pierrick.bouvier@oss.qualcomm.com, philmd@linaro.org Subject: [PATCH 2/5] target-info: Expose target_info as const data Date: Mon, 11 May 2026 14:06:31 -0500 Message-ID: <20260511190634.472174-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260511190634.472174-1-richard.henderson@linaro.org> References: <20260511190634.472174-1-richard.henderson@linaro.org> MIME-Version: 1.0 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=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::231; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x231.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: 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 @linaro.org) X-ZM-MESSAGEID: 1778526446866154100 Content-Type: text/plain; charset="utf-8" Expose a const TargetInfo structure instead of a function returning a const pointer. Signed-off-by: Richard Henderson --- include/qemu/target-info-impl.h | 11 ++++---- include/qemu/target-info-init.h | 45 ++++++++++++++++++++++--------- configs/targets/aarch64-softmmu.c | 18 +++---------- configs/targets/arm-softmmu.c | 18 +++---------- page-vary-common.c | 8 ++---- page-vary-system.c | 6 ++--- target-info-qom.c | 11 +++----- target-info-stub.c | 28 ++++--------------- target-info.c | 12 ++++----- 9 files changed, 65 insertions(+), 92 deletions(-) diff --git a/include/qemu/target-info-impl.h b/include/qemu/target-info-imp= l.h index c917d546ea..df94af4ef3 100644 --- a/include/qemu/target-info-impl.h +++ b/include/qemu/target-info-impl.h @@ -34,11 +34,10 @@ typedef struct TargetInfo { bool page_bits_vary; } TargetInfo; =20 -/** - * target_info: - * - * Returns: The TargetInfo structure definition for this target binary. - */ -const TargetInfo *target_info(void); +extern +#ifndef NONCONST_TARGET_INFO +const +#endif +TargetInfo target_info; =20 #endif diff --git a/include/qemu/target-info-init.h b/include/qemu/target-info-ini= t.h index a539d14d78..a70edeac21 100644 --- a/include/qemu/target-info-init.h +++ b/include/qemu/target-info-init.h @@ -20,30 +20,51 @@ static void register_##info(void) = \ module_init(register_##info, MODULE_INIT_TARGET_INFO) =20 #ifdef COMPILING_PER_TARGET + +#ifndef TARGET_PAGE_BITS_VARY +# define DEF_TARGET_INFO_PB \ + .page_bits_init =3D TARGET_PAGE_BITS +#elif defined(TARGET_PAGE_BITS_LEGACY) +# define DEF_TARGET_INFO_PB \ + .page_bits_vary =3D true, .page_bits_init =3D TARGET_PAGE_BITS_LEGACY +#else +# define DEF_TARGET_INFO_PB \ + .page_bits_vary =3D true +#endif + +#define DEF_TARGET_INFO_VAR(DECL, TYPE, MACHINE) = \ +const TargetInfo DECL =3D { = \ + .target_name =3D TARGET_NAME, = \ + .target_arch =3D glue(SYS_EMU_TARGET_, TARGET_ARCH), = \ + .long_bits =3D TARGET_LONG_BITS, = \ + .cpu_type =3D TYPE, = \ + .machine_typename =3D MACHINE, = \ + .endianness =3D TARGET_BIG_ENDIAN ? ENDIAN_MODE_BIG : ENDIAN_MODE_LITT= LE, \ + DEF_TARGET_INFO_PB, = \ +}; + #ifdef CONFIG_USER_ONLY =20 /* * 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; \ -} +#define DEF_TARGET_INFO(DECL, TYPE, MACHINE) \ + DEF_TARGET_INFO_VAR(target_info, TYPE, MACHINE) =20 #else /* CONFIG_USER_ONLY */ =20 #include "qemu/target-info-qom.h" #include "qom/object.h" =20 -#define target_info_init(ti_var) = \ -static const TypeInfo ti_var##_type_info =3D { = \ - .name =3D TYPE_TARGET_INFO"-"TARGET_NAME, = \ - .parent =3D TYPE_TARGET_INFO, = \ - .class_data =3D &ti_var, = \ -}; = \ -DEFINE_TARGET_INFO_TYPE(ti_var##_type_info) +#define DEF_TARGET_INFO(DECL, TYPE, MACHINE) = \ + static DEF_TARGET_INFO_VAR(DECL, TYPE, MACHINE) = \ + static const TypeInfo DECL##_type_info =3D { = \ + .name =3D TYPE_TARGET_INFO"-"TARGET_NAME, = \ + .parent =3D TYPE_TARGET_INFO, = \ + .class_data =3D &DECL, = \ + }; = \ + DEFINE_TARGET_INFO_TYPE(DECL##_type_info) =20 #endif /* CONFIG_USER_ONLY */ #endif /* COMPILING_PER_TARGET */ diff --git a/configs/targets/aarch64-softmmu.c b/configs/targets/aarch64-so= ftmmu.c index 75d95b0e74..4f43f3e89a 100644 --- a/configs/targets/aarch64-softmmu.c +++ b/configs/targets/aarch64-softmmu.c @@ -7,21 +7,11 @@ */ =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" +#include "qemu/target-info-impl.h" +#include "qemu/target-info-init.h" =20 -static const TargetInfo target_info_aarch64_system =3D { - .target_name =3D "aarch64", - .target_arch =3D SYS_EMU_TARGET_AARCH64, - .long_bits =3D 64, - .cpu_type =3D TYPE_ARM_CPU, - .machine_typename =3D TYPE_TARGET_AARCH64_MACHINE, - .endianness =3D ENDIAN_MODE_LITTLE, - .page_bits_vary =3D true, - .page_bits_init =3D TARGET_PAGE_BITS_LEGACY, -}; - -target_info_init(target_info_aarch64_system) +DEF_TARGET_INFO(target_info_aarch64_system, + TYPE_ARM_CPU, TYPE_TARGET_AARCH64_MACHINE) diff --git a/configs/targets/arm-softmmu.c b/configs/targets/arm-softmmu.c index 73546fa573..8272ce58fd 100644 --- a/configs/targets/arm-softmmu.c +++ b/configs/targets/arm-softmmu.c @@ -7,21 +7,11 @@ */ =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" +#include "qemu/target-info-impl.h" +#include "qemu/target-info-init.h" =20 -static const TargetInfo target_info_arm_system =3D { - .target_name =3D "arm", - .target_arch =3D SYS_EMU_TARGET_ARM, - .long_bits =3D 32, - .cpu_type =3D TYPE_ARM_CPU, - .machine_typename =3D TYPE_TARGET_ARM_MACHINE, - .endianness =3D ENDIAN_MODE_LITTLE, - .page_bits_vary =3D true, - .page_bits_init =3D TARGET_PAGE_BITS_LEGACY, -}; - -target_info_init(target_info_arm_system) +DEF_TARGET_INFO(target_info_arm_system, + TYPE_ARM_CPU, TYPE_TARGET_ARM_MACHINE) diff --git a/page-vary-common.c b/page-vary-common.c index ddd0863378..b4e8cdf405 100644 --- a/page-vary-common.c +++ b/page-vary-common.c @@ -29,10 +29,8 @@ TargetPageBits target_page; =20 bool set_preferred_target_page_bits(int bits) { - const TargetInfo *ti =3D target_info(); - assert(bits >=3D TARGET_PAGE_BITS_MIN); - if (ti->page_bits_vary) { + if (target_info.page_bits_vary) { =20 /* * The target page size is the lowest common denominator for all @@ -55,9 +53,7 @@ void finalize_target_page_bits(void) int bits =3D target_page.bits; =20 if (bits =3D=3D 0) { - const TargetInfo *ti =3D target_info(); - - bits =3D ti->page_bits_init; + bits =3D target_info.page_bits_init; assert(bits !=3D 0); target_page.bits =3D bits; } diff --git a/page-vary-system.c b/page-vary-system.c index 6c49c10e23..b2a1c45deb 100644 --- a/page-vary-system.c +++ b/page-vary-system.c @@ -26,8 +26,6 @@ QEMU_BUILD_BUG_ON(TLB_FLAGS_MASK & ((1u < TARGET_PAGE_BIT= S_MIN) - 1)); =20 int migration_legacy_page_bits(void) { - const TargetInfo *ti =3D target_info(); - - assert(ti->page_bits_init >=3D TARGET_PAGE_BITS_MIN); - return ti->page_bits_init; + assert(target_info.page_bits_init >=3D TARGET_PAGE_BITS_MIN); + return target_info.page_bits_init; } diff --git a/target-info-qom.c b/target-info-qom.c index 52dfc8aee4..abaf7507a0 100644 --- a/target-info-qom.c +++ b/target-info-qom.c @@ -6,6 +6,8 @@ * SPDX-License-Identifier: GPL-2.0-or-later */ =20 +#define NONCONST_TARGET_INFO + #include "qemu/osdep.h" #include "qapi/error.h" #include "qom/object.h" @@ -44,12 +46,7 @@ static const TypeInfo target_info_parent_type =3D { =20 DEFINE_TARGET_INFO_TYPE(target_info_parent_type) =20 -static const TargetInfo *target_info_ptr; - -const TargetInfo *target_info(void) -{ - return target_info_ptr; -} +TargetInfo target_info; =20 void target_info_qom_set_target(void) { @@ -62,5 +59,5 @@ void target_info_qom_set_target(void) "more than one target-info is available"); } =20 - target_info_ptr =3D TARGET_INFO_CLASS(targets->data)->target_info; + target_info =3D *TARGET_INFO_CLASS(targets->data)->target_info; } diff --git a/target-info-stub.c b/target-info-stub.c index 22b7911201..813d562058 100644 --- a/target-info-stub.c +++ b/target-info-stub.c @@ -7,13 +7,13 @@ */ =20 #include "qemu/osdep.h" +#include "cpu.h" +#include "hw/core/boards.h" +#include "exec/cpu-defs.h" +#include "exec/page-vary.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/cpu-defs.h" -#include "exec/page-vary.h" =20 /* Validate correct placement of CPUArchState. */ QEMU_BUILD_BUG_ON(offsetof(ArchCPU, parent_obj) !=3D 0); @@ -24,22 +24,4 @@ QEMU_BUILD_BUG_ON(offsetof(ArchCPU, env) !=3D sizeof(CPU= State)); QEMU_BUILD_BUG_ON(TARGET_PAGE_BITS < TARGET_PAGE_BITS_MIN); #endif =20 -static const TargetInfo target_info_stub =3D { - .target_name =3D TARGET_NAME, - .target_arch =3D glue(SYS_EMU_TARGET_, TARGET_ARCH), - .long_bits =3D TARGET_LONG_BITS, - .cpu_type =3D CPU_RESOLVING_TYPE, - .machine_typename =3D TYPE_MACHINE, - .endianness =3D TARGET_BIG_ENDIAN ? ENDIAN_MODE_BIG : ENDIAN_MODE_LITT= LE, -#ifdef TARGET_PAGE_BITS_VARY - .page_bits_vary =3D true, -# ifdef TARGET_PAGE_BITS_LEGACY - .page_bits_init =3D TARGET_PAGE_BITS_LEGACY, -# endif -#else - .page_bits_vary =3D false, - .page_bits_init =3D TARGET_PAGE_BITS, -#endif -}; - -target_info_init(target_info_stub) +DEF_TARGET_INFO(target_info_stub, CPU_RESOLVING_TYPE, TYPE_MACHINE) diff --git a/target-info.c b/target-info.c index 28c458fc7a..6bd3f9485f 100644 --- a/target-info.c +++ b/target-info.c @@ -14,32 +14,32 @@ =20 const char *target_name(void) { - return target_info()->target_name; + return target_info.target_name; } =20 unsigned target_long_bits(void) { - return target_info()->long_bits; + return target_info.long_bits; } =20 SysEmuTarget target_arch(void) { - return target_info()->target_arch; + return target_info.target_arch; } =20 const char *target_cpu_type(void) { - return target_info()->cpu_type; + return target_info.cpu_type; } =20 const char *target_machine_typename(void) { - return target_info()->machine_typename; + return target_info.machine_typename; } =20 EndianMode target_endian_mode(void) { - return target_info()->endianness; + return target_info.endianness; } =20 bool target_big_endian(void) --=20 2.43.0 From nobody Sat May 30 17:45:18 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=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1778526463; cv=none; d=zohomail.com; s=zohoarc; b=kBG040AQfe22PYUsvMRa1zwHPS7mz01F+P8Q/w5TKkp9kAT+678HfTIkcGDnVpYz7eFFmSsW3/yCYYvyYu91va07W8NgTVqiIUz83T0CNk4OdM0ooIsnBYIXley0IG6/ufBkb1xRH8JMu3IeT2b4vnMJEak9mIm5xwp4ZMxCPu4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778526463; 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=JNeU90ONlcyG7CR2NzocXsDCE+v8Zb8u7b70G8mFHiM=; b=C1JQmGqjTu2oOO1Iq3sAVwx93hZvLqZuzRVmy3Z1DNXP29SzVsnD+TA//u13s0/1tcyMP3CpnJrFdhag3pGPNa2BQFMfuhCFu/SxSDi6qwfIYCQz4+h9U8Uiujv1MMdEEqX19+RgnFZa3dwqTn416u8te81NCY/fpSPaKWKQstc= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778526463047737.9228499824615; Mon, 11 May 2026 12:07:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wMVy4-0002LT-67; Mon, 11 May 2026 15:07:04 -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 1wMVxj-0002JY-US for qemu-devel@nongnu.org; Mon, 11 May 2026 15:06:45 -0400 Received: from mail-oi1-x22d.google.com ([2607:f8b0:4864:20::22d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wMVxh-00086R-PQ for qemu-devel@nongnu.org; Mon, 11 May 2026 15:06:43 -0400 Received: by mail-oi1-x22d.google.com with SMTP id 5614622812f47-47cacb4ed99so3025634b6e.1 for ; Mon, 11 May 2026 12:06:41 -0700 (PDT) Received: from stoup.attlocal.net ([2600:381:c938:6375:e3e5:757d:3cef:3491]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7e367d8feb1sm7157011a34.23.2026.05.11.12.06.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 May 2026 12:06:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778526401; x=1779131201; 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=JNeU90ONlcyG7CR2NzocXsDCE+v8Zb8u7b70G8mFHiM=; b=R3l9p9DtVREZluK738PuCOk0k6cJy/Q1V/Mkm1xozNbSKQsKYjcLuksMuR08bsrBGV Vr8G5aD8WrBCYoX4JbfMlRaEwS2llcuCynf0vBTMR1N719xDn8iCSr7ICZ9/ZcUZ0u2A LXNV5onDLFSEDJgVxrI2uepzdz0q0H6TYlLJs2OjHHc5NrBmriz7EyhyciGYNLEk6Ym1 uK0Pm3/BlPcEP8gZw5Sljyim4AmTM8i7WIAK1jZ+JJUXMtSqX2xky7XMZvFltShThW3H oZAKHSXtc8tA5eYst8P0wFBGExhv+shNbriQbOhYV4V/9WZfppOwwFhpyvj4SZyZEn/9 3Fvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778526401; x=1779131201; 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=JNeU90ONlcyG7CR2NzocXsDCE+v8Zb8u7b70G8mFHiM=; b=SfjdA5pYgRd8ngzv639Ahjg2KFq9KdRwLIKFQcT+iqYDnG9YZZtq1P9WkJAdA0kQY/ Y9auethKdmq9uKn8SZq6Uwfu2BeJLvzoiGg/qFoMfjgVv/V5hn7eaefTt5KhTd9dnB6G MqjCSFgPG9K+5rIAF1FjagB2uaSVa2IS09Tzy126rzq+2kZEj7szGPiAwi1rv8+Z+QLG 5z/fhS65FQd7f+PptAPc7SZqhbSZ7YCQ5bH1PBEMgMV6wqQ45BXuY7m5RsDJLdPQb9fG FtvnDXJyWJY2E81j010YCiDxLn41DqQjmhd2KWwxpQbaiBAGEbJcpcTkm1tacR9D22cU Wm1Q== X-Gm-Message-State: AOJu0Yx1dCYhx1EGatl0rCQMvUg+fh/rknzjmtiOSpLxmucswcVEAXT/ MXLes7F9/RI/CdqAf6RCh/udkdGmgsTOcCGv8GHnUgs0evjDFvIm03iRKwvRq+eZrJiYLJrrdwb Mcnhb X-Gm-Gg: Acq92OHrnaPbyg4m4C0NXCHSykhffB5IAd6f1FwAfjwORzCbAPe6NtGLFh0SrJNyk1e rTo9VgC6CLyEGRKV6/SsRubj1GhjtWcCV/HkB9+v7Ru/b9Hz96mMZxnS67T3c5hjghZW5LXBS3C mlpNXxB7g7dg8giexkNuczdAbBwPq5UffhmgepD8Ps0el1HnwAx1etCheI/ZMyWBDTxc85ww21M kx2GYny0NT8phz+phwalXbLq+leZxfOffcNkeatJZAlswUOnMv2fm/tZ/bze01mozPSHby2wALE JYeewE4wCqXKufsoFntRcbXoXedUTS2Y+H8F9OUfK4R9NSH2N5aEfsP9Z0edkjNSe8pTYvUFJEV g+GUodiJSxCyhRl1eCMO4CIRSF0T57t1XgGVHhUPH40D8xjSKdB0q4njO+alhPMNLiIKkNpN2WS pE5dAyFZp5t8SdVp7KUN2U5nkoJeLdluXxw9fQVBd+yVQsVw== X-Received: by 2002:a05:6808:1a27:b0:479:ffcf:52d7 with SMTP id 5614622812f47-4824ab6b061mr6252420b6e.46.1778526400490; Mon, 11 May 2026 12:06:40 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: pierrick.bouvier@oss.qualcomm.com, philmd@linaro.org Subject: [PATCH 3/5] target-info: Merge target-info-impl.h into target-info.h Date: Mon, 11 May 2026 14:06:32 -0500 Message-ID: <20260511190634.472174-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260511190634.472174-1-richard.henderson@linaro.org> References: <20260511190634.472174-1-richard.henderson@linaro.org> MIME-Version: 1.0 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=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::22d; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x22d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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 @linaro.org) X-ZM-MESSAGEID: 1778526464129158500 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson Reviewed-by: Pierrick Bouvier --- include/qemu/target-info-impl.h | 43 ------------------------------- include/qemu/target-info-qom.h | 2 +- include/qemu/target-info.h | 31 ++++++++++++++++++++++ configs/targets/aarch64-softmmu.c | 2 +- configs/targets/arm-softmmu.c | 2 +- page-vary-common.c | 2 +- page-vary-system.c | 2 +- target-info-qom.c | 2 +- target-info-stub.c | 1 - target-info.c | 1 - 10 files changed, 37 insertions(+), 51 deletions(-) delete mode 100644 include/qemu/target-info-impl.h diff --git a/include/qemu/target-info-impl.h b/include/qemu/target-info-imp= l.h deleted file mode 100644 index df94af4ef3..0000000000 --- a/include/qemu/target-info-impl.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * QEMU TargetInfo structure definition - * - * Copyright (c) Linaro - * - * SPDX-License-Identifier: GPL-2.0-or-later - */ - -#ifndef QEMU_TARGET_INFO_IMPL_H -#define QEMU_TARGET_INFO_IMPL_H - -#include "qapi/qapi-types-common.h" -#include "qapi/qapi-types-machine.h" - -typedef struct TargetInfo { - /* runtime equivalent of TARGET_NAME definition */ - const char *target_name; - /* related to TARGET_ARCH definition */ - SysEmuTarget target_arch; - /* runtime equivalent of TARGET_LONG_BITS definition */ - unsigned long_bits; - /* runtime equivalent of CPU_RESOLVING_TYPE definition */ - const char *cpu_type; - /* QOM typename machines for this binary must implement */ - const char *machine_typename; - /* related to TARGET_BIG_ENDIAN definition */ - EndianMode endianness; - /* - * runtime equivalent of - * TARGET_PAGE_BITS_VARY ? TARGET_PAGE_BITS_LEGACY : TARGET_PAGE_BITS - */ - unsigned page_bits_init; - /* runtime equivalent of TARGET_PAGE_BITS_VARY definition */ - bool page_bits_vary; -} TargetInfo; - -extern -#ifndef NONCONST_TARGET_INFO -const -#endif -TargetInfo target_info; - -#endif diff --git a/include/qemu/target-info-qom.h b/include/qemu/target-info-qom.h index 91be415ed3..fedb1a2914 100644 --- a/include/qemu/target-info-qom.h +++ b/include/qemu/target-info-qom.h @@ -9,7 +9,7 @@ #ifndef QEMU_TARGET_INFO_QOM_H #define QEMU_TARGET_INFO_QOM_H =20 -#include "qemu/target-info-impl.h" +#include "qemu/target-info.h" #include "qom/object.h" =20 #define TYPE_TARGET_INFO "target-info" diff --git a/include/qemu/target-info.h b/include/qemu/target-info.h index 23c997de54..c9f7f2aa26 100644 --- a/include/qemu/target-info.h +++ b/include/qemu/target-info.h @@ -9,6 +9,37 @@ #ifndef QEMU_TARGET_INFO_H #define QEMU_TARGET_INFO_H =20 +#include "qapi/qapi-types-common.h" +#include "qapi/qapi-types-machine.h" + +typedef struct TargetInfo { + /* runtime equivalent of TARGET_NAME definition */ + const char *target_name; + /* related to TARGET_ARCH definition */ + SysEmuTarget target_arch; + /* runtime equivalent of TARGET_LONG_BITS definition */ + unsigned long_bits; + /* runtime equivalent of CPU_RESOLVING_TYPE definition */ + const char *cpu_type; + /* QOM typename machines for this binary must implement */ + const char *machine_typename; + /* related to TARGET_BIG_ENDIAN definition */ + EndianMode endianness; + /* + * runtime equivalent of + * TARGET_PAGE_BITS_VARY ? TARGET_PAGE_BITS_LEGACY : TARGET_PAGE_BITS + */ + unsigned page_bits_init; + /* runtime equivalent of TARGET_PAGE_BITS_VARY definition */ + bool page_bits_vary; +} TargetInfo; + +extern +#ifndef NONCONST_TARGET_INFO +const +#endif +TargetInfo target_info; + /** * target_name: * diff --git a/configs/targets/aarch64-softmmu.c b/configs/targets/aarch64-so= ftmmu.c index 4f43f3e89a..f0631353ee 100644 --- a/configs/targets/aarch64-softmmu.c +++ b/configs/targets/aarch64-softmmu.c @@ -10,7 +10,7 @@ #include "hw/arm/machines-qom.h" #include "target/arm/cpu-qom.h" #include "target/arm/cpu-param.h" -#include "qemu/target-info-impl.h" +#include "qemu/target-info.h" #include "qemu/target-info-init.h" =20 DEF_TARGET_INFO(target_info_aarch64_system, diff --git a/configs/targets/arm-softmmu.c b/configs/targets/arm-softmmu.c index 8272ce58fd..606b42befa 100644 --- a/configs/targets/arm-softmmu.c +++ b/configs/targets/arm-softmmu.c @@ -10,7 +10,7 @@ #include "hw/arm/machines-qom.h" #include "target/arm/cpu-qom.h" #include "target/arm/cpu-param.h" -#include "qemu/target-info-impl.h" +#include "qemu/target-info.h" #include "qemu/target-info-init.h" =20 DEF_TARGET_INFO(target_info_arm_system, diff --git a/page-vary-common.c b/page-vary-common.c index b4e8cdf405..ec07b91d96 100644 --- a/page-vary-common.c +++ b/page-vary-common.c @@ -20,7 +20,7 @@ #define IN_PAGE_VARY 1 =20 #include "qemu/osdep.h" -#include "qemu/target-info-impl.h" +#include "qemu/target-info.h" #include "exec/page-vary.h" =20 /* WARNING: This file must *not* be complied with -flto. */ diff --git a/page-vary-system.c b/page-vary-system.c index b2a1c45deb..ccc242b498 100644 --- a/page-vary-system.c +++ b/page-vary-system.c @@ -20,7 +20,7 @@ #include "qemu/osdep.h" #include "exec/page-vary.h" #include "exec/tlb-flags.h" -#include "qemu/target-info-impl.h" +#include "qemu/target-info.h" =20 QEMU_BUILD_BUG_ON(TLB_FLAGS_MASK & ((1u < TARGET_PAGE_BITS_MIN) - 1)); =20 diff --git a/target-info-qom.c b/target-info-qom.c index abaf7507a0..f7a03d78d4 100644 --- a/target-info-qom.c +++ b/target-info-qom.c @@ -11,7 +11,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "qom/object.h" -#include "qemu/target-info-impl.h" +#include "qemu/target-info.h" #include "qemu/target-info-init.h" #include "qemu/target-info-qom.h" #include "hw/arm/machines-qom.h" diff --git a/target-info-stub.c b/target-info-stub.c index 813d562058..edd4b78aa2 100644 --- a/target-info-stub.c +++ b/target-info-stub.c @@ -12,7 +12,6 @@ #include "exec/cpu-defs.h" #include "exec/page-vary.h" #include "qemu/target-info.h" -#include "qemu/target-info-impl.h" #include "qemu/target-info-init.h" =20 /* Validate correct placement of CPUArchState. */ diff --git a/target-info.c b/target-info.c index 6bd3f9485f..3679e3ddd6 100644 --- a/target-info.c +++ b/target-info.c @@ -9,7 +9,6 @@ #include "qemu/osdep.h" #include "qemu/target-info.h" #include "qemu/target-info-qapi.h" -#include "qemu/target-info-impl.h" #include "qapi/error.h" =20 const char *target_name(void) --=20 2.43.0 From nobody Sat May 30 17:45:18 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=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1778526457; cv=none; d=zohomail.com; s=zohoarc; b=bCTbMFJ+Z0xD+n/CCLdkMBKqQm2wBdZFX69MkBlG7KCvASxoNJc93NWyGRcuw/Kvy/7rvsh95QpnKjUVnj6H490PWPvhG5F0J1P7eecUqZEDHv7AzAZZyzdO2rnvNYPe5rCuvN5VR41qFL65bA/5B1Q6LuqTdxxlZEzOjA3DXVs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778526457; 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=4HYcto3bMmCQk+FYvg5UJK0RuShy2ZzvXpICY4IIjUw=; b=BtQHqY7WiNM3khs9gtJc31NfSy+GVNS7iGmWOW5YweN9DIEhpacGTZcn8CQgMDgoYNewKDDiEywj0dOHxxB4USEwMnLUqOyj5q4ab2TR7MjKnxSxmFonmxPaX9aQRh8B2HnX1TD3pInJvR/G7rnRtDtkf4rxJ+D4gZSdxhZX4iQ= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778526457153644.0201443034609; Mon, 11 May 2026 12:07:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wMVy6-0002OS-Tr; Mon, 11 May 2026 15:07:06 -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 1wMVxk-0002Jj-SM for qemu-devel@nongnu.org; Mon, 11 May 2026 15:06:45 -0400 Received: from mail-ot1-x32e.google.com ([2607:f8b0: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 1wMVxj-00086e-60 for qemu-devel@nongnu.org; Mon, 11 May 2026 15:06:44 -0400 Received: by mail-ot1-x32e.google.com with SMTP id 46e09a7af769-7df05fc49e5so4561959a34.3 for ; Mon, 11 May 2026 12:06:42 -0700 (PDT) Received: from stoup.attlocal.net ([2600:381:c938:6375:e3e5:757d:3cef:3491]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7e367d8feb1sm7157011a34.23.2026.05.11.12.06.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 May 2026 12:06:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778526402; x=1779131202; 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=4HYcto3bMmCQk+FYvg5UJK0RuShy2ZzvXpICY4IIjUw=; b=Os7Rsqw6rf/r27wV6Jk5QYTCD37l/9bSjazZ6s6HA4lkQ/MNH2cpEtkGdeEq86d2Cu w/UxmSRVRnTThhwuZQQVAyTkhXqzz4nO+4cPnYvD7Zt7Kg+ZK4EkihQsM5kVhxJE3T5F zobjSXglS/Rhkex9ZDKpBKzl9wqZSxZmElVF9+wLmhhVSP77Wcj38iDqykebmOiPZ8r4 dpxuiCJ88Kva4chg920tMStCfJ2u4MdfcQO8ps16cgiV149gdujaY/KX4zonFDTca2IA Q7Jz2KukT+612+MYaOrmKPB2eGPhpLEz+lJ5Svz476bE2nOsc+54mWy+X3t9/Op0yLiS ZiJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778526402; x=1779131202; 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=4HYcto3bMmCQk+FYvg5UJK0RuShy2ZzvXpICY4IIjUw=; b=HcJyOIU/kAr1EXOy9Zt16wj+4mH+ZN/cxpUzgM+tYyOLAhPNjyWVpFK0WIQCzuJgDJ e9hPYoqTs7LpsBdTrHtUbSBaIAWIqvz7lMapqWcqBVWZxSi2Pm/ixwD+lgwzzauDjg8s ZtQBKOSDnhV8PN1uyvSI2eNEh5iP8yC6Cs5FnZeiMjtwGW7agRwp+/peNkCgoUFsIf2P 2ujj4vJ8H+bQo1cqhG31D74p7gIUsh7YaLFiJ2SGiI6PZKBsTj74vr2mttPyrKs31PQz MqzvZVZm2C0NTGEpm1WJ8r72CFafbGD6XjLUoEavCIFyNgrkWWFDz0eDCmnzWNJGMZD+ fyMQ== X-Gm-Message-State: AOJu0YwzbfYbTlto7OxiNWjaSiuj70FX6aua2KNK7PZSDTWM9r0zCKIf +0R17qJPQDcds+00ann2k0D+eQTVB1STmlBwjpHGUYsUjks5y54MjklBKp9T7LGNqZnyn232/9v HmMLZ X-Gm-Gg: Acq92OH0OBjSWONKSqDtgiMQous5sRMh3ONAd166Ow6Um8Kw+HMIUsVb4P0Ws66Ye9D uycAGuvQd9A/Kkyf3ZtlBY+CyQu/BmS4XTQSbjuEOB3qONoe/7or15WhBAMMALppI3BaRlFKxfc 9eCIqSCXUTQU4n2u4ZYBGfkl+Q3Y1IXJlAkRP1DdvU29fo46fDsuh5uAEZAlqni/20XhXnJi2sH ZZikaDLU/e5DWiw3aGcynFoILKYaY7VUBgRsY7diTcS4ypgJXD3+mfTHL4iDQVbXCtNHDhcbBHP wNJd6S0MotOZw22v2txY0CJWoHR9O6Xrt/O3KcG9OAKG36F1wTqRITCCgV6ZoM4TX1w7A7IYPbx 5Fe2GEa1oyYZL9zYwxiQbByPW95Ys9LOu31NFPdrx03mRUb8vPxPTq0T82vaULT1yuc6X65OSxG JLWseEBZzaWe0WK8+ReyQGahTU9Kyt8osu9s1fPew5R0iN1w== X-Received: by 2002:a05:6830:6118:b0:7d9:7201:1acf with SMTP id 46e09a7af769-7e381f0fae0mr6974352a34.5.1778526401619; Mon, 11 May 2026 12:06:41 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: pierrick.bouvier@oss.qualcomm.com, philmd@linaro.org Subject: [PATCH 4/5] target-info: Merge target-info-qapi.h into target-info.h Date: Mon, 11 May 2026 14:06:33 -0500 Message-ID: <20260511190634.472174-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260511190634.472174-1-richard.henderson@linaro.org> References: <20260511190634.472174-1-richard.henderson@linaro.org> MIME-Version: 1.0 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=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::32e; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-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: 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 @linaro.org) X-ZM-MESSAGEID: 1778526458093158500 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson Reviewed-by: Pierrick Bouvier --- include/qemu/target-info-qapi.h | 29 ----------------------------- include/qemu/target-info.h | 14 ++++++++++++++ hw/core/machine-qmp-cmds.c | 1 - hw/uefi/ovmf-log.c | 2 +- hw/virtio/virtio-mem.c | 2 +- system/arch_init.c | 2 +- target-info.c | 1 - 7 files changed, 17 insertions(+), 34 deletions(-) delete mode 100644 include/qemu/target-info-qapi.h diff --git a/include/qemu/target-info-qapi.h b/include/qemu/target-info-qap= i.h deleted file mode 100644 index d5ce052323..0000000000 --- a/include/qemu/target-info-qapi.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * QEMU target info API (returning QAPI types) - * - * Copyright (c) Linaro - * - * SPDX-License-Identifier: GPL-2.0-or-later - */ - -#ifndef QEMU_TARGET_INFO_EXTRA_H -#define QEMU_TARGET_INFO_EXTRA_H - -#include "qapi/qapi-types-common.h" -#include "qapi/qapi-types-machine.h" - -/** - * target_arch: - * - * Returns: QAPI SysEmuTarget enum (e.g. SYS_EMU_TARGET_X86_64). - */ -SysEmuTarget target_arch(void); - -/** - * target_endian_mode: - * - * Returns: QAPI EndianMode enum (e.g. ENDIAN_MODE_LITTLE). - */ -EndianMode target_endian_mode(void); - -#endif diff --git a/include/qemu/target-info.h b/include/qemu/target-info.h index c9f7f2aa26..d8d2194d9b 100644 --- a/include/qemu/target-info.h +++ b/include/qemu/target-info.h @@ -69,6 +69,13 @@ const char *target_machine_typename(void); */ const char *target_cpu_type(void); =20 +/** + * target_endian_mode: + * + * Returns: QAPI EndianMode enum (e.g. ENDIAN_MODE_LITTLE). + */ +EndianMode target_endian_mode(void); + /** * target_big_endian: * @@ -81,6 +88,13 @@ const char *target_cpu_type(void); */ bool target_big_endian(void); =20 +/** + * target_arch: + * + * Returns: QAPI SysEmuTarget enum (e.g. SYS_EMU_TARGET_X86_64). + */ +SysEmuTarget target_arch(void); + /** * target_base_arm: * diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c index e62cb4ec88..3583a60ee8 100644 --- a/hw/core/machine-qmp-cmds.c +++ b/hw/core/machine-qmp-cmds.c @@ -21,7 +21,6 @@ #include "qapi/type-helpers.h" #include "qemu/uuid.h" #include "qemu/target-info.h" -#include "qemu/target-info-qapi.h" #include "qom/qom-qobject.h" #include "system/hostmem.h" #include "system/hw_accel.h" diff --git a/hw/uefi/ovmf-log.c b/hw/uefi/ovmf-log.c index 3a24afd941..ed351149f1 100644 --- a/hw/uefi/ovmf-log.c +++ b/hw/uefi/ovmf-log.c @@ -8,7 +8,7 @@ =20 #include "qemu/osdep.h" #include "qemu/units.h" -#include "qemu/target-info-qapi.h" +#include "qemu/target-info.h" #include "hw/core/boards.h" #include "hw/i386/x86.h" #include "hw/arm/virt.h" diff --git a/hw/virtio/virtio-mem.c b/hw/virtio/virtio-mem.c index a4b71974a1..3d285eaf60 100644 --- a/hw/virtio/virtio-mem.c +++ b/hw/virtio/virtio-mem.c @@ -15,7 +15,7 @@ #include "qemu/cutils.h" #include "qemu/error-report.h" #include "qemu/units.h" -#include "qemu/target-info-qapi.h" +#include "qemu/target-info.h" #include "system/numa.h" #include "system/system.h" #include "system/ramblock.h" diff --git a/system/arch_init.c b/system/arch_init.c index 1ad2f3d6f7..6fa5ae2160 100644 --- a/system/arch_init.c +++ b/system/arch_init.c @@ -24,7 +24,7 @@ #include "qemu/osdep.h" #include "qemu/base-arch-defs.h" #include "qemu/bitops.h" -#include "qemu/target-info-qapi.h" +#include "qemu/target-info.h" =20 bool qemu_arch_available(uint32_t arch_bitmask) { diff --git a/target-info.c b/target-info.c index 3679e3ddd6..f02a033584 100644 --- a/target-info.c +++ b/target-info.c @@ -8,7 +8,6 @@ =20 #include "qemu/osdep.h" #include "qemu/target-info.h" -#include "qemu/target-info-qapi.h" #include "qapi/error.h" =20 const char *target_name(void) --=20 2.43.0 From nobody Sat May 30 17:45:19 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=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1778526457; cv=none; d=zohomail.com; s=zohoarc; b=eZgSSB9dtAAhcAWMV3RjQldCQIXFejfcMwgYfl3BK44QHgzwfybe+L9H/IxFjRLho6se18w8cQwghF7O3Db2qGj/GA/DSCNXBpaFRHMCVDDfH9sb+HxGf16nOGsijCgpEQJgJDlPGmcQr3lQAHlDU2ygT8MQlK7hKtjYB9gK3wA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778526457; 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=QNzWFtx4aSEzEdv4w40+EvVQ4L/q5Dh2oDWi/8nPse4=; b=l5BU1EpFMNFp08Ccseq/AyMQApCFg90WmgVwO08znrHYPVrt0zGhH/3QLhiRMNMdzDGHjdX0Q9+OBav8qe4NQI5OkWCxHVp+PNRAHgWPaOHhEyH1tWzkS5woV3WaKZx3dP24NX6UReE/GkP4bronWgT/k65WO7+1Gs73n1cE5sI= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778526457286152.2100553380767; Mon, 11 May 2026 12:07:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wMVy4-0002Lu-70; Mon, 11 May 2026 15:07:04 -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 1wMVxm-0002KI-2W for qemu-devel@nongnu.org; Mon, 11 May 2026 15:06:52 -0400 Received: from mail-oi1-x230.google.com ([2607:f8b0:4864:20::230]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wMVxj-00086k-Ry for qemu-devel@nongnu.org; Mon, 11 May 2026 15:06:45 -0400 Received: by mail-oi1-x230.google.com with SMTP id 5614622812f47-47bdee5bfc4so3271710b6e.1 for ; Mon, 11 May 2026 12:06:43 -0700 (PDT) Received: from stoup.attlocal.net ([2600:381:c938:6375:e3e5:757d:3cef:3491]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-7e367d8feb1sm7157011a34.23.2026.05.11.12.06.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 May 2026 12:06:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778526403; x=1779131203; 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=QNzWFtx4aSEzEdv4w40+EvVQ4L/q5Dh2oDWi/8nPse4=; b=nH/VIH8YeoPty0pZDpE96ITYcPug1hwuawAzQ6+KmXIeDnDyJsdIk40bAroWn2aIOU Hn074i6U6ovW5GU4QJwMbbSakhBe+iDJr/4q8SQQlU22IoFp8TGxcVv8BJcu+q2lhz6j Ht6113RqOcfFYrUGV0T00g6heHveG6A3WDaLl2FrutG7vr5TDUfj6BKWi+ef5hSUpq6S tCUqcDto75nDVEpw3kLPd6twnlplpQSz9adVzgOGbK6pa9M8wgBbMNkfHrh7YjQ0VoCc 0Etkd6LgPK6ErfJEM50Sn4e+z5rKFXIRfztCWvQVr480jdFfDs5k8s8vkzpDHnvqPD1F sATQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778526403; x=1779131203; 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=QNzWFtx4aSEzEdv4w40+EvVQ4L/q5Dh2oDWi/8nPse4=; b=BsyT2zZt4w58wKVTgoIR6P9pxU8DYYrbaNE1ffF1oyksGUQVtOSb+4XmaxHOXbWNhD b8Z1GcL5CKAaIQDnpwLIo+VqjeQKj3J5iEbiiCRcuTBR0W9h6jSpR7X2ctPIvLNCyviA Nc5yiAMoYzxJTnWqU0TQSg8MrrXKh1wofUs4LdBZiXLYsiRyKZsRaSLBNFd7+gUVc2qL BAdcEePYCgYH5S4svRrFUQfqtkBiTrmaZuXtwUP1/e+oJWOSKrQ3CUUn6OXdjTd0J0mG 0HauH4g56ZDLMGtiMNG3i8bIIAzTHPoQBeikVbXBW/mIkoZqgcIX1DUimDIb5R77KoTW qO1g== X-Gm-Message-State: AOJu0Yzy/wHqDfI/qOZxPBKh5HgHAt6lDgLBFSfnagur78QDYdNBgFKe ytur7+9G9net4H78oR3joS3X1jugjIsRAFJfaQtQjnNaB/MEy1c5c45pvjJemFvjz+7vnTeXHcc 4zSKG X-Gm-Gg: Acq92OG/Pjdlv0Tzrc5TRsNvrHO2d9WsgnY6q9rU1CahH99ygJK8hMCwA/qPdb06TS3 uL78Su+uRFT7RKF2u/gIYZcgeUahnkeE1hNYpvKhKDWZSWVqbUCyo62CcWkJapYF3s3xPxRBE9f nmNgBN2C7pScvByuJ0hgw8prl8moi4fzSd2/CGxHeY6BzuX0r9HIU1B8aGKXhDAdOyOVUpzato8 S5D+iwaMb0jn+ArekWpjY5HI31YmBZm7zFOLEt/OJ0G/+4WPjVN3JthcLLxfjj0DTmv8VkZPfWm 9rrrIhysnIZNtBHnVPefL8tzB4jrA9Ll3/y9JE+XW8ggYDnjYhw3YexU3KILwR56Sr9U5LEytbK xkZ9VaYza/uyntTvIqZ1vT0WTlrs+pjdKX7db91E1dUOcRUypZb7U/Z4ZePRLmz7TulknAiRJuI ORAITA/zOWftcL5s7DFzYMlnFDUzlZuNSIjO6oaakvM/x2Lg== X-Received: by 2002:a05:6808:2203:b0:479:daee:1084 with SMTP id 5614622812f47-482937d8b23mr487835b6e.0.1778526402590; Mon, 11 May 2026 12:06:42 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: pierrick.bouvier@oss.qualcomm.com, philmd@linaro.org Subject: [PATCH 5/5] target-info: Inline accessors Date: Mon, 11 May 2026 14:06:34 -0500 Message-ID: <20260511190634.472174-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260511190634.472174-1-richard.henderson@linaro.org> References: <20260511190634.472174-1-richard.henderson@linaro.org> MIME-Version: 1.0 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=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::230; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x230.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: 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 @linaro.org) X-ZM-MESSAGEID: 1778526458212158501 Content-Type: text/plain; charset="utf-8" Move the entire contents of target-info.c into target-info.h, marking each function inline. Signed-off-by: Richard Henderson --- include/qemu/target-info.h | 82 +++++++++++++++++++++++++++------ target-info.c | 93 -------------------------------------- meson.build | 1 - 3 files changed, 68 insertions(+), 108 deletions(-) delete mode 100644 target-info.c diff --git a/include/qemu/target-info.h b/include/qemu/target-info.h index d8d2194d9b..2c9f5c78fb 100644 --- a/include/qemu/target-info.h +++ b/include/qemu/target-info.h @@ -45,14 +45,20 @@ TargetInfo target_info; * * Returns: Canonical target name (i.e. "i386"). */ -const char *target_name(void); +static inline const char *target_name(void) +{ + return target_info.target_name; +} =20 /** * target_long_bits: * * Returns: number of bits in a long type for this target (i.e. 64). */ -unsigned target_long_bits(void); +static inline unsigned target_long_bits(void) +{ + return target_info.long_bits; +} =20 /** * target_machine_typename: @@ -60,21 +66,30 @@ unsigned target_long_bits(void); * Returns: Name of the QOM interface implemented by machines * usable on this target binary. */ -const char *target_machine_typename(void); +static inline const char *target_machine_typename(void) +{ + return target_info.machine_typename; +} =20 /** * target_cpu_type: * * Returns: target CPU base QOM type name (i.e. TYPE_X86_CPU). */ -const char *target_cpu_type(void); +static inline const char *target_cpu_type(void) +{ + return target_info.cpu_type; +} =20 /** * target_endian_mode: * * Returns: QAPI EndianMode enum (e.g. ENDIAN_MODE_LITTLE). */ -EndianMode target_endian_mode(void); +static inline EndianMode target_endian_mode(void) +{ + return target_info.endianness; +} =20 /** * target_big_endian: @@ -86,62 +101,101 @@ EndianMode target_endian_mode(void); * the target, so please do *not* use this function unless you know very * well what you are doing! */ -bool target_big_endian(void); +static inline bool target_big_endian(void) +{ + return target_endian_mode() =3D=3D ENDIAN_MODE_BIG; +} =20 /** * target_arch: * * Returns: QAPI SysEmuTarget enum (e.g. SYS_EMU_TARGET_X86_64). */ -SysEmuTarget target_arch(void); +static inline SysEmuTarget target_arch(void) +{ + return target_info.target_arch; +} =20 /** * target_base_arm: * * Returns whether the target architecture is ARM or Aarch64. */ -bool target_base_arm(void); +static inline bool target_base_arm(void) +{ + switch (target_arch()) { + case SYS_EMU_TARGET_ARM: + case SYS_EMU_TARGET_AARCH64: + return true; + default: + return false; + } +} =20 /** * target_arm: * * Returns whether the target architecture is ARM (32-bit, not Aarch64). */ -bool target_arm(void); +static inline bool target_arm(void) +{ + return target_arch() =3D=3D SYS_EMU_TARGET_ARM; +} =20 /** * target_aarch64: * * Returns whether the target architecture is Aarch64. */ -bool target_aarch64(void); +static inline bool target_aarch64(void) +{ + return target_arch() =3D=3D SYS_EMU_TARGET_AARCH64; +} =20 /** * target_base_ppc: * * Returns whether the target architecture is PowerPC 32-bit or 64-bit. */ -bool target_base_ppc(void); +static inline bool target_base_ppc(void) +{ + switch (target_arch()) { + case SYS_EMU_TARGET_PPC: + case SYS_EMU_TARGET_PPC64: + return true; + default: + return false; + } +} =20 /** * target_ppc: * * Returns whether the target architecture is PowerPC 32-bit. */ -bool target_ppc(void); +static inline bool target_ppc(void) +{ + return target_arch() =3D=3D SYS_EMU_TARGET_PPC; +} =20 /** * target_ppc64: * * Returns whether the target architecture is PowerPC 64-bit. */ -bool target_ppc64(void); +static inline bool target_ppc64(void) +{ + return target_arch() =3D=3D SYS_EMU_TARGET_PPC64; +} =20 /** * target_s390x: * * Returns whether the target architecture is S390x. */ -bool target_s390x(void); +static inline bool target_s390x(void) +{ + return target_arch() =3D=3D SYS_EMU_TARGET_S390X; +} =20 #endif diff --git a/target-info.c b/target-info.c deleted file mode 100644 index f02a033584..0000000000 --- a/target-info.c +++ /dev/null @@ -1,93 +0,0 @@ -/* - * QEMU target info helpers - * - * Copyright (c) Linaro - * - * SPDX-License-Identifier: GPL-2.0-or-later - */ - -#include "qemu/osdep.h" -#include "qemu/target-info.h" -#include "qapi/error.h" - -const char *target_name(void) -{ - return target_info.target_name; -} - -unsigned target_long_bits(void) -{ - return target_info.long_bits; -} - -SysEmuTarget target_arch(void) -{ - return target_info.target_arch; -} - -const char *target_cpu_type(void) -{ - return target_info.cpu_type; -} - -const char *target_machine_typename(void) -{ - return target_info.machine_typename; -} - -EndianMode target_endian_mode(void) -{ - return target_info.endianness; -} - -bool target_big_endian(void) -{ - return target_endian_mode() =3D=3D ENDIAN_MODE_BIG; -} - -bool target_base_arm(void) -{ - switch (target_arch()) { - case SYS_EMU_TARGET_ARM: - case SYS_EMU_TARGET_AARCH64: - return true; - default: - return false; - } -} - -bool target_arm(void) -{ - return target_arch() =3D=3D SYS_EMU_TARGET_ARM; -} - -bool target_aarch64(void) -{ - return target_arch() =3D=3D SYS_EMU_TARGET_AARCH64; -} - -bool target_base_ppc(void) -{ - switch (target_arch()) { - case SYS_EMU_TARGET_PPC: - case SYS_EMU_TARGET_PPC64: - return true; - default: - return false; - } -} - -bool target_ppc(void) -{ - return target_arch() =3D=3D SYS_EMU_TARGET_PPC; -} - -bool target_ppc64(void) -{ - return target_arch() =3D=3D SYS_EMU_TARGET_PPC64; -} - -bool target_s390x(void) -{ - return target_arch() =3D=3D SYS_EMU_TARGET_S390X; -} diff --git a/meson.build b/meson.build index 9a804dc810..aad149cdb4 100644 --- a/meson.build +++ b/meson.build @@ -3868,7 +3868,6 @@ endif common_ss.add(pagevary) system_ss.add(files('page-vary-system.c')) =20 -common_ss.add(files('target-info.c')) system_ss.add(tinfoqom) =20 subdir('backends') --=20 2.43.0