From patchwork Mon Mar 24 18:46:04 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: 875770 Delivered-To: patch@linaro.org Received: by 2002:a5d:5f4c:0:b0:38f:210b:807b with SMTP id cm12csp2294102wrb; Mon, 24 Mar 2025 11:47:05 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXwuWDpEl9mB4WNxCHWPnx4QfGBKEAMKRsP8nMNM4HqtEup5YbeNvwi3r9yEPGsXtCmVVOajA==@linaro.org X-Google-Smtp-Source: AGHT+IH8pObwp9ODY5+rM4bGPx+XCI+uNAAd9Xd8ZSCr6OZ3KVUg8Vp0xwDr03cDmuAKxjThC2a6 X-Received: by 2002:a05:6214:29e9:b0:6d8:9872:adc1 with SMTP id 6a1803df08f44-6eb3f34ef14mr198379956d6.38.1742842024896; Mon, 24 Mar 2025 11:47:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1742842024; cv=none; d=google.com; s=arc-20240605; b=RzmmTS0p2u89uVJCMkUeu9qH8HjmT2tbG1NPY7Uiv3yqxfamwbARtxF+Yb0b7Gn9U6 z9FIjDyJK/QFOnhqndugPmh6TGS9Mu+DG4OZh+EBox0pD6iqRlZfd/4m432xuBH2+6qW atEky3nqazDe5iqgR+JNZsOHDVYbD6MutMiK4m6R6ubTN9EkUTo4TqAXeFqwa/Gyy9tv T6L3VTU3QrDyF1aKzL7GNgjXIdxKiedC4FJqgxhPBKPG1MIkh8GzMYWfh8osx3xAOkkh pZWf9o8NOIBroBFQ8yvYa5cLDcBbV4FyX89RMPdtJaSBzUriLDNMeQ1iSuA09yhxK/Je NnQw== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=EtHbfn1fbFKflRQMdeysPm/QTqpqrsNvRoPoT6AS7VQ=; fh=jn65LpBog/h77pKixoe86z6WrIBQWrzlfmjRxMqbSL8=; b=abSpNVbj7VPYubDyldZ7ReaInJ0Z17ouEk+VoDf5BoDJTRXagoP5wiF+XYnIOrCAG7 1hXA3fn6PgVu1bPuNn+wJCvC2eiM5yGjOvSBEaaKl30FEm4P7yY08DyJWuXMakEJGrwH HoMBbQT+3MaZhFkjarYRJpgOlZ6q7WHuFI6KPbn+otVwV0Fros8XSzX9xrZzP+PgvPqU jnDZK34+frAb1v8TtGyDHna6S6/T+7Etolp/H2xwnlgzvswgnBnOEyqhoKbgcAy19JLL hs+ebgOqLSn5LEPvVTV8hyLebBrM0Bsyhyt4KocjptaqgdU+g15bMebErkABYwAbv1DE 3k0g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="eMRx/pSK"; 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 6a1803df08f44-6eb3f03ef24si79245746d6.427.2025.03.24.11.47.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Mar 2025 11:47:04 -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="eMRx/pSK"; 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 1twmoZ-0000w5-6u; Mon, 24 Mar 2025 14:46:23 -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 1twmoW-0000ua-Kt for qemu-devel@nongnu.org; Mon, 24 Mar 2025 14:46:20 -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 1twmoT-0008Mp-Rm for qemu-devel@nongnu.org; Mon, 24 Mar 2025 14:46:19 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-43cfebc343dso36110775e9.2 for ; Mon, 24 Mar 2025 11:46:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1742841975; x=1743446775; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=EtHbfn1fbFKflRQMdeysPm/QTqpqrsNvRoPoT6AS7VQ=; b=eMRx/pSKTjLWa0FccGmAtPjED1AW+mWFKbpwwloTozX77mp75zoEbCa0a6RaFKRMda QnFPGpx0Mw61Otlhfh9YrO7janR85rJHmDTqk+oHgebL1CMOgWj1NBFWMLRIn7KvlV17 RFXyMVi4YbbqVzhbfZWUq61/8cZrx/lzawJHlaVfQbGqaqgDexkDXo8Rhz05uD+1CO8R s1nrRMSPrJE3c4qm/jlDvfqofZPRi1mBbcvIEfpsnbWFkzCadu53LrphbzguqwwfUVIz Vy+lmgYs+virtEE7svKg31Ky6d2NpKXza3W/9L49EodwUBKofDvqAjfHvLp3zc/kbiGz s0+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742841975; x=1743446775; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=EtHbfn1fbFKflRQMdeysPm/QTqpqrsNvRoPoT6AS7VQ=; b=Gd5fSOM/VscejSJCGGZx3Si0kjU4F6IeezoIQtGs4ZLPZKq8cnLGR0WWnWscBFxg5j O3pUa3mueJSaXoOiiCTzcKcH0vtssQCbJ8ha9YHW5+m3+Y4OHx3W1ksCLg6PPZRsvp28 yZ9jzFrNVo+Pi1PyFTt6JfndFOeMeJOljj0aGUv67RmbqN6DkFvQIrVYlbwOyj9CPbQC p4jwsUw/ldm2+uujEWpZlNitDfG6OZ9QX1oZ4UsHRi90R99n5QUgEi65JvuVntrFdQq7 b+ZlAfZ4gOA3iuAK4TGgmJIZ8U+OUIexu7aVnTgW/yCSwpR1SqiKb2eTlgesvdoDcVOu eppw== X-Gm-Message-State: AOJu0YzBLhxhjNpb+F503qWO8yEXUMo1g29lBZEmIXYvH1SWEllsQZ3k ZmeBtcPy6BaXt28UO6x4qxJuAq+cgnHu26Cz6gcPs/q5rriMszmOoGw3s70YLF0idZL2DZ/VYs3 r X-Gm-Gg: ASbGnctJidBgySlaUEhs2oxqpXZiEVwhmQ0L9cM7FWV5NgE/SeYBzf8K3by9i4d6DpV u//Q+LcxofoVIfWt61bp2y5Z20geVzKFMP9pSbYN3pz9wVwVHdyKTn1DhvAGoUeXy9KZfHt7s3O jjpdh+iMDXV25urDs3OeE/jjSSxMwKFTdy9jDilguvw9sjxCdX3ivG/R/gWD1aZWTJsWvwebHxz glM7s8ThqKHc1NHk+TRL/adHCdvGq4b63kcBwbeuXUeDEd53BN+U3bZzSAtF8nmwhS0yJgRzySg 7Vqav1ZAkK3i3yxsOz4ysEcFnfqmclPHEjlE3FbisJB5XZNFL4BgzEYt9Wob1X9l190huR1NMiw uc3tM0bJ6zOQHHewvAI80lBX/ X-Received: by 2002:a05:600c:3b95:b0:43b:b756:f0a9 with SMTP id 5b1f17b1804b1-43d509ea96fmr129771595e9.11.1742841974818; Mon, 24 Mar 2025 11:46:14 -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-43d43f43e50sm177444345e9.12.2025.03.24.11.46.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 24 Mar 2025 11:46:13 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Eric Farman , Ilya Leoshkevich , Nicholas Piggin , Eduardo Habkost , Marcel Apfelbaum , Yanan Wang , Paolo Bonzini , Mark Cave-Ayland , qemu-s390x@nongnu.org, Christian Borntraeger , Daniel Henrique Barboza , Richard Henderson , Thomas Huth , Artyom Tarasenko , Zhao Liu , qemu-ppc@nongnu.org, Pierrick Bouvier , David Hildenbrand , Halil Pasic , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH-for-10.1 v2 0/7] cpus: Convert cpu_list definition to CPUClass:list_cpus callback Date: Mon, 24 Mar 2025 19:46:04 +0100 Message-ID: <20250324184611.44031-1-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 MIME-Version: 1.0 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Since v1 (Thomas review comments) - Move s390_set_qemu_cpu_model/s390_cpu_list to "cpu_models.h" - Correct 'target/s390x: Register CPUClass:list_cpus' subject 'cpu_list' might be defined per target, and force code to be built per-target. We can avoid that by introducing a CPUClass callback. This series combined with another which converts CPU_RESOLVING_TYPE to a runtime helper, allows to move most of cpu-target to common. Based-on: <20250324165356.39540-1-philmd@linaro.org> Philippe Mathieu-Daudé (7): cpus: Introduce CPUClass::list_cpus() callback target/i386: Register CPUClass:list_cpus target/ppc: Register CPUClass:list_cpus target/sparc: Register CPUClass:list_cpus target/s390x: Declare s390_set_qemu_cpu_model/cpu_list in cpu_models.h target/s390x: Register CPUClass:list_cpus cpus: Remove #ifdef check on cpu_list definition include/hw/core/cpu.h | 2 ++ target/i386/cpu.h | 3 --- target/ppc/cpu.h | 4 ---- target/s390x/cpu.h | 4 ---- target/s390x/cpu_models.h | 3 +++ target/sparc/cpu.h | 3 --- cpu-target.c | 25 ++++++++++++------------- hw/s390x/s390-virtio-ccw.c | 2 +- target/i386/cpu.c | 3 ++- target/ppc/cpu_init.c | 3 ++- target/s390x/cpu.c | 1 + target/sparc/cpu.c | 3 ++- 12 files changed, 25 insertions(+), 31 deletions(-) Reviewed-by: Richard Henderson