From nobody Sat Dec 13 22:59:00 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=1751909180; cv=none; d=zohomail.com; s=zohoarc; b=Fpg5maox4lUOy9eHv0w3qlRVABCH2jhbQHqFb/Rrc/0ohzQz9TmY07gS/ZoPb2xIG6RRvFeMpW1dVdvD2k/FON5I6SnOL+IEh5E6UeLgw0JMU0BUSXX8u1G/Kj/fHKqZpESNXU1G1JoOGB4x7AL+it9Dl+vCZReknskQVdEGveY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751909180; 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=RPKj5S3tHFubjMvOc+FpSPzyOTtYDrCXYgAF/148ssQ=; b=KbSa/FFKpVLozJyUhIynWfDr3VJR+e2Y94YM0o0RfXqOSVJbv2mwS01xfKqWjiql2egSSAorKZWXZ5PSrt7hiFlGFObN7FkTh/r5E+31XtgZyjk91Evu1oP49VIJCeTurcY9sE4ggaVRBanrFrhTFrWqTMRgfjENP2qiHnm5T/k= 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 1751909180755336.40978547620807; Mon, 7 Jul 2025 10:26:20 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uYpY3-0003l2-9j; Mon, 07 Jul 2025 13:22:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uYpVu-0000Qr-DC for qemu-devel@nongnu.org; Mon, 07 Jul 2025 13:20:25 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uYpVr-0004yr-Qy for qemu-devel@nongnu.org; Mon, 07 Jul 2025 13:20:22 -0400 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-3a50fc7ac4dso1539368f8f.0 for ; Mon, 07 Jul 2025 10:20:18 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b47030baa5sm11084319f8f.12.2025.07.07.10.20.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 07 Jul 2025 10:20:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751908817; x=1752513617; 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=RPKj5S3tHFubjMvOc+FpSPzyOTtYDrCXYgAF/148ssQ=; b=vi/0Szt/odD7mCaQ3ijnqksRBn0A+3My0nPWR8NfldWdiMvdLbD424LL89MXpAasBX VsY0q4DxVs+1Y6qPi1m5vKjhZv8t3i4+tBqAHIUa1WjJdAvO3ubojOQbUCQUp5wARxPx Lp+xWQPE+tdecEA4ZsHahdW/X8maanKJTKvWnvarxzD3zIwR4OoSMmt8T1UztpU1G1Fu nuDvSjKVdkksvzVHHVKqJTej4h8cNWlEgaZSlJqZBZPeG4WH7WgeIBVT8IJi1gqXwkoH OPju/cu9/yml2/MLQTo5mzEiXfZZdnVPXTEXrXrFryS7LYMGa6IwAneTJ7asw8M4+s5o fWoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751908817; x=1752513617; 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=RPKj5S3tHFubjMvOc+FpSPzyOTtYDrCXYgAF/148ssQ=; b=PhxveBzKfRueBSkiRFM0oMDLZpG7c7CMatBHYK9Lxq5GAUGcZilY9l+51m0kEn4jma VmCpjQjmlgZKxs/AW18XLQLqC5gdp78pIWAB2gd3ro6qi2KDk6Cxsottg9jcFzQ3AVdm W9bJJYpQuYl5AIvw8CZWL30Tcr1fQdrB9LtAgcf8PrPCWJz9SqSisxQjJwmVdDTh4C3n X52LCVSRrhA1wKTgNxidEz/K8fKyEp6/skEOtHm/lA5hyuKQNwodEDcJcYfr0Glc5FZv JhUo0G3mmqcJJPLfqlO97bY3/aL8klILawg/8WB+hMZvmYfHGpK5PvY5V28X3X1/IZY0 fW1w== X-Gm-Message-State: AOJu0Yyvr+QWgdrCiVGZQeZ/utxYmJ5yXo7oUebxLf1HsF7RDMKfLUDO n+s6Jck4/eq654u/BacNCWLSQVY0NeZM7lVgdBXrOPDHWwNya2OCIS/qv7xn2H0KZ3BXiRnGUrW VI6ToNVY= X-Gm-Gg: ASbGncu62O7a5jKIJPTYjcUhZlVIV/U67mpYh/plhTEfoQHBtmsunLDp0bTrqUoFwwe UVpQjBtGT/fXmHfOaJ82QiuQme4ntOIOtTsQb8k01qkEP/qIrrOKzWebETn63E0dhpF36vrEh84 VgADNsZLWvj/oIAnfyYBqE3iPrWQU7XQIHlWNQKNc67/dxG65rXlmjnH2etp9FO7hAFq4QtulAQ Mn6UPNd/A8FonxVQdtzE7Nbajk3TXNT4cmXnDMw5nRca76Y/i0WxKHc0vdkUjmcP3g/7NV9WxHa haeKHptXfHXf3/CIt8TNMcHYODiupN3deYwbgEf70P/ya4pVOOB8Q2Lq5HgJxgdaZLHZP3AekjU 6gohrA52bComUDDlMlohF/y7eeZq5v7k+xuRp X-Google-Smtp-Source: AGHT+IGCSV5kO8RY5wl3hODLRNtupRcCVEnCURNmqdz6EdIEC8nno86Za7JhyuoqB207ZkzMCGrdVA== X-Received: by 2002:a05:6000:98e:b0:3a4:e387:c0bb with SMTP id ffacd0b85a97d-3b49aabdc06mr7100887f8f.59.1751908816657; Mon, 07 Jul 2025 10:20:16 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierrick Bouvier , qemu-block@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, Paolo Bonzini , qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell , Song Gao , Huacai Chen , Aurelien Jarno , Jiaxun Yang , Aleksandar Rikalo Subject: [PATCH-for-10.1 v6 01/14] target/qmp: Use target_cpu_type() Date: Mon, 7 Jul 2025 19:19:55 +0200 Message-ID: <20250707172009.3884-2-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250707172009.3884-1-philmd@linaro.org> References: <20250707172009.3884-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=unavailable 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: 1751909181535116600 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- target/arm/arm-qmp-cmds.c | 3 ++- target/loongarch/loongarch-qmp-cmds.c | 3 ++- target/mips/system/mips-qmp-cmds.c | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/target/arm/arm-qmp-cmds.c b/target/arm/arm-qmp-cmds.c index cefd2352638..d292c974c44 100644 --- a/target/arm/arm-qmp-cmds.c +++ b/target/arm/arm-qmp-cmds.c @@ -21,6 +21,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/target-info.h" #include "hw/boards.h" #include "kvm_arm.h" #include "qapi/error.h" @@ -241,7 +242,7 @@ CpuDefinitionInfoList *qmp_query_cpu_definitions(Error = **errp) CpuDefinitionInfoList *cpu_list =3D NULL; GSList *list; =20 - list =3D object_class_get_list(TYPE_ARM_CPU, false); + list =3D object_class_get_list(target_cpu_type(), false); g_slist_foreach(list, arm_cpu_add_definition, &cpu_list); g_slist_free(list); =20 diff --git a/target/loongarch/loongarch-qmp-cmds.c b/target/loongarch/loong= arch-qmp-cmds.c index f5f1cd0009d..1d8cd32f5fc 100644 --- a/target/loongarch/loongarch-qmp-cmds.c +++ b/target/loongarch/loongarch-qmp-cmds.c @@ -7,6 +7,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/target-info.h" #include "qapi/error.h" #include "qapi/qapi-commands-machine.h" #include "cpu.h" @@ -32,7 +33,7 @@ CpuDefinitionInfoList *qmp_query_cpu_definitions(Error **= errp) CpuDefinitionInfoList *cpu_list =3D NULL; GSList *list; =20 - list =3D object_class_get_list(TYPE_LOONGARCH_CPU, false); + list =3D object_class_get_list(target_cpu_type(), false); g_slist_foreach(list, loongarch_cpu_add_definition, &cpu_list); g_slist_free(list); =20 diff --git a/target/mips/system/mips-qmp-cmds.c b/target/mips/system/mips-q= mp-cmds.c index d98d6623f2f..b6a2874f2dd 100644 --- a/target/mips/system/mips-qmp-cmds.c +++ b/target/mips/system/mips-qmp-cmds.c @@ -7,6 +7,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/target-info.h" #include "qapi/error.h" #include "qapi/qapi-commands-machine.h" #include "cpu.h" @@ -40,7 +41,7 @@ CpuDefinitionInfoList *qmp_query_cpu_definitions(Error **= errp) CpuDefinitionInfoList *cpu_list =3D NULL; GSList *list; =20 - list =3D object_class_get_list(TYPE_MIPS_CPU, false); + list =3D object_class_get_list(target_cpu_type(), false); g_slist_foreach(list, mips_cpu_add_definition, &cpu_list); g_slist_free(list); =20 --=20 2.49.0 From nobody Sat Dec 13 22:59:00 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=1751908964; cv=none; d=zohomail.com; s=zohoarc; b=B4c7i9TTeDvuF9jTZcjx058OYlCG/LO/jDg1F76eF2J9tQxAUjudQZz8IUUwMZpTr6rALslvKiMYzQicpYCDnqok10ynXbXKV4q9PIVyZDU01znIPQYbCAK4vQn6K3ABZK3Fsu0FLvAZd/ixTOhDbGX8n1sulGuKdgyux9EpCAk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751908964; 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=YHZVDxqmNYoTl1VtUEuGuCVslQK6vMHQOasVIFp7MBk=; b=kDxfrbU9TEj3QNWNSe/vE+CmKB1ygC0L9yZ/q9t4Q2ihlJzQ5lhWOkpr4PLSaQ5mRv1nnoL86eU6H7BKIs9YovPuOXHTOfzornTJU0cHb6PZCixoG7yBt1x2TZa/OuU3pfjjKfrwe26oYGtXRKpoQbql4FlZZ+cszg5b2tQfEKI= 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 1751908964158190.49058363190272; Mon, 7 Jul 2025 10:22:44 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uYpXF-0001uG-M9; Mon, 07 Jul 2025 13:21:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uYpW5-0000Vh-0w for qemu-devel@nongnu.org; Mon, 07 Jul 2025 13:20:37 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uYpVx-00051i-UD for qemu-devel@nongnu.org; Mon, 07 Jul 2025 13:20:28 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-454cc6e987dso1748125e9.0 for ; Mon, 07 Jul 2025 10:20:23 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-454a9969f2asm153421035e9.8.2025.07.07.10.20.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 07 Jul 2025 10:20:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751908822; x=1752513622; 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=YHZVDxqmNYoTl1VtUEuGuCVslQK6vMHQOasVIFp7MBk=; b=kewiTgaJceFTQzpXqB2vbBtgQCVcnHeSa2Vr6ebf9gWpEO6pjL46S04Ky2aSYOfM/m KT7MYowWPunOIzePxoKZ5TRBJQm5D3P5Hp383yrU2cYPA9x45FLthcP19MjLMB+pZ2nl +d2/5lZk3CQQxdo4vBI9jCz0eR5/HV/ZnB1b4J+RlDyo/NLHDcDmfQ/v2BXi8fAkZZzT dDZrN4Y9/ZKvANdCPxIzTFWttHc3wxFZ+Go8BSPiJcFnsg4EIelz2dBpYDabPzCHQIec qoi0Bc/19qx3lzXFPxNjBUjWkeGYoEdSokTifHSTzOX1mFrbq0I5adAoT1WfIzuH7ZQ2 /w0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751908822; x=1752513622; 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=YHZVDxqmNYoTl1VtUEuGuCVslQK6vMHQOasVIFp7MBk=; b=hF19i/G6dAVn/axuNj0Puo/DacbDjnK6S88CLVIQBeWyNsiP8gjmEie0vTMgw0wlDe WbuMvrmg5Pw4IgAK0zaWBvsnvHn35RI2OnGxEUhrveKg3GpA+lX/7UyxD5z4mKBwa4nt Aws3PtZbAFLQ/b+NhPMhgwO+/OWAzdsvvHVYTy1KWvBp7mddntKmsMeH+uE+7Gp7ltDO fgkS5V7Wy+Xu7yGL6JQkgbDZwzTUp+KW9ZnAmOXY4W+seyUrs+ybFVMYDk8hHOynHhBp dZ6LPmlkoQ9gdJWvSSCVEnsIXOHj2DvcP/0Svo4vL9HC/bcF3lsIufZyst6yBjpk7FPP t5Pg== X-Gm-Message-State: AOJu0YzY2+BYsM+gHEHoJ+lXEjIsoSw0J3yJ8jtg3Ga96iB5dfxVoFrh FEKAryL19tRxmGhynfYNmoEZaeTPB3JT0Pf3h8xwofdiTBbVGlZbbCDGIKFJEEY+NzNmNv3lflj bVsFtWFc= X-Gm-Gg: ASbGncv3uS+rPcgGFwazisBELYt+/+QPnIO8HoivIxc7yhx67Gg30MUCgH0AHzWDw5C juU/a+jpto9T5cJieunbkPLuv3gQejOettod2yx1fWNEGgodOxt6bc28hywVxBFiM0w4bt4U3Ni Vky8EVL0UgFNjdZ9Wo8OSV0mPg9/57X2Ei8j6T9b6Q9DB01NOTrnVpkZFm5yRKGBiZIl0Pc5Kvt 3mk3mboW/ogkPyux/ScMjGI15KFLOSWbK7SvI6XR7mWoCwHdJnXaSJjdsmiuF2UmrVUIO+X7RdP ZnLrH0mJvEP8gaDF9KVfQU0WB2Ts4x9BzKSulPwfD/uHwtzqJAD4kSSXaii4Yq12FMC8XsIrSYs w46Odtv1b2QGiLRI+qW2C66NY0Q7/kl5au8M0 X-Google-Smtp-Source: AGHT+IGJWyLS8lgTHM5f90/ohERSYYo8nxRNDz3UptV3SZAweJlFBaD/aoNOl7V4tLgRk+G+NoreSg== X-Received: by 2002:a05:600c:3f15:b0:43d:5264:3cf0 with SMTP id 5b1f17b1804b1-454ccde169dmr3783675e9.11.1751908821686; Mon, 07 Jul 2025 10:20:21 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierrick Bouvier , qemu-block@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, Paolo Bonzini , qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang , Zhao Liu Subject: [PATCH-for-10.1 v6 02/14] qemu/target-info: Factor target_arch() out Date: Mon, 7 Jul 2025 19:19:56 +0200 Message-ID: <20250707172009.3884-3-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250707172009.3884-1-philmd@linaro.org> References: <20250707172009.3884-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::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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=unavailable 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: 1751908965115116600 To keep "qemu/target-info.h" self-contained to native types, declare target_arch() -- which returns a QAPI type -- in "qemu/target-info-qapi.h". No logical change. Keeping native types in "qemu/target-info.h" is necessary to keep building tests such tests/tcg/plugins/mem.c, as per the comment added in commit ecbcc9ead2f ("tests/tcg: add a system test to check memory instrumentation"): /* * plugins should not include anything from QEMU aside from the * API header. However as this is a test plugin to exercise the * internals of QEMU and we want to avoid needless code duplication we * do so here. bswap.h is pretty self-contained although it needs a * few things provided by compiler.h. */ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Zhao Liu --- include/qemu/target-info-qapi.h | 21 +++++++++++++++++++++ include/qemu/target-info.h | 2 +- hw/core/machine-qmp-cmds.c | 8 +++----- target-info.c | 8 ++++++++ 4 files changed, 33 insertions(+), 6 deletions(-) create mode 100644 include/qemu/target-info-qapi.h diff --git a/include/qemu/target-info-qapi.h b/include/qemu/target-info-qap= i.h new file mode 100644 index 00000000000..dae92c47eb1 --- /dev/null +++ b/include/qemu/target-info-qapi.h @@ -0,0 +1,21 @@ +/* + * QEMU target info API (returning QAPI types) + * + * Copyright (c) Linaro + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef QEMU_TARGET_INFO_EXTRA_H +#define QEMU_TARGET_INFO_EXTRA_H + +#include "qapi/qapi-types-machine.h" + +/** + * target_arch: + * + * Returns: QAPI SysEmuTarget enum (i.e. SYS_EMU_TARGET_X86_64). + */ +SysEmuTarget target_arch(void); + +#endif diff --git a/include/qemu/target-info.h b/include/qemu/target-info.h index 850a2958b9c..dde0e7d968a 100644 --- a/include/qemu/target-info.h +++ b/include/qemu/target-info.h @@ -1,5 +1,5 @@ /* - * QEMU target info API + * QEMU target info API (returning native types) * * Copyright (c) Linaro * diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c index d82043e1c68..cd98daedd18 100644 --- a/hw/core/machine-qmp-cmds.c +++ b/hw/core/machine-qmp-cmds.c @@ -19,7 +19,7 @@ #include "qapi/qobject-input-visitor.h" #include "qapi/type-helpers.h" #include "qemu/uuid.h" -#include "qemu/target-info.h" +#include "qemu/target-info-qapi.h" #include "qom/qom-qobject.h" #include "system/hostmem.h" #include "system/hw_accel.h" @@ -37,8 +37,7 @@ CpuInfoFastList *qmp_query_cpus_fast(Error **errp) MachineState *ms =3D MACHINE(qdev_get_machine()); MachineClass *mc =3D MACHINE_GET_CLASS(ms); CpuInfoFastList *head =3D NULL, **tail =3D &head; - SysEmuTarget target =3D qapi_enum_parse(&SysEmuTarget_lookup, target_n= ame(), - -1, &error_abort); + SysEmuTarget target =3D target_arch(); CPUState *cpu; =20 CPU_FOREACH(cpu) { @@ -139,8 +138,7 @@ QemuTargetInfo *qmp_query_target(Error **errp) { QemuTargetInfo *info =3D g_malloc0(sizeof(*info)); =20 - info->arch =3D qapi_enum_parse(&SysEmuTarget_lookup, target_name(), -1, - &error_abort); + info->arch =3D target_arch(); =20 return info; } diff --git a/target-info.c b/target-info.c index 16fdca7aaaf..9ebabec988f 100644 --- a/target-info.c +++ b/target-info.c @@ -8,7 +8,9 @@ =20 #include "qemu/osdep.h" #include "qemu/target-info.h" +#include "qemu/target-info-qapi.h" #include "qemu/target-info-impl.h" +#include "qapi/error.h" =20 const char *target_name(void) { @@ -20,6 +22,12 @@ unsigned target_long_bits(void) return target_info()->long_bits; } =20 +SysEmuTarget target_arch(void) +{ + return qapi_enum_parse(&SysEmuTarget_lookup, target_name(), -1, + &error_abort); +} + const char *target_cpu_type(void) { return target_info()->cpu_type; --=20 2.49.0 From nobody Sat Dec 13 22:59:00 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=1751908984; cv=none; d=zohomail.com; s=zohoarc; b=exLdx5cZNXq11I0ke+W+CktkUgZT4CY/cccykpyI7X1bUQjSL/fSpwMyzuDlzhUbeNcSJFhcYtIfwA9Qr9UbHMWrIHRdXu60iEemetpZt7psJxVjHLZNtqhOjTS0ZGB2n/bg9UdmXrdbR7R9CDACkb3mCtjOGA6IfJpWdDm6XoQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751908984; 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=MdQhcbrWCDw+stGMxabzY7NAeBH4tymx5hVA3eT0Fq4=; b=JqaBJHSZtJ/NAXxSGTEkjjan7ZTcJ6fHNNmzWqkJCIiloPkGIzfAeI5YCGiMPdBJXBvOVYfwucuYlnBvL90Zj6vjGRDGZZg2xNmbRpiL6qIQiqhE5W8KMXVzKEh/86wGfciW0eVCra8g6OTNQtVpRoB8u9QViHDrf2LV3DkABCk= 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 1751908984651855.4224846922459; Mon, 7 Jul 2025 10:23:04 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uYpXn-0002nF-HK; Mon, 07 Jul 2025 13:22:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uYpWB-0000aA-Ta for qemu-devel@nongnu.org; Mon, 07 Jul 2025 13:20:41 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uYpW4-000531-OM for qemu-devel@nongnu.org; Mon, 07 Jul 2025 13:20:35 -0400 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-3a536ecbf6fso1800595f8f.2 for ; Mon, 07 Jul 2025 10:20:28 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b47030c2e8sm10611361f8f.3.2025.07.07.10.20.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 07 Jul 2025 10:20:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751908827; x=1752513627; 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=MdQhcbrWCDw+stGMxabzY7NAeBH4tymx5hVA3eT0Fq4=; b=NVNai+COG99kpDvNGILKVlTjLqhQ+4hqxd5vz+J6IOlCZ4jKqsClEHi8/8wurONKqW pJDA23JfL+XDki6S3tBld8xWiPyUWdg7huIxaR8e7mbb2LYJKbeBYhd3BfvMM0/u7Qq7 4e4Qx5fTan/6WRbGoepfFT7/UftGGl2RHF2UqnUpWJIsNumaoEJzPClCVNYoUwHYieQx YYvM34dVe3I5SdzcekUsuxe41+1koi2Jr6jwA5pPIDjgCNWkzO0rMKJ14eLdfEXkYoyf Y03sHwNHGDX+kVqWo+jP/63/yjcoq0316vqPdnWXSZe6AStUYEHo0c5RVnPUBrfy7yXO SBew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751908827; x=1752513627; 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=MdQhcbrWCDw+stGMxabzY7NAeBH4tymx5hVA3eT0Fq4=; b=IvGYHxobgp0aoCryOSBcqqQVExAx75ULYFpt37fOZEoCZVk6ol03d+rtoKcOnCt5CF jNLv6iCxu7nWcT+95+smroxdJIC815u7Cb2U/qrrJN3p3CUKLIIMNyb7Sm3KSXjrQFmv j3o5Bqdqr9AprKQjPXQapg6siecZN2L8vafVsjJKZxz0EAMNHrpdCgL+piAzuX2ca2fj FZTjDGsEcuIYEA0iIQRCXbEcMUY4G60o2fpNkZZBGv7/4b4SpKMc76fwUYAvwiizm3Wd JBk5q/jzHFiWkHxuuNmPq6yumE9tghsfES0vqvbDVbvlhR73G35j2EQhkGi1d3OND9ad Xi5g== X-Gm-Message-State: AOJu0Yy9iXcKvPx80KZHfGWrHxRHKRIEkcMFEANIsgRUZmiPINusyUOF kQ0paJKLgR/atUiyVleFwpVFrvOyfbTllz2WtzV/+ftDUhaOmh95F9vrTOzaxlXyAlVsgKLeDtr puMtNb+o= X-Gm-Gg: ASbGncs0PUnLjhUk+wAZJUE4zoP4WqQkCwBzQ1/LLjDbh/H7PAzBsvUh+Rt2lCYamvK 5NOJV/eNJkMjBdBpe8EA9r09wHcLPr23/7GXvepxV0JqSZhAQ2eGzAjXiSzIVxn8+VkB+rHeT2w pWl05w1eVAmI8j4o2p2GDV3UvWmBY6BP3erUgVAKLongIQNC2ra3D4VBlNUVwP7DnRV68NT9Bss 3/4oJAGgZ3EXprrkA+KIlhXslAjXIAYrJbbPUFpy+HhyLlt0HJQ7euuD1d09ujg2o1QYrlyuUzs eJG13qLKQlUvX3xMOKfyUzZNU4SjLlN6Kh/jOjgIJvWjlC6tKfqSlLDmekHg2xJDhbE49ac5Hfh mph8c032re5yUxgpEbGR6zllE3+unJKA7Iw4A X-Google-Smtp-Source: AGHT+IHgxWsQMmAO1HC/m+G4aoKXFMZBmXnsWXv6XR3g4QAjowjDWEhNK2HOw2Gxi/FtEhT3yJoiPA== X-Received: by 2002:a05:6000:2006:b0:3a6:c923:bc5f with SMTP id ffacd0b85a97d-3b49aa5eef1mr8409979f8f.17.1751908826685; Mon, 07 Jul 2025 10:20:26 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierrick Bouvier , qemu-block@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, Paolo Bonzini , qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH-for-10.1 v6 03/14] qemu/target-info: Add %target_arch field to TargetInfo Date: Mon, 7 Jul 2025 19:19:57 +0200 Message-ID: <20250707172009.3884-4-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250707172009.3884-1-philmd@linaro.org> References: <20250707172009.3884-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=unavailable 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: 1751908985151116600 Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/qemu/target-info-impl.h | 4 +++- target-info-stub.c | 1 + target-info.c | 9 +++++++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/include/qemu/target-info-impl.h b/include/qemu/target-info-imp= l.h index 1b51cbcfe1b..a8b34d150ab 100644 --- a/include/qemu/target-info-impl.h +++ b/include/qemu/target-info-impl.h @@ -9,11 +9,13 @@ #ifndef QEMU_TARGET_INFO_IMPL_H #define QEMU_TARGET_INFO_IMPL_H =20 -#include "qemu/target-info.h" +#include "qapi/qapi-types-machine.h" =20 typedef struct TargetInfo { /* runtime equivalent of TARGET_NAME definition */ const char *target_name; + /* related to TARGET_ARCH definition */ + SysEmuTarget target_arch; /* runtime equivalent of TARGET_LONG_BITS definition */ unsigned long_bits; /* runtime equivalent of CPU_RESOLVING_TYPE definition */ diff --git a/target-info-stub.c b/target-info-stub.c index fecc0e71286..2e4407ff04b 100644 --- a/target-info-stub.c +++ b/target-info-stub.c @@ -14,6 +14,7 @@ =20 static const TargetInfo target_info_stub =3D { .target_name =3D TARGET_NAME, + .target_arch =3D SYS_EMU_TARGET__MAX, .long_bits =3D TARGET_LONG_BITS, .cpu_type =3D CPU_RESOLVING_TYPE, .machine_typename =3D TYPE_MACHINE, diff --git a/target-info.c b/target-info.c index 9ebabec988f..8e29553b4ef 100644 --- a/target-info.c +++ b/target-info.c @@ -24,8 +24,13 @@ unsigned target_long_bits(void) =20 SysEmuTarget target_arch(void) { - return qapi_enum_parse(&SysEmuTarget_lookup, target_name(), -1, - &error_abort); + SysEmuTarget arch =3D target_info()->target_arch; + + if (arch =3D=3D SYS_EMU_TARGET__MAX) { + arch =3D qapi_enum_parse(&SysEmuTarget_lookup, target_name(), -1, + &error_abort); + } + return arch; } =20 const char *target_cpu_type(void) --=20 2.49.0 From nobody Sat Dec 13 22:59:00 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=1751908990; cv=none; d=zohomail.com; s=zohoarc; b=F/RNc2EXjbeoYtfHK5I206HHVFubKcieHqohFsz1l8tfISblBwQdnJLL4KVpww+0YJD4o3YAPzxxPjvNZlF6C4M2lQG05MuTGTX/N/LXpwQ4ljvIAG6u6IiKvfNcJbvMv8XWT3wy+SVriuGZvNMrP1bOlx9uMtKlrov1a/GpwAk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751908990; 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=j6jE+E8cLL9PvtEqsQIMM5Q/m0eFlodpHTi07huBO/s=; b=TTdVJKaftyhEpuAmqLeQekftbopEn1uDAqyG2XxtYo3xtHQU3ThUVnUfwSkOous5YbBRrr/ACuLDz9KERlOQoSerHN74WCCIKiUOeFN0usVCRqvNmWJbQpThSwqDL2iwt34ieFHUoj+XAervOu5jDJvdmGCG47u5Py0CDftuqgU= 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 1751908990190848.2141255261705; Mon, 7 Jul 2025 10:23:10 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uYpY9-00044l-Oq; Mon, 07 Jul 2025 13:22:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uYpWI-0000fg-To for qemu-devel@nongnu.org; Mon, 07 Jul 2025 13:20:55 -0400 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 1uYpWB-000540-Bc for qemu-devel@nongnu.org; Mon, 07 Jul 2025 13:20:42 -0400 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-3a54700a463so1886079f8f.1 for ; Mon, 07 Jul 2025 10:20:33 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b47225afd4sm10589634f8f.83.2025.07.07.10.20.30 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 07 Jul 2025 10:20:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751908832; x=1752513632; 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=j6jE+E8cLL9PvtEqsQIMM5Q/m0eFlodpHTi07huBO/s=; b=W2yzfMoRJ11v8bg8P+Qg4ls0nJaIPhvLMev1/23gceETeNRghxq96r17Q3W23VtfLj sJwezp3J24ng3cGsv2alz0/ew6MyWx+2orJKf7B9+D7dfR7MWxW12islGds7sZ/Z7mnP 5u08tAe05DvA5FmsByc2GEqcC21Kf1H8X7v1xvAxx5thhlPnchhvef6zxy32SqnleTXp yaHb9VK5Se/ibRlx93mo7pNgNKylJNwijlz5UEyVHNjBd2a1KbvVaM0F6/ogflqCSyfO wQpg9oK8e+d+QL7hS3x6OI96DwE3EBvHRVBcmw8QErnd/zKx0X6aZTdhcvsaAWwNBKM4 ZUBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751908832; x=1752513632; 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=j6jE+E8cLL9PvtEqsQIMM5Q/m0eFlodpHTi07huBO/s=; b=Ri/fYoS7fLPhlBybaGUxCqUiclM/6vNyC40NPifl21/YpLovxywsyAK3AeJZVA6ZRL EIpB9A+ALibe7L90V295BB0/t3cs4KLelj+S+8CaBYYTol/c5MMCt/AESnOHnsvDeDl2 HPNvoFF6sW1OkB6nNGImzyDYEhIashlLEi8jloQ44BGhcMAWsCa9jZ5euxqxHsCG6v/x d7xlUJbvuQnqU5kRa4ypHehcrmft7ZS4SPKoYz/qY5xlV4HV/mBJVckzwGLh85r2Cw8c /NHo+po5NeEStuhX2sUNd7gXEYCIN2esyt0sjksffgZLJpubuFZykfrRHDAdTJ010uCb qw0w== X-Gm-Message-State: AOJu0YyAXcpgV4037ldh4GXbflT3r35eYC3TjUi6QCuyoPgSunl488jq bAHv3/t/NsX2ohIkmsuFMTMpCS1Xj3E5+yTdw7eRmBQAgiDMtssNh7VL0Ooy6/uEirmf8mDudvE 1ShKPbYM= X-Gm-Gg: ASbGncs0fl1jRyV6gmLAF+NBzLYGuTtFtHPBA+AVZKxAe+NTOMutpy3+f09dCrAHy3l F5Ro3rG9jtBgCLa/9hizKr5S54aN+KWs9UnIar+GDgNPbXCs7NuKVKG7loaSwHUeZoFJTsuP+pS axIrKy2lGp/DKCqSf9Jjhsa6Kcfo1K8CnC/OeH38JHnKlUP5kDaYywKo+iienipvO9HMj6BfmFs RF2+1g7/o1xETs11KjTvZORjrqSZBBRxQXmu8GobUzlgyH0hn+siTu1c8OJMtW6R2wwoJVSqJTY FTH6Hd5X6ReOtGuYXHrDPWdI4LNYhKeJas34RB+j4J+mU3UMbPOeykmQMI+g8mFUAZMTTogyij2 eSUynuW6zAuIy0fyWTVjDPhbEhqRUA7rAEvpr X-Google-Smtp-Source: AGHT+IEBAmgTQWwQQDm+6K4rVCpjdWQ5u057LU8G4ktHHXd0VbtGTyL3sl9T3U7ABAnB++ZEW7nESw== X-Received: by 2002:a05:6000:20c2:b0:3a4:f722:a46b with SMTP id ffacd0b85a97d-3b5dd15bdfcmr143247f8f.15.1751908831556; Mon, 07 Jul 2025 10:20:31 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierrick Bouvier , qemu-block@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, Paolo Bonzini , qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH-for-10.1 v6 04/14] qemu/target-info: Introduce target_base_arch() Date: Mon, 7 Jul 2025 19:19:58 +0200 Message-ID: <20250707172009.3884-5-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250707172009.3884-1-philmd@linaro.org> References: <20250707172009.3884-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=unavailable 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: 1751908991263116600 target_base_arch() returns the base architecture as in QEMU target/$arch/ path. For example, X86_64 is implemented in the target/i386/ so its QEMU base arch is 'i386'. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/qemu/target-info-impl.h | 2 ++ include/qemu/target-info-qapi.h | 7 +++++++ target-info-stub.c | 1 + target-info.c | 10 ++++++++++ 4 files changed, 20 insertions(+) diff --git a/include/qemu/target-info-impl.h b/include/qemu/target-info-imp= l.h index a8b34d150ab..c5aea6fa6d2 100644 --- a/include/qemu/target-info-impl.h +++ b/include/qemu/target-info-impl.h @@ -16,6 +16,8 @@ typedef struct TargetInfo { const char *target_name; /* related to TARGET_ARCH definition */ SysEmuTarget target_arch; + /* related to TARGET_BASE_ARCH definition (target/${base_arch}/ path) = */ + SysEmuTarget target_base_arch; /* runtime equivalent of TARGET_LONG_BITS definition */ unsigned long_bits; /* runtime equivalent of CPU_RESOLVING_TYPE definition */ diff --git a/include/qemu/target-info-qapi.h b/include/qemu/target-info-qap= i.h index dae92c47eb1..5d63fc4ab84 100644 --- a/include/qemu/target-info-qapi.h +++ b/include/qemu/target-info-qapi.h @@ -18,4 +18,11 @@ */ SysEmuTarget target_arch(void); =20 +/** + * target_base_arch: + * + * Returns: QAPI SysEmuTarget enum (i.e. SYS_EMU_TARGET_I386). + */ +SysEmuTarget target_base_arch(void); + #endif diff --git a/target-info-stub.c b/target-info-stub.c index 2e4407ff04b..c0f438b45c4 100644 --- a/target-info-stub.c +++ b/target-info-stub.c @@ -15,6 +15,7 @@ static const TargetInfo target_info_stub =3D { .target_name =3D TARGET_NAME, .target_arch =3D SYS_EMU_TARGET__MAX, + .target_base_arch =3D SYS_EMU_TARGET__MAX, .long_bits =3D TARGET_LONG_BITS, .cpu_type =3D CPU_RESOLVING_TYPE, .machine_typename =3D TYPE_MACHINE, diff --git a/target-info.c b/target-info.c index 8e29553b4ef..46780ec5450 100644 --- a/target-info.c +++ b/target-info.c @@ -33,6 +33,16 @@ SysEmuTarget target_arch(void) return arch; } =20 +SysEmuTarget target_base_arch(void) +{ + SysEmuTarget base_arch =3D target_info()->target_base_arch; + + if (base_arch =3D=3D SYS_EMU_TARGET__MAX) { + base_arch =3D target_arch(); + } + return base_arch; +} + const char *target_cpu_type(void) { return target_info()->cpu_type; --=20 2.49.0 From nobody Sat Dec 13 22:59:00 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=1751909077; cv=none; d=zohomail.com; s=zohoarc; b=VMkG/n/hM8bhsA2KXNYeP2CJ/w5XFKjc9nCKUhzlcAMQOUfAvoHdi2MRP8aBuTftVVscBTyRYq/jj0qZzTh98t6VHGW2zN5ADVFs5pMIN586B8ivSTUbXltp/hRyHljuH7Xd22/uFyMkvHLjkzGTZ7a/1OVfRLDRvxbFvThtf5M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751909077; 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=cgrWE9rtuwlVoQniQnEFDvLHdGO1X//mrH1eSofFQXI=; b=BTsJiCEXCidyqZ9OLSFkd14tdDhB06H6pW1YWKyvn6FasJQL3LugwyW6/GTnWzN1p46sMcoYF4ioy1LP+dMNYfEICBJk/+TE5Crtmm/sVqd0AoP308zorvLfDziPjZiEk4YkN8T2rw1AwXYuhwh1UBUVV/7zKCq5z0qt+bFJY9w= 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 1751909077185289.25864325409634; Mon, 7 Jul 2025 10:24:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uYpY8-00040y-Aw; Mon, 07 Jul 2025 13:22:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uYpWJ-0000fr-NV for qemu-devel@nongnu.org; Mon, 07 Jul 2025 13:20:55 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uYpWB-00055K-Cd for qemu-devel@nongnu.org; Mon, 07 Jul 2025 13:20:43 -0400 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-3a582e09144so2178959f8f.1 for ; Mon, 07 Jul 2025 10:20:37 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-454b1628ebcsm119933865e9.14.2025.07.07.10.20.35 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 07 Jul 2025 10:20:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751908836; x=1752513636; 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=cgrWE9rtuwlVoQniQnEFDvLHdGO1X//mrH1eSofFQXI=; b=oiNGde3wfus/XUbcYFcK4ocZjWH7SetkqbPoc10lPr+zTtzEyis0wHtcjx/IHxOqgX 7DVAXxZml0r5qfN05H8MYIW1RnHWt5qrd9xpZhHqg3nSrPBgQbhhIJdixfR4G3VqOpyG 8hYFvniEpBZ0ItoMyKkzV9SK35XgtsXijz65HaAFUxLg7wKd1FGTsYk7bJqsPB4nYda6 efTdWMbMimN5WL127kHfn0lC/Gkvrav4/8Ou4nSBATZfoS7i1B1JF0p72OtROjd1P/zu aUbEflM18kxzxrC7wRbMaohycTHdSaCDlNXPjsJc120yDkDFdgWL7JtrQJNhngVyQYdq WMUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751908836; x=1752513636; 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=cgrWE9rtuwlVoQniQnEFDvLHdGO1X//mrH1eSofFQXI=; b=mWTg+LLJTPlgVbjiXnRf4Bs7euVhxQivGpdSS1dyFktrztAVaBJHhIQMQ8y2zlJnKu DBsnW/vMy5VnhhKnLaPquY9Q+0KLxxUKY/stMwtaZ4RxPh2EG3uKfvyjjBSv6TX/K9vl ZtlIgjSumsrcyIX3H5cZWWzgX68VdvNhIhLMK0QhnmwcMPVO3ce3NDHFWFdIpsFGpFpf JNx1QrYZ0C0Eq8l2Mp0n0cQA/SF5effCq/cLlU2opxI61O1zd7DHcWKEEC/3ocjev7c1 43pEB8dBdM56lLelz0IYPRc6MW22vjLrH9ePlHMhsfZ3lfR1agDeeo4ufoUE8reGkqlE B5sw== X-Gm-Message-State: AOJu0YxXma/8QcRkAbyW0XH79IHhuIL8xnQw1rMk1Ob0PJUwLNiQo8tX JzpoM3BJNmZ5OQpOL8fhhuB9PQrSZHYZC87lz1cSkYpAsqFYArmJKhks6Nrl29HJtKV5hPmfiOy W7gkYESs= X-Gm-Gg: ASbGncuspyExu7HRQpnoTusJm3VxPfCEAs+gMdBD8jSqIfTxn+uCL6cy9sl2VIdgbFE Rff8hWxmcSujmcGDwzKNH+1WpoWVqyhf9h6+1Z8Kw0ZzZD98rpul26cYl9XASXCxTan4E1uDnAX qNH7GTZpT/afgyKOl+gqqZTbNqD65QW7oTOgABXD3FdPHaK6LSDZqpeNgAS596zqzpV8CYIScoR oVZFlFPrypgeVePHJOieubQtv4Y9r7CKsT8VmUATIhRX2q5Rh3ereFvj20haB8YjEyV6iVZvHy/ lZ78NePhujZNhOKqk5f3P7JIFIfv8/IuiNsSXl7twZJjmNqSdYomCKiFnRSzrge2N35Qcvo2BVf ysYgCi/wUJCVW9vBsqVkU6hIX2/FGY4VMh9hh9C3wEzOiJiU= X-Google-Smtp-Source: AGHT+IEG1Kubu2soTehOwJGuZ2eurE5fqlh0gsIIAXhWlgAtUIVUAar8E8mtP/O5tKH5EvbxDm59WQ== X-Received: by 2002:a05:6000:420f:b0:3a5:25e0:ab53 with SMTP id ffacd0b85a97d-3b497038f53mr9375751f8f.32.1751908836506; Mon, 07 Jul 2025 10:20:36 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierrick Bouvier , qemu-block@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, Paolo Bonzini , qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH-for-10.1 v6 05/14] qemu/target-info: Add target_endian_mode() Date: Mon, 7 Jul 2025 19:19:59 +0200 Message-ID: <20250707172009.3884-6-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250707172009.3884-1-philmd@linaro.org> References: <20250707172009.3884-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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: 1751909078319116600 target_endian_mode() returns the default endianness (QAPI type) of a target. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/qemu/target-info-impl.h | 2 ++ include/qemu/target-info-qapi.h | 8 ++++++++ target-info-stub.c | 1 + target-info.c | 5 +++++ 4 files changed, 16 insertions(+) diff --git a/include/qemu/target-info-impl.h b/include/qemu/target-info-imp= l.h index c5aea6fa6d2..065cd59d2e8 100644 --- a/include/qemu/target-info-impl.h +++ b/include/qemu/target-info-impl.h @@ -24,6 +24,8 @@ typedef struct TargetInfo { const char *cpu_type; /* QOM typename machines for this binary must implement */ const char *machine_typename; + /* related to TARGET_BIG_ENDIAN definition */ + EndianMode endianness; } TargetInfo; =20 /** diff --git a/include/qemu/target-info-qapi.h b/include/qemu/target-info-qap= i.h index 5d63fc4ab84..749f874084c 100644 --- a/include/qemu/target-info-qapi.h +++ b/include/qemu/target-info-qapi.h @@ -9,6 +9,7 @@ #ifndef QEMU_TARGET_INFO_EXTRA_H #define QEMU_TARGET_INFO_EXTRA_H =20 +#include "qapi/qapi-types-common.h" #include "qapi/qapi-types-machine.h" =20 /** @@ -25,4 +26,11 @@ SysEmuTarget target_arch(void); */ SysEmuTarget target_base_arch(void); =20 +/** + * target_endian_mode: + * + * Returns: QAPI EndianMode enum (i.e. ENDIAN_MODE_LITTLE). + */ +EndianMode target_endian_mode(void); + #endif diff --git a/target-info-stub.c b/target-info-stub.c index c0f438b45c4..5fa7fc93114 100644 --- a/target-info-stub.c +++ b/target-info-stub.c @@ -19,6 +19,7 @@ static const TargetInfo target_info_stub =3D { .long_bits =3D TARGET_LONG_BITS, .cpu_type =3D CPU_RESOLVING_TYPE, .machine_typename =3D TYPE_MACHINE, + .endianness =3D TARGET_BIG_ENDIAN ? ENDIAN_MODE_BIG : ENDIAN_MODE_LITT= LE, }; =20 const TargetInfo *target_info(void) diff --git a/target-info.c b/target-info.c index 46780ec5450..2659aecd8d1 100644 --- a/target-info.c +++ b/target-info.c @@ -52,3 +52,8 @@ const char *target_machine_typename(void) { return target_info()->machine_typename; } + +EndianMode target_endian_mode(void) +{ + return target_info()->endianness; +} --=20 2.49.0 From nobody Sat Dec 13 22:59:00 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=1751909233; cv=none; d=zohomail.com; s=zohoarc; b=GrxA81CJ7Lu61t6968y6/Bno8LDv9V7tqlyIAQt/o46gWV30j6cROYZW+F0kkj6sl1Lyz1N8GJeFAwVjlZszgWG6CItzw1qXZK1POnO/Egam6rPlRD/4iH8BvbqqAWjMMAmtFMQ7yUWUq2iShN+M0ab/XT0VQd7TH9pK4iKyxJ4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751909233; 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=q/3S1SutETVOVzQXn+B5Ty8Wa6Pzu0fGa53c3etvcBA=; b=BbuFUqcDfLmlHRhr30PsTJU/DoWgufIYS8nGHwQ0TY8aZpV5SidqEhP1yC3E9qldUa/3TYyAIXW6pvNcVlsx9viLxGFSSBSGNwSQWshSXBJxZWZRfKqu8DqhSU/2lot/Hl31mWo/An8Y8jCMyNgqc7v7EmsWmbOqAOZ5y/XiJTg= 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 1751909233170862.9355657288789; Mon, 7 Jul 2025 10:27:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uYpXx-0003Qv-WE; Mon, 07 Jul 2025 13:22:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uYpWR-0000iY-Vv for qemu-devel@nongnu.org; Mon, 07 Jul 2025 13:20:57 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uYpWK-000574-I3 for qemu-devel@nongnu.org; Mon, 07 Jul 2025 13:20:53 -0400 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-3a528243636so1960420f8f.3 for ; Mon, 07 Jul 2025 10:20:43 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-454b1685499sm117981975e9.22.2025.07.07.10.20.40 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 07 Jul 2025 10:20:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751908842; x=1752513642; 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=q/3S1SutETVOVzQXn+B5Ty8Wa6Pzu0fGa53c3etvcBA=; b=lMmFyQVS5UyejsR6o0MB3nNkYbGyS8jS61F+/iTt7aHA2WyANZG70JCFcKzRYul13p a60FEXY+tTxJSPsdiFBPWSi4kzJ0txfsKcLTMxjUFtRDsXW2bc5Deo2CHVcVcMuz0DAq fM+UMuD8YNX7lwU7/ncpMpmDOldsJ+Z5ccdeaB88v/vflEyzkoPl3N5fA4UKPbcHvgVM AkzXKF3yjqaKeEDI4xNysv1FmJ4POal/6f9tIKZnricVgpal2tCmAglenBmZaAb2qJgM LD/2AWdsYfVi0vYbzgpJLmWQl38ni0+OKP8ED4P3vLiVSC6q2Yl/OaNhnvuKJjwsPpoZ eBNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751908842; x=1752513642; 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=q/3S1SutETVOVzQXn+B5Ty8Wa6Pzu0fGa53c3etvcBA=; b=J3/LTP8rHpXa0+k7Nlerv5ZkOre1ieszf9wtsLCZl1I7lALU6nIZCzzytdpde/De6Q 7V5HhIITyiCr1THYz5L0MFVpUDk/H+OdIJkQr6EOXIjkzEdqyY8waVka1C8A2pvyAnaw JkYzy5MUsEx87TeNG7TaPzcjkOp16AUoRlOsDoSlFODwu3Hm8H9ym2BeKi7YHV+x18BG AOEfP/3eTDJC+2SRwmKpGBJnjstezWdzTngGxzsOtZ6BqezdkCQ7SIJfv5S110Oksc2V W/L61VLMByn+482QDNUPlOrm0o1meViun9dzJewhhx4jkK/qL4Wx5kJEYUrvpp6kIXJ0 6XtQ== X-Gm-Message-State: AOJu0YwPvTiexzyenEINWEgO1H9e/loli5vvd2IQ73adIgZ4X8OcSXFN a6dMitYzmgnxWfkInOq/CSqORKytFpdoIdS3Ddqxc3i8KDplVea8jsCVyQbqqDO822cuuHzBOL4 tp5XZgdY= X-Gm-Gg: ASbGncvUtNVOg4Hj2UPOkihrTw0AnSMrs6wuM4CeSOLv2PQjuq7/B21HLtNnQ5hJyDT bMGIObMgNYuDF9wTkY/SrbqTujWmgW6UydObuvw2McnZSUzwyHSuu/wRdxES7CUJTNgqhZmWi99 RpkDVNyckBmy5/gWo3EjmN4o0rJ630Pg71IyFuU/ktJSxP0GxLTdweAbSe2+m6kBmy+bAObPBX6 eKN+C+f6clUUbkMcTQ/hzHDTIjXezRdj+WYkCzIG+hvrSulsoPfLDW5mH9SbJQpPpWnEZK3hGeK eiWiV/cfcAdQ6JvX6rFXDSIqwwd8aJsA3TX1wdipBT1cjeS8is9gguOPJ8amZR/Rwaii6NHFMDE pRh47V/PlLEbhtn5iOY00RctKeiXFXP9y9sjYUvCQr+N/o/w= X-Google-Smtp-Source: AGHT+IEE2BgYU4ioX3C7uU/iCZP0JhspMkrKzzO2Roh10BzFrS0z4whPy53s/TQGYRTtAf2ayV+M7g== X-Received: by 2002:a05:6000:40c9:b0:3b3:a43a:cc54 with SMTP id ffacd0b85a97d-3b49aa7daeamr8990189f8f.45.1751908841758; Mon, 07 Jul 2025 10:20:41 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierrick Bouvier , qemu-block@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, Paolo Bonzini , qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang , Zhao Liu , Gerd Hoffmann , Peter Xu , David Hildenbrand , Fabiano Rosas , Laurent Vivier Subject: [PATCH-for-10.1 v6 06/14] qemu: Convert target_words_bigendian() to TargetInfo API Date: Mon, 7 Jul 2025 19:20:00 +0200 Message-ID: <20250707172009.3884-7-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250707172009.3884-1-philmd@linaro.org> References: <20250707172009.3884-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=unavailable 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: 1751909234217116600 Reviewed-by: Pierrick Bouvier Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/exec/tswap.h | 13 +------------ include/qemu/target-info.h | 8 ++++++++ cpu-target.c | 7 ------- hw/core/cpu-system.c | 2 +- hw/display/vga.c | 2 +- hw/virtio/virtio.c | 2 +- system/memory.c | 1 + system/qtest.c | 1 + target-info.c | 5 +++++ 9 files changed, 19 insertions(+), 22 deletions(-) diff --git a/include/exec/tswap.h b/include/exec/tswap.h index 49511f26117..55ffa633598 100644 --- a/include/exec/tswap.h +++ b/include/exec/tswap.h @@ -9,18 +9,7 @@ #define TSWAP_H =20 #include "qemu/bswap.h" - -/** - * target_big_endian: - * Returns true if the (default) endianness of the target is big endian, - * false otherwise. Common code should normally never need to know about t= he - * endianness of the target, so please do *not* use this function unless y= ou - * know very well what you are doing! - */ -bool target_big_endian(void); -#ifdef COMPILING_PER_TARGET -#define target_big_endian() TARGET_BIG_ENDIAN -#endif +#include "qemu/target-info.h" =20 /* * If we're in target-specific code, we can hard-code the swapping diff --git a/include/qemu/target-info.h b/include/qemu/target-info.h index dde0e7d968a..18a8c4ff6e8 100644 --- a/include/qemu/target-info.h +++ b/include/qemu/target-info.h @@ -38,4 +38,12 @@ const char *target_machine_typename(void); */ const char *target_cpu_type(void); =20 +/** + * target_big_endian: + * + * Returns: %true if the (default) endianness of the target is big endian, + * %false otherwise. + */ +bool target_big_endian(void); + #endif diff --git a/cpu-target.c b/cpu-target.c index 1c90a307593..20db5ff3108 100644 --- a/cpu-target.c +++ b/cpu-target.c @@ -22,7 +22,6 @@ #include "system/accel-ops.h" #include "system/cpus.h" #include "exec/cpu-common.h" -#include "exec/tswap.h" #include "exec/replay-core.h" #include "exec/log.h" #include "hw/core/cpu.h" @@ -85,9 +84,3 @@ void cpu_abort(CPUState *cpu, const char *fmt, ...) #endif abort(); } - -#undef target_big_endian -bool target_big_endian(void) -{ - return TARGET_BIG_ENDIAN; -} diff --git a/hw/core/cpu-system.c b/hw/core/cpu-system.c index 3c84176a0c5..a975405d3a0 100644 --- a/hw/core/cpu-system.c +++ b/hw/core/cpu-system.c @@ -24,7 +24,7 @@ #include "exec/cputlb.h" #include "system/memory.h" #include "exec/tb-flush.h" -#include "exec/tswap.h" +#include "qemu/target-info.h" #include "hw/qdev-core.h" #include "hw/qdev-properties.h" #include "hw/core/sysemu-cpu-ops.h" diff --git a/hw/display/vga.c b/hw/display/vga.c index 20475ebbd31..90b89cf4044 100644 --- a/hw/display/vga.c +++ b/hw/display/vga.c @@ -26,7 +26,7 @@ #include "qemu/units.h" #include "system/reset.h" #include "qapi/error.h" -#include "exec/tswap.h" +#include "qemu/target-info.h" #include "hw/display/vga.h" #include "hw/i386/x86.h" #include "hw/pci/pci.h" diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index 82a285a31d1..0f4d28033d7 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -20,7 +20,7 @@ #include "qemu/log.h" #include "qemu/main-loop.h" #include "qemu/module.h" -#include "exec/tswap.h" +#include "qemu/target-info.h" #include "qom/object_interfaces.h" #include "hw/core/cpu.h" #include "hw/virtio/virtio.h" diff --git a/system/memory.c b/system/memory.c index e8d9b15b28f..38da62f5052 100644 --- a/system/memory.c +++ b/system/memory.c @@ -22,6 +22,7 @@ #include "qemu/error-report.h" #include "qemu/main-loop.h" #include "qemu/qemu-print.h" +#include "qemu/target-info.h" #include "qom/object.h" #include "trace.h" #include "system/ram_addr.h" diff --git a/system/qtest.c b/system/qtest.c index 301b03be2d3..fa42c9f9215 100644 --- a/system/qtest.c +++ b/system/qtest.c @@ -29,6 +29,7 @@ #include "qemu/error-report.h" #include "qemu/module.h" #include "qemu/cutils.h" +#include "qemu/target-info.h" #include "qom/object_interfaces.h" =20 #define MAX_IRQ 256 diff --git a/target-info.c b/target-info.c index 2659aecd8d1..758b430d94a 100644 --- a/target-info.c +++ b/target-info.c @@ -57,3 +57,8 @@ EndianMode target_endian_mode(void) { return target_info()->endianness; } + +bool target_big_endian(void) +{ + return target_endian_mode() =3D=3D ENDIAN_MODE_BIG; +} --=20 2.49.0 From nobody Sat Dec 13 22:59:00 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=1751909059; cv=none; d=zohomail.com; s=zohoarc; b=DeD6X5INmLFZprQyZx4Uwt2X+mlRcjJyPKfvdC9NWYldH92QotJIein3x+UE7kFGs7u9fI+eSopTqFkuCuc5jn+CC5TX9EMUVC4fyRPc6EOmkErxlXi2fgs3hRt0ldPigjd9hqkmahT32ieMZTXlXCGrQJXMKV/xcNmR2nKY8ao= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751909059; 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=RFonhSB51r1m9DRDPq3gxW3IKaSRsXZYDkC267ansE0=; b=P2RJecQ/U5YtBoja14CV30iEn2JlOOJ49yO/j5XHg1xeu9rC/ew2yn5iDcWRgVu4eu92JbHdijZG01b0ZJNAPJCJ7PwkzkXr61lnmEmv0mGT1CeCxY1Vw4AhAZRjUtVg8BcdcuMAaJJ1i/pp0sGVqiJG+6l3nqrCwu5lQunO8y4= 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 1751909058777989.6178405333901; Mon, 7 Jul 2025 10:24:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uYpYT-00054N-Sx; Mon, 07 Jul 2025 13:23:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uYpWT-0000kS-7K for qemu-devel@nongnu.org; Mon, 07 Jul 2025 13:20:58 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uYpWO-00058S-5F for qemu-devel@nongnu.org; Mon, 07 Jul 2025 13:20:55 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-450cfb790f7so26806745e9.0 for ; Mon, 07 Jul 2025 10:20:48 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-454a9bcf35csm147172605e9.20.2025.07.07.10.20.45 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 07 Jul 2025 10:20:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751908847; x=1752513647; 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=RFonhSB51r1m9DRDPq3gxW3IKaSRsXZYDkC267ansE0=; b=tX5jj3y6GzOlWOO/ey+MQQQDZWQeuOK7XpbtwCtlOQoxxs76dz884cYpP/0bltCmZB oqVX5nJhP6SfaqfNCMLZ27pYjgSJ6W85nibSfS2/rAO4bEA//DrykmlcQ6aaXsgW849R dkJpuVl22zxEuLSfxPiHNYq71e0von0zZagxgl7V7cl9gUPuqlheENGZ+AWmzV72Er9o 0hNLElbsFX3kkvVi1UaMg/+0aONG+dT/Nqi6O4W6nP4OE5OCe6Kr+hWU9EJDRp/O1ktO so1weJGw8GgWUpi7ViNX2ePS1kskk0kmRIhDzQKxlZ6rTLhnNQ89sw7U+/GY4aEMwcSx 6PEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751908847; x=1752513647; 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=RFonhSB51r1m9DRDPq3gxW3IKaSRsXZYDkC267ansE0=; b=ThGIRJxMnmctgLb25d14LmV85LTHivsDlahyd2h37l12+hqPNBaKuAs7fxGQUQMLUQ kYrs8KVXJcvDs3lpGnbbC7qbYa8uL390NTVShBkKvT8+Y2sIg4anBh3h95GjEB2tNKdd RSMV7o+d9TpLGh9TZWyRZq9J1/TuraIRi1hvz4v2ZP2Kj45paL9J6DIFgENxUqytdngr R5psceagsfFq0WT+q8prir3BE6SRjPaqxZWTiPZzRNA89NZ//ViN2414/btUecQkytFD 7EyPEJKXTJrFqrVNbbP4kXX/r2mDD2y7uwbLqleWwwE3QVVdEZe69xdKrJQH+ZO2Ho2m 2VFQ== X-Gm-Message-State: AOJu0YwUWALYJ2ooNhNzavTj4D9BrZIUe7sK1BgA2xRGt9GZd/r/bI9/ aWbAw/06Xk+2GNAePSvDbdIBHQWSH+jweFirmha7vPLArnY7sjFHv2hd8YVQ+SwiVmdVgHWzUSh XXYkQd7o= X-Gm-Gg: ASbGncvp8ZsVjPLyTRT/Gc8gdRfkVQIUUcBGlg4VzJe/GI0nsEi0HwdUTNyKcp16dpC IjKDA+ZsottACcMrn1n0QjYiGejGqs14Lqt956+Qh2chFVIW2SLsDbBb/eafMamWNQ7oIKz+mw7 qyMSL1VOdYHQLok4wAfsBI2OzI09rPfjEKKVO/D8hoB2i3gDbj+tNejep46hvTWSeb68Kw+52b0 /MnfgsYizR7rhJKo1nGNuoBd2G0ETqCBmhjUO9ZTmUx5TaEWTMfw+KcAYnL23i62N34uOcwInM3 b7GJX1nF36tahsFMfvJvlBTTMSIuM9JeQoF4G0nBUpAyGAT1sfmaAVGATpBMp+934J4qEYvsfwI lTze/DNp0nGytpNZnbRVsERtKSp7axQWV80OL X-Google-Smtp-Source: AGHT+IGhI82KjTmq2GBYUFjCnNZWFDyft3wJhBMSIY8cUy9DDxHlM8oqhAuXnW0mZvX6TO7CAfhsVw== X-Received: by 2002:a05:600c:818c:b0:43c:efed:733e with SMTP id 5b1f17b1804b1-454ccc799d0mr4855545e9.14.1751908846639; Mon, 07 Jul 2025 10:20:46 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierrick Bouvier , qemu-block@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, Paolo Bonzini , qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH-for-10.1 v6 07/14] gdbstub/helpers: Replace TARGET_BIG_ENDIAN -> target_big_endian() Date: Mon, 7 Jul 2025 19:20:01 +0200 Message-ID: <20250707172009.3884-8-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250707172009.3884-1-philmd@linaro.org> References: <20250707172009.3884-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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: 1751909059935116600 Check endianness at runtime to remove the target-specific TARGET_BIG_ENDIAN definition. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/gdbstub/helpers.h | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/include/gdbstub/helpers.h b/include/gdbstub/helpers.h index 6f7cc48adcb..1411b136d5c 100644 --- a/include/gdbstub/helpers.h +++ b/include/gdbstub/helpers.h @@ -16,6 +16,7 @@ #error "gdbstub helpers should only be included by target specific code" #endif =20 +#include "qemu/target-info.h" #include "exec/tswap.h" #include "cpu-param.h" =20 @@ -55,18 +56,14 @@ static inline int gdb_get_reg64(GByteArray *buf, uint64= _t val) static inline int gdb_get_reg128(GByteArray *buf, uint64_t val_hi, uint64_t val_lo) { + bool be =3D target_big_endian(); uint64_t to_quad; -#if TARGET_BIG_ENDIAN - to_quad =3D tswap64(val_hi); + + to_quad =3D tswap64(be ? val_hi : val_lo); g_byte_array_append(buf, (uint8_t *) &to_quad, 8); - to_quad =3D tswap64(val_lo); + to_quad =3D tswap64(be ? val_lo : val_hi); g_byte_array_append(buf, (uint8_t *) &to_quad, 8); -#else - to_quad =3D tswap64(val_lo); - g_byte_array_append(buf, (uint8_t *) &to_quad, 8); - to_quad =3D tswap64(val_hi); - g_byte_array_append(buf, (uint8_t *) &to_quad, 8); -#endif + return 16; } =20 --=20 2.49.0 From nobody Sat Dec 13 22:59:00 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=1751909147; cv=none; d=zohomail.com; s=zohoarc; b=TUdetZqwd0xKbFuf8ekT9n1wx1R6BwGItXrbw5SHMmi/vSMFzbjxJg7aabJOpUeIosFdXVPAXSInh+ygm4ATQiAQOb6OUeTupphS4QJ2YEFhxXC4WJjWZEhCgOK9UykzQTxk/J9Ojj3xFA0tra5JEZqMB1O5+f22z4VOQzm2uC8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751909147; 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=rdBIXTavtg6pNFCK5VZLNyddFa1VV1Q1VDfkVeBkEjg=; b=jqo4HyQ2v1ID6K3+eAZi2VWlQSHWEgu4QcDflW2A1DzjaEPM4HiUuMkUzamUMu+SoB6Ofn1c9tE/G5EUbiZzteExZ2Lj9xw1jbrSQ+TgpzScqrxU8+ggZXAX0bgHs64Tgagd4mCAg5nHGG7Qf9uo3XToDgCWmIwmeibLAo2ksZM= 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 1751909147524893.208642367133; Mon, 7 Jul 2025 10:25:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uYpXp-0002xE-4s; Mon, 07 Jul 2025 13:22:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uYpWa-0000qn-2Q for qemu-devel@nongnu.org; Mon, 07 Jul 2025 13:21:04 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uYpWT-00059d-Lf for qemu-devel@nongnu.org; Mon, 07 Jul 2025 13:21:01 -0400 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-3a4ef2c2ef3so3199391f8f.2 for ; Mon, 07 Jul 2025 10:20:55 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b47285c919sm10866869f8f.92.2025.07.07.10.20.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 07 Jul 2025 10:20:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751908854; x=1752513654; 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=rdBIXTavtg6pNFCK5VZLNyddFa1VV1Q1VDfkVeBkEjg=; b=ZiRXJQyUDbPyqsMtBN6vhzjTge0WWB3LDhS1eHVUKbGqTRswpdETuF40LDhQKDkwFU 4RSjtvHG+YsiLuqx2icJxbn9jX+/Eky7NtMGzX/+ebrBig4QB+KU0k0w4zyGO+ZXw/X6 bTTFtGwxtkCyeu0DMAyKBqe78MQRze6U/wc6Vr2HH9Kaku6CESRry5zk9G+6Fj3P86sj YtUUMXVl3gBVBjn2nR9FWs+MjWyKNKwxwNo7SBjYiPM7Jjffqcz5m3j8yFrj/Auh1qxg ibZQ6ckV8rNt/4ZEhdmnx3FqEouDyAz+n8CpZ6qylzxneWJ66ZQ456wmycPytfEik021 /Syg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751908854; x=1752513654; 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=rdBIXTavtg6pNFCK5VZLNyddFa1VV1Q1VDfkVeBkEjg=; b=CF2/9y1/IjAua7Ht+PD8QEdJ4rxL0XgNkFd0dvUD8k+eGeW/4SLev+IO46slKuvfyD B39jCYrws3v86bACQyWA68X4FzXb5xiHNyKoF+3OEkyXu6p/SkdEBwICNyN/d9m++dne kKiGsE2mxZ1tVE5/EIHnpCllQTFf42M1pdMJ/+YtEc6EG33Rufee23+MKZM/YFJhHlMn lhtuKDz2/Wn+NqlHseLA54/hayTe7jkAfKSz7yxtiJbpJ/kTS99EprUkqWChfxgfxyxN n3Ez/jYfl19adVNu2cPt8n2vxekUdv/RIF31Rlm5R9rBfM4zcas1mWta6mu1K8MV6BOe FSfg== X-Gm-Message-State: AOJu0YxO6aF1ZtdAIYoatQT0MlsC11NSlawMuOU/Y3mQ2scV8moFkYZF K6H8hs0o06dRHTcxBAWnj8qphOa3u+u6Wc/q/jiGxkL9anPmmJMSuSD+EXC1M/Lu6cI9KU/Hl4f 7u/IJQVU= X-Gm-Gg: ASbGncvSzDkqum+EsxaN2ivZ/a8s7u1VBfTpSdrNwtd3EK17SOd17GRbQK/4ErTLWdZ U2XFn39qQ/se5/NsdS9ssmuYVWrV5ClY+poJgYdcJkWNDJ/M8MSwvi0P1m2+yHMkmJklWf0H+9B Ar3r6x8Rb+/7fWLuMWxmFNYJBu2w7meLgQPV3Di+qmz+C1QBGxiN+uaK/UMa26vqoV1M5CfXttD DY/5lVOAUueIhOi4fZ7Pb9fK4M3T9Vgi1Hq8TR9DOn+6GIyp7mNIqAD6xV114gzESOCzlrN1QVK lJbq6fqgDQBcYc0DKiIa1/DGKaZx3O8Yo46C2CEEFppHwjhLu6v9+qBoAMijFokM1q0uzOlCAva xcPxorZLLpxQjC27JDfD/tuU9waRvA/aTZe4r X-Google-Smtp-Source: AGHT+IFI1WknZE5hNjE5tC2Okg1zWmamvrV1ZimpnUj7kNl4GFDT2Lt3AllJHJtPk8MqUJPrfb4mhA== X-Received: by 2002:a05:6000:25c2:b0:3a5:1471:d89b with SMTP id ffacd0b85a97d-3b497036230mr11108869f8f.53.1751908853624; Mon, 07 Jul 2025 10:20:53 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierrick Bouvier , qemu-block@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, Paolo Bonzini , qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Igor Mammedov , Ani Sinha , Peter Maydell , Beniamino Galvani , Strahinja Jankovic , Tyrone Ting , Hao Wu , John Snow , Kevin Wolf , Hanna Reitz , Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Jonathan Cameron , Fan Ni , Helge Deller , Pavel Pisa , Francisco Iglesias , Vikram Garhwal , Jason Wang , Dmitry Fleytman , Aurelien Jarno , Nicholas Piggin , =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Barrat?= , Bernhard Beschow , Yoshinori Sato , Magnus Damm , Matthew Rosato , Eric Farman , Halil Pasic , Christian Borntraeger , David Hildenbrand , Ilya Leoshkevich , Thomas Huth , Alex Williamson , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Alexander Graf , Phil Dennis-Jordan , Peter Xu , Riku Voipio , Eduardo Habkost , Zhao Liu , Alexandre Iooss , Mahmoud Mandour Subject: [RFC PATCH-for-10.1 v6 08/14] qemu: Declare all load/store helpert in 'qemu/bswap.h' Date: Mon, 7 Jul 2025 19:20:02 +0200 Message-ID: <20250707172009.3884-9-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250707172009.3884-1-philmd@linaro.org> References: <20250707172009.3884-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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: 1751909150884116600 Restrict "exec/tswap.h" to the tswap*() methods, move the load/store helpers with the other ones declared in "qemu/bswap.h". Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/exec/tswap.h | 70 -------------------------- include/qemu/bswap.h | 73 ++++++++++++++++++++++++++++ include/system/memory.h | 1 - include/user/abitypes.h | 1 - target/ppc/mmu-hash64.h | 2 - hw/acpi/bios-linker-loader.c | 2 - hw/arm/allwinner-r40.c | 1 - hw/arm/boot.c | 2 + hw/arm/npcm7xx.c | 2 +- hw/block/hd-geometry.c | 1 - hw/char/riscv_htif.c | 1 - hw/cxl/cxl-events.c | 2 - hw/display/artist.c | 1 + hw/display/ati.c | 1 + hw/net/can/ctucan_core.c | 1 - hw/net/lan9118.c | 1 + hw/net/rtl8139.c | 1 + hw/net/vmxnet3.c | 1 - hw/pci-host/gt64120.c | 1 + hw/pci-host/pnv_phb3.c | 1 + hw/pci-host/pnv_phb4.c | 1 + hw/pci-host/ppce500.c | 1 - hw/pci-host/sh_pci.c | 1 - hw/s390x/s390-pci-inst.c | 1 + hw/sensor/lsm303dlhc_mag.c | 1 - hw/smbios/smbios.c | 1 + hw/vfio/migration-multifd.c | 1 - hw/virtio/virtio-pci.c | 1 + hw/vmapple/virtio-blk.c | 1 - target/arm/cpu.c | 1 - target/i386/tcg/system/excp_helper.c | 1 - target/i386/xsave_helper.c | 1 - target/riscv/vector_helper.c | 1 - tests/tcg/plugins/mem.c | 1 + 34 files changed, 87 insertions(+), 93 deletions(-) diff --git a/include/exec/tswap.h b/include/exec/tswap.h index 55ffa633598..72219e2c431 100644 --- a/include/exec/tswap.h +++ b/include/exec/tswap.h @@ -69,74 +69,4 @@ static inline void tswap64s(uint64_t *s) } } =20 -/* Return ld{word}_{le,be}_p following target endianness. */ -#define LOAD_IMPL(word, args...) \ -do { \ - if (target_big_endian()) { \ - return glue(glue(ld, word), _be_p)(args); \ - } else { \ - return glue(glue(ld, word), _le_p)(args); \ - } \ -} while (0) - -static inline int lduw_p(const void *ptr) -{ - LOAD_IMPL(uw, ptr); -} - -static inline int ldsw_p(const void *ptr) -{ - LOAD_IMPL(sw, ptr); -} - -static inline int ldl_p(const void *ptr) -{ - LOAD_IMPL(l, ptr); -} - -static inline uint64_t ldq_p(const void *ptr) -{ - LOAD_IMPL(q, ptr); -} - -static inline uint64_t ldn_p(const void *ptr, int sz) -{ - LOAD_IMPL(n, ptr, sz); -} - -#undef LOAD_IMPL - -/* Call st{word}_{le,be}_p following target endianness. */ -#define STORE_IMPL(word, args...) \ -do { \ - if (target_big_endian()) { \ - glue(glue(st, word), _be_p)(args); \ - } else { \ - glue(glue(st, word), _le_p)(args); \ - } \ -} while (0) - - -static inline void stw_p(void *ptr, uint16_t v) -{ - STORE_IMPL(w, ptr, v); -} - -static inline void stl_p(void *ptr, uint32_t v) -{ - STORE_IMPL(l, ptr, v); -} - -static inline void stq_p(void *ptr, uint64_t v) -{ - STORE_IMPL(q, ptr, v); -} - -static inline void stn_p(void *ptr, int sz, uint64_t v) -{ - STORE_IMPL(n, ptr, sz, v); -} - -#undef STORE_IMPL - #endif /* TSWAP_H */ diff --git a/include/qemu/bswap.h b/include/qemu/bswap.h index 9a117645360..39ba64046a6 100644 --- a/include/qemu/bswap.h +++ b/include/qemu/bswap.h @@ -1,6 +1,8 @@ #ifndef BSWAP_H #define BSWAP_H =20 +#include "qemu/target-info.h" + #undef bswap16 #define bswap16(_x) __builtin_bswap16(_x) #undef bswap32 @@ -432,4 +434,75 @@ DO_STN_LDN_P(be) #undef le_bswaps #undef be_bswaps =20 + +/* Return ld{word}_{le,be}_p following target endianness. */ +#define LOAD_IMPL(word, args...) \ +do { \ + if (target_big_endian()) { \ + return glue(glue(ld, word), _be_p)(args); \ + } else { \ + return glue(glue(ld, word), _le_p)(args); \ + } \ +} while (0) + +static inline int lduw_p(const void *ptr) +{ + LOAD_IMPL(uw, ptr); +} + +static inline int ldsw_p(const void *ptr) +{ + LOAD_IMPL(sw, ptr); +} + +static inline int ldl_p(const void *ptr) +{ + LOAD_IMPL(l, ptr); +} + +static inline uint64_t ldq_p(const void *ptr) +{ + LOAD_IMPL(q, ptr); +} + +static inline uint64_t ldn_p(const void *ptr, int sz) +{ + LOAD_IMPL(n, ptr, sz); +} + +#undef LOAD_IMPL + +/* Call st{word}_{le,be}_p following target endianness. */ +#define STORE_IMPL(word, args...) \ +do { \ + if (target_big_endian()) { \ + glue(glue(st, word), _be_p)(args); \ + } else { \ + glue(glue(st, word), _le_p)(args); \ + } \ +} while (0) + + +static inline void stw_p(void *ptr, uint16_t v) +{ + STORE_IMPL(w, ptr, v); +} + +static inline void stl_p(void *ptr, uint32_t v) +{ + STORE_IMPL(l, ptr, v); +} + +static inline void stq_p(void *ptr, uint64_t v) +{ + STORE_IMPL(q, ptr, v); +} + +static inline void stn_p(void *ptr, int sz, uint64_t v) +{ + STORE_IMPL(n, ptr, sz, v); +} + +#undef STORE_IMPL + #endif /* BSWAP_H */ diff --git a/include/system/memory.h b/include/system/memory.h index 46248d4a52c..3ba34d49ba3 100644 --- a/include/system/memory.h +++ b/include/system/memory.h @@ -19,7 +19,6 @@ #include "exec/memattrs.h" #include "exec/memop.h" #include "exec/ramlist.h" -#include "exec/tswap.h" #include "qemu/bswap.h" #include "qemu/queue.h" #include "qemu/int128.h" diff --git a/include/user/abitypes.h b/include/user/abitypes.h index 7528124b62f..be7a8765238 100644 --- a/include/user/abitypes.h +++ b/include/user/abitypes.h @@ -6,7 +6,6 @@ #endif =20 #include "exec/cpu-defs.h" -#include "exec/tswap.h" #include "user/tswap-target.h" =20 #ifdef TARGET_ABI32 diff --git a/target/ppc/mmu-hash64.h b/target/ppc/mmu-hash64.h index b8fb12a9705..ae8d4b37aed 100644 --- a/target/ppc/mmu-hash64.h +++ b/target/ppc/mmu-hash64.h @@ -1,8 +1,6 @@ #ifndef MMU_HASH64_H #define MMU_HASH64_H =20 -#include "exec/tswap.h" - #ifndef CONFIG_USER_ONLY =20 #ifdef TARGET_PPC64 diff --git a/hw/acpi/bios-linker-loader.c b/hw/acpi/bios-linker-loader.c index 108061828b1..c9ffe449aac 100644 --- a/hw/acpi/bios-linker-loader.c +++ b/hw/acpi/bios-linker-loader.c @@ -22,8 +22,6 @@ #include "hw/acpi/bios-linker-loader.h" #include "hw/nvram/fw_cfg.h" =20 -#include "qemu/bswap.h" - /* * Linker/loader is a paravirtualized interface that passes commands to gu= est. * The commands can be used to request guest to diff --git a/hw/arm/allwinner-r40.c b/hw/arm/allwinner-r40.c index 0bf700865c2..c8eda39957c 100644 --- a/hw/arm/allwinner-r40.c +++ b/hw/arm/allwinner-r40.c @@ -20,7 +20,6 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "qemu/error-report.h" -#include "qemu/bswap.h" #include "qemu/module.h" #include "qemu/units.h" #include "hw/boards.h" diff --git a/hw/arm/boot.c b/hw/arm/boot.c index becd827af13..d391cd01bb1 100644 --- a/hw/arm/boot.c +++ b/hw/arm/boot.c @@ -15,6 +15,7 @@ #include "hw/arm/boot.h" #include "hw/arm/linux-boot-if.h" #include "cpu.h" +#include "exec/tswap.h" #include "exec/target_page.h" #include "system/kvm.h" #include "system/tcg.h" @@ -29,6 +30,7 @@ #include "qemu/config-file.h" #include "qemu/option.h" #include "qemu/units.h" +#include "qemu/bswap.h" =20 /* Kernel boot protocol is specified in the kernel docs * Documentation/arm/Booting and Documentation/arm64/booting.txt diff --git a/hw/arm/npcm7xx.c b/hw/arm/npcm7xx.c index 2f30c49df55..ecfae328a96 100644 --- a/hw/arm/npcm7xx.c +++ b/hw/arm/npcm7xx.c @@ -24,7 +24,7 @@ #include "hw/qdev-clock.h" #include "hw/qdev-properties.h" #include "qapi/error.h" -#include "qemu/bswap.h" +#include "exec/tswap.h" #include "qemu/units.h" #include "system/system.h" #include "target/arm/cpu-qom.h" diff --git a/hw/block/hd-geometry.c b/hw/block/hd-geometry.c index f3939e73f42..db221901cf4 100644 --- a/hw/block/hd-geometry.c +++ b/hw/block/hd-geometry.c @@ -33,7 +33,6 @@ #include "qemu/osdep.h" #include "system/block-backend.h" #include "qapi/qapi-types-block.h" -#include "qemu/bswap.h" #include "hw/block/block.h" #include "trace.h" =20 diff --git a/hw/char/riscv_htif.c b/hw/char/riscv_htif.c index c884be5d757..a78ea9b01c0 100644 --- a/hw/char/riscv_htif.c +++ b/hw/char/riscv_htif.c @@ -29,7 +29,6 @@ #include "qemu/timer.h" #include "qemu/error-report.h" #include "system/address-spaces.h" -#include "exec/tswap.h" #include "system/dma.h" #include "system/runstate.h" #include "trace.h" diff --git a/hw/cxl/cxl-events.c b/hw/cxl/cxl-events.c index 12dee2e4675..f90470930d6 100644 --- a/hw/cxl/cxl-events.c +++ b/hw/cxl/cxl-events.c @@ -8,8 +8,6 @@ */ =20 #include "qemu/osdep.h" - -#include "qemu/bswap.h" #include "qemu/error-report.h" #include "hw/pci/msi.h" #include "hw/pci/msix.h" diff --git a/hw/display/artist.c b/hw/display/artist.c index 3fafc8a222b..3c884c92437 100644 --- a/hw/display/artist.c +++ b/hw/display/artist.c @@ -12,6 +12,7 @@ #include "qemu/log.h" #include "qemu/module.h" #include "qemu/units.h" +#include "qemu/bswap.h" #include "qapi/error.h" #include "hw/sysbus.h" #include "hw/loader.h" diff --git a/hw/display/ati.c b/hw/display/ati.c index 7de27732cdc..f7c0006a879 100644 --- a/hw/display/ati.c +++ b/hw/display/ati.c @@ -22,6 +22,7 @@ #include "vga-access.h" #include "hw/qdev-properties.h" #include "vga_regs.h" +#include "qemu/bswap.h" #include "qemu/log.h" #include "qemu/module.h" #include "qemu/error-report.h" diff --git a/hw/net/can/ctucan_core.c b/hw/net/can/ctucan_core.c index 17131a4e18f..6bd99c477b2 100644 --- a/hw/net/can/ctucan_core.c +++ b/hw/net/can/ctucan_core.c @@ -28,7 +28,6 @@ =20 #include "qemu/osdep.h" #include "qemu/log.h" -#include "qemu/bswap.h" #include "qemu/bitops.h" #include "hw/irq.h" #include "migration/vmstate.h" diff --git a/hw/net/lan9118.c b/hw/net/lan9118.c index 6dda1e5c940..3017e129710 100644 --- a/hw/net/lan9118.c +++ b/hw/net/lan9118.c @@ -21,6 +21,7 @@ #include "hw/ptimer.h" #include "hw/qdev-properties.h" #include "qapi/error.h" +#include "qemu/bswap.h" #include "qemu/log.h" #include "qemu/module.h" #include /* for crc32 */ diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c index 654a087d80a..324fb932aac 100644 --- a/hw/net/rtl8139.c +++ b/hw/net/rtl8139.c @@ -57,6 +57,7 @@ #include "system/dma.h" #include "qemu/module.h" #include "qemu/timer.h" +#include "qemu/bswap.h" #include "net/net.h" #include "net/eth.h" #include "system/system.h" diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c index 7c0ca56b7c0..af73aa8ef28 100644 --- a/hw/net/vmxnet3.c +++ b/hw/net/vmxnet3.c @@ -22,7 +22,6 @@ #include "net/tap.h" #include "net/checksum.h" #include "system/system.h" -#include "qemu/bswap.h" #include "qemu/log.h" #include "qemu/module.h" #include "hw/pci/msix.h" diff --git a/hw/pci-host/gt64120.c b/hw/pci-host/gt64120.c index b12a25696c4..b1d96f62fe9 100644 --- a/hw/pci-host/gt64120.c +++ b/hw/pci-host/gt64120.c @@ -28,6 +28,7 @@ #include "qapi/error.h" #include "qemu/units.h" #include "qemu/log.h" +#include "qemu/bswap.h" #include "hw/qdev-properties.h" #include "hw/registerfields.h" #include "hw/pci/pci_device.h" diff --git a/hw/pci-host/pnv_phb3.c b/hw/pci-host/pnv_phb3.c index a4335f44f22..5d8383fac30 100644 --- a/hw/pci-host/pnv_phb3.c +++ b/hw/pci-host/pnv_phb3.c @@ -8,6 +8,7 @@ */ #include "qemu/osdep.h" #include "qemu/log.h" +#include "qemu/bswap.h" #include "qapi/visitor.h" #include "qapi/error.h" #include "hw/pci-host/pnv_phb3_regs.h" diff --git a/hw/pci-host/pnv_phb4.c b/hw/pci-host/pnv_phb4.c index 77ea35299d3..18992054e83 100644 --- a/hw/pci-host/pnv_phb4.c +++ b/hw/pci-host/pnv_phb4.c @@ -8,6 +8,7 @@ */ #include "qemu/osdep.h" #include "qemu/log.h" +#include "qemu/bswap.h" #include "qapi/visitor.h" #include "qapi/error.h" #include "target/ppc/cpu.h" diff --git a/hw/pci-host/ppce500.c b/hw/pci-host/ppce500.c index 52269b05bb1..975d191ccb8 100644 --- a/hw/pci-host/ppce500.c +++ b/hw/pci-host/ppce500.c @@ -20,7 +20,6 @@ #include "migration/vmstate.h" #include "hw/pci/pci_device.h" #include "hw/pci/pci_host.h" -#include "qemu/bswap.h" #include "hw/pci-host/ppce500.h" #include "qom/object.h" =20 diff --git a/hw/pci-host/sh_pci.c b/hw/pci-host/sh_pci.c index de8f6a84aab..62fb945075f 100644 --- a/hw/pci-host/sh_pci.c +++ b/hw/pci-host/sh_pci.c @@ -28,7 +28,6 @@ #include "hw/irq.h" #include "hw/pci/pci_device.h" #include "hw/pci/pci_host.h" -#include "qemu/bswap.h" #include "qemu/module.h" #include "qom/object.h" =20 diff --git a/hw/s390x/s390-pci-inst.c b/hw/s390x/s390-pci-inst.c index b5dddb22b84..a3bb5aa2216 100644 --- a/hw/s390x/s390-pci-inst.c +++ b/hw/s390x/s390-pci-inst.c @@ -16,6 +16,7 @@ #include "exec/target_page.h" #include "system/memory.h" #include "qemu/error-report.h" +#include "qemu/bswap.h" #include "system/hw_accel.h" #include "hw/boards.h" #include "hw/pci/pci_device.h" diff --git a/hw/sensor/lsm303dlhc_mag.c b/hw/sensor/lsm303dlhc_mag.c index f9e501da840..cd5773ae64e 100644 --- a/hw/sensor/lsm303dlhc_mag.c +++ b/hw/sensor/lsm303dlhc_mag.c @@ -28,7 +28,6 @@ #include "qapi/visitor.h" #include "qemu/module.h" #include "qemu/log.h" -#include "qemu/bswap.h" =20 enum LSM303DLHCMagReg { LSM303DLHC_MAG_REG_CRA =3D 0x00, diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c index ad4cd6721e6..1ac063cfb4b 100644 --- a/hw/smbios/smbios.c +++ b/hw/smbios/smbios.c @@ -17,6 +17,7 @@ =20 #include "qemu/osdep.h" #include "qemu/units.h" +#include "qemu/bswap.h" #include "qapi/error.h" #include "qemu/config-file.h" #include "qemu/module.h" diff --git a/hw/vfio/migration-multifd.c b/hw/vfio/migration-multifd.c index 850a3194887..69e57833dbd 100644 --- a/hw/vfio/migration-multifd.c +++ b/hw/vfio/migration-multifd.c @@ -13,7 +13,6 @@ #include "hw/vfio/vfio-device.h" #include "migration/misc.h" #include "qapi/error.h" -#include "qemu/bswap.h" #include "qemu/error-report.h" #include "qemu/lockable.h" #include "qemu/main-loop.h" diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index fba2372c93b..767216d7959 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -30,6 +30,7 @@ #include "qemu/error-report.h" #include "qemu/log.h" #include "qemu/module.h" +#include "qemu/bswap.h" #include "hw/pci/msi.h" #include "hw/pci/msix.h" #include "hw/loader.h" diff --git a/hw/vmapple/virtio-blk.c b/hw/vmapple/virtio-blk.c index 532b5649ab7..9de9aaae0bf 100644 --- a/hw/vmapple/virtio-blk.c +++ b/hw/vmapple/virtio-blk.c @@ -19,7 +19,6 @@ #include "hw/vmapple/vmapple.h" #include "hw/virtio/virtio-blk.h" #include "hw/virtio/virtio-pci.h" -#include "qemu/bswap.h" #include "qemu/log.h" #include "qemu/module.h" #include "qapi/error.h" diff --git a/target/arm/cpu.c b/target/arm/cpu.c index ebac86f70d3..baaa13aed6d 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -23,7 +23,6 @@ #include "qemu/timer.h" #include "qemu/log.h" #include "exec/page-vary.h" -#include "exec/tswap.h" #include "target/arm/idau.h" #include "qemu/module.h" #include "qapi/error.h" diff --git a/target/i386/tcg/system/excp_helper.c b/target/i386/tcg/system/= excp_helper.c index c1626215877..50040f6fcaf 100644 --- a/target/i386/tcg/system/excp_helper.c +++ b/target/i386/tcg/system/excp_helper.c @@ -25,7 +25,6 @@ #include "exec/page-protection.h" #include "exec/target_page.h" #include "exec/tlb-flags.h" -#include "exec/tswap.h" #include "tcg/helper-tcg.h" =20 typedef struct TranslateParams { diff --git a/target/i386/xsave_helper.c b/target/i386/xsave_helper.c index 24ab7be8e9a..996e9f3bfef 100644 --- a/target/i386/xsave_helper.c +++ b/target/i386/xsave_helper.c @@ -5,7 +5,6 @@ #include "qemu/osdep.h" =20 #include "cpu.h" -#include "exec/tswap.h" =20 void x86_cpu_xsave_all_areas(X86CPU *cpu, void *buf, uint32_t buflen) { diff --git a/target/riscv/vector_helper.c b/target/riscv/vector_helper.c index b41c29da0be..7c67d67a13f 100644 --- a/target/riscv/vector_helper.c +++ b/target/riscv/vector_helper.c @@ -27,7 +27,6 @@ #include "exec/helper-proto.h" #include "exec/tlb-flags.h" #include "exec/target_page.h" -#include "exec/tswap.h" #include "fpu/softfloat.h" #include "tcg/tcg-gvec-desc.h" #include "internals.h" diff --git a/tests/tcg/plugins/mem.c b/tests/tcg/plugins/mem.c index ca4e8883dd2..9649bce99ca 100644 --- a/tests/tcg/plugins/mem.c +++ b/tests/tcg/plugins/mem.c @@ -20,6 +20,7 @@ * few things provided by compiler.h. */ #include +#include #include #include =20 --=20 2.49.0 From nobody Sat Dec 13 22:59:00 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=1751909199; cv=none; d=zohomail.com; s=zohoarc; b=kkEf7Lp+blle1DF5sFgKFrvKVGq2MzN86OjGaJy+Xyl4pNbH/8hGx5Z+gZjKfl36Wq9KSYVD2lnDn/v8s9Vl97e1hAXsaDF843GPFdK35adzvkXkYcPomVRoF5saCIyzxtSOCf9po/+fqztHCqGBrI/BBsrZPJV51hVtKLKdSzA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751909199; 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=8lDaJH6Ce53XuxvTc0s491uDx3B3bM8+Y+iNdGUdVDY=; b=Ow1QJRVe3/A94Z5+MF08mcLrQOIADT/JAMJu+MMV/F3In6iSD6uQwWijjGtckhjgTpQb0d/iAlHYD0al4mnAMtNEfDe7mx0JLWARePR2xhgDv0hErWVqEF21SOkylhopej7T8v1E+RF/RuMNXaAZRqGqoil2yoVLO17Chw0QIcA= 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 1751909199474123.54474952196972; Mon, 7 Jul 2025 10:26:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uYpYf-0006F4-Lj; Mon, 07 Jul 2025 13:23:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uYpWf-0000tb-Lm for qemu-devel@nongnu.org; Mon, 07 Jul 2025 13:21:16 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uYpWY-0005BG-UJ for qemu-devel@nongnu.org; Mon, 07 Jul 2025 13:21:05 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-4531e146a24so23931495e9.0 for ; Mon, 07 Jul 2025 10:21:00 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b47040161bsm10692655f8f.4.2025.07.07.10.20.57 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 07 Jul 2025 10:20:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751908859; x=1752513659; 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=8lDaJH6Ce53XuxvTc0s491uDx3B3bM8+Y+iNdGUdVDY=; b=Rx86VCTHlCv0wU0GqeRyP6zwJLiGHjONm/RpAb0hP1OEyJc5yYubxFbuIeVElsN+n1 eoPI1QgSAh92cfrrmKaZ3euyoSHFIWens4YUF/gP+mSX4Xl8VxmktlR3r//6vsaG5tY2 uLsLUPIPjHEc9B0pvw2MuJjkjNFugNkE/RcFjYKqCADJIvC6YlcP+BeM63AOiE5XnfMF 8rS0/IBt33hVWgD4azqhaMr4IMxd6Dh4j65384tUjLesmZtXsQCkpLHGJW8nt9ku55rp Zj+WdVMiNUtAkOHJBoAWMr/xEnd7l/R3eh4LdoXJZzKr1nKEHh3R29CDlBCjGdSiTgTB IXDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751908859; x=1752513659; 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=8lDaJH6Ce53XuxvTc0s491uDx3B3bM8+Y+iNdGUdVDY=; b=BcDuaoxc2qeix//pDa6mByU1oq4gXyoJnxLkUjur64998DUvgrRw70ziklaMPGjAio WxIjW0TrJ5+nLid+vwqxWPv514RJd1Q13JNyK/814bIPUkxnXYDkwwWQY7Fa7eRabZlX WK/u6hYBICKz1wYEKmHCcTmAP1Kbpf13x7ZoIcb/eGZv7sBJpnROTG/nY4HTXiMzWbaf /RJs0nevc54D51oOxkOIxESpoashb3DVfoYuyICL79nlwv2HNLF47z+QHzNRl4Ax2mNY xh5oVq9PtrTRm+AYp/efJRplr8afDt8O0jjJUS+cJhIT1P9C/7/rST3/hmFqOputO2e9 X9PQ== X-Gm-Message-State: AOJu0YxXDJmseQWK0734ruqcl6fjJ4tGYtXIVZbraIuleBoVAO0G0OGi fviyYx2pHTSPobOHhJaN+Nq+u4Uhc1GQOmhqXD+J0fQTzv4AgfrfrVRihE9XFGw8xm6Yso3thw0 Qa1Cn8Sg= X-Gm-Gg: ASbGncvammiWUJnt29445RBBsHvDHR4UM6n+uKM9Fy7i3nMOcaPc/pzeXWBPSWXF3yk fAnVkyIthdBe6qvBN6H0wY+mb7D7xWQ8cQdZek50ASactDD7S2YbQAaqHQeOQbWkx1uhqlzXXZB 0x0w217BIseJCJGwNhEZ9IHOw8MEEwaQPAmP6wILSDCQsMdbkW2cwfWclFv9wje//tQRw19Wdmr OhRNMdxQY/mcZWv8LwVc4zc3AxadMJOXelA34ysYf/1TTzn3IF58/8MpZkwi1Oz8quig/mSUd28 vhqcNvE6G14oj6pZuy1j7rx6N7WlvzRr8mnOI+WBSZaf0Q8vn9vS+jGTwBH3STv2R9byuqFnZSD yOM0vOMenoGaa8ieZm4kgf8PZRphUWrWQKlBY X-Google-Smtp-Source: AGHT+IFz7F32N7Ofbk3BqanonWCW/gDDJTCEpN0e8m21S47/jx+luTuR3jluFTHsrv8uZNwF5aWxFA== X-Received: by 2002:a05:600c:6303:b0:442:dc75:5625 with SMTP id 5b1f17b1804b1-454ccfada1fmr1254505e9.5.1751908858528; Mon, 07 Jul 2025 10:20:58 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierrick Bouvier , qemu-block@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, Paolo Bonzini , qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Kevin Wolf , Hanna Reitz Subject: [PATCH-for-10.1 v6 09/14] hw/virtio: Build various files once Date: Mon, 7 Jul 2025 19:20:03 +0200 Message-ID: <20250707172009.3884-10-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250707172009.3884-1-philmd@linaro.org> References: <20250707172009.3884-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::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.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=unavailable 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: 1751909201681116600 Now than various VirtIO files don't use target specific API anymore, we can move them to the system_ss[] source set to build them once. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Manos Pitsidianakis --- hw/virtio/virtio-config-io.c | 1 - hw/block/meson.build | 6 ++++-- hw/virtio/meson.build | 20 +++++++++++--------- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/hw/virtio/virtio-config-io.c b/hw/virtio/virtio-config-io.c index ad78e0b9bc5..f58d90b6e31 100644 --- a/hw/virtio/virtio-config-io.c +++ b/hw/virtio/virtio-config-io.c @@ -11,7 +11,6 @@ =20 #include "qemu/osdep.h" #include "hw/virtio/virtio.h" -#include "cpu.h" =20 uint32_t virtio_config_readb(VirtIODevice *vdev, uint32_t addr) { diff --git a/hw/block/meson.build b/hw/block/meson.build index 655704471a5..43ed296cf47 100644 --- a/hw/block/meson.build +++ b/hw/block/meson.build @@ -13,7 +13,9 @@ system_ss.add(when: 'CONFIG_SSI_M25P80', if_true: files('= m25p80_sfdp.c')) system_ss.add(when: 'CONFIG_SWIM', if_true: files('swim.c')) system_ss.add(when: 'CONFIG_XEN_BUS', if_true: files('xen-block.c')) =20 -specific_ss.add(when: 'CONFIG_VIRTIO_BLK', if_true: files('virtio-blk.c', = 'virtio-blk-common.c')) -specific_ss.add(when: 'CONFIG_VHOST_USER_BLK', if_true: files('vhost-user-= blk.c', 'virtio-blk-common.c')) +specific_ss.add(when: 'CONFIG_VIRTIO_BLK', if_true: files('virtio-blk.c')) +system_ss.add(when: 'CONFIG_VIRTIO_BLK', if_true: files('virtio-blk-common= .c')) +specific_ss.add(when: 'CONFIG_VHOST_USER_BLK', if_true: files('vhost-user-= blk.c')) +system_ss.add(when: 'CONFIG_VHOST_USER_BLK', if_true: files('virtio-blk-co= mmon.c')) =20 subdir('dataplane') diff --git a/hw/virtio/meson.build b/hw/virtio/meson.build index 164f6fd995a..3ea7b3cec83 100644 --- a/hw/virtio/meson.build +++ b/hw/virtio/meson.build @@ -1,6 +1,7 @@ system_virtio_ss =3D ss.source_set() system_virtio_ss.add(files('virtio-bus.c')) system_virtio_ss.add(files('iothread-vq-mapping.c')) +system_virtio_ss.add(files('virtio-config-io.c')) system_virtio_ss.add(when: 'CONFIG_VIRTIO_PCI', if_true: files('virtio-pci= .c')) system_virtio_ss.add(when: 'CONFIG_VIRTIO_MMIO', if_true: files('virtio-mm= io.c')) system_virtio_ss.add(when: 'CONFIG_VIRTIO_CRYPTO', if_true: files('virtio-= crypto.c')) @@ -10,11 +11,11 @@ system_virtio_ss.add(when: 'CONFIG_VHOST_VDPA_DEV', if_= true: files('vdpa-dev.c') =20 specific_virtio_ss =3D ss.source_set() specific_virtio_ss.add(files('virtio.c')) -specific_virtio_ss.add(files('virtio-config-io.c', 'virtio-qmp.c')) +specific_virtio_ss.add(files('virtio-qmp.c')) =20 if have_vhost system_virtio_ss.add(files('vhost.c')) - specific_virtio_ss.add(files('vhost-backend.c', 'vhost-iova-tree.c')) + system_virtio_ss.add(files('vhost-backend.c', 'vhost-iova-tree.c')) if have_vhost_user # fixme - this really should be generic specific_virtio_ss.add(files('vhost-user.c')) @@ -43,22 +44,22 @@ if have_vhost endif if have_vhost_vdpa system_virtio_ss.add(files('vhost-vdpa.c')) - specific_virtio_ss.add(files('vhost-shadow-virtqueue.c')) + system_virtio_ss.add(files('vhost-shadow-virtqueue.c')) endif else system_virtio_ss.add(files('vhost-stub.c')) endif +system_virtio_ss.add(when: 'CONFIG_VHOST_USER_VSOCK', if_true: files('vhos= t-user-vsock.c')) +system_virtio_ss.add(when: 'CONFIG_VIRTIO_RNG', if_true: files('virtio-rng= .c')) =20 specific_virtio_ss.add(when: 'CONFIG_VIRTIO_BALLOON', if_true: files('virt= io-balloon.c')) specific_virtio_ss.add(when: 'CONFIG_VHOST_USER_FS', if_true: files('vhost= -user-fs.c')) specific_virtio_ss.add(when: 'CONFIG_VIRTIO_PMEM', if_true: files('virtio-= pmem.c')) specific_virtio_ss.add(when: 'CONFIG_VHOST_VSOCK', if_true: files('vhost-v= sock.c')) -specific_virtio_ss.add(when: 'CONFIG_VHOST_USER_VSOCK', if_true: files('vh= ost-user-vsock.c')) -specific_virtio_ss.add(when: 'CONFIG_VIRTIO_RNG', if_true: files('virtio-r= ng.c')) -specific_virtio_ss.add(when: 'CONFIG_VIRTIO_NSM', if_true: [files('virtio-= nsm.c', 'cbor-helpers.c'), libcbor]) specific_virtio_ss.add(when: 'CONFIG_VIRTIO_MEM', if_true: files('virtio-m= em.c')) -specific_virtio_ss.add(when: 'CONFIG_VHOST_USER_SCMI', if_true: files('vho= st-user-scmi.c')) -specific_virtio_ss.add(when: ['CONFIG_VIRTIO_PCI', 'CONFIG_VHOST_USER_SCMI= '], if_true: files('vhost-user-scmi-pci.c')) +system_virtio_ss.add(when: 'CONFIG_VIRTIO_NSM', if_true: files('virtio-nsm= .c')) +system_virtio_ss.add(when: 'CONFIG_VIRTIO_NSM', if_true: [files('cbor-help= ers.c'), libcbor]) +system_virtio_ss.add(when: 'CONFIG_VHOST_USER_SCMI', if_true: files('vhost= -user-scmi.c')) =20 virtio_pci_ss =3D ss.source_set() virtio_pci_ss.add(when: 'CONFIG_VHOST_VSOCK', if_true: files('vhost-vsock-= pci.c')) @@ -67,6 +68,7 @@ virtio_pci_ss.add(when: 'CONFIG_VHOST_USER_BLK', if_true:= files('vhost-user-blk- virtio_pci_ss.add(when: 'CONFIG_VHOST_USER_SCSI', if_true: files('vhost-us= er-scsi-pci.c')) virtio_pci_ss.add(when: 'CONFIG_VHOST_SCSI', if_true: files('vhost-scsi-pc= i.c')) virtio_pci_ss.add(when: 'CONFIG_VHOST_USER_FS', if_true: files('vhost-user= -fs-pci.c')) +virtio_pci_ss.add(when: 'CONFIG_VHOST_USER_SCMI', if_true: files('vhost-us= er-scmi-pci.c')) =20 virtio_pci_ss.add(when: 'CONFIG_VIRTIO_CRYPTO', if_true: files('virtio-cry= pto-pci.c')) virtio_pci_ss.add(when: 'CONFIG_VIRTIO_INPUT_HOST', if_true: files('virtio= -input-host-pci.c')) @@ -85,7 +87,7 @@ virtio_pci_ss.add(when: 'CONFIG_VIRTIO_MEM', if_true: fil= es('virtio-mem-pci.c')) virtio_pci_ss.add(when: 'CONFIG_VHOST_VDPA_DEV', if_true: files('vdpa-dev-= pci.c')) virtio_pci_ss.add(when: 'CONFIG_VIRTIO_MD', if_true: files('virtio-md-pci.= c')) =20 -specific_virtio_ss.add_all(when: 'CONFIG_VIRTIO_PCI', if_true: virtio_pci_= ss) +system_virtio_ss.add_all(when: 'CONFIG_VIRTIO_PCI', if_true: virtio_pci_ss) =20 system_ss.add_all(when: 'CONFIG_VIRTIO', if_true: system_virtio_ss) system_ss.add(when: 'CONFIG_VIRTIO', if_false: files('vhost-stub.c')) --=20 2.49.0 From nobody Sat Dec 13 22:59:00 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=1751908987; cv=none; d=zohomail.com; s=zohoarc; b=LB99hJBJoR/By1YlYt6iUquUeE+5LdpIZf9KOdUjgrHvplaBp++U7XuAgPo8cjdYNlUtjKSn5/GHZKleGxnTrboLOe+Rh2MNcyxS4yMp0aQXLJ8n4/gSrWxfuEIRlrMH9l2BPOOXMCREclNgOKjv4HiG/W4hNzbWABr+UDQd3z0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751908987; 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=jqODDGmVZwWpLG85t5AjRhEjZXJgSLCLXmN69PZ4Bno=; b=RvZXwQeWT24zCbIbG511go9jm0+CuVM42RZYU37joqJZygXcwpkDA02qYdlTPjc1wv/dvx0Su3c72VtpGp4Nue/X4j+1PST60qOinf4wzpWljybMHuA4lPKLDTpdpGyro7ZJzHrvH9dLEf/krCY8wvb9kg1/G4lGgLXntKy0cIg= 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 1751908987340957.2081681480889; Mon, 7 Jul 2025 10:23:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uYpY0-0003ct-RD; Mon, 07 Jul 2025 13:22:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uYpWo-0000wh-3G for qemu-devel@nongnu.org; Mon, 07 Jul 2025 13:21:18 -0400 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 1uYpWk-0005CQ-Up for qemu-devel@nongnu.org; Mon, 07 Jul 2025 13:21:17 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-451d6ade159so29957915e9.1 for ; Mon, 07 Jul 2025 10:21:05 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-454b161e8fcsm122271075e9.7.2025.07.07.10.21.02 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 07 Jul 2025 10:21:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751908863; x=1752513663; 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=jqODDGmVZwWpLG85t5AjRhEjZXJgSLCLXmN69PZ4Bno=; b=zYT6tcE9nRHOtCk+jYfqKkZZ+8G6aPt22pNdoezSBiboDiQYRiqksYtmhvCUikolNP GLFCj1q754AzAOPSFs1FhSjSnY1Un8QBpPlt9Ys68b2W4g3EXes5aQtsirHvkuBsUUzc G6P2mAKXn/CzHwb5wNeo0DbJQiiWk0miFn60tVXC6XnP0A3jh+irRArmAgIh/dYFbZ7J zbEr0VMJ59ppcXeoVE3fvifa2cy68x5ABybjsz1Ip42w3oPfEOX2t7kxcl5jU3QADsVX EgvR1umfKKUSP/9W066kafJL/3Au7FkcvZZ+XqIomE5kTlQ++NKwRuZYEscnspUltgOJ b+Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751908863; x=1752513663; 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=jqODDGmVZwWpLG85t5AjRhEjZXJgSLCLXmN69PZ4Bno=; b=IMYZpcNzFgc60Q2pnnIw5lI3lTrFWVs7Q5P2LFpQ0LJehqaOxJTnR1Jx+jTl/H/7U5 E+Y1pjqwouNhnuUo/VB14ZtJtt6KS6f1wX4msQS6XIlyfdNKfQin4cStgQVS91yhpLcJ 86j8AGHVxEzL6PisQyPFYXAVlwICbY70JPLObGuFNq9Km2nk5FhEw7tGhbBMJJqGQYoh g+5K79SGxstWjQrk5EdZhnTiJwdbwli5a3w1hdh2s/kb2ezf7gP5DsjRdbfisbfjMN8N pseeCbLGJoNIDLuetKRkeFh7oyw4876TbNZbtxrQovn8t7lS3fQ0m+pwneu/Jgb5FAIk Au5g== X-Gm-Message-State: AOJu0YzCJ+cG051nyvZuDXLMrqWMLNUaj4CIyfWgxb5Wcuo99Xq9szGe 93kEBgD49Cp9L8TqIvhBQwq8LiIW+D0Ik4zwrds71zRsJ0Z8lM2Qgy0xJBRK2L250b8ad91Ffp8 ndug0lZk= X-Gm-Gg: ASbGncvrSbuVM5A1YvJsw480ROGzBsF4/uBQtWGmr4WYBs/MiNfaN+erx1pUX+XpakF NmXdSjA476uQKYT1zaatHtjmMqVAKGpifFnwm6QtQ8XMVIQRzDyl+VePVXIbBxXi2PrIlgJo78D 8CYWzfvDJd7D3XA7TT5Bl41S8OYQF9t+CK3bEGNBJYJ2qsi3dLu8hJNygrj+ltJ0YB/q8k00aiR Adr0HEkMgSuV4VO97yjL0mGeTSSN2BqdHiMtvwajLAygLhY7z88pi7JlEUFRgTuCdxwBJhsf+nJ EmbhTcE3v0JEP6ZtM1ewrgyksPnUr7aPcHsDM3+ulcKw5pVcpwUIx5TO6wYh4+kXJymJiYFw75L ybNhygFYCfZ5oIQ97OEwr792bO/4eWx/u30b9 X-Google-Smtp-Source: AGHT+IH4AKONYKk8WayseeK6glA6RWMBLDwrfBPAg+NlginweazDCvf0XL2oKfGi1AQj0zCr2pB27w== X-Received: by 2002:a05:600c:8885:b0:450:d5bf:6720 with SMTP id 5b1f17b1804b1-454b5e9a2ffmr100958275e9.3.1751908863459; Mon, 07 Jul 2025 10:21:03 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierrick Bouvier , qemu-block@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, Paolo Bonzini , qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang , Zhao Liu Subject: [PATCH-for-10.1 v6 10/14] hw/core/null-machine: Define machine as generic QOM type Date: Mon, 7 Jul 2025 19:20:04 +0200 Message-ID: <20250707172009.3884-11-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250707172009.3884-1-philmd@linaro.org> References: <20250707172009.3884-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=unavailable 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: 1751908989301116600 While DEFINE_MACHINE() is a succinct macro, it doesn't allow registering QOM interfaces to the defined machine. Convert to the generic DEFINE_TYPES() in preparation to register interfaces. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier Reviewed-by: Zhao Liu --- hw/core/null-machine.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/hw/core/null-machine.c b/hw/core/null-machine.c index a6e477a2d88..3e03771d570 100644 --- a/hw/core/null-machine.c +++ b/hw/core/null-machine.c @@ -42,8 +42,10 @@ static void machine_none_init(MachineState *mch) } } =20 -static void machine_none_machine_init(MachineClass *mc) +static void null_machine_class_init(ObjectClass *oc, const void *data) { + MachineClass *mc =3D MACHINE_CLASS(oc); + mc->desc =3D "empty machine"; mc->init =3D machine_none_init; mc->max_cpus =3D 1; @@ -55,4 +57,12 @@ static void machine_none_machine_init(MachineClass *mc) mc->no_cdrom =3D 1; } =20 -DEFINE_MACHINE("none", machine_none_machine_init) +static const TypeInfo null_machine_types[] =3D { + { + .name =3D MACHINE_TYPE_NAME("none"), + .parent =3D TYPE_MACHINE, + .class_init =3D null_machine_class_init, + }, +}; + +DEFINE_TYPES(null_machine_types) --=20 2.49.0 From nobody Sat Dec 13 22:59:00 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=1751909193; cv=none; d=zohomail.com; s=zohoarc; b=P7RCYcZvxIrXcLsw1QN8pNGRmZjNBm/StgT0vnFu3F4ainSCPa3hjvAAsmgdrtGjwktH9PDjyEQ+rn3cWIfcO79Ru5de93W5wbN0eOjUd2VkfVVRI3W0Q0H1fqjIB1HO+Sm4ZfGcgMwHd4m+XcQcFj0zwEUeOT9TVp5tcG+WEs4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751909193; 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=tcYY49R7t8cD3E0o3RM5/WaFwIS6rVmkHsnfg7UE9No=; b=g9V3hABTsvCzAKkcs6bM6FtJFOf5Op0xiwqG3tUyHndI0CPUQ3N8JYJGZG7UX79TfoIvJuj4kP6kkliu0b3WAXLMGd4NJWjvxI33eNEu/kriWnoalgfbn0Co5GfeK8p/35aQw40YcXrMl2orGTSlfCpMhrEmUdKn5ZK2sVmUEQM= 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 1751909193644807.4446035916952; Mon, 7 Jul 2025 10:26:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uYpY1-0003g7-QI; Mon, 07 Jul 2025 13:22:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uYpWp-0000zK-4b for qemu-devel@nongnu.org; Mon, 07 Jul 2025 13:21:20 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uYpWl-0005Dj-77 for qemu-devel@nongnu.org; Mon, 07 Jul 2025 13:21:18 -0400 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-3a575a988f9so2131457f8f.0 for ; Mon, 07 Jul 2025 10:21:09 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-454a997b1ecsm149058215e9.11.2025.07.07.10.21.07 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 07 Jul 2025 10:21:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751908868; x=1752513668; 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=tcYY49R7t8cD3E0o3RM5/WaFwIS6rVmkHsnfg7UE9No=; b=LWkQ5G2z3d+WQpgo5dSsYEiKEWFZ5P3IJzQVgT0iTPuyrCmcTsj3+AcPlki1FnnVUL kOgax440WWD2/ppqrunriHF9tGtKLP5nqHdHl6a43aUjvjOWvItxG+Jyyw+8tI3Frle7 MpBuGObSuPwH61gHh1XPQ/QBWs1NeCohs0DSl1nEMCpY2iKl/ulqL5qYKVKvw5BJ0rNK po/4Vt2sYKecopa96VEe4y3F0JvUSR62yZ1puBOelvPDUlZSnbk4bAQm6/CuwkFn4GXD N3VcBd+RdBxVFbasoCfKgHFWmZbSrsZPNothpup5HrQqUzb6/3XAvU5c8B5tZKfBUBCg rSEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751908868; x=1752513668; 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=tcYY49R7t8cD3E0o3RM5/WaFwIS6rVmkHsnfg7UE9No=; b=BMgJ2xpi3RJzj1lZSCBz8eQW0lrVVLKsEEqv9mitNpGvw1Uvd5O5ClySFkvRjn9l+8 5OC2MkQY/QPS7E7lXIRiJiLbS8h3/EQDd7BpS86XB4qM3QMpw+54z3Kc1NNGHSOrcHKn MVqRQq1n82HyCLEKSbq1KAIlHUuYPnt/T+yVEsGNwWr4kpeckolMkbBZmxSD4ua5CF6D dA7bqSKnQWC1PEhxZYa8eyMyVXuA7pZJDtai9AJmyP7bR+ORnhVr38WFPoOWu9nSgbmu uzb33z23ixyMnB1LFSoyl4zxFtfosn36zQoqP5APUBsvakFTHiwPo6j/dsHnqbTefWax Umlw== X-Gm-Message-State: AOJu0Yy9QlptOgL0V++Lq6a7QBF4ZfkRJhnKCqhlcGvkr12tTjGuYGaG V2ayFfQoi9fMGvALbVXVAxvJba92hL9tQmHq5RIY4dtKBy1t7Qfr0dMQyiZFouYt8A0G0Vdtd2d nxdyJbwg= X-Gm-Gg: ASbGncsCjYwzaGnzlp0jG/yJSWYlLUV2g8KtA/NdxhPccoq3HsJmkW2FypiuJ5x1/xm AqRNkMwlBjCnxOA6GXpWGCHqPXreBrHyFXK7SoysU3kNv73w/jrzkSO6T0RhJo9miInzkCI/Pmp 8MYowvkwXfe8FNOH0LWzqs26RL7xAXu8HwwM7rfqxuYRu2G6q4fHgI3HFoIJuzA3f/wQ5A/jAnQ /Up8/wqfDA6eugDCGFzbBn+11j+VAkrJ1jOT9RVQqldzX6cVkjtClFFDP8CNKUPHzCH6uqGY6PK 9dRpATkAoIjLBSV1woOuQFjnePihZ+0a0BS4Fq+nW9FEjBNMsCAL5FUWD3qg1S9FZGRgVBVGMR1 SHLDxo59KSxoCkVaJb8CHawSipLLhFnecXJ11 X-Google-Smtp-Source: AGHT+IFnrPorS9WLSbdH7zTaU10K5+rThP1w8i6Qrfo5VMoicWjPRg/v6fPCP0B/272vnMAgO6/XoA== X-Received: by 2002:a05:6000:1a8c:b0:3a4:dde7:ee12 with SMTP id ffacd0b85a97d-3b49aa86c76mr7874874f8f.53.1751908868301; Mon, 07 Jul 2025 10:21:08 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierrick Bouvier , qemu-block@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, Paolo Bonzini , qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH-for-10.1 v6 11/14] hw/arm: Register TYPE_TARGET_ARM/AARCH64_MACHINE QOM interfaces Date: Mon, 7 Jul 2025 19:20:05 +0200 Message-ID: <20250707172009.3884-12-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250707172009.3884-1-philmd@linaro.org> References: <20250707172009.3884-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::436; envelope-from=philmd@linaro.org; helo=mail-wr1-x436.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=unavailable 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: 1751909195497116600 Define the TYPE_TARGET_ARM_MACHINE and TYPE_TARGET_AARCH64_MACHINE QOM interface names to allow machines to implement them. Register these interfaces in common code in target_info-qom.c used by all binaries because QOM interfaces must be registered before being checked (see next commit with the 'none' machine). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier Reviewed-by: Richard Henderson --- meson.build | 1 + include/hw/arm/machines-qom.h | 18 ++++++++++++++++++ target-info-qom.c | 24 ++++++++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 include/hw/arm/machines-qom.h create mode 100644 target-info-qom.c diff --git a/meson.build b/meson.build index b5f74aa37a7..a6cdccd8094 100644 --- a/meson.build +++ b/meson.build @@ -3879,6 +3879,7 @@ common_ss.add(pagevary) specific_ss.add(files('page-target.c', 'page-vary-target.c')) =20 common_ss.add(files('target-info.c')) +system_ss.add(files('target-info-qom.c')) specific_ss.add(files('target-info-stub.c')) =20 subdir('backends') diff --git a/include/hw/arm/machines-qom.h b/include/hw/arm/machines-qom.h new file mode 100644 index 00000000000..a17225f5f92 --- /dev/null +++ b/include/hw/arm/machines-qom.h @@ -0,0 +1,18 @@ +/* + * QOM type definitions for ARM / Aarch64 machines + * + * Copyright (c) Linaro + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef HW_ARM_MACHINES_QOM_H +#define HW_ARM_MACHINES_QOM_H + +#define TYPE_TARGET_ARM_MACHINE \ + "target-info-arm-machine" + +#define TYPE_TARGET_AARCH64_MACHINE \ + "target-info-aarch64-machine" + +#endif diff --git a/target-info-qom.c b/target-info-qom.c new file mode 100644 index 00000000000..7fd58d24818 --- /dev/null +++ b/target-info-qom.c @@ -0,0 +1,24 @@ +/* + * QEMU binary/target API (QOM types) + * + * Copyright (c) Linaro + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "qom/object.h" +#include "hw/arm/machines-qom.h" + +static const TypeInfo target_info_types[] =3D { + { + .name =3D TYPE_TARGET_ARM_MACHINE, + .parent =3D TYPE_INTERFACE, + }, + { + .name =3D TYPE_TARGET_AARCH64_MACHINE, + .parent =3D TYPE_INTERFACE, + }, +}; + +DEFINE_TYPES(target_info_types) --=20 2.49.0 From nobody Sat Dec 13 22:59:00 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=1751909022; cv=none; d=zohomail.com; s=zohoarc; b=OraYPp3KiXvY+Hp8zoAO0bjNWhlq+I2ulUsKn72xMyJjZrGYWF+yPwQiSV9f8GOBuCoMNEf2MHIwkK8qjkRuiYqKXk15QfV2bUzLOJneJfrDyk8SiS0WrWUhzBx0cMuN8v+7SGdiuzed+sOwzxIeAtrVyi85MrswtFeRkbIhBSk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751909022; 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=3Cwq/mg6mG+kk7LlFctkSmffhOYT5MXBLjyGm0TM8y0=; b=nWpy3VN4oc1Q5R0ezAsciv5iayGhbFca2ttp8Kiah/DiUlgpGA0eLnHy9Wi9zGyJa+9IPQB8p+rwRmiIY50GF5l03sYCHUKRXz9wuuHlhWFvC6jOj9egZ9+lqyUCVi7g6SGylRwUpkDZLZ0mXLcJuOmqYZdU+V+DUyUVyxwt03w= 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 1751909022605400.91810813939776; Mon, 7 Jul 2025 10:23:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uYpY2-0003kC-Pc; Mon, 07 Jul 2025 13:22:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uYpWq-00011q-Sm for qemu-devel@nongnu.org; Mon, 07 Jul 2025 13:21:21 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uYpWn-0005Ev-QC for qemu-devel@nongnu.org; Mon, 07 Jul 2025 13:21:20 -0400 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-3a536ecbf6fso1801167f8f.2 for ; Mon, 07 Jul 2025 10:21:15 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b47030cdf5sm10626615f8f.1.2025.07.07.10.21.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 07 Jul 2025 10:21:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751908873; x=1752513673; 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=3Cwq/mg6mG+kk7LlFctkSmffhOYT5MXBLjyGm0TM8y0=; b=UT9tdmB517MI2DDfz8iVRjG5Cqv2YVG0rnP7pQShEal8heuN1Hguug4kMYD6ftVCev C1vDBUP4Sc1avE0/JWFkOTwsGM13Uzq4AhFcJwtY2pCiMFy3qT3gyvpxyhdk9RWgZtf9 Jlr3DNt5InvCJ1S/XTkpr7G5VjlOYEL8M6oEbskaCl0d9v272yv1/bWRKYbGVomNtPoI 3TWNayRzvsj/Nk8tamU/fPr3i6imzTwwdaRdEpzYn4QjPeKDVzuTMYMxsmg/2Opsztcm 75YPIQT+O0yeeMVuis6YyRG8oi/8DHYsnrv4qt5qv0i8M7JOygffc7lqMBhldnKy1ht3 QQTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751908873; x=1752513673; 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=3Cwq/mg6mG+kk7LlFctkSmffhOYT5MXBLjyGm0TM8y0=; b=TM9INxsDLBRLABMWoZ9XZprm7O1z1sItZrYZgudFH/AWl6FTyvHdaChzq2QG/9ADxE +oYj2heaGL8SrMdSQTYhHwSp/NJo4WHHKKjkPIhyVzdfP78WZAHzYbBicW9chn2Tv7SA Qm26ctcyXioguxDR3nmCDmywZUpSFxkeESCtVeS2nY81AqholwZ5GtdXjGQxGokzLlSE iYdpCQCIWPkBEa0YeoeA0XXyEuD4G7moVNjjLC0V25J1SjSvJj0SVk6NLtD/qXAWDOAG D4z/hqTM9GpVhbyLBs7dHd+EURTwg6OqHxM6Abqf4Q8R/EZvzuGbQwsNWdPiwuRryNTC YrCw== X-Gm-Message-State: AOJu0YxcEwx2spvGMD238YZ0CGw/c1A+UxkisjD5u+xSDYOAKCNwWNXK hMRvInlhmLac85Qw448tH328YwulC5aNxDW89TWLpjnmXIn9LHWPWTr5YNCHnNnZNEnksbKIr4r oHMjz6cA= X-Gm-Gg: ASbGncuHfR3T+szF8fNdQVgbzZdH5VI9CQG5OmT9RH88s3VHuxoOMRVpM4Jys5WsgfJ ySyd01Ip70xlyDilOAEyMVIpfBTsRDZnbvrqJEJSqu9/AN72Gxhpy1a/5ajH8YhrjwvfomoyNvN WSWkpkw5odBsEy36IVJPCwSi9H46uBGDfn7brDIyVVfl/CMhK0dWkvkPVP/XhdDbFXQwmurbYNT IDLhwNu6kZYOmlqUxpy0lKyjpMkWxROSyEH+0ooAbs09a1WM6qK1YSxGuUiVGpR9NeGE8kjnVki RyTVk+aNBDwBmDZcsnAiM+jS2E9YSs+uhuDIt5EvKHr5M+PCp5cnJKVjqyWReZVKt83/NgpqeD3 x4lql5uq4/snStVfumIIvGgTIgn3W7yjfDLY0 X-Google-Smtp-Source: AGHT+IHXaaojgFflZHFVgx/9YZwYL4Ew/vAuJGo1fV1TzYAtliJIJA45khGxb2ny/B0r5JZXVjiorg== X-Received: by 2002:a05:6000:98e:b0:3a4:e387:c0bb with SMTP id ffacd0b85a97d-3b49aabdc06mr7102985f8f.59.1751908873206; Mon, 07 Jul 2025 10:21:13 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierrick Bouvier , qemu-block@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, Paolo Bonzini , qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang , Zhao Liu Subject: [PATCH-for-10.1 v6 12/14] hw/core: Allow ARM/Aarch64 binaries to use the 'none' machine Date: Mon, 7 Jul 2025 19:20:06 +0200 Message-ID: <20250707172009.3884-13-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250707172009.3884-1-philmd@linaro.org> References: <20250707172009.3884-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::42e; envelope-from=philmd@linaro.org; helo=mail-wr1-x42e.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=unavailable 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: 1751909023532116600 When we'll start to use target_machine_typename() to filter machines for the ARM/Aarch64 binaries, the 'none' machine would be filtered out. Register the proper interfaces to keep it available. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier --- hw/core/null-machine.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/core/null-machine.c b/hw/core/null-machine.c index 3e03771d570..bd3ca6c7719 100644 --- a/hw/core/null-machine.c +++ b/hw/core/null-machine.c @@ -16,6 +16,7 @@ #include "hw/boards.h" #include "system/address-spaces.h" #include "hw/core/cpu.h" +#include "hw/arm/machines-qom.h" =20 static void machine_none_init(MachineState *mch) { @@ -62,6 +63,11 @@ static const TypeInfo null_machine_types[] =3D { .name =3D MACHINE_TYPE_NAME("none"), .parent =3D TYPE_MACHINE, .class_init =3D null_machine_class_init, + .interfaces =3D (const InterfaceInfo[]) { + { TYPE_TARGET_AARCH64_MACHINE }, + { TYPE_TARGET_ARM_MACHINE }, + { }, + }, }, }; =20 --=20 2.49.0 From nobody Sat Dec 13 22:59:00 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=1751909086; cv=none; d=zohomail.com; s=zohoarc; b=HcLJhp/z/jtREbCJxoeD7oyDdtLhpthFP0G669onqMvl68Q7Sb0S5cY6Ll9pE3CyotblufnEpqLL0QTmnWEhwiMb3ha44pq6qknPF7+sAhHUW0zVmUjdXsaTfs+3qQGDw1OJnlt6sXBvro286mA04I3Df8zUz+JjEwAL1M8Mvhk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751909086; 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=pvxMUI2thDzOMTo1pay//3ftJosdxs4d110g7m8EMAY=; b=exIWhVjC/GEnw/YhmR7BxPNS2oduLOrXq5n4MmlKbEr2tKB2pqXaV3qZfOscTvFpHjXIZf3Hcau3tfsqJIE97Z32/nRpfF4+leT7yKnl9Lh+9P91T7ZI2g0IRNJfV/c7Fv5K7e8aA+RRuPRh/vOqEMGVmC+D701VbKFIXdcQChE= 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 1751909086503373.56028439254294; Mon, 7 Jul 2025 10:24:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uYpY5-0003rx-CW; Mon, 07 Jul 2025 13:22:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uYpWu-0001Be-Iz for qemu-devel@nongnu.org; Mon, 07 Jul 2025 13:21:28 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uYpWq-0005Gi-VF for qemu-devel@nongnu.org; Mon, 07 Jul 2025 13:21:23 -0400 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-3a6e8b1fa37so2761648f8f.2 for ; Mon, 07 Jul 2025 10:21:20 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b47225b5cdsm10602448f8f.85.2025.07.07.10.21.17 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 07 Jul 2025 10:21:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751908878; x=1752513678; 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=pvxMUI2thDzOMTo1pay//3ftJosdxs4d110g7m8EMAY=; b=YcHqdutKAnXeTd0OxYYnFQOiQucuo2mW0crzGtcGtbiqY4aJ6vVEEr3xvPr+0D4n2j X6dztEBHEGGOS78UN1LqSp3HyJDADqXoqU+P95fGH8WAIPIPbqODfyn2Kq+Fof0NqnkQ kqbbnb7ERHv050ibcqcFJO6f58sRlaMAbkwNERUBA5AknKZQnOis5s9gFIDIKHPB4x+K zfmr1/9KuAvP4LKXLuw53hsrcwuXjcyFiJwWoOV5tlp9x7HWvAsdDVeV6eJbMpsqx8Wf wp3aH1qDkt/9l0GiucnVYL2gOMIizRDhuQUchE9FstGeVzMhGFTljkJLEJSVj8AGCpB6 etVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751908878; x=1752513678; 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=pvxMUI2thDzOMTo1pay//3ftJosdxs4d110g7m8EMAY=; b=nMW1bGqZ0VZlGRVM3xaMBGhsYQEyb9XVJdTMaIiswsxZXHiAYxnCdnzI4GWnipPIkF SH82hg6B698+vl2dDPKogebCoDB2UlgqAiqYSrbiQdjMqJTRZePEiQpa0SnCAjQetAUu q8pKZccpHwjD6lvd36uef6m4PHLDPXiEcv8blFlFLDXXG6OJIV5Iab/H96o/b0VOHaja J4o+XPW/keblZRKAKbg4YD0rkyYhguUYn1ARLyjpfzfGy9+mTCS9b3mW3Glb9WPMjozX RG0t7Ht7Y3VmRo4AD9qoaLoU8ofNwtmZ/+tcVayItPQtDO/RXvzfxH3+GRrIfXybS8OF u3fg== X-Gm-Message-State: AOJu0Ywo3EglzrmCB/6ZO8qNm1V6ttTIkEQPsrd7N6dRk6eg1ktubKpv Rx5OLfUJ2D+0Ah53kPjdZBFiX+t4LsggQavp3TZEVrG5O5K2W14QXgxFwRCQlk4y49I1hvzFnsj kPiTxXsg= X-Gm-Gg: ASbGncsavHSP4M2A48oCgiGAiHuQDviZkWABRGd459E+COXCcufwJnfD1QXXypiiECx BHyRbiKiMofOwfWCmayt0p5MnjIPQUjQshF9e0SOxdcFiMcx7OETcgLm6hDRIYww6K6jjNXpHrk uqRcUO8i7e+Keynpehh75vPpjXxFbQzOIcwJGIqtxkl9NLJkNoMUGqCdSt5mqF8LNj5UZQPi6gm bxxczvvrpmcomVEQMVk2xsiVonjZ5fJyh2qNUDOekGwUtVMTFM41kiECytKX6C50+M0iZTgIBQL VFcjvk8xExlvq51f5hqiuTAKUMVDJ/s2dtvcD1ZszS/7rsXLLGf3V9Hl/Z5Rg1Tc6NjcsuCt08G xsJhUqEpPZP0I+74pN/wzo0gMfdacKAYZS5Kk X-Google-Smtp-Source: AGHT+IG3R7nzDUbI7ywyegfqyBV4/z9vERQ/HKQhcLB40Q0IMcGvVvbb0hYfAK75Dye22kA1OdRJjw== X-Received: by 2002:a05:6000:4703:b0:3a5:2465:c0a4 with SMTP id ffacd0b85a97d-3b4964feceemr9778712f8f.20.1751908878378; Mon, 07 Jul 2025 10:21:18 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierrick Bouvier , qemu-block@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, Paolo Bonzini , qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang , Zhao Liu Subject: [PATCH-for-10.1 v6 13/14] hw/boards: Introduce DEFINE_MACHINE_WITH_INTERFACES() macro Date: Mon, 7 Jul 2025 19:20:07 +0200 Message-ID: <20250707172009.3884-14-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250707172009.3884-1-philmd@linaro.org> References: <20250707172009.3884-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::42e; envelope-from=philmd@linaro.org; helo=mail-wr1-x42e.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=unavailable 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: 1751909088283116600 DEFINE_MACHINE_WITH_INTERFACES() is similar to DEFINE_MACHINE() but allows to pass a InterfaceInfo[] pointer. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier --- include/hw/boards.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/hw/boards.h b/include/hw/boards.h index f424b2b5058..91ccb68113c 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -761,7 +761,7 @@ struct MachineState { } \ } while (0) =20 -#define DEFINE_MACHINE(namestr, machine_initfn) \ +#define DEFINE_MACHINE_WITH_INTERFACES(namestr, machine_initfn, ifaces) \ static void machine_initfn##_class_init(ObjectClass *oc, const void *d= ata) \ { \ MachineClass *mc =3D MACHINE_CLASS(oc); \ @@ -771,6 +771,7 @@ struct MachineState { .name =3D MACHINE_TYPE_NAME(namestr), \ .parent =3D TYPE_MACHINE, \ .class_init =3D machine_initfn##_class_init, \ + .interfaces =3D ifaces, \ }; \ static void machine_initfn##_register_types(void) \ { \ @@ -778,6 +779,9 @@ struct MachineState { } \ type_init(machine_initfn##_register_types) =20 +#define DEFINE_MACHINE(namestr, machine_initfn) \ + DEFINE_MACHINE_WITH_INTERFACES(namestr, machine_initfn, NULL) + extern GlobalProperty hw_compat_10_0[]; extern const size_t hw_compat_10_0_len; =20 --=20 2.49.0 From nobody Sat Dec 13 22:59:00 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=1751909221; cv=none; d=zohomail.com; s=zohoarc; b=AZVkCHRfdGf2N0A6biQmK06JvuUfZL24kSjhuMUt6wXWiKcRfJe5Oe0Y8fvxa5QnJx/6y8YxEhd76h0PBv1ixP9PtR1CpsqG6sQCAacNHmRwIQa4dn7mdiztvMhFlzpeldvLN7nvCK0h+cRwJDH1Twn0beYXMHcGIgiEoRQkNQY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1751909221; 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=7p3/Hmprmc6/fhtaFhxu5792QEnsgrd/nZSQrS03GGU=; b=iR5toUMIDwsJgPisZ+BOdU2yNG5A4mC8VK35DX0Nsn9WwhqZ0XM5qiVEpRVgaLTpwBm+qDHtQM2M5SYCKx/En6SvqJLxNojdySq8bDhoj0dap8oSwAjgf4QeClwk/kxjVyBLuO6HlZU5cUAPDu5RgGJzBoTdRsT2Hy9qoKUS6qA= 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 1751909221510537.411756574776; Mon, 7 Jul 2025 10:27:01 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uYpYs-00077W-5Z; Mon, 07 Jul 2025 13:23:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uYpWy-0001Eh-Hb for qemu-devel@nongnu.org; Mon, 07 Jul 2025 13:21:29 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uYpWv-0005IZ-UR for qemu-devel@nongnu.org; Mon, 07 Jul 2025 13:21:28 -0400 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-3a528243636so1960936f8f.3 for ; Mon, 07 Jul 2025 10:21:24 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-454adc71a96sm138055735e9.24.2025.07.07.10.21.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 07 Jul 2025 10:21:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1751908883; x=1752513683; 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=7p3/Hmprmc6/fhtaFhxu5792QEnsgrd/nZSQrS03GGU=; b=s8p/QYoJj8gkRCIGYM72Ugm9ndpMQpNpwpVzMySTJv/CkUh6uDO84uXC1SzC0JabPd d5ipY6pQ0CVtLrzzzw3yqNLU0mwPX/NTcB0g6gUzDfepqfDZrNkcvcYQg6DjGSdX6h+G Pzf1bti/KvKjQFtJPG0jGHognm1s++yghSGkB8S28dN8wkPlOYjLjA2bWsGyB5P/HRT0 mzYjZiUL50uqJYPb0+Rbf2hwO3uh7O0zQG4u6Xj6SnkIQgjvmkKsDRhbNs+26bLYk7jn s4vvMH5baATtBFRyNWnUcrh6NPGDOzrXFQDnZHXOPUZVo5CNUN+ah7cdtewLC0AL8M1U /SdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751908883; x=1752513683; 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=7p3/Hmprmc6/fhtaFhxu5792QEnsgrd/nZSQrS03GGU=; b=TJnEEMfpRKnQVzlISBIxEkoliqUbUZLbeM5/nJORHPiMmyi5R6dbPLOM01tC+MEnEd Qzhs3hC5JYkjq/qm4LpmMKq+aXY5dz+ETy3Mrumem0Qh8VJBkZAyCdKSs5oB2iH3KC/6 fXTFGQ8YZO9+HnboyRxBnkA6N2n/VF8K5HZUrJgxn2unYWeEo3CvCvRsd2coAOJU/tYP cOaIo52bU306LgFGj1CVN6K4gkvg+LTj6Om+EX4VFYjBNlxbFf5Ll732+j3MJzu/wReB jLgS6pkEvNBKFsk+Fo9JqKsXYiDXpz016kLwbsbQ5BYisOGly8cZmqYs/EZlzXRAAcom HU5Q== X-Gm-Message-State: AOJu0YwRQntRQLT1zXJFR5RAgkZzcL0wLtOvC9+ESb3ZhFqDbruWIYN1 amM9Ccj4yYtQqYnZBPMSzqML92kfpfaHCoDjiK2rLPh3xkEdxjKOQDwgAbYiyWE9XX143HzROo0 bc8OCO/w= X-Gm-Gg: ASbGncvlqwABlouVlL50Jc8Avl6s+bezEkyRE+1Vo4cgVstZ+vRY89iWlJevXztqTHc 6/+YxkULXiwJC4M/nsr09DtPazkAy44Ae5xJwRTfsalMZXluVncCB7RBzTd9H9VBcun8Ih2U4iw 9Cn4JqrWw1C5UIdfmyrfLFyUggRmGE7fgEfjyPijC9/QOkMbOt3ng6+5v6Yo13YUV1aBxfA3Urg FIJYT46M9dU0ziYF91QQLKrxmkPuvl35Xz5yN0wwJxluM8pAkjDUcooaENLYLV4q5dpgryvr3gD hblriMm9lrgxaUMdXfHLSE9/Mb4ZZ0BhM6NLZEAIubJZKPNzbI+NXyaK8DBTQQc7qIRwEmAXiyh 8Dj9Rlwo+3mDy0M8d3QgAz2rdhKcHxiu58FTv X-Google-Smtp-Source: AGHT+IFqHPha3JU0SZDEsSk94xHPuM6ykN63Gj5nxi9VvSTcrrq3iiZaJo12fIbdCfh+Smny4ThY7Q== X-Received: by 2002:a5d:5847:0:b0:3a4:eef5:ae26 with SMTP id ffacd0b85a97d-3b49aa87429mr7359954f8f.55.1751908883136; Mon, 07 Jul 2025 10:21:23 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Pierrick Bouvier , qemu-block@nongnu.org, Richard Henderson , qemu-ppc@nongnu.org, Paolo Bonzini , qemu-riscv@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell Subject: [RFC PATCH-for-10.1 v6 14/14] hw/arm: Add DEFINE_MACHINE_[ARM_]AARCH64() macros Date: Mon, 7 Jul 2025 19:20:08 +0200 Message-ID: <20250707172009.3884-15-philmd@linaro.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250707172009.3884-1-philmd@linaro.org> References: <20250707172009.3884-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::42f; envelope-from=philmd@linaro.org; helo=mail-wr1-x42f.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=unavailable 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: 1751909223797116600 A machine defined with the DEFINE_MACHINE_ARM_AARCH64() macro will be available on qemu-system-arm and qemu-system-aarch64 binaries. One defined with DEFINE_MACHINE_AARCH64() will only be available in the qemu-system-aarch64 binary. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/arm/machines-qom.h | 13 +++++++++++++ target/arm/machine.c | 12 ++++++++++++ 2 files changed, 25 insertions(+) diff --git a/include/hw/arm/machines-qom.h b/include/hw/arm/machines-qom.h index a17225f5f92..b71a24ceb95 100644 --- a/include/hw/arm/machines-qom.h +++ b/include/hw/arm/machines-qom.h @@ -9,10 +9,23 @@ #ifndef HW_ARM_MACHINES_QOM_H #define HW_ARM_MACHINES_QOM_H =20 +#include "hw/boards.h" + #define TYPE_TARGET_ARM_MACHINE \ "target-info-arm-machine" =20 #define TYPE_TARGET_AARCH64_MACHINE \ "target-info-aarch64-machine" =20 +extern const InterfaceInfo arm_aarch64_machine_interfaces[]; +extern const InterfaceInfo aarch64_machine_interfaces[]; + +#define DEFINE_MACHINE_ARM_AARCH64(namestr, machine_initfn) \ + DEFINE_MACHINE_WITH_INTERFACES(namestr, machine_initfn, \ + arm_aarch64_machine_interfaces) + +#define DEFINE_MACHINE_AARCH64(namestr, machine_initfn) \ + DEFINE_MACHINE_WITH_INTERFACES(namestr, machine_initfn, \ + aarch64_machine_interfaces) + #endif diff --git a/target/arm/machine.c b/target/arm/machine.c index e442d485241..61ad3b681c7 100644 --- a/target/arm/machine.c +++ b/target/arm/machine.c @@ -9,6 +9,7 @@ #include "migration/qemu-file-types.h" #include "migration/vmstate.h" #include "target/arm/gtimer.h" +#include "hw/arm/machines-qom.h" =20 static bool vfp_needed(void *opaque) { @@ -1102,3 +1103,14 @@ const VMStateDescription vmstate_arm_cpu =3D { NULL } }; + +const InterfaceInfo arm_aarch64_machine_interfaces[] =3D { + { TYPE_TARGET_ARM_MACHINE }, + { TYPE_TARGET_AARCH64_MACHINE }, + { } +}; + +const InterfaceInfo aarch64_machine_interfaces[] =3D { + { TYPE_TARGET_AARCH64_MACHINE }, + { } +}; --=20 2.49.0