From patchwork Mon Mar 24 18:58:31 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 875778 Delivered-To: patch@linaro.org Received: by 2002:a5d:5f4c:0:b0:38f:210b:807b with SMTP id cm12csp2298069wrb; Mon, 24 Mar 2025 11:59:15 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWOE81xBXxHq3BlHTKpy3F62PCFnGiDFnrN7YSwslrL3VyDGgAg84udRWaAvSZaMSWq6SlwOg==@linaro.org X-Google-Smtp-Source: AGHT+IHrBQMXDNzleUQgGfdgxo3FaXTMceUUjZEBd6Ljua4M55H9R78WHsmILNj7c4HF/vzF0n3W X-Received: by 2002:a05:622a:1f0a:b0:476:a74d:f23b with SMTP id d75a77b69052e-4771de62897mr234457411cf.48.1742842755569; Mon, 24 Mar 2025 11:59:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1742842755; cv=none; d=google.com; s=arc-20240605; b=EEI1iz4l+Iyl/ba9xY0V1MHfnehTvJ2Ym20yA7QepzMYdkoVKBblpZrjXrbEl4s08i X5oISoOAIDRU1CB2rvG2Qsnyu9ONnzcyrH02NIqgUdPhwcV8Zy7B8U2Aw3io/5T4Q1zu PswDbMroG5crP5Cz/+cw+MUwO6FoaPxCIEE/RLqFiq9qkVd9HSprvQB9mmuBzDAoIMUQ 2o8K8wEAIL+7p9a0FDG41DowbhNp3+dXOvj9BK1E55ELCCRMy5w59YtSRaSzDcePM76r Nqr0CO46xa1cHM05N8oLKeZix00KSQbZopNmHpX46sW8nF/PC5UdpX0LEyOhkVFyR5rC xPpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=IpLxLOfIgkSLgm5ySIPU3BNmm1oN+7/70Slcc1e/Pik=; fh=5r5SmC1LiMx1zQnZIEbJrBEhy4OEKpCVEjDd1+1UapA=; b=A7XStNVfKOiAigK8801l/fBPx6yXvhABwbm5vi6Yp8F6RJ6Yu9Nq+lGeKscH9PwSJH Zeub9CFlj/QUqvJ1jW/HIGbnD48K7F4h3ARoXZSY4dn3Ok11rnhJ4CdAhBMzCVxG3KW0 vYgFLuLSOxUAGXkTWu2rgBGSb4Ovug5Gb4RkDCf32IyFbOmrh4h7/fL9XDUXLIG4Km90 GVLN1t4GNDRW7BodkQAQIvvQ9PTf21DpBejAzfdU3alxMwy1CruETyZeUMMTn922fysX uElHnLa7kjD/gayRSvDFw63fiGEEjImj3MgMSBWKd1dRFJgs+koS0HEeG0qFGGxkvg53 52Zg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oxEUQ6V0; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-4771d52c1a0si82150931cf.435.2025.03.24.11.59.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Mar 2025 11:59:15 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oxEUQ6V0; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1twn0h-0000ux-EP; Mon, 24 Mar 2025 14:58:55 -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 1twn0e-0000tr-62 for qemu-devel@nongnu.org; Mon, 24 Mar 2025 14:58:52 -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 1twn0a-0001MY-5q for qemu-devel@nongnu.org; Mon, 24 Mar 2025 14:58:50 -0400 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-3914aba1ce4so4058269f8f.2 for ; Mon, 24 Mar 2025 11:58:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1742842726; x=1743447526; 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=IpLxLOfIgkSLgm5ySIPU3BNmm1oN+7/70Slcc1e/Pik=; b=oxEUQ6V0qPmpWWrSD+4Qpb7yq7cQYazzVc4VRaj5RGZ/fczXIA+5UoG/Jdw+0EoNXF 5beeZMqVLG1g4rLaHqTG8ppJi0fAPAVDvWoriQkv5+LcEcwfRsK/J7k/esVAM1EKlv0Y PoVPySjXi/81im2PipfjiHfphDTKubMy/w/rZ5JHrrzX0e3ud/Kk9wKCTLjbj7WqSK64 gVYkhTd3/I894seYonUz/sUp8m+1GxW6Zdy3VzVQlpqe/zwdsPQ6PPL4TUcHH4pvG+1L 2eS/jNW4F4odcvQN1yes1vwtVgZfVZE8Yt2OxyoTZisHt6675tpT0inbohwF5zben5zb eD1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742842726; x=1743447526; 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=IpLxLOfIgkSLgm5ySIPU3BNmm1oN+7/70Slcc1e/Pik=; b=D0Hj+8pYRfhBxvdxDcW75BfldFvh6G/UexMFOUyKD7e4f04qElDGG8O1UDiSTDjWlS P4Cc3GBW2BWz9lWZ1uPZLt8XwO6jgWWLpnwxVvQ2di94p7G7PaMN0KscEuH+TWK5z5H6 u6+ibDx9ljV1DURAbh6J3NE3ZsDXEwqUMoJoAIZ4+FOTKkrMlvaIRZsBSWDacs5DcswM wr/RlNF9vi+svfMtFhNgVEItbTJH14hf5buVxbb+G48tfDZ4px5IOgNlv0+kyMWWFejb TGmv/9bKXMapFEzjVDWsQFBSKy6SsS7ZG07XLOp84wApk+szsPfzQWCXwb9DYbN4FmiD X/Eg== X-Gm-Message-State: AOJu0YzfXfKFvuqu2rGOhWBEzRIqfQf07p0YahikqAqawzHANdBZxnId 8jBt93uoTKJcmWaKtTLiQanm/oNBBQ6htaCR7r8WYmQB9uL0dy6SXd6TyGchDbHVQr3o6dyYGyf 2 X-Gm-Gg: ASbGncs8cN4LsPm5RQxnWj+AeRDicwN9zCKi9/XI4iDJhiANqfLWhbgNkRqT20wWj8y NyPC23l54oGsKldLQegqYQ2gjX70bKg5kkYYVq76kXU6XFEw6lwgpm3EDW4o+LAAZ99PyZPNrlJ RQko0c1woLZDdRxYQHiO8NbiPLvJZ1JGbOuldDnfceZPkJamLWB4zKUwcTmnjrgjywB9XVps7VC 2Bi71bKMG5jxWU531nnDHgrsh0F+zUmLLYY8wcPZHBWU4a7FymfEqG+Hv9I17h0gd1NzvVhlN25 LPgmtD06SuPTLH1j8kIGl2RSC3JJ5dlWQSNCKSouniknfV3hf0fD+GRzaREgjn+CfU6nYSZqFap Q5Y8JaXvNw2JPm2MvLzmcWNM8 X-Received: by 2002:a05:6000:4187:b0:38f:4fa6:68df with SMTP id ffacd0b85a97d-3997f940e06mr8229005f8f.51.1742842725682; Mon, 24 Mar 2025 11:58:45 -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-3997f9b5b8dsm11845800f8f.59.2025.03.24.11.58.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 24 Mar 2025 11:58:44 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , qemu-s390x@nongnu.org, Daniel Henrique Barboza , David Hildenbrand , Christian Borntraeger , Artyom Tarasenko , Eric Farman , Paolo Bonzini , Halil Pasic , Zhao Liu , Eduardo Habkost , Yanan Wang , Richard Henderson , qemu-ppc@nongnu.org, Nicholas Piggin , Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Mark Cave-Ayland , Marcel Apfelbaum Subject: [PATCH v3 1/7] cpus: Introduce CPUClass::list_cpus() callback Date: Mon, 24 Mar 2025 19:58:31 +0100 Message-ID: <20250324185837.46506-2-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250324185837.46506-1-philmd@linaro.org> References: <20250324185837.46506-1-philmd@linaro.org> MIME-Version: 1.0 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Some targets define cpu_list to a method listing their CPUs on stdout. In order to make list_cpus() generic, introduce the CPUClass::list_cpus() callback. When no callback is registered, list_cpus() defaults to the cpu_list definition. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Reviewed-by: Richard Henderson Reviewed-by: Zhao Liu --- include/hw/core/cpu.h | 2 ++ cpu-target.c | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 5d11d26556a..ccfcd3eb3a6 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -102,6 +102,7 @@ struct SysemuCPUOps; * CPUClass: * @class_by_name: Callback to map -cpu command line model name to an * instantiatable CPU type. + * @list_cpus: list available CPU models and flags. * @parse_features: Callback to parse command line arguments. * @reset_dump_flags: #CPUDumpFlags to use for reset logging. * @mmu_index: Callback for choosing softmmu mmu index; @@ -150,6 +151,7 @@ struct CPUClass { /*< public >*/ ObjectClass *(*class_by_name)(const char *cpu_model); + void (*list_cpus)(void); void (*parse_features)(const char *typename, char *str, Error **errp); int (*mmu_index)(CPUState *cpu, bool ifetch); diff --git a/cpu-target.c b/cpu-target.c index cae77374b38..5947ca31a0a 100644 --- a/cpu-target.c +++ b/cpu-target.c @@ -98,7 +98,13 @@ static void cpu_list(void) void list_cpus(void) { - cpu_list(); + CPUClass *cc = CPU_CLASS(object_class_by_name(CPU_RESOLVING_TYPE)); + + if (cc->list_cpus) { + cc->list_cpus(); + } else { + cpu_list(); + } } /* enable or disable single step mode. EXCP_DEBUG is returned by the From patchwork Mon Mar 24 18:58:32 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 875783 Delivered-To: patch@linaro.org Received: by 2002:a5d:5f4c:0:b0:38f:210b:807b with SMTP id cm12csp2298744wrb; Mon, 24 Mar 2025 12:00:44 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWCERCkpPsmPsFiebvOI4TfAmRFiFCrU/PDEQnwUMY8L1ImDtOXCTkgagKcG0oRNvL1Q+vvjw==@linaro.org X-Google-Smtp-Source: AGHT+IFHgOHdfgRELCb/wnkySnuMWASQMlonFw1w7e/Ft0lrseGGLnhXqEfvMUCsjFLriC2AA/nB X-Received: by 2002:a05:622a:5e17:b0:477:cb9:13b0 with SMTP id d75a77b69052e-4771dd5c6cemr193812441cf.7.1742842844524; Mon, 24 Mar 2025 12:00:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1742842844; cv=none; d=google.com; s=arc-20240605; b=TJN9BWdadiqdkllMhY7qIWMcpXLTEO1kNvvuLiHznLFWPDr5VFHuBHSYEuEVZw6b4i 2BOIWz+jg8gb5Zw1UxLHOrCF7KeQZiJYYd3gHEvK1dvbuEgvNru2DUKi699SGmyfK3ts K5kg0aphKZAfsLEJBnH7Glj8sWYivk0wPBE+vulKV9uHN9nijIVzrvkLWRsMJmhL1cvJ HOCtC60/8eHtK1t0+TD1/jsKvH2Qm+wloRxX0gR+uhGN7scjBUx7+eXvsb89k+Fos70E /iLf5LH1TcZmeyJZnZwkViRf3dJlIDIJq8pOuYyOeRT66CGblAfoWFJognZJiihRhlBY igZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Zf76aMsp0+6jr1JxvVNGTxTaiF5oL0/9z9OpNWiIMMw=; fh=5r5SmC1LiMx1zQnZIEbJrBEhy4OEKpCVEjDd1+1UapA=; b=hmNcUNKZ62F0BLLus2ngbGFW56hWOxkovJQbmicHtnOgB3I/KeutuWdvy/yfRdvkZS Np78hFC49l7jK44tPOs04GThjBUIaIxIihLroeCrZbRyqRyN+2j0U5Hb4VLKPa/TCPv4 1nJrx/ZqK+2GpiZ/mxWQPpfVpqK2SF+th74OZwbb23BT7R781qzx3MYRi112uqCoYdGe ryELKDFChHv73NcdWW+2n8weDyEdcT4iDt+3TKtLUvUrrCaytlA3A1OVDDPxmSXQNwl3 nLqrqgBYvBH7GFf82bvIgWUFYEOo/HtcADayQ/bgADKbBf2WkrRq5d3/f8z8bI0tH8Dh tw2g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HClBqcV1; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-4771d4fe4d4si79545131cf.230.2025.03.24.12.00.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Mar 2025 12:00:44 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HClBqcV1; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1twn0j-0000vW-Ga; Mon, 24 Mar 2025 14:58:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1twn0h-0000uy-CF for qemu-devel@nongnu.org; Mon, 24 Mar 2025 14:58:55 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1twn0e-0001NG-SG for qemu-devel@nongnu.org; Mon, 24 Mar 2025 14:58:54 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-43cf628cb14so36958385e9.1 for ; Mon, 24 Mar 2025 11:58:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1742842731; x=1743447531; 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=Zf76aMsp0+6jr1JxvVNGTxTaiF5oL0/9z9OpNWiIMMw=; b=HClBqcV1MHHLmJHJ3zjh5i5/vsDeJ/qPEjSvqSBpJhKq/y9EUOsJTkp+S4BP33BS2F XSOcZSCTDQ1/MxyfawIFo61cvnultNQk0fTDtlqT/XYKfEfXQD1bI7OLFTTIJJ+93iec 292YdWrIwXC3qVwUcqqRbML1kN/gdvVlFbG9fthiIx2b9jZ3SBaPYwRuVGeWO8twYiLP SLi3CeZ1WZC2ElVyxEmqvWKaLR7DM5YkY3YD2miMNNaK0Z1sxJ3MkNwU9lUep0tLxeN0 //+DVxKLPM9ewTcKSVg+UtLl+9sc1v8d669/iz12aKTjhqdb6UTL2eTNmi9Dr8yE//Tr Q+1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742842731; x=1743447531; 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=Zf76aMsp0+6jr1JxvVNGTxTaiF5oL0/9z9OpNWiIMMw=; b=oiH8H3QH1kWequYWzfO4nh9HoWlMbhazOch8PN1AEne0pza9ZVwUyayS90hX38O4O9 4vZUJbkYq4MjCf7A9MUs4p/xt7tLeDRok2TSqmXodV8IyNJE5NhyvGxryYp7wqkoemo7 8ntnz9/1B3C4jVThn4ZkQtSkcQaPLvGKmgj807Bv1wFVvxa/+6brApTHB6aDqVPkhec6 Sy9ob9izo68LEic8DZRhEvLG6gHTcMbNVK4sCPoYvNneQWrqFcHw4Fce/EgQJYQwICeg wd1IrzK3OCt0BIPz2uPqyjh09S8l2flyZeLx8PtIEZuja9wN0j5JH239tTYpMRAfYHwM CqaQ== X-Gm-Message-State: AOJu0YyJF0w2FzuKedOPNrNhy+8nju6wW0NgsD/9+jEQGvpVMq69WCXI XJofoDTHriqJvvR9PJN7XQNrFtmyXNMcgCp+AMUpqdqv+6jQX+FNGE0oNybvyqDj+iMTFDgTiwf D X-Gm-Gg: ASbGncsznBn8C+KLq/aNUESKk8fzq+rh3GirswspRh5U0YCZOBMDYefMTIS9Ocbhv1v eSV0cdfkzgH1v3VgUU2FLoMSw/AmSBr7q+olhA8VJ7ZLxkji7LSTiX4yyMOQmD2MVrm0y1QZ5zP EZ/ebBsbvowd+CkOqdGEEZRDRPL+13/m6ziAAdbDIZI1gaHOcXskmT7UlVdnxCjsK3vw+xaKT/5 L/uxtOSjLjnX6FvaX2R/URYNt63BOMyt9qfoISy7GEFV5hwQXEdC9WPLh4zqU2Gir4YXD5/e/KQ oGTduzCstYq1XnwsCzvFLtiSCL96OTiin/UQQtE45FO+frsdcVid0p6zb3jN0m25p4AZ3YPLMHA 4w/356fxuIF1nGose3Ckq+9fL X-Received: by 2002:a05:600c:42ca:b0:43c:f680:5c2e with SMTP id 5b1f17b1804b1-43d491be155mr136243045e9.13.1742842731028; Mon, 24 Mar 2025 11:58:51 -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-3997f9957d9sm11627959f8f.9.2025.03.24.11.58.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 24 Mar 2025 11:58:50 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , qemu-s390x@nongnu.org, Daniel Henrique Barboza , David Hildenbrand , Christian Borntraeger , Artyom Tarasenko , Eric Farman , Paolo Bonzini , Halil Pasic , Zhao Liu , Eduardo Habkost , Yanan Wang , Richard Henderson , qemu-ppc@nongnu.org, Nicholas Piggin , Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Mark Cave-Ayland , Marcel Apfelbaum Subject: [PATCH v3 2/7] target/i386: Register CPUClass:list_cpus Date: Mon, 24 Mar 2025 19:58:32 +0100 Message-ID: <20250324185837.46506-3-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250324185837.46506-1-philmd@linaro.org> References: <20250324185837.46506-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Register x86_cpu_list() as CPUClass:list_cpus callback. Reduce its scope and remove the cpu_list definition. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Reviewed-by: Richard Henderson Reviewed-by: Zhao Liu --- target/i386/cpu.h | 3 --- target/i386/cpu.c | 3 ++- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 76f24446a55..28011eff0a8 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -2367,7 +2367,6 @@ int x86_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); int x86_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); void x86_cpu_gdb_init(CPUState *cs); -void x86_cpu_list(void); int cpu_x86_support_mca_broadcast(CPUX86State *env); #ifndef CONFIG_USER_ONLY @@ -2561,8 +2560,6 @@ uint64_t cpu_get_tsc(CPUX86State *env); #define TARGET_DEFAULT_CPU_TYPE X86_CPU_TYPE_NAME("qemu32") #endif -#define cpu_list x86_cpu_list - /* MMU modes definitions */ #define MMU_KSMAP64_IDX 0 #define MMU_KSMAP32_IDX 1 diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 1b64ceaaba4..1f502587c96 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -6305,7 +6305,7 @@ static void x86_cpu_list_entry(gpointer data, gpointer user_data) } /* list available CPU models and flags */ -void x86_cpu_list(void) +static void x86_cpu_list(void) { int i, j; GSList *list; @@ -8924,6 +8924,7 @@ static void x86_cpu_common_class_init(ObjectClass *oc, void *data) cc->reset_dump_flags = CPU_DUMP_FPU | CPU_DUMP_CCOP; cc->class_by_name = x86_cpu_class_by_name; + cc->list_cpus = x86_cpu_list; cc->parse_features = x86_cpu_parse_featurestr; cc->mmu_index = x86_cpu_mmu_index; cc->dump_state = x86_cpu_dump_state; From patchwork Mon Mar 24 18:58:33 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 875779 Delivered-To: patch@linaro.org Received: by 2002:a5d:5f4c:0:b0:38f:210b:807b with SMTP id cm12csp2298241wrb; Mon, 24 Mar 2025 11:59:45 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVuF2H8X4NGa9z+DU289GXYhoM0qqRZCHUNzlr4X7wk9GmOwO4+eloMM77RJFKCYzvZCJ5q8g==@linaro.org X-Google-Smtp-Source: AGHT+IHvEXFaTIDFC1k0JI+MUTHUe7tkBB1yuF2qfNNC7kh3sm6YiUbx9l8DBFG7oC0TtODTjdUB X-Received: by 2002:a05:620a:4102:b0:7c5:49e3:333f with SMTP id af79cd13be357-7c5ba1e890amr2814701785a.36.1742842785137; Mon, 24 Mar 2025 11:59:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1742842785; cv=none; d=google.com; s=arc-20240605; b=IqN3eqeuV/zdN6poJQErZpU3L0ja735Ix8Nvxf/jGzPY9SUXx2AV15kMa8GHkAO7Uy msazgYbx/s02FWTF1+yNvFtdhm12icPY3zrIOSW+h0gyPnirxdypSJenk6zuRWnilL+a /Z91WGlf7UPZ5C4nMPcLTrKaMPmUReHTP7SpzxehGn4eXerMyMWqFbTjxFYreWNUJv2S ZythWJ1fKHWMsJFX9YOEQJulX7ls4O175JHkKBQlgsUmPSoJad9SN3M5C3DrPHUDDVhO D4wFGRwrQLJORNxSMHHgTfBryoqcN4S9iEHNGtopV/1W9joJXAEuxwY6RYs2EZXdiN4L bGvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=IeFNeyXdS+DEibAETcGegMoKLdTByvDR+wtJ99heK9k=; fh=5r5SmC1LiMx1zQnZIEbJrBEhy4OEKpCVEjDd1+1UapA=; b=P5NYXnVUlbs+aWRh4n6BBmUlH3P7JP6BsVWJlgExEPrBlTO8yrCY35R/uoYQPZHn8C yFlTEY/qW/e8AMjkmGX/oq3vXzwmJKP1KD3ipAvLoLBXJydTVhWEvvravv8HqBLt9g6G aRJRfD/pAGZI7Rwkji6JIY1YQn1wrtkK+rd2ORQ6d0kGt7qjhQhtNC+R9z69Kbrhk+94 OjB7DfFoF50fefQdFP2fY6/5PXH7ybZ+lYGEk0OFqm2JMkk6BFixCBqfXAp/C5LL10ER Y9f5vSjctgM8gOY6Vtvq0gTDjYGHesjW5cAgcBkvGscGNJPkvdYr/D8MWeSsQZIqaqcO tq1w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vjYTW2oR; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7c5b92afe41si801121185a.113.2025.03.24.11.59.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Mar 2025 11:59:45 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vjYTW2oR; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1twn0p-0000xg-6P; Mon, 24 Mar 2025 14:59:03 -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 1twn0n-0000wp-1m for qemu-devel@nongnu.org; Mon, 24 Mar 2025 14:59:01 -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 1twn0l-0001Oi-By for qemu-devel@nongnu.org; Mon, 24 Mar 2025 14:59:00 -0400 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-3965c995151so2384187f8f.1 for ; Mon, 24 Mar 2025 11:58:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1742842736; x=1743447536; 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=IeFNeyXdS+DEibAETcGegMoKLdTByvDR+wtJ99heK9k=; b=vjYTW2oRb1Y7r6OhqEpWRE3aT2Y+qejzZtUO5xqIv1aGdAaul5tTWcvKNohzkvhvxw wHpn45BQQeuytqdl6VdrujTo3x239Cmjw45yWiqqHuZFK0txe5TDu2aSUh43XGBo0QDv c7jQnEtt5oh3ggnZ7oAxqzvsk8cLiTPz+tz3WOcNipBHdCR7nA4i5Iv8s/Y8M24HXZFQ 7K8a/K4hzNCd0iOy+tvicNeESjuJEIycErpXYO2o/fhLlmXFnNWykOzLmAMCYZL2TpqJ JKiZWN5wUSbi6kFMY3hvmYsF/IYNHhgKB9q1VxFzWRE+qgF/8AM3hRykk33uHeuehqbS IUNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742842736; x=1743447536; 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=IeFNeyXdS+DEibAETcGegMoKLdTByvDR+wtJ99heK9k=; b=RDSRJPZqR7csXk5nD1ivo9E1CWynmIw6dNV5Q9ANqv8+qiKdwveRE8d/CHzkiHHnmV tyRgtAY0xgiu4t5/7kqajqBLqfD/huSqyRtumWAI9obusoL6ByTRusJzOcIJpMSCv5D8 YJcrh642f7/aZ8a3bvwReytPGIVK9aqeKOEg3Lug5DbLWhHz8bLK0jDUc5CAmImwJDPw dDR0e2JgAL0xrBk4Js/AXditORB0U9K3OQ+nfLi61T1+Q/aITBltbp5GLq28utTxBF2k yXzyllGVCt9MHSd9jRb8II7q+5eAKDB5hJ01VG/WXJPCorbvhVseffp62vH2fDgl37Wx WgGQ== X-Gm-Message-State: AOJu0Yw/Yp4qkjEtFojf3bALuW3cmVLm6w30OK4Rkj3H5CbPJYJoqqa5 rYf9cXIq3lDR8HUIGofA8OtleSjJub7I75KWcFeAx8/CPZ2tTf8zErMSbbA2Lue100Uk59xeLLG 9 X-Gm-Gg: ASbGncsCRh2eYmaRuz1shuz3RQBSOKDCwFzI2zInzJKkpFrvUR8tm4gJNGRRNUhPAfi yvXQr2hL17XL3sTyKT4XPUbRk5/pSlAhOGIw6QVpXLaU21uR4/Tgea5BvokPg+ZhZDfSDBpCaka wfcTuwOk5P6ZDw1Np1uVum2GosGuDlGX/HAB2u34Y+LWmej2qczp9a2blfCRonSEQumxfq57M6g NflKKTgJFjFIUIeAm53LLmIViTDVQE6B7df/qj18e1RkpjED4V/Gy5dqqBJRqBsFAFA5eJd5heq +qy/FzdQUM/cDusdPhwa4Eg/0jZVcrcx5MNsA3QQZzneDDwouRLjLEAvNhWcU81KBasUedCIRr6 6WgWPP/KZFgKlaBrAY+RdjAjG X-Received: by 2002:a05:6000:2a1:b0:390:e8e4:7e3e with SMTP id ffacd0b85a97d-3997f8f268fmr11833858f8f.6.1742842736525; Mon, 24 Mar 2025 11:58:56 -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-43d43f55750sm183293305e9.21.2025.03.24.11.58.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 24 Mar 2025 11:58:55 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , qemu-s390x@nongnu.org, Daniel Henrique Barboza , David Hildenbrand , Christian Borntraeger , Artyom Tarasenko , Eric Farman , Paolo Bonzini , Halil Pasic , Zhao Liu , Eduardo Habkost , Yanan Wang , Richard Henderson , qemu-ppc@nongnu.org, Nicholas Piggin , Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Mark Cave-Ayland , Marcel Apfelbaum Subject: [PATCH v3 3/7] target/ppc: Register CPUClass:list_cpus Date: Mon, 24 Mar 2025 19:58:33 +0100 Message-ID: <20250324185837.46506-4-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250324185837.46506-1-philmd@linaro.org> References: <20250324185837.46506-1-philmd@linaro.org> MIME-Version: 1.0 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Register ppc_cpu_list() as CPUClass:list_cpus callback. Reduce its scope and remove the cpu_list definition. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Reviewed-by: Richard Henderson Reviewed-by: Zhao Liu --- target/ppc/cpu.h | 4 ---- target/ppc/cpu_init.c | 3 ++- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index efab54a0683..0062579ef3e 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -1597,8 +1597,6 @@ void ppc_store_dawrx1(CPUPPCState *env, uint32_t value); #endif /* !defined(CONFIG_USER_ONLY) */ void ppc_store_msr(CPUPPCState *env, target_ulong value); -void ppc_cpu_list(void); - /* Time-base and decrementer management */ uint64_t cpu_ppc_load_tbl(CPUPPCState *env); uint32_t cpu_ppc_load_tbu(CPUPPCState *env); @@ -1660,8 +1658,6 @@ static inline uint64_t ppc_dump_gpr(CPUPPCState *env, int gprn) int ppc_dcr_read(ppc_dcr_t *dcr_env, int dcrn, uint32_t *valp); int ppc_dcr_write(ppc_dcr_t *dcr_env, int dcrn, uint32_t val); -#define cpu_list ppc_cpu_list - /* MMU modes definitions */ #define MMU_USER_IDX 0 static inline int ppc_env_mmu_index(CPUPPCState *env, bool ifetch) diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index 8b590e7f17c..0ccb9068c89 100644 --- a/target/ppc/cpu_init.c +++ b/target/ppc/cpu_init.c @@ -7184,7 +7184,7 @@ static void ppc_cpu_list_entry(gpointer data, gpointer user_data) g_free(name); } -void ppc_cpu_list(void) +static void ppc_cpu_list(void) { GSList *list; @@ -7525,6 +7525,7 @@ static void ppc_cpu_class_init(ObjectClass *oc, void *data) &pcc->parent_phases); cc->class_by_name = ppc_cpu_class_by_name; + cc->list_cpus = ppc_cpu_list; cc->mmu_index = ppc_cpu_mmu_index; cc->dump_state = ppc_cpu_dump_state; cc->set_pc = ppc_cpu_set_pc; From patchwork Mon Mar 24 18:58:34 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 875784 Delivered-To: patch@linaro.org Received: by 2002:a5d:5f4c:0:b0:38f:210b:807b with SMTP id cm12csp2299024wrb; Mon, 24 Mar 2025 12:01:05 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUHnz11hDBlJF7O0z1Q2+Nv9bu+ifSt094ev8oQ1w7ZRNkkcuWgIxvuzmkCDG1enKMVQWBUZg==@linaro.org X-Google-Smtp-Source: AGHT+IEHHXzpXaPYJ6aZX7rg3Smg67Rj4I/rn5l52eAM5PQzFyffkDC49APFGndE8RWS3uIGOQAM X-Received: by 2002:a05:620a:284c:b0:7c3:cd78:df43 with SMTP id af79cd13be357-7c5ba2058b8mr2153609385a.58.1742842865394; Mon, 24 Mar 2025 12:01:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1742842865; cv=none; d=google.com; s=arc-20240605; b=UOw2zddhLvaxHAXcodRwI1VLkjg81pe3niR4KFht7i2XJR3ZFs1zRBIBiNaIlkvR/+ WsWfBAs8XRNpjN0nnAddhfdfXecuRXLil1IQoQrFi6yI7sS2ZKnm4taHWn5iMdHiQeVJ UV3jNrnocRY+IS7K8dimn9iH0RouG+OqmUFNo7MknAVynYQrlivSeHXfqPIET7lThpNa 1SHr5F+A8XW4Tzd5rW5vnhiapTAFhl6jgb9YyYywYnfnlhAHnC+u8TLbmmnQTF+6CA7K yj5MlH75jgVQLqDAwAwd99/b729WAEQhfLgGH+95OS+kGvpblkiMrIKDNOLCRotVeumV N0mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=H0dvd2P36winpZovlVz4NmarrWHHCldFw3mWW6dP9ow=; fh=5r5SmC1LiMx1zQnZIEbJrBEhy4OEKpCVEjDd1+1UapA=; b=UvSAyRAqYO6IG7srldV9h5CrkCzxBZOkLyEjkYnlUxXHAv23bDuDPeKmvpyjPGYriZ mzJOgPowIJKE7EQn1YqirMjQRI9fNRcohmKoocyozqW6mXd/Vpo840yi4wuhi9/gGiDc JoSu5OqS1AQ7nDKFg9oTfAVgv8diPqbhZ9VayxCaiAzWvvVCgNMTZn6EN9nd6a01ekIX E2BZ9L9AGbOW782UmRhCtFiRo1bV5xDkuWC0MWqLIIuVr0PZFiPffoYgZo06NCZwWiU2 3vEnUwrVLBYiL36j6cI7Lf9wUdKTsxZ9+7XHsd0lYVDtVRsvlD2ZfTcmmTU8t1NPYeW4 uchg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OI2G3Azk; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-4771d15b18csi78764441cf.127.2025.03.24.12.01.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Mar 2025 12:01:05 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OI2G3Azk; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1twn0t-0000zW-S0; Mon, 24 Mar 2025 14:59:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1twn0s-0000yx-F8 for qemu-devel@nongnu.org; Mon, 24 Mar 2025 14:59:06 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1twn0q-0001PS-S8 for qemu-devel@nongnu.org; Mon, 24 Mar 2025 14:59:06 -0400 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-3914aba1ce4so4058563f8f.2 for ; Mon, 24 Mar 2025 11:59:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1742842743; x=1743447543; 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=H0dvd2P36winpZovlVz4NmarrWHHCldFw3mWW6dP9ow=; b=OI2G3Azk+a5sNtfMmME005iyAiRlNgl8HDiynHZ+DJItQVaRf9HOOXjhk1dEGqcHn3 eOdkDDVmhX4bFL6L3i88+7bcXk1HOWr4/ZQ/1a2iPD/ajStz3JfaMGe3KDUJ85uxSeaj 7QIeP6L3rghXwmjkpiuWd6yef6oV/CD5dBvL17Lvscmn/MS9hvgMYafKppAWwXlHoYF6 7DbiJ5ENbZ5sC/Kdi6tLBavlMuzZnN9kNEVdNizInYjnni/HidsM7qhxVh578irw2SXb vkhuxsNoH9WN7mlrGJITUrPYk8utRWndQrBQteBxHuHAG2tC1mTEtfQHDsgUffIS+iTH lh5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742842743; x=1743447543; 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=H0dvd2P36winpZovlVz4NmarrWHHCldFw3mWW6dP9ow=; b=nPXrdUZGctRWhkzIXuDD0qLrMZzN2Yn7EF+F6jPle4pi6sdOJDj0lzYTx7iozZNIwH JMphrPQPpD7AKFFlf9q5Z3fGjvfk/We99jgQoyQL7+vC1EJce1hdEnOqXSfFuQkhpAgC 3aIX3tmOa0MH0f457AKILR2HfN7ePevwTbkEmwWj80jff5gQ9iw+7pr3u7wZjdq7ZScf 2YWUDXn6o3CHnJZU8nqzgu8mZnalb1nKlBtNefMOapZ6mli0Cjiy3jbANoJA95kEh+ic 0h3RVo4rh5EqtokR1caIFClJVCXu4bgXbFR3FeGgn4clDLfrdGLWOvDAfKPeUIDY3hPn ZVJQ== X-Gm-Message-State: AOJu0YxSeIA4uFwJxp22WDtvNHvYdf1mksFa4dyeLNujTWvIqaVgVi0h lngtaVd2TwrSaKp12YLkN4sibB0Ie/yS6m2AU1wVdvKJ6SqaaGFP+ma0aGWlq+d1BBTc44a9nqV y X-Gm-Gg: ASbGncsqCclWy2fX7O7wwXmGGJAppIAE5XY1vUPcxcpoL/hGYLvy1c4pJrElBRrd88o BQqSx+4RW3e+23g9PeFy/J+USTlNoyDSIYd7kBwn8L+K13j6NNJXVEKVE3/GsZ2/Eo1X/copUPj dGtJOjzNrny7aVHuz82QdmFWebKpiPjWpcxCCfrOslWBznGLhWXrEJmgk33o9wjyyDpIR+gKnHH 8RcCKEJltfzJwoAR1CDJtILoHYr8WnV2y79hkXw7l5ZhAArCky4KdVhKGed5z2Os5icXGi8RtkH R1+XS0F+wYY2CTcfPAjqPq7jfKmmtChvvLSDCgOISerj81H0JzVbMX5xPzAb7XQZi26HbZJK2WA YAHNWu34oQq8ugASO+0+LhTEj X-Received: by 2002:a05:6000:2801:b0:391:139f:61af with SMTP id ffacd0b85a97d-3997f913a91mr9102368f8f.32.1742842742804; Mon, 24 Mar 2025 11:59:02 -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-43d4fd18505sm127632185e9.11.2025.03.24.11.59.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 24 Mar 2025 11:59:01 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , qemu-s390x@nongnu.org, Daniel Henrique Barboza , David Hildenbrand , Christian Borntraeger , Artyom Tarasenko , Eric Farman , Paolo Bonzini , Halil Pasic , Zhao Liu , Eduardo Habkost , Yanan Wang , Richard Henderson , qemu-ppc@nongnu.org, Nicholas Piggin , Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Mark Cave-Ayland , Marcel Apfelbaum Subject: [PATCH v3 4/7] target/sparc: Register CPUClass:list_cpus Date: Mon, 24 Mar 2025 19:58:34 +0100 Message-ID: <20250324185837.46506-5-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250324185837.46506-1-philmd@linaro.org> References: <20250324185837.46506-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=philmd@linaro.org; helo=mail-wr1-x42c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Register sparc_cpu_list() as CPUClass:list_cpus callback. Reduce its scope and remove the cpu_list definition. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Reviewed-by: Richard Henderson Reviewed-by: Zhao Liu --- target/sparc/cpu.h | 3 --- target/sparc/cpu.c | 3 ++- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/target/sparc/cpu.h b/target/sparc/cpu.h index 462bcb6c0e6..7c6296ae70e 100644 --- a/target/sparc/cpu.h +++ b/target/sparc/cpu.h @@ -594,7 +594,6 @@ G_NORETURN void cpu_raise_exception_ra(CPUSPARCState *, int, uintptr_t); /* cpu_init.c */ void cpu_sparc_set_id(CPUSPARCState *env, unsigned int cpu); -void sparc_cpu_list(void); /* mmu_helper.c */ bool sparc_cpu_tlb_fill(CPUState *cs, vaddr address, int size, MMUAccessType access_type, int mmu_idx, @@ -665,8 +664,6 @@ hwaddr cpu_get_phys_page_nofault(CPUSPARCState *env, target_ulong addr, #define CPU_RESOLVING_TYPE TYPE_SPARC_CPU -#define cpu_list sparc_cpu_list - /* MMU modes definitions */ #if defined (TARGET_SPARC64) #define MMU_USER_IDX 0 diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index 57161201173..635d5d81143 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -579,7 +579,7 @@ static void print_features(uint32_t features, const char *prefix) } } -void sparc_cpu_list(void) +static void sparc_cpu_list(void) { unsigned int i; @@ -1031,6 +1031,7 @@ static void sparc_cpu_class_init(ObjectClass *oc, void *data) &scc->parent_phases); cc->class_by_name = sparc_cpu_class_by_name; + cc->list_cpus = sparc_cpu_list, cc->parse_features = sparc_cpu_parse_features; cc->mmu_index = sparc_cpu_mmu_index; cc->dump_state = sparc_cpu_dump_state; From patchwork Mon Mar 24 18:58:35 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 875781 Delivered-To: patch@linaro.org Received: by 2002:a5d:5f4c:0:b0:38f:210b:807b with SMTP id cm12csp2298328wrb; Mon, 24 Mar 2025 11:59:58 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUiSBSTCLE7+cd1IfBSXbxDPXY+Iw1cG+5+etlwclZD/07zCJMsjuxymz7BX0zWGYWnlLElww==@linaro.org X-Google-Smtp-Source: AGHT+IEM4aHih6bNwixohqYAVRvbKhCMapcfz71YjeilDNpcXEvmaGeaKr6RQ2jUxqrmxW72cWBe X-Received: by 2002:a05:620a:24d5:b0:7c5:59a6:bae2 with SMTP id af79cd13be357-7c5ba135bdcmr1956058285a.4.1742842798313; Mon, 24 Mar 2025 11:59:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1742842798; cv=none; d=google.com; s=arc-20240605; b=E8Vxc0CEq0qdRrrdRKOwuy70G4FxYaujvr+baskzgOnFlNYZ73jQy/cHVSvs2jb0Aa a1EGsYkGFmQLi6qPXcannwfuH1mfa0nEl5VQTfzs8IbFeErhREzod2CzOZWMmAf76Chc QLRPXcTUK+DAykhN+J8f9zM0gzcon0q/23PG4wV3FdhwGoc43kUWnLf18mQEsYk+9xxV TV/QGI/S0QFjjBi+KZr6gur99SrH1pPt78U7xo6K+HYAALTNOyJalDWFYFeG1nzGOKe6 am/fSEwJMqc2iUDweC38+Jc/URxFsEWPjnTbcROr1/NSNu99hWs5ixp/jqPci69+vDsw KrhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=vhAN9Lyj4bqTf4UUrdE+Pmn+JYUm8J4DDJYtyAVBykw=; fh=5r5SmC1LiMx1zQnZIEbJrBEhy4OEKpCVEjDd1+1UapA=; b=MHths8W6ad8x2C5xTNYLrJ6/ckg1hoPkEljW/zhO/DKauaPSP9d+doBNtpdW7IHk+Z Uqhcy/8oDsc5PWuqKpzn8C/oIkjIEs4WU8fnF1DGaotGJzXQPj6Z0fxfLeVmo2uyOKGk smCiW/uHT2mvB2TObeoURc2lI7U5U7M7TEtryMrg8PlgQ18ebr0yCHiYxcqr74rkvYEl UrOx7RqBBKXwczeqUkDKRBB8ntldVSXVucHZaEI0g4NqM23y1FAMRRZ2VA3bX1OFMf8e Pnxh2LjHRLKIU6dr9bxV753Quk4DTix1R7/ctULPq6W3SQlgc6hLsQVpvK4ayCtmeb6p avhA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tsbZ9IDW; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7c5b936cdd0si776420585a.584.2025.03.24.11.59.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Mar 2025 11:59:58 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tsbZ9IDW; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1twn11-000144-DM; Mon, 24 Mar 2025 14:59:15 -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 1twn0z-00012v-Bc for qemu-devel@nongnu.org; Mon, 24 Mar 2025 14:59:13 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1twn0w-0001Qy-Kj for qemu-devel@nongnu.org; Mon, 24 Mar 2025 14:59:13 -0400 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-38f2f391864so2823624f8f.3 for ; Mon, 24 Mar 2025 11:59:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1742842748; x=1743447548; 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=vhAN9Lyj4bqTf4UUrdE+Pmn+JYUm8J4DDJYtyAVBykw=; b=tsbZ9IDWQzEi9TLyUBrySZJb04NukdaXjn4GluRc3gmMINqEcvuyn7WpqVKG0Wh9zr 1U7PegJc7y0DLjQDFMS1ZcGfK1GWoktTQYGR/ifnCzOthTuLFXrEpYxAAAwtad5LLu07 cMgKvVItVlxkbTtVyUeEjdBcf720BPeMXgaFDH8eBTd5hsxttiPwTyQ/ZotJbCZwkyxd yLMOTJCZIpaJKRhafHha8aPYTOh3AvMxUpSxH9+fp2P7sdK3tQ5qcTvwzJFruuRcBHpr t1EP3KrNiM6ma/W4NRKWeJcQ6PUZMyGq9o8vmWaOjc8eQ7nILWbsuWfwkNRrAV37iDLn mNRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742842748; x=1743447548; 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=vhAN9Lyj4bqTf4UUrdE+Pmn+JYUm8J4DDJYtyAVBykw=; b=pSfv4mMD/fkGFfmUOlUTs7/1DHdNdKp/mYhMMOZ/iYGKB8+S7UvzOu8T3+UvDOxBRQ yxDFJMzkriW7iHVZHY7eF4QNBt0kvr+IrTHz0nzOXDiSKqmB2zRPGMKBBNNlE4xK/5Sg TRM33bDMeHKJ090BcCkjczbfKi9k/lefZR2fRKZawZ8VbWw3/URXBjpndY2v505ROYA5 4X1E6D/VlJk1hIqeYwzgoyd/uQdYTFmPC4WwL6z8rZiAXsV0PQAQjNxHLt6y8vonqoXl qQ5XMQlf9kM9hYj6CKc53eaXg0XBpC7rIn3UKHRGrm1+nNSdWv8SPt0OooA60JfZ2hMq KlzA== X-Gm-Message-State: AOJu0Yz+wHZlClHGG0emVHN4/dmz0o/oNbcYvjd3m20N4t3t+cdjLm2r r8jsEsHqVl+dGmykcmAVGkVHICEqv1MvXYUUD4H+S+yPltxpfnP/Xv0IKKI0dWb9Fqs8bxlZP/3 4 X-Gm-Gg: ASbGncss1T84fODfoeoxZaSrFd9I6aT/Oz4p3fv7dddn5JfsmraffQdKPj7bqOrOCAa Ho3xU/FD2WyMMepTtUlAkYxQ86+3SVkM7IfVCrAqtXlO5bKALxFN9iPPZskKEVm9AA6bzEOJpm0 i7WAyq2MC4yHQWevAoFlK3nbyQPVEMkb8y3TRsJz+5U6vMHFe8PO7CrRIa/1eLa/FtQnQ1b68RG By/JbcZRJQPvfsyQTLrPl7a3TvljlT9kVaZ/5UipAJkGaaJUDhorXR1aFFqv/EJ8sbO0Vw32ZQo XGr3yM59Al+/xPlxEPViM5imRYhxMO8gYRS10xsYlmwjKzY7gwLzIuBfJd/QcIobCLT42Hu+NO6 p9+SgtHnA3NjXJxlCuY+E38hT X-Received: by 2002:a5d:5f85:0:b0:390:d6b0:b89 with SMTP id ffacd0b85a97d-3997f93c41fmr11979681f8f.50.1742842748242; Mon, 24 Mar 2025 11:59:08 -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-3997f9b25c9sm11542529f8f.42.2025.03.24.11.59.06 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 24 Mar 2025 11:59:07 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , qemu-s390x@nongnu.org, Daniel Henrique Barboza , David Hildenbrand , Christian Borntraeger , Artyom Tarasenko , Eric Farman , Paolo Bonzini , Halil Pasic , Zhao Liu , Eduardo Habkost , Yanan Wang , Richard Henderson , qemu-ppc@nongnu.org, Nicholas Piggin , Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Mark Cave-Ayland , Marcel Apfelbaum Subject: [PATCH v3 5/7] target/s390x: Declare s390_set_qemu_cpu_model/cpu_list in cpu_models.h Date: Mon, 24 Mar 2025 19:58:35 +0100 Message-ID: <20250324185837.46506-6-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250324185837.46506-1-philmd@linaro.org> References: <20250324185837.46506-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=philmd@linaro.org; helo=mail-wr1-x435.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Both s390_cpu_list() and s390_set_qemu_cpu_model() are defined in cpu_models.c, move their declarations in the related "cpu_models.h" header. Use full path to header in s390-virtio-ccw.c file. Suggested-by: Thomas Huth Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Reviewed-by: Zhao Liu Reviewed-by: Eric Farman --- target/s390x/cpu.h | 4 ---- target/s390x/cpu_models.h | 3 +++ hw/s390x/s390-virtio-ccw.c | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index 5b7992deda6..8dd1936e3e2 100644 --- a/target/s390x/cpu.h +++ b/target/s390x/cpu.h @@ -900,11 +900,7 @@ static inline uint8_t s390_cpu_get_state(S390CPU *cpu) } -/* cpu_models.c */ -void s390_cpu_list(void); #define cpu_list s390_cpu_list -void s390_set_qemu_cpu_model(uint16_t type, uint8_t gen, uint8_t ec_ga, - const S390FeatInit feat_init); /* helper.c */ diff --git a/target/s390x/cpu_models.h b/target/s390x/cpu_models.h index 71d4bc2dd4a..f701bc0b532 100644 --- a/target/s390x/cpu_models.h +++ b/target/s390x/cpu_models.h @@ -113,6 +113,9 @@ static inline uint64_t s390_cpuid_from_cpu_model(const S390CPUModel *model) } S390CPUDef const *s390_find_cpu_def(uint16_t type, uint8_t gen, uint8_t ec_ga, S390FeatBitmap features); +void s390_set_qemu_cpu_model(uint16_t type, uint8_t gen, uint8_t ec_ga, + const S390FeatInit feat_init); +void s390_cpu_list(void); bool kvm_s390_cpu_models_supported(void); bool kvm_s390_get_host_cpu_model(S390CPUModel *model, Error **errp); diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 75b32182eb0..4f11c75b625 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -35,7 +35,7 @@ #include "hw/s390x/css-bridge.h" #include "hw/s390x/ap-bridge.h" #include "migration/register.h" -#include "cpu_models.h" +#include "target/s390x/cpu_models.h" #include "hw/nmi.h" #include "hw/qdev-properties.h" #include "hw/s390x/tod.h" From patchwork Mon Mar 24 18:58:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 875782 Delivered-To: patch@linaro.org Received: by 2002:a5d:5f4c:0:b0:38f:210b:807b with SMTP id cm12csp2298735wrb; Mon, 24 Mar 2025 12:00:43 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUpAlfJnJkY24OuXGhQc7nKm419p1sERbObOUny+klXAG9okbTdiMu2cbdHj1qcZLGWOCKOzA==@linaro.org X-Google-Smtp-Source: AGHT+IGhz6AUFoi67ybWbFFqv5M6fEctuxPNJQHv7STAXzrUK3++7vJsmo1EoTKwWjlBFLaiNcRo X-Received: by 2002:a05:622a:17cd:b0:476:8825:99bf with SMTP id d75a77b69052e-4771dda676cmr244952261cf.27.1742842843735; Mon, 24 Mar 2025 12:00:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1742842843; cv=none; d=google.com; s=arc-20240605; b=d7kzIqSiET88r/wKdA/AE+1l0FEvl8tGnOH/BJf3xBJfpIS7m73FsifUzV04Bf00J/ wJXC9jZDmlUMrt3IOplk3DsofHe6eFWPCVIFnvTAu1d3HIBw3pl3tmeJkj0H8HW8OKeM G5N8azCdYOHvK6xnmyCD6/8CitCF89IYGLs/w8EpW+kh4K8kk+WlT1ToShLhcm8DPlfZ DlS7aC7TTAjCK6UyOzqDXIUvYEUUaLFXWVm6jt4LoFSN96g2kdj6Y8f2Fu0WQ5PJYKph etXrap8tz2a/6O13Cj3z+mjez/SKHf3x1Foek5A5tJjUR1zxJllFrXnjpeFAzoeaQIkc cEcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=giTKQDxO89eOtpjts+wN77TEM8FZNJXhQbxAjblDYy4=; fh=5r5SmC1LiMx1zQnZIEbJrBEhy4OEKpCVEjDd1+1UapA=; b=QvkWbXvgogBm70pLDVFNrRqwZ9lDjjufiYF2z4ESPQ5nzsj2MK4rRqodPu/0m6m93Q T5ijCuuVuhKJobJfLp6WKouB9UsXAsTNVRrbYwmzt0fww9Kt1y4Ct1vjFTKeMxXqjHLj OrbMQkJSU2l9NMVlaFbKcE2+unyrqKvJjlhGfxULIRZ4zxeThXi59dOhk/rw38KmBPh6 0xA4RMNqaaZGNzVfjqHNv2+/Ovn6RZGRDP5BCYEuS9Z5iu8KfDTXh5gPgTIL+GVxVnRY 1berlT7en/yBXJt8stojchm1a022oW9es4ElphU7nHv8BF7Q0aY6YIVnEm48RL0jPxdj dZ6g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rbfkHjGA; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-4771d52cfe1si82843421cf.392.2025.03.24.12.00.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Mar 2025 12:00:43 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rbfkHjGA; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1twn16-0001Dr-Ib; Mon, 24 Mar 2025 14:59:20 -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 1twn13-00019e-F5 for qemu-devel@nongnu.org; Mon, 24 Mar 2025 14:59:17 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1twn11-0001Rb-Ew for qemu-devel@nongnu.org; Mon, 24 Mar 2025 14:59:17 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-43690d4605dso33746455e9.0 for ; Mon, 24 Mar 2025 11:59:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1742842753; x=1743447553; 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=giTKQDxO89eOtpjts+wN77TEM8FZNJXhQbxAjblDYy4=; b=rbfkHjGAsqb9DHS3hh+UAhkXM4FOdr+UialGuOEzRRn8ZPj/K2Xv+uQn6W0lWeugDz 3jfheh5mY5x7OsieBik3xtAxlj09CBoHWnnd+tv6hpcnzP063x5PA5SmI41k1t0jMMUi r7QdvY2q6huRWM/fx1HGa8GqyIWm20d08f5+C1ucLSbucNMxrafgUkJU7J+7iu1pAPJg fcHQJ+mWWM2LDjKKJpIrO7obczLqL+VU7V7KE7OaG9YJ+jUIPVDVaFrMN/dlMPN7h0DM qas2FKG7W0zFGy0T8XuQ3MyiUzFawBFP5gmm8SV5TayHlMaicGFJeNJt/0UkK5WSxO7d BvUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742842753; x=1743447553; 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=giTKQDxO89eOtpjts+wN77TEM8FZNJXhQbxAjblDYy4=; b=RBisoBBJ2itwde7z60ceZdeWN5c5LFdDLr4bRev/IBZdArr4KhOzxVaOUiFocZJ37b WLIgyS9mB4QxSIKGS6cri6d1GaMIeaGu7fZGnmXZMQleHRA7HJuxTEEWrIWuFSsiPuGk SSQi4j45NpWhESQM3ktov6exrbPXxQSZDL03z5dCLoCr5mv0ifw9S2I2ZV32funsdhvj +OFmlQREv2ETjryzQ1PPeH0GooauBObM+IsPX0vUUvunf3tfkZAMq4mnZ5oX5xKdvxzh vSbmFRSL1Sf3gVU3NiaztHMDDCnAj9eY1bh5fgeg2OINl7LoUxtpin0bh1aqMyyxcGTk qViA== X-Gm-Message-State: AOJu0YyRtd4y4MMiFK8mNJJiUoJfHSc7VHm4wOtvsDgqbIWaiiP/PYhm ie3JB9Fqq+2k8ZeI5txBTRKE4yq4Y3rgOHbRXit5CJPrh1rSeu7xkU9ra9ejC+bqsMNzmhPNAvI p X-Gm-Gg: ASbGnctZI9kl8WeXeBQUJwO79VrW7BvkG0xx3EEMA8GPPLjU/oXZtZw+Iu9Z2+jyE5o gGejbYRiPy2ynjWRQcSWS4BvKBr/gyHKzX2enJ2WOSusWTUT50qaDHy0WBHiAvbswwcDiv/sNij LCU6Y8gYNaZe07z+FbkMg6KwN1+v2CWDfgxgDRnSAZp5IGSKzo/D/LvOgLT9XO/gBuNerROlpsX Td9rFRls9VI960m2iqE8q660yt+SGMxBSOuLJXIRmwBAeTcVFpFfRq0n+WfNTbjh6Ggt5jiuSQ0 GuHc2v9QS3BC2fgNfO3t7ra8LEmN/OIL3d2fczTBuxa8++E6MsaHOdpzdhe1OcHQCLtMmGgbdwQ DKx61oTUw4fFC8ycZeDvyQsr7 X-Received: by 2002:a05:600c:138a:b0:43d:224:86b5 with SMTP id 5b1f17b1804b1-43d509e38eemr131575315e9.4.1742842753375; Mon, 24 Mar 2025 11:59:13 -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-43d43f43ecbsm178124395e9.10.2025.03.24.11.59.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 24 Mar 2025 11:59:12 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , qemu-s390x@nongnu.org, Daniel Henrique Barboza , David Hildenbrand , Christian Borntraeger , Artyom Tarasenko , Eric Farman , Paolo Bonzini , Halil Pasic , Zhao Liu , Eduardo Habkost , Yanan Wang , Richard Henderson , qemu-ppc@nongnu.org, Nicholas Piggin , Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Mark Cave-Ayland , Marcel Apfelbaum Subject: [PATCH v3 6/7] target/s390x: Register CPUClass:list_cpus Date: Mon, 24 Mar 2025 19:58:36 +0100 Message-ID: <20250324185837.46506-7-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250324185837.46506-1-philmd@linaro.org> References: <20250324185837.46506-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Register s390_cpu_list() as CPUClass:list_cpus callback and remove the cpu_list definition. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Reviewed-by: Zhao Liu Reviewed-by: Eric Farman --- target/s390x/cpu.h | 3 --- target/s390x/cpu.c | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index 8dd1936e3e2..1012be35d25 100644 --- a/target/s390x/cpu.h +++ b/target/s390x/cpu.h @@ -900,9 +900,6 @@ static inline uint8_t s390_cpu_get_state(S390CPU *cpu) } -#define cpu_list s390_cpu_list - - /* helper.c */ #define CPU_RESOLVING_TYPE TYPE_S390_CPU diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index 1f75629ddc2..ac05e82f0ac 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -378,6 +378,7 @@ static void s390_cpu_class_init(ObjectClass *oc, void *data) &scc->parent_phases); cc->class_by_name = s390_cpu_class_by_name; + cc->list_cpus = s390_cpu_list; cc->mmu_index = s390x_cpu_mmu_index; cc->dump_state = s390_cpu_dump_state; cc->query_cpu_fast = s390_query_cpu_fast; From patchwork Mon Mar 24 18:58:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 875785 Delivered-To: patch@linaro.org Received: by 2002:a5d:5f4c:0:b0:38f:210b:807b with SMTP id cm12csp2300237wrb; Mon, 24 Mar 2025 12:03:03 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWGssEdDx+bdDHoO27xneWxLGKaDkfoMCrTwK5YPV76MKDoUtlAgDGfZrK6bCtwMSJdoeo6dQ==@linaro.org X-Google-Smtp-Source: AGHT+IEpI6qPFCpU2nd9G1HH+q5VhQOfwNy952ysA+x8MiWhprJi4hiNn2GfHJV2ehLl9Y2zqWaZ X-Received: by 2002:a05:620a:4556:b0:7c5:4738:8a11 with SMTP id af79cd13be357-7c5ba18feafmr1781525785a.27.1742842983552; Mon, 24 Mar 2025 12:03:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1742842983; cv=none; d=google.com; s=arc-20240605; b=ftI9SyZhv1oz9fqtGCEfkYT3UsbgpznX2xZM5l50kdlj+K8RaTMofco5ONBeWJdde6 kvJ7MBxOaovrGj8bgR7azhWCxCNoaoc9DEFXEp9Rk0slMG6CgTKd5ZFD2ucOlquyzn0t 2hHUZyxqnW2SecYsj2IxcsEFIfyrvxh1FusahX5d7p/Tz7sN1dGR/PalbhBCIlSFncWr EnykKW6ITh5zdrUNKZiUURd2ngmMmw6ZU6K6aKbotn09At8ZmxfUbiveEO8+M0BuxDEU 0iOK2wb02Q6t+GOfGUGKjjuHLEeFAN/jjBU3axSmriOs6gE6XwpR4zMKwNXJI0BXlVqk atAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8MoNEz0fSiYs6s5Ieob4OaWyw4h8Wjxiwtk24X27qIo=; fh=5r5SmC1LiMx1zQnZIEbJrBEhy4OEKpCVEjDd1+1UapA=; b=aDhDOLyPrBV4yKAzk9HPOpWON6IPawKFyNFIiO9LMma128BA1UX6b2rHSrOuauyZgL zVDOGJBs37kQR+9uQ93aUH0YH+XIMmgMZkazG8sYiqd1vEpo8L81yp3e3SvovjneM+5N zgpgkXVbsAb44zZB72z5KGeHa007UBmnG+5+YEM6MwqseNeKNbZnmg0t5hBOwapt7yGz E6fFjiPnvegcp7RkkiVZoJPJz6yYO4+iVkybC25s0+f6ouDpfZN/gHvJFr3upw7S2o3q PyItadwAlPefAxy3r0gZ50jfYo0joXyKGtEn4ZVL99fmyzACJ2776l/hjNa6CSjVfyZV RT2w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qXfXSdsc; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7c5b9362150si808014785a.533.2025.03.24.12.03.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Mar 2025 12:03:03 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qXfXSdsc; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1twn1V-0001TZ-9k; Mon, 24 Mar 2025 14:59: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 1twn1E-0001HH-0y for qemu-devel@nongnu.org; Mon, 24 Mar 2025 14:59:32 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1twn16-0001SK-JI for qemu-devel@nongnu.org; Mon, 24 Mar 2025 14:59:27 -0400 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-391342fc148so3311169f8f.2 for ; Mon, 24 Mar 2025 11:59:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1742842759; x=1743447559; 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=8MoNEz0fSiYs6s5Ieob4OaWyw4h8Wjxiwtk24X27qIo=; b=qXfXSdscP27fQ6aRFQNL7k8DZGedGVA4XB32M3YC1rcFD20QMaygRCyAxbkDWucORA CkB+RfOiJgLbvvYW4ljKXatCE5fCmXenD3AR2Trxy/wBMiYKGjqDd/qCCd0zNp78eh92 gRVSmApeZs3YvqWKuDwpwkBS0vxVCsEMXZqeFiY+TlTk7zDar4PaeFn2GxDYU7br2lJP BkLFU8RFYnQlbQGcpghmd+jgXZcquroFywbW723nt+FT1C8X9230jeJx8S2Yd042GpqR JcX2YX9eFE0ejF82b2h1jWx8TbCM1CZf+h4yzsPIkZLJsSfC1jg0qqThEmntQDOICUOM UJLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742842759; x=1743447559; 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=8MoNEz0fSiYs6s5Ieob4OaWyw4h8Wjxiwtk24X27qIo=; b=oYhTYgkWCltGImny8Fl+yUrE7i6Yxd4cRhT6OOaBjuMeI47csCf/Q9jkJPC0bzbQNP rTaVtETNCt4yysVRBWt9HXu9sBwOYfmld3qRKvrZDoSJVZDzG1nSRcHURUO47k/dSyJH j/2ag7FE6R1ySYtG9KLBRPL9fVmCyxGlYuzz8u9Xxp1U8h4rAZo2NyDmaJekCQ+qsd+i FVl60URCYXktwzO2uNZsUWZfVcmHTuP/YdgOhXlVr/j8tkf8TGiESLIHpGIr8pKaldcC E7nPQ30O63IqGKxbtydW3SaRH16NrOSJUl1ytOQt4QBSJ1mIuqpy+oPvtY4r95qdo4SK /K5w== X-Gm-Message-State: AOJu0YxuHZPAVTXFD537Wsq1rOljH0vZKotwTPUVOPkTe7ThrTpWeaIF ZBSMNgqzGLMMT9O0zbbnnK/G1WpeV23hEMVyjI+0CYP/Buq+HwZK/j/0jhvHyGs5wHy/hWsdkAh u X-Gm-Gg: ASbGnctvbzkVm8R5n10Ghuz8XAJsjc6oeUAHUeYF5Cn1CutTCWtFo/RS2WxeXUUIBRn ItzjFsz+lkJQK7JYDeTr2Ucj02h5Jl7B73tV/KOoc2XWgI15qWcCltXUyDv3datE9vCrMxgVUG9 Sp5ph1OMp1ea5a4eztcTSpzH4vjdPaDZzBdr8gFiglWc7vWcGvH6YlpblY51FxB/0bvDiKaWt15 Tr14IUsK1X1zxyVcnIcLHtdMjGpOb6GX3jx2Lw4vwkIwucKzpat2Z8RxRkDHZ047hPNkv0A57rc FHTKWrIDCsSuc4Vg6tCjKop/AzCNyZG+c1sm1IBCDbVMm+V/bZlpG5wwIN4l3vvMbdDNpYqt7l6 /w+xQ3yY5ljs4f4EcIkfifwC1 X-Received: by 2002:a05:6000:1fa5:b0:391:3b1b:f3b7 with SMTP id ffacd0b85a97d-3997f90ddb7mr14616046f8f.28.1742842758740; Mon, 24 Mar 2025 11:59: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-3997f9efe61sm11889476f8f.97.2025.03.24.11.59.17 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 24 Mar 2025 11:59:18 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , qemu-s390x@nongnu.org, Daniel Henrique Barboza , David Hildenbrand , Christian Borntraeger , Artyom Tarasenko , Eric Farman , Paolo Bonzini , Halil Pasic , Zhao Liu , Eduardo Habkost , Yanan Wang , Richard Henderson , qemu-ppc@nongnu.org, Nicholas Piggin , Ilya Leoshkevich , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Mark Cave-Ayland , Marcel Apfelbaum Subject: [PATCH v3 7/7] cpus: Remove #ifdef check on cpu_list definition Date: Mon, 24 Mar 2025 19:58:37 +0100 Message-ID: <20250324185837.46506-8-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250324185837.46506-1-philmd@linaro.org> References: <20250324185837.46506-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=philmd@linaro.org; helo=mail-wr1-x431.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Since we removed all definitions of cpu_list, the #ifdef check is always true. Remove it, inlining cpu_list(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Reviewed-by: Richard Henderson Reviewed-by: Zhao Liu --- cpu-target.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/cpu-target.c b/cpu-target.c index 5947ca31a0a..30598619581 100644 --- a/cpu-target.c +++ b/cpu-target.c @@ -71,7 +71,6 @@ const char *parse_cpu_option(const char *cpu_option) return cpu_type; } -#ifndef cpu_list static void cpu_list_entry(gpointer data, gpointer user_data) { CPUClass *cc = CPU_CLASS(OBJECT_CLASS(data)); @@ -85,17 +84,6 @@ static void cpu_list_entry(gpointer data, gpointer user_data) } } -static void cpu_list(void) -{ - GSList *list; - - list = object_class_get_list_sorted(TYPE_CPU, false); - qemu_printf("Available CPUs:\n"); - g_slist_foreach(list, cpu_list_entry, NULL); - g_slist_free(list); -} -#endif - void list_cpus(void) { CPUClass *cc = CPU_CLASS(object_class_by_name(CPU_RESOLVING_TYPE)); @@ -103,7 +91,12 @@ void list_cpus(void) if (cc->list_cpus) { cc->list_cpus(); } else { - cpu_list(); + GSList *list; + + list = object_class_get_list_sorted(TYPE_CPU, false); + qemu_printf("Available CPUs:\n"); + g_slist_foreach(list, cpu_list_entry, NULL); + g_slist_free(list); } }