From nobody Wed Apr 2 13:11:06 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1741136081; cv=none; d=zohomail.com; s=zohoarc; b=hqCgqWJ5NMKF96uQ9plCif9u06+tc7+DnPyJtcu616XGz6fx1fgIm4U7jlsJ3v3561WfTORaOW7Un0Fh0j2aduvADhXNEoNC3Xzt/CgCA2s7QeymUF1sVTfQjra+yPFXuwwDLBXlJiddsyXCRfLkz8sOUDcuvTfuxbKcqkxkdbk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1741136081; 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=lk9TI+rSZkzKv7Njal1Wbs7A5Y+36v2tj7kLtziVEzo=; b=k1l+oIb3OazRPEtLIUoislqck3avto+dRckD9vFNCqo0Tge5cVepjPtAeVpxnQs6T3Q1NcYONeYKVx8LnQn6IWBjmSkUybyQWaSxtwd4Qlsguo3fwrVcuMYcJgiew5e+2ipO23pLXpR0wBk6ZoS2SOvw58W08RsDPou/iwHTbH0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1741136081003215.11576723032874; Tue, 4 Mar 2025 16:54:41 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tpd02-0001yX-GS; Tue, 04 Mar 2025 19:52:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tpd01-0001yH-08 for qemu-devel@nongnu.org; Tue, 04 Mar 2025 19:52:37 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tpczz-0007R8-5a for qemu-devel@nongnu.org; Tue, 04 Mar 2025 19:52:36 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-4394a0c65fcso66759665e9.1 for ; Tue, 04 Mar 2025 16:52:34 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43bcc13b23asm21499725e9.1.2025.03.04.16.52.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Mar 2025 16:52:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741135953; x=1741740753; 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=lk9TI+rSZkzKv7Njal1Wbs7A5Y+36v2tj7kLtziVEzo=; b=ipNReLJRXOHXo+sPkQyGh2PL2R5IRoL8f9X+40CuLYGSMVZ8sGcpAzscO3OlB3lyxZ 6gH9naTiheXA4UariubfBippcI2RbfVY/Hk1b2SB7rJmJPAnzfsG8xrXRPUjHUXY6QKf JiIbq7/qWy06hPRRfnmf5frQrBhIFoyB9hFU6WaAh3uLuwPtoUcL+fVfrpbBuR6rwhQQ fbvppcBlyECVEiIMphAc60pCbACb5HJQTZplfWAwSD+7PsKQalubTEJziNSJqKv/C5V3 O8fjL81Y2KR2dASpy3es8oM0BXzhVenGmzB4P4oEU14FxJ618c804jeAikzc9UZhO1fR k5aQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741135953; x=1741740753; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lk9TI+rSZkzKv7Njal1Wbs7A5Y+36v2tj7kLtziVEzo=; b=IWKt6Myqkkdh5yOhDbBGz1XUP9slqNeypBvjN2XqChTAib+FIil97LYAETKKiiaxzn iwDRkoPdcXTutT3M1P6ThFc+zooW50MRKxXkFMmYBCvKbtJ43QYUIvkUi7avRwRXzneQ RnRYGo8n4jN9XzgTulVTorNNY1M+qZEnXVHhkH5JpY+pWsGabKg41olVwFsSFln3F3dc hs6UbKzPEv5pnoEzqotwuQKDJePU1FfLUZD3ky+Wm3ENQnStVB0ATVqWKL5ttzci9/cD LoiFOutfSTkb9prx0oKTFT+SlY4rVRtskaXGItHx06vrHnEFXocLskokzKi6jUFUsUrV O18w== X-Gm-Message-State: AOJu0YyM41Cxy/iumxVkHpscy3fGf4fG1wGK0H394YPgkLtN57dA1u66 DfiZV0+HV3Z4a+GjTg+ccPVxceM78zsP9q6NrD3r4vdjfmmN+cugfFvA7gFf8SbIDCVPgqsXHcy YNGc= X-Gm-Gg: ASbGncv4+pQccMKCRfVsqKc5Ucs+dNQ1D7niFWmvV5aNf08Q7917NgdHcxgkS03qLVD Mf6WQAUylVOFrXJp47Nnal4+CB1Diz6QhB1AjnbRDrJ+WWqubkJFGJ2pw/EsESmHVBCywKEL11q gYa76MvHj2v/YME07nR5rB9KyO/m9L2cvCQslpCgvVYE0//QBg1nRBYlPVqcwN4OUN4bBRmMAry hkCgMuH0ocFYTiAdTYFMVMXX/5aNi1peRO7j5KHZ11JOuq4jnzPuaqnlC0zfDdo/XSpv/LNNpVQ y7nqDED9VCywINmVWgEZb8hwj/sTrFveVg+icv3hUGzo30ls4LhNKvbB/sN7wqPZm8Qie/0Wod6 Cx0s0M+uMYFjc/fPuCFY= X-Google-Smtp-Source: AGHT+IEAp+T7jbKyE/IL9MPtQR2WZJ7USejrJCM9Stl3cHW7orNQM9hsROUx2jxG6xIf/nWUxgL1wA== X-Received: by 2002:a05:600c:5493:b0:439:9106:c09 with SMTP id 5b1f17b1804b1-43bd29d0497mr5548175e9.26.1741135953104; Tue, 04 Mar 2025 16:52:33 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Pierrick Bouvier , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Richard Henderson , Thomas Huth , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH 01/11] system: Extract target-specific globals to their own compilation unit Date: Wed, 5 Mar 2025 01:52:15 +0100 Message-ID: <20250305005225.95051-2-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250305005225.95051-1-philmd@linaro.org> References: <20250305005225.95051-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1741136082437019000 We shouldn't use target specific globals for machine properties. These ones could be desugarized, as explained in [*]. While certainly doable, not trivial nor my priority for now. Just move them to a different file to clarify they are *globals*, like the generic globals residing in system/globals.c. [*] https://lore.kernel.org/qemu-devel/e514d6db-781d-4afe-b057-9046c70044dc= @redhat.com/ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alex Benn=C3=A9e --- system/arch_init.c | 14 -------------- system/globals-target.c | 24 ++++++++++++++++++++++++ system/meson.build | 1 + 3 files changed, 25 insertions(+), 14 deletions(-) create mode 100644 system/globals-target.c diff --git a/system/arch_init.c b/system/arch_init.c index d2c32f84887..ea0842b7410 100644 --- a/system/arch_init.c +++ b/system/arch_init.c @@ -25,20 +25,6 @@ #include "qemu/module.h" #include "system/arch_init.h" =20 -#ifdef TARGET_SPARC -int graphic_width =3D 1024; -int graphic_height =3D 768; -int graphic_depth =3D 8; -#elif defined(TARGET_M68K) -int graphic_width =3D 800; -int graphic_height =3D 600; -int graphic_depth =3D 8; -#else -int graphic_width =3D 800; -int graphic_height =3D 600; -int graphic_depth =3D 32; -#endif - const uint32_t arch_type =3D QEMU_ARCH; =20 void qemu_init_arch_modules(void) diff --git a/system/globals-target.c b/system/globals-target.c new file mode 100644 index 00000000000..989720591e7 --- /dev/null +++ b/system/globals-target.c @@ -0,0 +1,24 @@ +/* + * Global variables that should not exist (target specific) + * + * Copyright (c) 2003-2008 Fabrice Bellard + * + * SPDX-License-Identifier: MIT + */ + +#include "qemu/osdep.h" +#include "system/system.h" + +#ifdef TARGET_SPARC +int graphic_width =3D 1024; +int graphic_height =3D 768; +int graphic_depth =3D 8; +#elif defined(TARGET_M68K) +int graphic_width =3D 800; +int graphic_height =3D 600; +int graphic_depth =3D 8; +#else +int graphic_width =3D 800; +int graphic_height =3D 600; +int graphic_depth =3D 32; +#endif diff --git a/system/meson.build b/system/meson.build index 4952f4b2c7d..181195410fb 100644 --- a/system/meson.build +++ b/system/meson.build @@ -1,6 +1,7 @@ specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_true: [files( 'arch_init.c', 'ioport.c', + 'globals-target.c', 'memory.c', 'physmem.c', 'watchpoint.c', --=20 2.47.1 From nobody Wed Apr 2 13:11:06 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1741136111; cv=none; d=zohomail.com; s=zohoarc; b=YlX11hUwq82BxiiXe4bcCBXo3J94Qxsyo14qltveZaeexpkaqy4t3sW9x0MVce9Fuar78AFecEhUA/Nq3zNYz2NtbaP3pty89LBb2YxW06r+ccRhIkanhFzgM995WjnmbG0q3nj8AQjQ210HJIoiQO/RwrHfKm40Hwx2hoYR+Ks= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1741136111; 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=u+9rUxQ7+saDFqF8IM1RLmO8AxUwJBcx8QYoMNWV/dk=; b=ETVsV1DjWetTpPh+NME1eyamLPjTVo9acn/yni2qXYDSMe77zyjZhhnFUcVcaRLY97BUX8Vi308Cf97hnGbodAgQzIZb+j5xGuAl/pZqFafXNk2enB2smInjH3b6o94Vnts0rHkBuOk46JpiZxLMwHdCPQz9zEKizz9Fv5JtS1U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1741136111844876.486259497373; Tue, 4 Mar 2025 16:55:11 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tpd06-0001z9-49; Tue, 04 Mar 2025 19:52:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tpd05-0001yv-Cv for qemu-devel@nongnu.org; Tue, 04 Mar 2025 19:52:41 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tpd03-0007Rs-LH for qemu-devel@nongnu.org; Tue, 04 Mar 2025 19:52:41 -0500 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-390f5556579so2602337f8f.1 for ; Tue, 04 Mar 2025 16:52:39 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-390e485dba4sm19547475f8f.92.2025.03.04.16.52.36 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Mar 2025 16:52:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741135958; x=1741740758; 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=u+9rUxQ7+saDFqF8IM1RLmO8AxUwJBcx8QYoMNWV/dk=; b=JvJ2wlYCr5ctaiGriYQ1VvCpgdH5y9F1Rnx0NiSj/wU09QkszKpDpsEHT1ICv0dA22 PzING1Pt5bgLn5aBphaLJpbr0+i0mFxk03PCgcxzvcmX0EOtByM60gIM2eeiQBsGg4Zg /Bk8kMk07nR+NRWaiu7PZkuXXW1ehDLZ6PBTvKXaVJYh1NVCp3yZjTo49iTUXAPVajHc tEzpqJzO9u1go6t31P+DfnzgRjcl05tMgvOrIv4/4nQfNJYV/U8uKegrn56cl6EAG621 ZeYt7N+Dk1MclggNK+zNVa1vJpkdPPRHAo7tUUIdC9iBrQKiZA0yio+b4oZ/B/izHXBd to3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741135958; x=1741740758; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=u+9rUxQ7+saDFqF8IM1RLmO8AxUwJBcx8QYoMNWV/dk=; b=hpaZ81/WHmTe8rHTblqZvwX4zvmneIDvcjnMAGDPmoJfYWbQIUH+UWZKGFMEy2fdv4 cau9Rgeza1+8sCl0N648JeEIihB+KskErslACO+BuuhoyDytdRAVCELzBfCux/Yay5ME 68sx00MOPgHae7GM2DUVdHQvS7V11iMBKh/6hTAJuKqrEae7jixclXS3AarkdEQsSGw6 kOi7RNabvxpPrjVxlCnIPF3V35fI4+9zFDD06BD9dxDBShxQobUtBlY0nl1Sv8R2Afu2 Pmzi7/UW5+0FMKUoFfciHPxWn0SV5ytz4Wk7X8WNhzQaXjbvlyYJjapwfoxtFDsFy3d8 Vuuw== X-Gm-Message-State: AOJu0Yx5h4QJln6mo/fow9DoJhxL1f4DhiDxt3GNdw3SiKffKfgS3MHQ 4eyu7g04jHn/6bhoYg8CRKwcQD/nKgUDJWcynTDEepIBK/1Bwzd3n8VDMWe7SWYgJFsWLWhwJix BTFA= X-Gm-Gg: ASbGnct4WAAU1RcO5qRiRShvXlT1yVd4t6a1sOMAF2XR/YgAiUoFigWIO+fTIvweedv 4O8Buh9ztpl7I/iVLpcepzzsaElSHjL5P3RtGoExu7kiQDBddqDjdJfwGm+BWw8EWpDtZCnEHxl jNfLkQw7EVcPpvXPK/IADn02GuvJpSzmQCfMZYDeDsKJaLXW+xzSryzvtHiLe5cnaK3idmHP3po l/ldCX8zuSDC2td6HD/TD4dYVZZcaBtP7ftSC+Tt646QvwZBVHKgIIILH0HVc1Fi7Xs7kwXlcs/ QEbtIg59Aq8V+OLvuxVuIlCA6I2L0vtN2YFhuQfy+qojyerFgxVKt3cM8jd7ImEfjGn9rVUdXJv cNr+M3RdRVXsMAiWykOg= X-Google-Smtp-Source: AGHT+IGdyoEU2pvZRgT47UMA78C71xO/YTWGipOanziM0npLvMA4Idpzgu5NgXlMJQIF0OzJskBnCA== X-Received: by 2002:a5d:5849:0:b0:390:fdba:ac7 with SMTP id ffacd0b85a97d-3911f7c8629mr557172f8f.51.1741135957753; Tue, 04 Mar 2025 16:52:37 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Pierrick Bouvier , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Richard Henderson , Thomas Huth , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH 02/11] system: Open-code qemu_init_arch_modules() using target_name() Date: Wed, 5 Mar 2025 01:52:16 +0100 Message-ID: <20250305005225.95051-3-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250305005225.95051-1-philmd@linaro.org> References: <20250305005225.95051-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=philmd@linaro.org; helo=mail-wr1-x434.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1741136112261019000 Mostly revert commit c80cafa0c73 ("system: Add qemu_init_arch_modules") but using target_name() instead of the target specific 'TARGET_NAME' definition. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- include/system/arch_init.h | 2 -- system/arch_init.c | 9 --------- system/vl.c | 7 ++++++- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/include/system/arch_init.h b/include/system/arch_init.h index 5b1c1026f3a..d8b77440487 100644 --- a/include/system/arch_init.h +++ b/include/system/arch_init.h @@ -27,6 +27,4 @@ enum { =20 extern const uint32_t arch_type; =20 -void qemu_init_arch_modules(void); - #endif diff --git a/system/arch_init.c b/system/arch_init.c index ea0842b7410..b9147af93cb 100644 --- a/system/arch_init.c +++ b/system/arch_init.c @@ -22,15 +22,6 @@ * THE SOFTWARE. */ #include "qemu/osdep.h" -#include "qemu/module.h" #include "system/arch_init.h" =20 const uint32_t arch_type =3D QEMU_ARCH; - -void qemu_init_arch_modules(void) -{ -#ifdef CONFIG_MODULES - module_init_info(qemu_modinfo); - module_allow_arch(TARGET_NAME); -#endif -} diff --git a/system/vl.c b/system/vl.c index 8f776684ec8..04f78466c41 100644 --- a/system/vl.c +++ b/system/vl.c @@ -26,6 +26,7 @@ #include "qemu/help-texts.h" #include "qemu/datadir.h" #include "qemu/units.h" +#include "qemu/module.h" #include "exec/cpu-common.h" #include "exec/page-vary.h" #include "hw/qdev-properties.h" @@ -78,6 +79,7 @@ #include "hw/block/block.h" #include "hw/i386/x86.h" #include "hw/i386/pc.h" +#include "hw/core/cpu.h" #include "migration/cpr.h" #include "migration/misc.h" #include "migration/snapshot.h" @@ -2885,7 +2887,10 @@ void qemu_init(int argc, char **argv) =20 os_setup_limits(); =20 - qemu_init_arch_modules(); +#ifdef CONFIG_MODULES + module_init_info(qemu_modinfo); + module_allow_arch(target_name()); +#endif =20 qemu_init_subsystems(); =20 --=20 2.47.1 From nobody Wed Apr 2 13:11:06 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1741135993; cv=none; d=zohomail.com; s=zohoarc; b=X/fOcMnhPJhjLX1nKM9mIaonolbE11PFRPUD+IyrRuXWAgbS+sTg9DY1xPPmdCGZwvmcz4InB6ibmtOsEIWUrMEcKILH8gxw68Zequq9A4TcaotEUt0AwyReIJCGuoIyr7tdzXOxQx//vuZHPRc0lSWpK/TDdW4D7Jfn+RqflC8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1741135993; 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=Gvg7bjz4W+7lzF+vO3juWf59GOeb1i4zphl0KgEd4ko=; b=WxnQ2uoW9lQ92Pkcln/F93uidzbMfrMZOlTfVI76YJ6wWwIwblw9LJls3ywPU5Mx1vaIATYFw76YbaJkm/aLyrVKP/C9NUuhu5p/sFxMzksvEoK0n/kf1D3OBg3v5NzYbqOotHzlHdXci7FLhXav3kNFblk6DfEbTY/Z6LBv/dE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1741135993821497.7553080209249; Tue, 4 Mar 2025 16:53:13 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tpd0C-000206-Ri; Tue, 04 Mar 2025 19:52:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tpd0B-0001zg-8T for qemu-devel@nongnu.org; Tue, 04 Mar 2025 19:52:47 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tpd09-0007SU-4X for qemu-devel@nongnu.org; Tue, 04 Mar 2025 19:52:46 -0500 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-390dd3403fdso5286861f8f.0 for ; Tue, 04 Mar 2025 16:52:44 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39122da6cb4sm37957f8f.72.2025.03.04.16.52.41 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Mar 2025 16:52:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741135963; x=1741740763; 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=Gvg7bjz4W+7lzF+vO3juWf59GOeb1i4zphl0KgEd4ko=; b=msBVr5SB/ThYOS4z8boJRdNwBJaqE1SAnyDfcPoW9L2VYNLup0uVjupRsPKtUqfZCS pQ7EichT67ISxtQis61YNg0/MmUcvDzqHQAmw8xTrCVMVxjqKEJZDXhsD7gcF0DzJKOL Xx9E/Zoi2bC64PD/n//1G+xdJ1ABnMeCnyeNl4NCXDsSEFjrJVU28emWGWkODNoWVPZR 3ZXUW7BzNAa83tAtrMhdSJzyCpE8R5l0XFjonOsp6kDDz6EEQi25Cj6TlcqJ9CCtHBF1 kZYBOWw6SCjWF5V1/MJVxJxvYm4Q1h6vP//jrW4sNPCVYLRqq+c2CjA+pjUIG3HmC8d1 Osvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741135963; x=1741740763; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Gvg7bjz4W+7lzF+vO3juWf59GOeb1i4zphl0KgEd4ko=; b=YGD85/yiymqJphlNRYYUJ9Yd3tnbfFTqbiqH11cVWefaZom4B6xTtGgJjhQ/CW7U7L d4fMHBAFtzNL93iV8YzoEv0p8FMadcmx7ee3KGIg1v+MCBjxeEEteUDKyGNXlIVoLDvH E1qjVberorwA8ms+kFtSNY2ifvn8yRnfLa1i9YM10ZAHwqZ5ujdQ6EhHn37KNcLfRapQ mJ5zZK7Sv4Q16HjpLEQMLC504AOVWtx7NmloOKzJpS49A4K3e7djCtW+X9t9ic5lCESe H/HRl6iuU7n/ixtqrg0cH6papJsN0ReuRIXqCv6g++VJjUmaHQlROD1SaJUCBmEFAdw5 od0A== X-Gm-Message-State: AOJu0YxLQx7fkKP7I3ZOEZeveQ+/Ps/5Tns7rp88XUagy1jMHKy9WjEL qLmWAa98q3zSg7+EYom33vWsxX5U6bnT/OqnSqTKNfSmhoNmLFj3pprP74YJZZuqjJKu31uekmM gBPM= X-Gm-Gg: ASbGncvSlq6jIzAd3QySub0uBrIH/t8mDMPnd/k32vXQxtgwgBddc15mGMn/nqiW5Ca aHLoQeS5KsbXHILTXgua9pdsgz3y8z2UvaI3cm70Kr2SucDiY4n3DvWRYIKPR4QIN8sjr/DRShG eeRIyas7b6m4bmlrp3g4eIJVorbIZnRaaT59pSDvOgsonss85zoxOvvUQnxQV/d6pyMSiVs/uyG f9DC61Jz2szdrtFqWKzL2zDbYTaRAZB+j993jBaUQ8GinNXanhkhd4IT3UMspUCWdh6e0quuAUc T8w6Uj3z2mZNqBS68P21bjqi8ZHtzNw1h/lUoj9S+cpp7ZwMiDYsCBDCPF8awBDufRlIr36rdHq qODfLt0wIZFqDMUJCLQY= X-Google-Smtp-Source: AGHT+IHjU9RSQgn8/qnNnh/JVX6W+KNECJ40bx++dPyvd0u8d+AIzAL5WAYkiUmXC1KuhwQi+vQuyQ== X-Received: by 2002:a5d:5886:0:b0:38f:2ddd:a1bb with SMTP id ffacd0b85a97d-3911f727557mr607055f8f.8.1741135963191; Tue, 04 Mar 2025 16:52:43 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Pierrick Bouvier , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Richard Henderson , Thomas Huth , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH 03/11] system: Introduce QemuArchBit enum Date: Wed, 5 Mar 2025 01:52:17 +0100 Message-ID: <20250305005225.95051-4-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250305005225.95051-1-philmd@linaro.org> References: <20250305005225.95051-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=philmd@linaro.org; helo=mail-wr1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, UPPERCASE_50_75=0.008 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1741135996914019100 Declare QEMU_ARCH_BIT_$target as QemuArchBit enum. Use them to declare QEMU_ARCH_$target bitmasks. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- meson.build | 4 +-- include/system/arch_init.h | 65 +++++++++++++++++++++++++------------- system/arch_init.c | 2 +- 3 files changed, 46 insertions(+), 25 deletions(-) diff --git a/meson.build b/meson.build index 0a2c61d2bfa..1ab02a5d48d 100644 --- a/meson.build +++ b/meson.build @@ -3357,8 +3357,8 @@ foreach target : target_dirs config_target_data.set(k, v) endif endforeach - config_target_data.set('QEMU_ARCH', - 'QEMU_ARCH_' + config_target['TARGET_BASE_ARCH'].= to_upper()) + config_target_data.set('QEMU_ARCH_BIT', + 'QEMU_ARCH_BIT_' + config_target['TARGET_BASE_ARC= H'].to_upper()) config_target_h +=3D {target: configure_file(output: target + '-config-t= arget.h', configuration: config_targe= t_data)} =20 diff --git a/include/system/arch_init.h b/include/system/arch_init.h index d8b77440487..06e5527ec88 100644 --- a/include/system/arch_init.h +++ b/include/system/arch_init.h @@ -1,29 +1,50 @@ #ifndef QEMU_ARCH_INIT_H #define QEMU_ARCH_INIT_H =20 +#include "qemu/bitops.h" =20 -enum { - QEMU_ARCH_ALL =3D -1, - QEMU_ARCH_ALPHA =3D (1 << 0), - QEMU_ARCH_ARM =3D (1 << 1), - QEMU_ARCH_I386 =3D (1 << 3), - QEMU_ARCH_M68K =3D (1 << 4), - QEMU_ARCH_MICROBLAZE =3D (1 << 6), - QEMU_ARCH_MIPS =3D (1 << 7), - QEMU_ARCH_PPC =3D (1 << 8), - QEMU_ARCH_S390X =3D (1 << 9), - QEMU_ARCH_SH4 =3D (1 << 10), - QEMU_ARCH_SPARC =3D (1 << 11), - QEMU_ARCH_XTENSA =3D (1 << 12), - QEMU_ARCH_OPENRISC =3D (1 << 13), - QEMU_ARCH_TRICORE =3D (1 << 16), - QEMU_ARCH_HPPA =3D (1 << 18), - QEMU_ARCH_RISCV =3D (1 << 19), - QEMU_ARCH_RX =3D (1 << 20), - QEMU_ARCH_AVR =3D (1 << 21), - QEMU_ARCH_HEXAGON =3D (1 << 22), - QEMU_ARCH_LOONGARCH =3D (1 << 23), -}; +typedef enum QemuArchBit { + QEMU_ARCH_BIT_ALPHA =3D 0, + QEMU_ARCH_BIT_ARM =3D 1, + QEMU_ARCH_BIT_I386 =3D 3, + QEMU_ARCH_BIT_M68K =3D 4, + QEMU_ARCH_BIT_MICROBLAZE =3D 6, + QEMU_ARCH_BIT_MIPS =3D 7, + QEMU_ARCH_BIT_PPC =3D 8, + QEMU_ARCH_BIT_S390X =3D 9, + QEMU_ARCH_BIT_SH4 =3D 10, + QEMU_ARCH_BIT_SPARC =3D 11, + QEMU_ARCH_BIT_XTENSA =3D 12, + QEMU_ARCH_BIT_OPENRISC =3D 13, + QEMU_ARCH_BIT_TRICORE =3D 16, + QEMU_ARCH_BIT_HPPA =3D 18, + QEMU_ARCH_BIT_RISCV =3D 19, + QEMU_ARCH_BIT_RX =3D 20, + QEMU_ARCH_BIT_AVR =3D 21, + QEMU_ARCH_BIT_HEXAGON =3D 22, + QEMU_ARCH_BIT_LOONGARCH =3D 23, +} QemuArchBit; + +#define QEMU_ARCH_ALPHA BIT(QEMU_ARCH_BIT_ALPHA) +#define QEMU_ARCH_ARM BIT(QEMU_ARCH_BIT_ARM) +#define QEMU_ARCH_I386 BIT(QEMU_ARCH_BIT_I386) +#define QEMU_ARCH_M68K BIT(QEMU_ARCH_BIT_M68K) +#define QEMU_ARCH_MICROBLAZE BIT(QEMU_ARCH_BIT_MICROBLAZE) +#define QEMU_ARCH_MIPS BIT(QEMU_ARCH_BIT_MIPS) +#define QEMU_ARCH_PPC BIT(QEMU_ARCH_BIT_PPC) +#define QEMU_ARCH_S390X BIT(QEMU_ARCH_BIT_S390X) +#define QEMU_ARCH_SH4 BIT(QEMU_ARCH_BIT_SH4) +#define QEMU_ARCH_SPARC BIT(QEMU_ARCH_BIT_SPARC) +#define QEMU_ARCH_XTENSA BIT(QEMU_ARCH_BIT_XTENSA) +#define QEMU_ARCH_OPENRISC BIT(QEMU_ARCH_BIT_OPENRISC) +#define QEMU_ARCH_TRICORE BIT(QEMU_ARCH_BIT_TRICORE) +#define QEMU_ARCH_HPPA BIT(QEMU_ARCH_BIT_HPPA) +#define QEMU_ARCH_RISCV BIT(QEMU_ARCH_BIT_RISCV) +#define QEMU_ARCH_RX BIT(QEMU_ARCH_BIT_RX) +#define QEMU_ARCH_AVR BIT(QEMU_ARCH_BIT_AVR) +#define QEMU_ARCH_HEXAGON BIT(QEMU_ARCH_BIT_HEXAGON) +#define QEMU_ARCH_LOONGARCH BIT(QEMU_ARCH_BIT_LOONGARCH) +#define QEMU_ARCH_ALL -1 =20 extern const uint32_t arch_type; =20 diff --git a/system/arch_init.c b/system/arch_init.c index b9147af93cb..fedbb18e2cc 100644 --- a/system/arch_init.c +++ b/system/arch_init.c @@ -24,4 +24,4 @@ #include "qemu/osdep.h" #include "system/arch_init.h" =20 -const uint32_t arch_type =3D QEMU_ARCH; +const uint32_t arch_type =3D BIT(QEMU_ARCH_BIT); --=20 2.47.1 From nobody Wed Apr 2 13:11:06 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1741136074; cv=none; d=zohomail.com; s=zohoarc; b=FVyP3vGqEA+Ia8XMF470QPFco/sCCbsF6yA1BhJdU/yNzbQx8Ip5zy0WqkEoTx7mIadd550pClW/fR22NtHwBH6y/Ydc28kg1FlBsh4o6ajBM/rNn09/CUsxI+lLMoDo7UUncWAsA8fSFHLjhvHvqWr1AxpIwaYlxeN+UaYa504= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1741136074; 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=IqxIPPwTTylIALJZg+yGEIl/36eft918YUUplk+Ib0s=; b=iw8rfUlWy5QurN8o+J+BgQk6iPGRUiYvd8scPvCsI4o3xLlQs5ynvCbMIQd1pIcBe30mXt+XV7Lg49UVCtFsrKOXUU2aRb1AELi0bBUudSxRH58vNnannT1r621PapmKTcAqRxxMTjflS/hTuz0GlstNuAqoQubc8NiqaWD17r0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1741136074667582.923583706641; Tue, 4 Mar 2025 16:54:34 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tpd0I-00020r-Tu; Tue, 04 Mar 2025 19:52:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tpd0H-00020c-5z for qemu-devel@nongnu.org; Tue, 04 Mar 2025 19:52:53 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tpd0F-0007Tb-7K for qemu-devel@nongnu.org; Tue, 04 Mar 2025 19:52:52 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-4398ec2abc2so55758515e9.1 for ; Tue, 04 Mar 2025 16:52:50 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-390e485e61csm19488252f8f.98.2025.03.04.16.52.46 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Mar 2025 16:52:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741135969; x=1741740769; 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=IqxIPPwTTylIALJZg+yGEIl/36eft918YUUplk+Ib0s=; b=vMfyQlwW3ifHEUez9rMcU15yy3BugspweUKQKayjIpu5JwrHfCAxtruDw8F8M7gvxn S4Xe4+XKEpRMhahyr9uVA54EPr/KAZRWbOZwuVd4KjFL1mNy4CQe2wf+nGs88gyDrfIP +ZuHYI4Knf05+tPSHA8dD08daBwXF+LjmAdWR7wbS9caow2HGdBnWzdhg3CIIh4oP7aM tfIJQcl9CoHnD+30Q7I4x1kJM8iDVdvcDoAfSh/smfchEtdwLHH4+8tPohVVdPf3PXoC 8jTUA4q1a7T1TdmW7Uaf7J0BZXCUk3R57vxby+QweYnyQokwg9YnzgNlKM+6VY8ESKss WxFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741135969; x=1741740769; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IqxIPPwTTylIALJZg+yGEIl/36eft918YUUplk+Ib0s=; b=DFCETfR+449XRXOKXuheUPDIi+9daZtuFhZbV27IM+MCDg8MHfEOm+XGxBw9ZDlYeB O/mLK/aNKMdvS9O6KVkrlOVp/Y6oC1tdRxe+t9WbjF1GyRllafL86HwXGBteSBjW090E eTZWLk82TmAyAbCTfmoyMnwLWECWG/Uc+9hUL+ZPfTt9xOBWpdT78SU6iARcQWgL6OqC REp93azp46hgkf1yL9VhIWQG4nvTSy9UiMAqFi9xtja3dy8oYVCn+n0Fnn/jekKoR0I6 9C28+qjcQSw+c0HN5/iTjSxWp0xabvYwlBYcjExFFkbhVyOg67FKXfHljbBocxSejLYu yLHA== X-Gm-Message-State: AOJu0Yy7nEJ1rBMNN+arMYByqb1HtM5CzrR3MkmoNdmwWj5wOuA2jbLW zLblAvAtcT/ZruJeb9c/T7AlOlQq1kb48pNH7qMlvamAm8pciuoRYbgzsKQ6NpB04qrgJAZ6zB8 8yO4= X-Gm-Gg: ASbGncvEmJT37yCSWJpsxXJyGI+rDuyQ5RKxDJ0FjngIwP+hGyXuhx6UdGIr5l9KZor gt2fOCW9Xp7m9cisif/7FgJpW0Zb9hUaaKXEzHI/qKsghuQWkLk44GBEL+0k45pKcQFXL5hgu1l T44Ym+9dn1IU1cWxtwPWUVuvYc8xlYIf3Ggk4wVwS2QEwGEuCBSprxOT1G+a8qGEsFladNRgMlj LzaLgln8R58fj8ZK2qWvf5dZYPQ4TdUguGEFGNCBykoNlKl+OYDmVhPhqCItSXwuSvp7EI7Suta BHTsp7LoJX6tMno/pELNT10Lf1pj/pRlcWmY9xj26Tbi3jvCFousqVDI4Fc8u44y08sQG6/LOPp /iL1tORcvKoQDAI2M9fs= X-Google-Smtp-Source: AGHT+IFkkESVTMJACdAouYCNj8b63Ia4DfV/xQK4xvXC7T6yZGBtKO5jarL2vPnB3cvAXhHTFY/Mvg== X-Received: by 2002:a05:600c:3b87:b0:439:6101:5440 with SMTP id 5b1f17b1804b1-43bd296abc2mr5697225e9.8.1741135968698; Tue, 04 Mar 2025 16:52:48 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Pierrick Bouvier , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Richard Henderson , Thomas Huth , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH 04/11] system: Replace arch_type global by qemu_arch_available() helper Date: Wed, 5 Mar 2025 01:52:18 +0100 Message-ID: <20250305005225.95051-5-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250305005225.95051-1-philmd@linaro.org> References: <20250305005225.95051-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1741136076170019000 qemu_arch_available() is a bit simpler to understand while reviewing than the undocumented arch_type variable. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- include/system/arch_init.h | 2 +- hw/scsi/scsi-disk.c | 2 +- system/arch_init.c | 5 ++++- system/qdev-monitor.c | 4 ++-- system/vl.c | 6 +++--- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/include/system/arch_init.h b/include/system/arch_init.h index 06e5527ec88..023d27d5bd7 100644 --- a/include/system/arch_init.h +++ b/include/system/arch_init.h @@ -46,6 +46,6 @@ typedef enum QemuArchBit { #define QEMU_ARCH_LOONGARCH BIT(QEMU_ARCH_BIT_LOONGARCH) #define QEMU_ARCH_ALL -1 =20 -extern const uint32_t arch_type; +bool qemu_arch_available(unsigned qemu_arch_mask); =20 #endif diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index e7f738b4841..7c87b20e694 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -3165,7 +3165,7 @@ static void scsi_property_add_specifics(DeviceClass *= dc) ObjectClass *oc =3D OBJECT_CLASS(dc); =20 /* The loadparm property is only supported on s390x */ - if (arch_type & QEMU_ARCH_S390X) { + if (qemu_arch_available(QEMU_ARCH_S390X)) { object_class_property_add_str(oc, "loadparm", scsi_property_get_loadparm, scsi_property_set_loadparm); diff --git a/system/arch_init.c b/system/arch_init.c index fedbb18e2cc..0fec0cd416b 100644 --- a/system/arch_init.c +++ b/system/arch_init.c @@ -24,4 +24,7 @@ #include "qemu/osdep.h" #include "system/arch_init.h" =20 -const uint32_t arch_type =3D BIT(QEMU_ARCH_BIT); +bool qemu_arch_available(unsigned qemu_arch_mask) +{ + return qemu_arch_mask & BIT(QEMU_ARCH_BIT); +} diff --git a/system/qdev-monitor.c b/system/qdev-monitor.c index 856c9e8c32e..5588ed2047d 100644 --- a/system/qdev-monitor.c +++ b/system/qdev-monitor.c @@ -132,7 +132,7 @@ static const char *qdev_class_get_alias(DeviceClass *dc) =20 for (i =3D 0; qdev_alias_table[i].typename; i++) { if (qdev_alias_table[i].arch_mask && - !(qdev_alias_table[i].arch_mask & arch_type)) { + !qemu_arch_available(qdev_alias_table[i].arch_mask)) { continue; } =20 @@ -218,7 +218,7 @@ static const char *find_typename_by_alias(const char *a= lias) =20 for (i =3D 0; qdev_alias_table[i].alias; i++) { if (qdev_alias_table[i].arch_mask && - !(qdev_alias_table[i].arch_mask & arch_type)) { + !qemu_arch_available(qdev_alias_table[i].arch_mask)) { continue; } =20 diff --git a/system/vl.c b/system/vl.c index 04f78466c41..ec93988a03a 100644 --- a/system/vl.c +++ b/system/vl.c @@ -878,11 +878,11 @@ static void help(int exitcode) g_get_prgname()); =20 #define DEF(option, opt_arg, opt_enum, opt_help, arch_mask) \ - if ((arch_mask) & arch_type) \ + if (qemu_arch_available(arch_mask)) \ fputs(opt_help, stdout); =20 #define ARCHHEADING(text, arch_mask) \ - if ((arch_mask) & arch_type) \ + if (qemu_arch_available(arch_mask)) \ puts(stringify(text)); =20 #define DEFHEADING(text) ARCHHEADING(text, QEMU_ARCH_ALL) @@ -2929,7 +2929,7 @@ void qemu_init(int argc, char **argv) const QEMUOption *popt; =20 popt =3D lookup_opt(argc, argv, &optarg, &optind); - if (!(popt->arch_mask & arch_type)) { + if (!qemu_arch_available(popt->arch_mask)) { error_report("Option not supported for this target"); exit(1); } --=20 2.47.1 From nobody Wed Apr 2 13:11:06 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1741136024; cv=none; d=zohomail.com; s=zohoarc; b=aqhY2iB9BLfiLk8NjS+VWwxy04JZKNzyFXFJBhny73HHrslHjWp5ciMIiTvNvLpsfG3ubBXIn99nbRaSgm9lkOZxgmpveXdJguOiclTR8pIP9u7Kja0zbM6XY4/KQxDUHwPIFn4BQKA+8cAT8r7V6BQbWCSuDITp7M9Ai52teXU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1741136024; 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=TUuRn4CzCPoO/VAnx0IGvC9GeVl9hidcvGsy50QPlH8=; b=XFoqkTJbt8M9Bpet9tshef+Qqfyuk/P4gzGy/fsXMiGwDZB65F0K52iPHba+qu+OjqjlmOR+e2N3C0HK13+NvgK1lCDPkn3kFKaSt3yUTtfdKUMs3PuKm9mIwRXmAFWx36mgK9R0yz2XqRYvA14Aj8AUhyrSFW7R8eO1o5HSf08= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1741136024168923.37683258742; Tue, 4 Mar 2025 16:53:44 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tpd0O-00021z-LI; Tue, 04 Mar 2025 19:53:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tpd0N-00021a-Oe for qemu-devel@nongnu.org; Tue, 04 Mar 2025 19:52:59 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tpd0J-0007U3-8Y for qemu-devel@nongnu.org; Tue, 04 Mar 2025 19:52:59 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-43bcc85ba13so10279135e9.0 for ; Tue, 04 Mar 2025 16:52:54 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43bd4352ed7sm1356915e9.26.2025.03.04.16.52.52 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Mar 2025 16:52:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741135973; x=1741740773; 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=TUuRn4CzCPoO/VAnx0IGvC9GeVl9hidcvGsy50QPlH8=; b=tc6373CcIS6dpBTOy9WZ7ZHQigFCE0fEXIH1V4nODo0Z1rD7z1n36TSMcbpTk9grhq e6WoGFXSOzMHg0jr7kfVfgkuhy6MTEmUDfMtwZLS2rY9zCpMOlshEPuHdnhH5rLVfX/I Heg2OMFBUMIJ1f0BiY+fkkyDc5OVX6T0V0PWrYmP9NusI80n9KJCgO2zsm9ytvNblppa 9lsUu50YH782MtVQ0FJf62N57eFVvbd/j6BEslcgau6N7FtEDXRW8E8mXdInYi1Y943s TESbbEmCZIuTHAlGiEaBfiw4BuMbQp7rGokQju78JQju9AbMfNsf5a3G5X/NHTNDffRi UlZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741135973; x=1741740773; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TUuRn4CzCPoO/VAnx0IGvC9GeVl9hidcvGsy50QPlH8=; b=NC4S8/7AFFjFJuU3OvO4Ozu/GaTtq+chfD0fuqTQa/O9qfu5FSzPFtQfVkiZHdFtBS UdVHpZjrGbsJe4xXoZXHPrzx4lNvX/4UA7htJi6oPHKAR1NPRphLAOGi3R+3CWkoqVef sx0/KrZfGl4/bJz+BywREszXXppJgCw2EFjSv/BUaC4trLt0R5I8GL9X+b8A3HNKnjx4 TvLGUqpuIt0V1UwIElFqNyjqVHC2jSNIsaSthDXFz0rkz7HSzKyGkcXdc71hWpJuhkdE Y9cGKKXET62W+7kGhaPderEHGUVmsD74d+lA8R2tbb87m626ywHltzZ9/IYG4uvBhVP9 Z7UQ== X-Gm-Message-State: AOJu0YyfmKyPFqKKz/hGsxnW2wGhXo2R1MzJVbghDn4J2XGoC1uKRi+u 1ZhOX1pC+w5/K5F6LQIsTfaCUj+hVf0fxoHKYxHO9LfYUAql168WEJfld9hDpxwGMUR9VIYO3OO UuJU= X-Gm-Gg: ASbGncvrDxOhF7nHgiddxNHHWmhbelcdM5lSzO/Ynmza14e497jJa38WoCCuofvhWZv 19y1ap8wsEdPfbbxstJpN/hmuQ+8QSSn8xr+1Rja4SwfFLtPWf76gJuzn0Ee3ZsexCw9dhpFqEO YeYLMrK248rfBMRJ7Ncn9rqe50V36Nr5WOcOrcjX/jOzRnjeyYvJZFYc9x21My6LjPbuRXHMq3o m9XvOi3RDzGZ9F6PSLAOZEpi2evZhMsAYL713X2Ku7qknyQv/cwNTnVKS92crGmRUbK+6UxL5qR fHovZ9XH9dUizENtrevhIGV2brVCnNDyoG3uyB/fhYp89NzWOb4Mtsz0Qq0h64u2cUZ/bIJ/Ko4 m+Ie7nOj281mz4TewZEQ= X-Google-Smtp-Source: AGHT+IHnxvc6C4PFeofnXej0/DW0dO6R02VRDzhyURZuK4Dhj8oTHGkRfi7M6bv/MN6+HzSs/PDJ5Q== X-Received: by 2002:a05:600c:45c9:b0:439:8185:4ad4 with SMTP id 5b1f17b1804b1-43bd2ae6055mr5100495e9.27.1741135973366; Tue, 04 Mar 2025 16:52:53 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Pierrick Bouvier , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Richard Henderson , Thomas Huth , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH 05/11] include: Expose QemuArchBit enum to user emulation Date: Wed, 5 Mar 2025 01:52:19 +0100 Message-ID: <20250305005225.95051-6-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250305005225.95051-1-philmd@linaro.org> References: <20250305005225.95051-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1741136026100019000 QemuArchBit isn't really specific to system emulation, move the "system/arch_init.h" header to "qemu/arch_info.h", a more generic include path. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Richard Henderson --- meson.build | 2 +- include/{system/arch_init.h =3D> qemu/arch_info.h} | 4 ++-- system/arch_init.c =3D> arch_info-target.c | 2 +- hw/scsi/scsi-disk.c | 2 +- system/qdev-monitor.c | 2 +- system/vl.c | 2 +- system/meson.build | 1 - 7 files changed, 7 insertions(+), 8 deletions(-) rename include/{system/arch_init.h =3D> qemu/arch_info.h} (97%) rename system/arch_init.c =3D> arch_info-target.c (97%) diff --git a/meson.build b/meson.build index 1ab02a5d48d..04d8c477644 100644 --- a/meson.build +++ b/meson.build @@ -3766,7 +3766,7 @@ if have_block endif =20 common_ss.add(files('cpu-common.c')) -specific_ss.add(files('cpu-target.c')) +specific_ss.add(files('cpu-target.c', 'arch_info-target.c')) =20 subdir('system') =20 diff --git a/include/system/arch_init.h b/include/qemu/arch_info.h similarity index 97% rename from include/system/arch_init.h rename to include/qemu/arch_info.h index 023d27d5bd7..3cb95926e27 100644 --- a/include/system/arch_init.h +++ b/include/qemu/arch_info.h @@ -1,5 +1,5 @@ -#ifndef QEMU_ARCH_INIT_H -#define QEMU_ARCH_INIT_H +#ifndef QEMU_ARCH_INFO_H +#define QEMU_ARCH_INFO_H =20 #include "qemu/bitops.h" =20 diff --git a/system/arch_init.c b/arch_info-target.c similarity index 97% rename from system/arch_init.c rename to arch_info-target.c index 0fec0cd416b..6c11c73feb9 100644 --- a/system/arch_init.c +++ b/arch_info-target.c @@ -22,7 +22,7 @@ * THE SOFTWARE. */ #include "qemu/osdep.h" -#include "system/arch_init.h" +#include "qemu/arch_info.h" =20 bool qemu_arch_available(unsigned qemu_arch_mask) { diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c index 7c87b20e694..bafa9f39497 100644 --- a/hw/scsi/scsi-disk.c +++ b/hw/scsi/scsi-disk.c @@ -27,12 +27,12 @@ #include "qemu/module.h" #include "qemu/hw-version.h" #include "qemu/memalign.h" +#include "qemu/arch_info.h" #include "hw/scsi/scsi.h" #include "migration/qemu-file-types.h" #include "migration/vmstate.h" #include "hw/scsi/emulation.h" #include "scsi/constants.h" -#include "system/arch_init.h" #include "system/block-backend.h" #include "system/blockdev.h" #include "hw/block/block.h" diff --git a/system/qdev-monitor.c b/system/qdev-monitor.c index 5588ed2047d..b88e6e83512 100644 --- a/system/qdev-monitor.c +++ b/system/qdev-monitor.c @@ -22,7 +22,6 @@ #include "monitor/hmp.h" #include "monitor/monitor.h" #include "monitor/qdev.h" -#include "system/arch_init.h" #include "system/runstate.h" #include "qapi/error.h" #include "qapi/qapi-commands-qdev.h" @@ -37,6 +36,7 @@ #include "qemu/option.h" #include "qemu/qemu-print.h" #include "qemu/option_int.h" +#include "qemu/arch_info.h" #include "system/block-backend.h" #include "migration/misc.h" #include "qemu/cutils.h" diff --git a/system/vl.c b/system/vl.c index ec93988a03a..e96c72e5400 100644 --- a/system/vl.c +++ b/system/vl.c @@ -27,6 +27,7 @@ #include "qemu/datadir.h" #include "qemu/units.h" #include "qemu/module.h" +#include "qemu/arch_info.h" #include "exec/cpu-common.h" #include "exec/page-vary.h" #include "hw/qdev-properties.h" @@ -110,7 +111,6 @@ #include "trace/control.h" #include "qemu/plugin.h" #include "qemu/queue.h" -#include "system/arch_init.h" #include "system/confidential-guest-support.h" =20 #include "ui/qemu-spice.h" diff --git a/system/meson.build b/system/meson.build index 181195410fb..900c5d52ee4 100644 --- a/system/meson.build +++ b/system/meson.build @@ -1,5 +1,4 @@ specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_true: [files( - 'arch_init.c', 'ioport.c', 'globals-target.c', 'memory.c', --=20 2.47.1 From nobody Wed Apr 2 13:11:06 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1741136001; cv=none; d=zohomail.com; s=zohoarc; b=KYOHT9e4z5tO5F0XHtEpPR/p7rdaFyLaNPd0CfEwt/L+mPFLbcRae6Yrw415poqiPNx9gkOF7Iu9MtSjYUgwJawIXS/pQpWeFfwnanrEuop3VLK+auKo63pmoR28Gonxdf6x+vQ91HP4QppI2O69iSeT1+atOVn5VtvsEoMLHp4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1741136001; 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=aI7bGdusWwalQtQ/oihM/Pr8zgv/ivF1OVwRKsBRxKw=; b=Vsz7W7y/jQ1m1kV/gLXGoyCdPn7B6ysWrF+W0QTWwE4jqbkCU/j+DNNkFQkZ9DdA/C7umLpA1xU0C9gyh4gwHO+iAkuwlYsGHZgoBtf8+ek9YOhKlP/7MSb9iwxyj8sxB5vCcla6/GHtLqHQml9qAbQd5yy1DQyttGWVHvABi2U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1741136001629364.2514161420779; Tue, 4 Mar 2025 16:53:21 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tpd0S-00022M-J7; Tue, 04 Mar 2025 19:53:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tpd0Q-00022A-Ux for qemu-devel@nongnu.org; Tue, 04 Mar 2025 19:53:02 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tpd0O-0007Uh-Us for qemu-devel@nongnu.org; Tue, 04 Mar 2025 19:53:02 -0500 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-390eebcc371so2710193f8f.0 for ; Tue, 04 Mar 2025 16:53:00 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43bd42b7478sm1496035e9.17.2025.03.04.16.52.57 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Mar 2025 16:52:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741135979; x=1741740779; 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=aI7bGdusWwalQtQ/oihM/Pr8zgv/ivF1OVwRKsBRxKw=; b=g3whpSgMsjfDpFlmtAsVyRlysniRThxnmibzudnqjCWKjl1E5iFCW/ty37mXHiiXol hu6vog9URuJA8U6KdqasYWEET7zCsSRf6pUKFT3LnCBXI0OvoEJuMEvlhi3F6tt6Gsu9 KuJiC0fV5q3Q0u2vhvFV0fJpJ2ZtE9nSaQfEXlpWvgohOXTnJqzbMs0PXkWUNXLj/VbC /6vGf1q8r/trHZ94M1N50UgiIuPd7u95alxDWeBXJ6tWazTGnFMYJcTdZwG22Y3AZ14L IJ5n+QkTk+Cz360OAOUCKa50IyC+CBzWSMZ+IXaet/FayLsbs5N1SvX6Lhmf2k2+ti1Q K5nQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741135979; x=1741740779; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aI7bGdusWwalQtQ/oihM/Pr8zgv/ivF1OVwRKsBRxKw=; b=EJsxJpqeMiQT2q3oBkXOm41d3ZI0iu6PFY6Nao/Vrx8x7Wa6LNGSSB/VF6uCch4Ryq epfpDMFyK1KU7JWP8a4FW/PEF0CoPTWxG4HfDQBP8Eq1Q3YlUX0vJBUe1iw2H3u0l9jK ExXbvNKdQ8Auchmj3/zdAWw1fS6QaY/LrqLjEZ97GzVhhF8xUQOHeySQTXrCm9KmyRFR YDdKEajX2jV3IDadaJpG5JpdBxiHecBJ/7hhpuZmS08TAMkpHV9blJ3+/L0eAUkiUpZt CSLn4rtxmVkgfnxgEoh3Ok4SyWI3P6eE4r0YVkrwVf2DH0tZzLEePc5kULkTd9nN8jtC eT6w== X-Gm-Message-State: AOJu0Ywg8w1n2Cimo61fYQ6qZ3cukyH6Lcfg0SXXuzSIsCdcfiQ70Wid UDDyThebxodO5T62a4zTr40kxCn6uJoqVSHNrbL5zH7hueS/weIznbCY3u6xwGkq1CCojqvY9bc dp1k= X-Gm-Gg: ASbGnctMbkMx++0DE3RLniqMCE8UsbSPnubqso9jN3By6qb2aylaJpzHhJi5aBigCyq VTsFpZvo4uZZwFGv5synPaI/QwSkMxJlHH92/pIls6gs0sdMerlsNS6uAQe5QvN9zbUqEjJzhn7 OqaKzx6VCAeS6AduaRA7vsQeYAHSOney2eOYdoqV6gTbACG/bzPirq7Av9yW80bdSWNARQW5aHW DlcMLVjc/e5kxLjX8EtF994EREKh3CJl4Xhk4c2zl/gdPtbCYfq1G14Vv4YSpv0gMwe5Cq2fu3w 6TUVnINT0VfwAKAQ7O1SryaC/RaSWt5/4arJzTAAsufe1ftij690lUi4w4oQ0vB9eviuyIMlsn8 IHatGGKkx0lfTrYPKNhg= X-Google-Smtp-Source: AGHT+IHyudN3+aoLMMTl2NXHC5V5XiMCm46ELQZrXWSOxnMrXDJ0eiX43eqvnq0Af6uh3iIJFwywVw== X-Received: by 2002:a05:6000:18a7:b0:38f:483f:8319 with SMTP id ffacd0b85a97d-3911f7c17f2mr662075f8f.51.1741135978743; Tue, 04 Mar 2025 16:52:58 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Pierrick Bouvier , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Richard Henderson , Thomas Huth , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH 06/11] include: Declare target_name() in common "qemu/arch_info.h" Date: Wed, 5 Mar 2025 01:52:20 +0100 Message-ID: <20250305005225.95051-7-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250305005225.95051-1-philmd@linaro.org> References: <20250305005225.95051-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=philmd@linaro.org; helo=mail-wr1-x42c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1741136005822019100 No need to include the huge "hw/core/cpu.h" header to get a simple prototype declaration such target_name(). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- include/hw/core/cpu.h | 2 -- include/qemu/arch_info.h | 2 ++ arch_info-target.c | 5 +++++ cpu-target.c | 5 ----- hw/core/machine-qmp-cmds.c | 1 + system/vl.c | 1 - 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 5d11d26556a..4f538a8f96d 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -1162,8 +1162,6 @@ bool cpu_exec_realizefn(CPUState *cpu, Error **errp); void cpu_exec_unrealizefn(CPUState *cpu); void cpu_exec_reset_hold(CPUState *cpu); =20 -const char *target_name(void); - #ifdef COMPILING_PER_TARGET =20 #ifndef CONFIG_USER_ONLY diff --git a/include/qemu/arch_info.h b/include/qemu/arch_info.h index 3cb95926e27..613dc2037db 100644 --- a/include/qemu/arch_info.h +++ b/include/qemu/arch_info.h @@ -46,6 +46,8 @@ typedef enum QemuArchBit { #define QEMU_ARCH_LOONGARCH BIT(QEMU_ARCH_BIT_LOONGARCH) #define QEMU_ARCH_ALL -1 =20 +const char *target_name(void); + bool qemu_arch_available(unsigned qemu_arch_mask); =20 #endif diff --git a/arch_info-target.c b/arch_info-target.c index 6c11c73feb9..61007415b30 100644 --- a/arch_info-target.c +++ b/arch_info-target.c @@ -24,6 +24,11 @@ #include "qemu/osdep.h" #include "qemu/arch_info.h" =20 +const char *target_name(void) +{ + return TARGET_NAME; +} + bool qemu_arch_available(unsigned qemu_arch_mask) { return qemu_arch_mask & BIT(QEMU_ARCH_BIT); diff --git a/cpu-target.c b/cpu-target.c index f7e17a650c0..1177e93c444 100644 --- a/cpu-target.c +++ b/cpu-target.c @@ -158,8 +158,3 @@ bool target_words_bigendian(void) { return TARGET_BIG_ENDIAN; } - -const char *target_name(void) -{ - return TARGET_NAME; -} diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c index 3130c5cd456..3bf280cef16 100644 --- a/hw/core/machine-qmp-cmds.c +++ b/hw/core/machine-qmp-cmds.c @@ -19,6 +19,7 @@ #include "qapi/qobject-input-visitor.h" #include "qapi/type-helpers.h" #include "qemu/uuid.h" +#include "qemu/arch_info.h" #include "qom/qom-qobject.h" #include "system/hostmem.h" #include "system/hw_accel.h" diff --git a/system/vl.c b/system/vl.c index e96c72e5400..a41ba4a2d5f 100644 --- a/system/vl.c +++ b/system/vl.c @@ -80,7 +80,6 @@ #include "hw/block/block.h" #include "hw/i386/x86.h" #include "hw/i386/pc.h" -#include "hw/core/cpu.h" #include "migration/cpr.h" #include "migration/misc.h" #include "migration/snapshot.h" --=20 2.47.1 From nobody Wed Apr 2 13:11:06 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1741136115; cv=none; d=zohomail.com; s=zohoarc; b=MUGyMpOt7At9QSusAjoA0Fxjo2G+J6yJqa5ROIgdMgMeVDj0rAoh6VIRJgEJSm5mRJuGXeeaHrXkEAuQKqEtZrXUAe3580L9hXhmG9R1nBqwydhnv7UtYY9w0EnPlwY5fqoPeW5hxYdNhWxj51wZJoCpH4+265uCOU67uZ/j9ig= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1741136115; 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=Y4ACuYCqam8wBvbr9CPnjgFj0qVd0d3ZVp9SVoo31vs=; b=Ck4lB510x2MWTeEfFEyOIHCByvz0qzkHoSPCq6BMBhrCjpVYyriHd0dtAHeKXXpVK5ljQDuwGl8CY4Wjj8EiTRz2wahEbS+6H2QR7aL3KYn4ImWLPoJmR2iqpwHBGNkVnHcQK5xka9uCP3B3kkYA8w/Hi/T/hM2KBDSnBJ5SK1c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 174113611532512.542841518795967; Tue, 4 Mar 2025 16:55:15 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tpd0Y-00023C-7O; Tue, 04 Mar 2025 19:53:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tpd0W-00022i-H8 for qemu-devel@nongnu.org; Tue, 04 Mar 2025 19:53:08 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tpd0U-0007V6-PR for qemu-devel@nongnu.org; Tue, 04 Mar 2025 19:53:08 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-43996e95114so42360525e9.3 for ; Tue, 04 Mar 2025 16:53:06 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43bd4292af0sm1523095e9.12.2025.03.04.16.53.02 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Mar 2025 16:53:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741135985; x=1741740785; 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=Y4ACuYCqam8wBvbr9CPnjgFj0qVd0d3ZVp9SVoo31vs=; b=bfvpaNxgnzoXimRNGYRK/jwmFb1W+Zw8Zncq1IvUILgLcpc+WOxWX0ch5BZa8ScIU7 q6fD6ZZwqY/7zM6oFh0adsJpNIjkGGtjuhtrm2RKR+H5OCm6MWRmT6dx+BdCX85nOzz3 Fv+LEc6lBwYEGJN1Nf+MakqcX0ZQln2r7NvO/GuMt1DlcvIRvI8gjArEyfSa9CU+XoWQ 9RDSh+XLlrXGvjX8NAS5Dvo988yx7NjHqADI9LkjeEP+Wjo3r30978f6APr1vkYCbExm SutTPxDspJFcBd2e9OcninKs0ZoK+yZ5Z57qLtSR5lgwlivEigWCGkcINdOO6gX0V4Tc N3ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741135985; x=1741740785; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Y4ACuYCqam8wBvbr9CPnjgFj0qVd0d3ZVp9SVoo31vs=; b=hE2gegXHrTybNPgyrpr8BFFCTYp5UkNd9BlsxaxGmHMD/hP8SPQLjxqrVS2EW7izan ohFZDR1GlcNrz5F362jCz0ol45lzo+Nzm8/h3k7GTDVPNi1sG57qaog6G2/vU0Qkr9MX VdXlZok7XRUz2IouOkrO2c2Cg0DAeeq6nAcAdC57Nd3SSSuothaP31+VJEbO3Zct1F6Y rLrZz8GqF4oO7okQy1FVNIG/wP1Wz2gAAsn+FENVZz6dzarMWVMYIH0jutlQJKXIAE/K Gi0BM2KardK/tVJxRxhT0LxlpINThsj9bq8R9C1SA+lWAGpxuargB5nzpq/Blmm4f1wU wa2w== X-Gm-Message-State: AOJu0YzXhQYKaP/7umdrjzXsn9k13wNReGAdG7FvMyAXZ7JnCjY22dWr E9hkodSUTbaS/1XVQoU0Ntfw2QWrDJ/RCCmVGBRG+Bz87cb6vEmmevhPD2ffctK9FS52y/sGUVX W71s= X-Gm-Gg: ASbGncvIGpp4ajjx1FWQqHbcMs7uv6+T8ZwJOoiNmiDTpvgUj1Pu7gcyo/uPJ/QcqMq shuGmhnjKIGUsjvh9iqCGP2DC5Y7Tn8vnoNG+XwDh6Ng1gbsz98bU/2hjQgXcQij/ibtAgqhc1H 7vtyuR4nJ/dqvJCk3mNAxh53IIl6cdruTPlQVJcvI0591B7lefEPOnbe04jtiY1Isrf2nddFAg+ 9UqxPf4rETB2j09c5dhDIKsgK3nVaaG0ZBgGtKSKlShGtgLxGLH49OAlrJMHkWG/MejIgAo6iTg /blSL9TACXxpU74qes6eXWnXzzwJP9HBsNKJfz4DXi8NYBSJKALobwIO9ALNoUKcibaxAKVUWfC yyVWhF5pgKXOyGaoP9lc= X-Google-Smtp-Source: AGHT+IEefW2WBDmlXH1+AXHDBr1xDeUwcHJn4pfRv90OCogFE2mTqF8oU3YQSbzUUd8G44JT+yCVJw== X-Received: by 2002:a05:600c:4e8b:b0:43b:c0fa:f9ce with SMTP id 5b1f17b1804b1-43bd2955621mr5504105e9.14.1741135984903; Tue, 04 Mar 2025 16:53:04 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Pierrick Bouvier , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Richard Henderson , Thomas Huth , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH 07/11] plugins/loader: populate target_name with target_name() Date: Wed, 5 Mar 2025 01:52:21 +0100 Message-ID: <20250305005225.95051-8-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250305005225.95051-1-philmd@linaro.org> References: <20250305005225.95051-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1741136117199019100 From: Alex Benn=C3=A9e We have a function we can call for this, lets not rely on macros that stop us building once. Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Alex Benn=C3=A9e Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- plugins/loader.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/loader.c b/plugins/loader.c index 99686b54666..e56c1003c27 100644 --- a/plugins/loader.c +++ b/plugins/loader.c @@ -29,6 +29,7 @@ #include "qemu/xxhash.h" #include "qemu/plugin.h" #include "qemu/memalign.h" +#include "qemu/arch_info.h" #include "hw/core/cpu.h" #include "exec/tb-flush.h" #ifndef CONFIG_USER_ONLY @@ -297,7 +298,7 @@ int qemu_plugin_load_list(QemuPluginList *head, Error *= *errp) struct qemu_plugin_desc *desc, *next; g_autofree qemu_info_t *info =3D g_new0(qemu_info_t, 1); =20 - info->target_name =3D TARGET_NAME; + info->target_name =3D target_name(); info->version.min =3D QEMU_PLUGIN_MIN_VERSION; info->version.cur =3D QEMU_PLUGIN_VERSION; #ifndef CONFIG_USER_ONLY --=20 2.47.1 From nobody Wed Apr 2 13:11:06 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1741136113; cv=none; d=zohomail.com; s=zohoarc; b=L0acwDczxuo1Fm2M+xsicAU/WwNtp8N3gWdkCV0b4sfz7vuKQcIDxtHIDMfBZhNNGOtsepLfCoob2HoVUfBRi+K3TAm0kQKXAFXVna/XGEcV9sFqbBx6Y/n04/stjGw7R6ElNoQCItlyn3h3WhZ8F3X8/qT/4zsMqKRfIVOVjzI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1741136113; 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=istWwK/PBp4qWDVkDVm5a+mDjkZK9769dQ3JC5v2GBw=; b=fn8DKEdHydTPKM3bX7+ZTYKwqd1Yyd3Lwncsyi5gUnjO+kqFFWbEhw0GHzKafdyxnJj9VSjUM/QYSg/2WkveUaioFqyh8fZ+ud3GfLtgf6AVuVJ07+v0DNFb3rJTTIXHBJboFAg6D3hNvnkELgVw7YUoI8NrFYSpEuhn6GRnBbA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1741136113523416.6053131972026; Tue, 4 Mar 2025 16:55:13 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tpd0e-00029p-0S; Tue, 04 Mar 2025 19:53:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tpd0c-00028h-1U for qemu-devel@nongnu.org; Tue, 04 Mar 2025 19:53:14 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tpd0a-0007WO-5a for qemu-devel@nongnu.org; Tue, 04 Mar 2025 19:53:13 -0500 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-390dd362848so4824127f8f.3 for ; Tue, 04 Mar 2025 16:53:11 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43bd435c836sm1323485e9.37.2025.03.04.16.53.08 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Mar 2025 16:53:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741135990; x=1741740790; 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=istWwK/PBp4qWDVkDVm5a+mDjkZK9769dQ3JC5v2GBw=; b=uApn1ED5G2512UO648I1nJbFSsxYDir0b7FNJUG3qpA6vhZ74PJQTZWN33Fm093Ew2 SzybHv5swcnyhY9bGWC0iH6A4aiZYTKE2WQvCP55S641s4s46TPDNxHszv2T+2RXHDgr 04PPKkQActqAp5dEWKSQqnvdNuX8Bjv8o0ottk1IpGz4VHGZyoW8x85hfKDVtW9hhJxu S8j2z3UPpfO8aAHsZCBDT99tblEoZf6SZMEKyatLtgxud3OEamqytz/hq3P//TtmyN2j RZ3NdbJG8qf6cUbEORlDRZIB6kTxRiBUspUVcUfc/+s6g1i6vE1IyvicMGdWbvc2pdWS zLqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741135990; x=1741740790; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=istWwK/PBp4qWDVkDVm5a+mDjkZK9769dQ3JC5v2GBw=; b=IZSsrT2BnqvZhkp2i4V5r9y5W0AxOkUAEFBLsknkjy5rYGYyPSSLGFWrrGRVHLOS8u qn1WjoYftzfNxFe+PLid0X5jnggktn6fT0xzxEZLHSxppGf5pGbQ0CaD6VZOkwWZQKhZ GFYwCdrCaRrzNpOheUPaFm39fSdkEz4bU+UIztLthJHAI4U4m11QUbri75qiohyMq1ec vy2UbowJtzDR8cTAXPrdxgj3zKpH9PiMvhlR3rlT7IQ1CUR+C9Wm6uIy3/UFBRpLl1n6 fH0fHcxcTHtkCHApfMq+KvDywgbYRoNbcpHgdCYyqSLIxhhO1iLjDv9KbsOcZtDiotPE 0wNg== X-Gm-Message-State: AOJu0Yxd5NTwHgXD6B8JJ6z85JX5BdB8Ld1vBN2fLwu2yE6jXGx37pmT euAFGqH+AbY8FSSQZwvu3c5jiJtPV8X/mQgDpyXSnSRHpWBMyYn8OJjKSKLF6P+bM2JtXAbvIU6 oais= X-Gm-Gg: ASbGncvQY3zGzvPZQgp1DmDUdHN8aCYaj2ITnqb1px+By1J6eI3uUc9BdyIBPWD8gBf PAODNAW9AYfBrUwyPFT8IVZNWz5IyxW7N1N/SzDk9acTxahUioDg4ZRIqnt8Fud2DEOafe5OvFx 6m1BBoC0BQ0bpzrm5K1otT6AvCK9ef/9fxKR/0e+VyXtPap2SMNk5YoxJy94olmoKbXhqadnOuG EruRVaUU535+trktbsR+ZhLxpmHUCcbdiw/105xi1EhL+8PWXkx051SHBin/Yo/g3lLzxzoMoh1 qIW46QEiqZ6WVEF55uV+yaArKaH0OLYt1BM9zphXyEGYK7iIexyuu2uZH52R5Ubnh66G9yThVsS 8GTbX1ip2oUed2JDifX8= X-Google-Smtp-Source: AGHT+IFLaHEuYqBMxzfMC/y66DHhEBKMByv5Ts2cVU1l+a1jHcsqX4bCf9VpWdTd0iXvNHyrnAtQyw== X-Received: by 2002:a05:6000:2a8:b0:390:f0ff:2c11 with SMTP id ffacd0b85a97d-3911f714a20mr510534f8f.2.1741135990272; Tue, 04 Mar 2025 16:53:10 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Pierrick Bouvier , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Richard Henderson , Thomas Huth , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH 08/11] tests/qtest: Replace TARGET_NAME -> target_name() Date: Wed, 5 Mar 2025 01:52:22 +0100 Message-ID: <20250305005225.95051-9-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250305005225.95051-1-philmd@linaro.org> References: <20250305005225.95051-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1741136115170019100 In order to avoid the target-specific TARGET_NAME definition, replace it by the generic target_name() helper. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- tests/qtest/fuzz/fuzz.c | 5 ++--- tests/qtest/fuzz/generic_fuzz.c | 4 ++-- tests/qtest/fuzz/i440fx_fuzz.c | 5 +++-- tests/qtest/fuzz/qos_fuzz.c | 5 +++-- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/tests/qtest/fuzz/fuzz.c b/tests/qtest/fuzz/fuzz.c index ca248a51a6c..84cef4907f9 100644 --- a/tests/qtest/fuzz/fuzz.c +++ b/tests/qtest/fuzz/fuzz.c @@ -17,6 +17,7 @@ =20 #include "qemu/cutils.h" #include "qemu/datadir.h" +#include "qemu/arch_info.h" #include "system/system.h" #include "system/qtest.h" #include "system/runstate.h" @@ -35,8 +36,6 @@ typedef struct FuzzTargetState { =20 typedef QSLIST_HEAD(, FuzzTargetState) FuzzTargetList; =20 -static const char *fuzz_arch =3D TARGET_NAME; - static FuzzTargetList *fuzz_target_list; static FuzzTarget *fuzz_target; static QTestState *fuzz_qts; @@ -61,7 +60,7 @@ void fuzz_reset(QTestState *s) static QTestState *qtest_setup(void) { qtest_server_set_send_handler(&qtest_client_inproc_recv, &fuzz_qts); - return qtest_inproc_init(&fuzz_qts, false, fuzz_arch, + return qtest_inproc_init(&fuzz_qts, false, target_name(), &qtest_server_inproc_recv); } =20 diff --git a/tests/qtest/fuzz/generic_fuzz.c b/tests/qtest/fuzz/generic_fuz= z.c index d107a496da6..89a9c16ce1f 100644 --- a/tests/qtest/fuzz/generic_fuzz.c +++ b/tests/qtest/fuzz/generic_fuzz.c @@ -12,10 +12,10 @@ =20 #include "qemu/osdep.h" #include "qemu/range.h" +#include "qemu/arch_info.h" =20 #include =20 -#include "hw/core/cpu.h" #include "tests/qtest/libqtest.h" #include "tests/qtest/libqos/pci-pc.h" #include "fuzz.h" @@ -914,7 +914,7 @@ static size_t generic_fuzz_crossover(const uint8_t *dat= a1, size_t size1, const =20 static GString *generic_fuzz_cmdline(FuzzTarget *t) { - GString *cmd_line =3D g_string_new(TARGET_NAME); + GString *cmd_line =3D g_string_new(target_name()); if (!getenv("QEMU_FUZZ_ARGS")) { usage(); } diff --git a/tests/qtest/fuzz/i440fx_fuzz.c b/tests/qtest/fuzz/i440fx_fuzz.c index 155fe018f80..7b39a2ad085 100644 --- a/tests/qtest/fuzz/i440fx_fuzz.c +++ b/tests/qtest/fuzz/i440fx_fuzz.c @@ -13,6 +13,7 @@ #include "qemu/osdep.h" =20 #include "qemu/main-loop.h" +#include "qemu/arch_info.h" #include "tests/qtest/libqtest.h" #include "tests/qtest/libqos/pci.h" #include "tests/qtest/libqos/pci-pc.h" @@ -145,11 +146,11 @@ static void i440fx_fuzz_qos(QTestState *s, pciconfig_fuzz_qos(s, bus, Data, Size); } =20 -static const char *i440fx_qtest_argv =3D TARGET_NAME " -machine accel=3Dqt= est" +static const char *i440fx_qtest_argv =3D " -machine accel=3Dqtest" " -m 0 -display none"; static GString *i440fx_argv(FuzzTarget *t) { - return g_string_new(i440fx_qtest_argv); + return g_string_append(g_string_new(target_name()), i440fx_qtest_argv); } =20 =20 diff --git a/tests/qtest/fuzz/qos_fuzz.c b/tests/qtest/fuzz/qos_fuzz.c index d3839bf9994..fd93c405f2f 100644 --- a/tests/qtest/fuzz/qos_fuzz.c +++ b/tests/qtest/fuzz/qos_fuzz.c @@ -18,6 +18,7 @@ =20 #include "qemu/osdep.h" #include "qemu/units.h" +#include "qemu/arch_info.h" #include "qapi/error.h" #include "exec/memory.h" #include "qemu/main-loop.h" @@ -83,8 +84,8 @@ static GString *qos_build_main_args(void) test_arg =3D test_node->u.test.before(cmd_line, test_arg); } /* Prepend the arguments that we need */ - g_string_prepend(cmd_line, - TARGET_NAME " -display none -machine accel=3Dqtest -m 64 "); + g_string_prepend(cmd_line, target_name()); + g_string_prepend(cmd_line, " -display none -machine accel=3Dqtest -m 6= 4 "); return cmd_line; } =20 --=20 2.47.1 From nobody Wed Apr 2 13:11:06 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1741136043; cv=none; d=zohomail.com; s=zohoarc; b=nWnhtwFnlD/Ng82s399sSHQ0U5AVNQ9IW/UjXqsYu8yLglD9S/U83Y4Eux+0BzMftuhH7d1P2UxXDMopZ8V0tzfl3+nQ5sf4xfbG9147GIKIRQEsaJPXuKmJhKBfjFK5FvtNVNtgVEAhGyrgYHsyS2RqhNT1F0FDb+0VFZL+AhQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1741136043; 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=DSiKYdB6630hg7am6WhMyssXSt9ts03i324UUBol9bo=; b=J1E0I3T/1mk8K8NS7bU5C8H3hyts4kRIRIsM71vrEozBqWY5Ltkfra+B96HGTTf/uEteIt1BSwtPuMgrhdBPK/ObkXuu4TH/7Ip6TVyULD0z0oeC476Ma8WOQct1H/lnv6FQ57Ys5zyv41swugMsbiUYpKoQ0xTDu2YpHGpcgGY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 174113604347995.43766665415467; Tue, 4 Mar 2025 16:54:03 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tpd0y-0002Qp-Ns; Tue, 04 Mar 2025 19:53:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tpd0k-0002Dk-2C for qemu-devel@nongnu.org; Tue, 04 Mar 2025 19:53:22 -0500 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tpd0i-0007XM-AG for qemu-devel@nongnu.org; Tue, 04 Mar 2025 19:53:21 -0500 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-390fb1b987fso4249449f8f.1 for ; Tue, 04 Mar 2025 16:53:19 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-390e46f580bsm18957749f8f.0.2025.03.04.16.53.14 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Mar 2025 16:53:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741135997; x=1741740797; 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=DSiKYdB6630hg7am6WhMyssXSt9ts03i324UUBol9bo=; b=n1msjOdGswzmLJirKE03HDTmsAVFoPfesF7pqbfv5BfGq0e15DVV9kmxZ43kEGl331 52O8eLJebc8sbif/beLrz+t3H85NYw6cfxV4LvUwyuO8rOWBs9gosdsKpZFINqNgr1xA 4BjhMquQpl5ff+EO2Ex+Efi0yQxWXJo+giu6Z/mikCsxJlHZsX6lHgMS/arsWVcXA8BO v9fjKIvGy9+U+vkCuQrLEmnjsvYk6Q1a89/AVgHohLVfrwRnHyGUboxGieKXRbbSpS1L P8MHFn/X7B3gZZ5ggbj2EKPwC48j+eSHV05waDJPRo8ih3bsYgw1cLYZ5SKnUbmZZmFr ls1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741135997; x=1741740797; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DSiKYdB6630hg7am6WhMyssXSt9ts03i324UUBol9bo=; b=WAQSxvec4132eD0/lIObiKbIJ4azjIVI5KquW71itzGrBhk78PVHj4racQd4N02Hdo amFL3/zuegmlRUkgjHS3HUqTORRFs6oO/5W8HxfLMbzcDEEuhcQCJfJNFL988F4qyV2U SjimwrbpbHDROulo6rbPebKJjcIeLUdw3ICg70NrlsgD5RXVqrY7NkirkL719RPONtCF scXA1Rx5DyK70KcdtUsqCXTvpkwkdxUH1a7yZ4rYFuJCQM8ZRH8D+mZk1RuvTB/MCy+x NPvr1YBijrG7O5aR/6aHWSUodvdYYqmdTe3aulvnQOOJQ173n96ujFKH8nWv8bfKZDLW oDJQ== X-Gm-Message-State: AOJu0Yw9dINjIWeRvjZTla6DYv63aXVtkB9FetXYMzhLXrN1gIpz2j5k 5IUCYt+QP3QrJLhevHl/O21YnD6UJvgWKHVceQVapIs2wv5Gjm4khNYhBUbJHH+8rerYfU7ujXD 2bLw= X-Gm-Gg: ASbGnctqGEYMWGMk9qE8M6FUrzxNRL9WwSjEQi7HzXln7C1W5DprDw1j4ieZNw1Uvae t75iYu4CsJWySyTVJByfr1r2mlOeFdON80lpBmLJ1R9PofQKV08YHAH3OW21F+2CRTLg+TERlui GG7DJ12wFK7aRh57gF6a4+nUvtVx0sQO3jhPJJeG6dFZccUF23N6wBgx885HyIKJn4xfcrLcbqJ 752BTLUj8bck76/FaINXnVM3X5uNWEnza4IVoKxDsfnuUtxN2laVq9wFbOj+DjsE2GVZah9ObJm pcAOsk6JAGXLm3wCu/8hSG/dT1vqAbnDoQI5jXILGzSuPuFVxcHZwmv7AbU+JKYZgRzgb8KVolA GPYDkbRySANn5ZGyNybw= X-Google-Smtp-Source: AGHT+IG3egKbw9YIe/FSr3ntlHLIugkrh9BelKaDhfu61mibtTzaXiYY69Gx3hZ4lBTY1mh6EM46Tg== X-Received: by 2002:a5d:64c5:0:b0:391:1218:d5f7 with SMTP id ffacd0b85a97d-3911f7bb7a9mr582723f8f.40.1741135996445; Tue, 04 Mar 2025 16:53:16 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Pierrick Bouvier , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Richard Henderson , Thomas Huth , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH 09/11] user: Replace TARGET_NAME -> target_name() Date: Wed, 5 Mar 2025 01:52:23 +0100 Message-ID: <20250305005225.95051-10-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250305005225.95051-1-philmd@linaro.org> References: <20250305005225.95051-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=philmd@linaro.org; helo=mail-wr1-x430.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1741136044061019000 In order to avoid the target-specific TARGET_NAME definition, replace it by the generic target_name() helper. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- bsd-user/main.c | 9 ++++++--- linux-user/main.c | 12 +++++++----- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/bsd-user/main.c b/bsd-user/main.c index fdb160bed0f..683003c2d52 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -25,6 +25,7 @@ #include "qemu/help-texts.h" #include "qemu/units.h" #include "qemu/accel.h" +#include "qemu/arch_info.h" #include "qemu-version.h" #include =20 @@ -150,9 +151,11 @@ void cpu_loop(CPUArchState *env) =20 static void usage(void) { - printf("qemu-" TARGET_NAME " version " QEMU_FULL_VERSION + const char *target =3D target_name(); + + printf("qemu-%s version " QEMU_FULL_VERSION "\n" QEMU_COPYRIGHT "\n" - "usage: qemu-" TARGET_NAME " [options] program [arguments...]\n" + "usage: qemu-%s [options] program [arguments...]\n" "BSD CPU emulator (compiled for %s emulation)\n" "\n" "Standard options:\n" @@ -188,7 +191,7 @@ static void usage(void) "\n" QEMU_HELP_BOTTOM "\n" , - TARGET_NAME, + target, target, target, interp_prefix, target_dflssiz); exit(1); diff --git a/linux-user/main.c b/linux-user/main.c index 5c74c52cc52..0e4722ea273 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -21,6 +21,7 @@ #include "qemu/help-texts.h" #include "qemu/units.h" #include "qemu/accel.h" +#include "qemu/arch_info.h" #include "qemu-version.h" #include #include @@ -432,8 +433,8 @@ static void handle_arg_strace(const char *arg) =20 static void handle_arg_version(const char *arg) { - printf("qemu-" TARGET_NAME " version " QEMU_FULL_VERSION - "\n" QEMU_COPYRIGHT "\n"); + printf("qemu-%s version " QEMU_FULL_VERSION + "\n" QEMU_COPYRIGHT "\n", target_name()); exit(EXIT_SUCCESS); } =20 @@ -543,14 +544,15 @@ static const struct qemu_argument arg_table[] =3D { static void usage(int exitcode) { const struct qemu_argument *arginfo; + const char *target =3D target_name(); int maxarglen; int maxenvlen; =20 - printf("usage: qemu-" TARGET_NAME " [options] program [arguments...]\n" - "Linux CPU emulator (compiled for " TARGET_NAME " emulation)\n" + printf("usage: qemu-%s [options] program [arguments...]\n" + "Linux CPU emulator (compiled for %s emulation)\n" "\n" "Options and associated environment variables:\n" - "\n"); + "\n", target, target); =20 /* Calculate column widths. We must always have at least enough space * for the column header. --=20 2.47.1 From nobody Wed Apr 2 13:11:06 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1741136061; cv=none; d=zohomail.com; s=zohoarc; b=NwgzhVnRz6T3dZ4wDgutfcUjUDZwVhmYGATXEkiRI7TiuL7B30NRnvbIjnKXyn5O3J1K8zBL9jtvhIA6npkIfu7yy249GIzerG4kbxzDIIl2o0h9BuDvSSIMb5F1HU9HCC6KLsFEgCq+7NnwFprPQB/AsCmhAPDvDMZ0L+IZCac= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1741136061; 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=b6A3P5mAjc99C3XOMrVg6RA3bQK/YWQGC1ZLsd/UtMk=; b=KDYvL38i3/UCke+GN3vqSLUi73Bt8fpCVb4NwiKppU+QusJqzvswji9JADGNiuk8BAicNSKp2Mm/qzbtlr4WLba/VVl34MSGOD9ygfPqMoGBcOL1sqOX8ZCrHoZ/ZmGpjBdhWMozyxPfOqFJ+sPncOVfozhVuJjhAiyo1BhwRUg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1741136061799436.83225600201536; Tue, 4 Mar 2025 16:54:21 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tpd1B-0002Xk-B0; Tue, 04 Mar 2025 19:53:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tpd0o-0002Q8-GF for qemu-devel@nongnu.org; Tue, 04 Mar 2025 19:53:28 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tpd0m-0007YB-LV for qemu-devel@nongnu.org; Tue, 04 Mar 2025 19:53:26 -0500 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-38f403edb4eso3747175f8f.3 for ; Tue, 04 Mar 2025 16:53:24 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-390e4844c0dsm18818713f8f.80.2025.03.04.16.53.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Mar 2025 16:53:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741136002; x=1741740802; 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=b6A3P5mAjc99C3XOMrVg6RA3bQK/YWQGC1ZLsd/UtMk=; b=qsrNGILjoGFXNGR7uMjKc8RMCBX5SXbc8YZDIVxR1wucxksnAF2Y1tQUc7SnXX5UU4 GxV4pWDjPNPhRCWhHYYqHFfzaUgo0NTjwDitrUdkLvV7GNYwgMDiftwlzNMqZZic03dl XhFECDHmWqCthMygakDqVD4Mr4VBiHYIrKi13zuuTfDuYUWMfN2cojcp7ozQE20mGN7s W5YuahhGRDD1YLvcGEof+duMA9aR8lLAGXpBEvKVSoa3eYGAdV3PuNVLO5UkfLVmQHRO QN5kMUIz4v97hIJog6hKtNpB8h8Re9dNsskpFUl52ClZehWTZMkbTcVN5Z6/Sc2ki0FA 8k2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741136002; x=1741740802; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=b6A3P5mAjc99C3XOMrVg6RA3bQK/YWQGC1ZLsd/UtMk=; b=ug68RWa5pcR3nfDSQ9jCLkslxhb3lF+uXJzwLihtEhQwTGexhGGxOKY3DaaaHSiA9N bpod9zJJjfJh6fAYmavj1NzNEIymyCPX76+Vd4ZfyqLkXyx1Z3FZkIYAzrRwQrTHcqXQ TAD+zw2FmoX6ZLcuOq4uzXtTW6KymkyaEY6jKqvABEHeyEKL2o5wMe1sXmwS5pnvveAG KcXoF5DOhCcFddwF+FYqEaIu3UAGqXDLj12ou0BgEuYVZIbAa/SH7WFG5NNrzuTcMgwJ M8wdLyfAb1S9YchqW8LYKs7DQrG2pdhvMaoBCgyJn22F5VAVeKwsNLQhZxcKn+ub9Krd rFgw== X-Gm-Message-State: AOJu0YxgZIimYuLBLOK0xjBms8qsd5+o/CClxuz8eLLZ3364mGMqQ0sq MYxSa1iec92GTmcp+ja+uv7VVuD9JPw8fM/agaM4Sm2hYnXnuhF1ExuyuaG/WI/sLDaA/nR/h16 FE+I= X-Gm-Gg: ASbGncv9ATtGBalF88/1ega1KUCpMnaAvWPiR6v1zp+nzxNS0xlwIflSggTJE8o6sM1 KYGfR+ceUHYrE5Z53qcCrbeH5HDnvfT216L4Rx/2NsJ8IxG6ROMgyN4180pXtvZqFAohH+CJQcm eD74DxPUdg+j79DcYDZqkLsjyF1eZfUzTUjUrF8VQYKkVxPi0u9GotLXCzALqg0B5/4rFCO0A5p RSIBSc6GpW9GKvZ9V07huzho76Yo/te/R3K48VTttJHiqV7lKpsuZVDjxRznMqRsh9r1OuS/fxC QrjBIdUEeMRkgAlP2thMfOPlAAL9AlbO44W1pYST9eEwiW/9WPEnRAdu9idqG+qe01a1zfYTKnT wbh/LgXg097eTvmQAmKQ= X-Google-Smtp-Source: AGHT+IE08w5IQES/o1owcvHY4sjqN42KGZBHEOYyiWwIUOgo0oVKzhkwwMtW2brFSdhD2bQ9aO5FNQ== X-Received: by 2002:a5d:6c65:0:b0:391:d52:d042 with SMTP id ffacd0b85a97d-3911f76ee72mr620459f8f.32.1741136002313; Tue, 04 Mar 2025 16:53:22 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Pierrick Bouvier , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Richard Henderson , Thomas Huth , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH 10/11] qemu: Introduce qemu_arch_name() helper Date: Wed, 5 Mar 2025 01:52:24 +0100 Message-ID: <20250305005225.95051-11-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250305005225.95051-1-philmd@linaro.org> References: <20250305005225.95051-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1741136062276019000 Introduce a generic helper to get the target name of a QemuArchBit. (This will be used for single / heterogeneous binaries). Use it in target_name(), removing the last use of the TARGET_NAME definition. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/qemu/arch_info.h | 2 ++ arch_info-target.c | 34 +++++++++++++++++++++++++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/include/qemu/arch_info.h b/include/qemu/arch_info.h index 613dc2037db..7e3192f590f 100644 --- a/include/qemu/arch_info.h +++ b/include/qemu/arch_info.h @@ -46,6 +46,8 @@ typedef enum QemuArchBit { #define QEMU_ARCH_LOONGARCH BIT(QEMU_ARCH_BIT_LOONGARCH) #define QEMU_ARCH_ALL -1 =20 +const char *qemu_arch_name(QemuArchBit qemu_arch_bit); + const char *target_name(void); =20 bool qemu_arch_available(unsigned qemu_arch_mask); diff --git a/arch_info-target.c b/arch_info-target.c index 61007415b30..9b19fe8d56d 100644 --- a/arch_info-target.c +++ b/arch_info-target.c @@ -24,9 +24,41 @@ #include "qemu/osdep.h" #include "qemu/arch_info.h" =20 +const char *qemu_arch_name(QemuArchBit qemu_arch_bit) +{ + static const char *legacy_target_names[] =3D { + [QEMU_ARCH_ALPHA] =3D "alpha", + [QEMU_ARCH_BIT_ARM] =3D TARGET_LONG_BITS =3D=3D 32 ? "arm" : "aarc= h64", + [QEMU_ARCH_BIT_AVR] =3D "avr", + [QEMU_ARCH_BIT_HEXAGON] =3D "hexagon", + [QEMU_ARCH_BIT_HPPA] =3D "hppa", + [QEMU_ARCH_BIT_I386] =3D TARGET_LONG_BITS =3D=3D 32 ? "i386" : "x8= 6_64", + [QEMU_ARCH_BIT_LOONGARCH] =3D "loongarch64", + [QEMU_ARCH_BIT_M68K] =3D "m68k", + [QEMU_ARCH_BIT_MICROBLAZE] =3D TARGET_BIG_ENDIAN ? "microblaze" + : "microblazeel", + [QEMU_ARCH_BIT_MIPS] =3D TARGET_BIG_ENDIAN + ? (TARGET_LONG_BITS =3D=3D 32 ? "mips" : "mip= s64") + : (TARGET_LONG_BITS =3D=3D 32 ? "mipsel" : "m= ips64el"), + [QEMU_ARCH_BIT_OPENRISC] =3D "or1k", + [QEMU_ARCH_BIT_PPC] =3D TARGET_LONG_BITS =3D=3D 32 ? "ppc" : "ppc6= 4", + [QEMU_ARCH_BIT_RISCV] =3D TARGET_LONG_BITS =3D=3D 32 ? "riscv32" := "riscv64", + [QEMU_ARCH_BIT_RX] =3D "rx", + [QEMU_ARCH_BIT_S390X] =3D "s390x", + [QEMU_ARCH_BIT_SH4] =3D TARGET_BIG_ENDIAN ? "sh4eb" : "sh4", + [QEMU_ARCH_BIT_SPARC] =3D TARGET_LONG_BITS =3D=3D 32 ? "sparc" : "= sparc64", + [QEMU_ARCH_BIT_TRICORE] =3D "tricore", + [QEMU_ARCH_BIT_XTENSA] =3D TARGET_BIG_ENDIAN ? "xtensaeb" : "xtens= a", + }; + + assert(qemu_arch_bit < ARRAY_SIZE(legacy_target_names)); + assert(legacy_target_names[qemu_arch_bit]); + return legacy_target_names[qemu_arch_bit]; +} + const char *target_name(void) { - return TARGET_NAME; + return qemu_arch_name(QEMU_ARCH_BIT); } =20 bool qemu_arch_available(unsigned qemu_arch_mask) --=20 2.47.1 From nobody Wed Apr 2 13:11:06 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1741136089; cv=none; d=zohomail.com; s=zohoarc; b=LP0mJzBQSVJrHtWVgyHuRH2AS2nWH+XEtB9ub+s0LbJ/afO4VVfhH5A7YAgXIhOeEOtxw0K/KaTlIa3wyOrShPmT+Na9KPDHkqsyvSynq1BondjpkDZW5t5YWjWtnZROTwKUKSQNKdX6jl+JJ2Gt1Xja47z7hnxoW9squkI1o/M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1741136089; 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=SzOKHZRFCe8gSsyMmCbgGLcMBcX5RnVMQQNugexIWns=; b=VfA3pNLJVuo0nXAlO2Xe4DsAVIbgeRCpMZKPHfbOze9aoMJ6F6azAN/SWUXq+CPTprjJh4Qddb5E9E1enzLWFAqTqOAIEiui7zWToopvrTXfh4h++mSISL6DSmuHP6h5kIN5XM8Q9Pw03OTJqDQvMacjJMK5H4ejp/vrqcavjUY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1741136089205492.0702182218005; Tue, 4 Mar 2025 16:54:49 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tpd1R-00035V-2l; Tue, 04 Mar 2025 19:54:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tpd0u-0002UD-5x for qemu-devel@nongnu.org; Tue, 04 Mar 2025 19:53:36 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tpd0q-0007YW-Kw for qemu-devel@nongnu.org; Tue, 04 Mar 2025 19:53:30 -0500 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-38a8b17d7a7so3682142f8f.2 for ; Tue, 04 Mar 2025 16:53:28 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-390e4847fe5sm19327264f8f.73.2025.03.04.16.53.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Mar 2025 16:53:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1741136007; x=1741740807; 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=SzOKHZRFCe8gSsyMmCbgGLcMBcX5RnVMQQNugexIWns=; b=ZV+JpKfZ0Jw5FRV4T4jbnSvF6MZMn7S97k3SUVkqmCzEE8LA2gbyVAlM1xWbSYr1Oh 5hufbHB6NI/1jlAIU2NLc+t/EkFadGMmPNzuZdrDWlRNu2Om7AHbRIORFEKo7awPd/1k YiN4cZvriWcNSUAH6Ez3F6gD03UIwR7HAxaFPW/Hs3lu0h/vZVMdrnCgzHvY3xlVtUNV JKwEpqvXgCKD2deolia1v7MUUFJkupdmTfWt+XF7WWwnN0aNE9OLOZsRcu4/XGDJy1az wqIC0581qPdwpo+MSyiVhcICayzvPqbm8FrO/5xsIzNxrs8Mu7MnEjfjHIYXl4lzGae0 0jsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741136007; x=1741740807; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SzOKHZRFCe8gSsyMmCbgGLcMBcX5RnVMQQNugexIWns=; b=kGBJHJOfKpX5LoBXh8Z4uUay36pWw68jsx++mBvRdBcfRq93cEuNo8XFF58UJawBp/ 667bo7y9fVQuHmWXIXiRcvpsEVSRip8EkPMqCarQS0k0MiMkGD1DWR6OcSIDE73JFFRT X8uvYZdu/CNU/wDo/RSGlGjM3gB8dbJsWkIMpsdE060LC0rjKNNU/jSi5JAH/iu+NfQ3 PrM+zlvEbU9HZTGcsR2E8EHdtRqyZLQQpd6/xHBV5+3L78F1CLa0JubckoZJLdp99NCy 3HuVHEEAmy0g0zsZZpc23aKwCHDsiaAYrUjxcKO5ghy85c658/sWRGUbt4CWUxdcG7Uz 4CIA== X-Gm-Message-State: AOJu0Ywqn7rDfFEkA6+CxHOnpatGHW8Sv49sHGg8iApEIq6AqI+7VrI4 3fRG0cXQwss9p5COhcGUkIRpA8TcJl8aZT3/LFYbKHMl2IpBuMus7kqH5d84/Rw5VAjR+X2n0BW l5d4= X-Gm-Gg: ASbGncsHtA837A5/vD//IPpSsBs2wO2lCyGoEWy51cgzXa6iWjJeSq1Q8tVp11oBR8W gIvwOA+ixs6FaWWm3IjrdeaG4TbMswEPalfXYvVtTW+1nNtXZQNBr9lxf2SyaevJXPbVfR1Rs8v nGqj3wfT1r8sywf/n4l5wkzB8QZd2mA1jxKGZTX2eapt8c3Xo/zaBfyy2r2IZMuVOoY9F2bZtJK RSDEIiAjkcE6PBlJV4DVWpOfKAcEz6OkMu6z3lJfekf+qfy54GyUdFO1Aa1JX521xvKlUnIo5Mc FXS1SPvwp/y9qk4uLFLSPJ05UVGOBuP/hLwrK3mtLnQAuZkw7o9BlBeySv/egOQblKgSITcuGPB D30OUreaxQnGlUJTLgQo= X-Google-Smtp-Source: AGHT+IFmY0fHZO/RV2a0dc7rdZ6O+Ah3IMc1LZF0TdVbrJ7q+7Gb/Wpr2Xtlx31Ye/jq2gX+ESQr5Q== X-Received: by 2002:a05:6000:184c:b0:391:2163:dd67 with SMTP id ffacd0b85a97d-3912163dfe0mr147689f8f.6.1741136006937; Tue, 04 Mar 2025 16:53:26 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Pierrick Bouvier , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Richard Henderson , Thomas Huth , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [RFC PATCH 11/11] qemu: Remove C definitions of TARGET_NAME Date: Wed, 5 Mar 2025 01:52:25 +0100 Message-ID: <20250305005225.95051-12-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250305005225.95051-1-philmd@linaro.org> References: <20250305005225.95051-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1741136091239019100 We don't use TARGET_NAME anymore, remove and poison it globally. The symbol is still defined in Makefiles by the configure script (it is required by tests/tcg/). Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- meson.build | 4 +++- include/exec/poison.h | 1 - include/qemu/osdep.h | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 04d8c477644..eaae1da2e92 100644 --- a/meson.build +++ b/meson.build @@ -3347,7 +3347,9 @@ foreach target : target_dirs # Note that TARGET_BASE_ARCH ends up in config-target.h but it is # not used to select files from sourcesets. config_target_data.set('TARGET_' + v.to_upper(), 1) - elif k =3D=3D 'TARGET_NAME' or k =3D=3D 'CONFIG_QEMU_INTERP_PREFIX' + elif k =3D=3D 'TARGET_NAME' + # do nothing + elif k =3D=3D 'CONFIG_QEMU_INTERP_PREFIX' config_target_data.set_quoted(k, v) elif v =3D=3D 'y' config_target_data.set(k, 1) diff --git a/include/exec/poison.h b/include/exec/poison.h index f4283f693af..0c4ad04eb97 100644 --- a/include/exec/poison.h +++ b/include/exec/poison.h @@ -34,7 +34,6 @@ #pragma GCC poison TARGET_XTENSA =20 #pragma GCC poison TARGET_HAS_BFLT -#pragma GCC poison TARGET_NAME #pragma GCC poison TARGET_SUPPORTS_MTTCG #pragma GCC poison TARGET_BIG_ENDIAN #pragma GCC poison BSWAP_NEEDED diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 4397a906807..3167fda68e4 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -50,6 +50,8 @@ */ #pragma GCC poison TARGET_WORDS_BIGENDIAN =20 +#pragma GCC poison TARGET_NAME + #include "qemu/compiler.h" =20 /* Older versions of C++ don't get definitions of various macros from --=20 2.47.1