From patchwork Tue Dec 12 16:29:00 2023 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: 753087 Delivered-To: patch@linaro.org Received: by 2002:a5d:4c83:0:b0:333:3a04:f257 with SMTP id z3csp2010050wrs; Tue, 12 Dec 2023 08:31:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IHnhnAQ2Bmt9EThPntau4rdYCrcIvwO3lQ9kxfuXBf133pJb8nWBy3i+c8h7rtmYFyKUk28 X-Received: by 2002:a05:620a:956:b0:77f:8d69:c4a with SMTP id w22-20020a05620a095600b0077f8d690c4amr615947qkw.135.1702398664740; Tue, 12 Dec 2023 08:31:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702398664; cv=none; d=google.com; s=arc-20160816; b=wos++y5svlTaRYi+LDeWypaomQuK/ha6mqZJui587yxeSE3FBayG/dEB2Jq2pl16k/ Aj02dCd6kSIUqoW8P+6X/zzqmf39X++gLLbC2rY+z1BF437YK2QAUAmMSF5js+/RIEgs rKhEDVh3j0fMdAxu7lzEsFk/VaZkHUezpqon/fBtvEsiwXdCUdZf2UmEMF7P5YEmnDtG jCyBHW6v8T/VJ6Ht8jSy7/ZkvUT7rYvOZ346vHSYGWPhh6ciy+1qeywwhYiTdb1JlFJw JVtxPHjmeQ3yZiUmxuWdos+i+K0HGiAYkdgTu04sd2j/CDlqbur5PB0F8Ja9CTsQqop6 XveA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=mn32UhI3GcAekEbpxlWbpPxY01K3QFuN0m3na/SgxOo=; fh=CkupYgn1Qmdh7jizui9HJgGegpqbRR5NXz1VyjRE1Hs=; b=aZOb6wxip0Glhm9GaPinbTHnDBujf7tHZ68DyexGh74ToYqrWV8/PqXqpgeBiZSS4+ bFtfizw400j/MVyOd1GycmOgaCGfH4JIecD9nyhRqbtjt5OutKsSwvvpP7D5fQsrwMM8 q8RF+xL9joBW7n99MPL5V7MY5PK0bZmhOd6n3xzdmYUzR/hP3kDnqsjJVYaDkxvZ6pK9 KkIq4cZLNFUlCxrmnHZowUw1sZk0zgo1JGliw1NJa7f3o5C62HbVehdNpFq3bqvbCwEB J44HMfNC5dCwVKM7vouMgiUOo+tVnPSk5QFJYJL7AjoBkBY55fgr2UMFTnovB67EbuIP k4pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="zyq/5RIB"; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id bn34-20020a05620a2ae200b0077f4e80e131si10078821qkb.692.2023.12.12.08.31.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Dec 2023 08:31:04 -0800 (PST) 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="zyq/5RIB"; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rD5dk-0000om-06; Tue, 12 Dec 2023 11:29:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rD5dh-0000oC-Sx for qemu-devel@nongnu.org; Tue, 12 Dec 2023 11:29:45 -0500 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rD5df-0006vx-Op for qemu-devel@nongnu.org; Tue, 12 Dec 2023 11:29:45 -0500 Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-a22f2a28c16so21691966b.0 for ; Tue, 12 Dec 2023 08:29:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1702398581; x=1703003381; 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=mn32UhI3GcAekEbpxlWbpPxY01K3QFuN0m3na/SgxOo=; b=zyq/5RIBdjdWcddkS4QQceY/1cPJjictJG7iJ6ucI6ZaItSTr8Ofgx9J+jnMUO8Olb Dec0tB7SsXP0YQMvcPbzL+BiuMonAhmCyOncwLii9Sx5RxrX8UZpWo4O3E7DRp5c44bn a857dEWMndyfBnOtaUvy6t1xSqrNHYTyz20cSTiVI9GE7g3JQbUcH+wT+ygbs689ewoK DZgT6YGEZeGHbe8H7+Eqn/bBjXpchHdXmWyIOUdsfVgjLe2FnFiq4odX62KtkCOBu7pP KUyS+7duxAVlLSg8qxveag4Usr83R2+Tz/eIrE0ldWG/jfft4CWgk1LeBRc4arOsKsrh 2WVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702398581; x=1703003381; 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=mn32UhI3GcAekEbpxlWbpPxY01K3QFuN0m3na/SgxOo=; b=lTPTRbtJAKCGZ0orchtg/h81c5ToOcH5Bcl2CbSbYFiiCEGKgWEzyYYjm162lrulW+ bndRo9OTEX7CIsQIQc9zccdSz0+fTVzcWfpBoI4NL/bmMtkXaMW3EDMGcScmoUBnnOS7 gZjtrFF8wpKc7y9pjfzUiN3qOLQfChB3Pwr2UIiTmzk00Q7J3sA/GBYu8gVPGM6cfGrn 1TTBWlXj/hIfGNrra9ATDTrGIoUEgxtiTX53d2SL+IBAVxCaAk5M0A9mIXOnFGddpg7R uomNhj3522a5VzBqnYV1wd2Gn0wB8Wx/9aPYR0ILNv7ytID/KnKXjpfFnCnrMmEZJHrG e20w== X-Gm-Message-State: AOJu0YzQu40NgAPK6n4pKoZLAEWpWmNubuQ7JPOHEVfXTzxnX4e8BEp3 OVzkO8oLZ0GVmxY/0uVOpAfU8CuUN8X/y4HGp1I= X-Received: by 2002:a17:907:9411:b0:a1d:9697:73a2 with SMTP id dk17-20020a170907941100b00a1d969773a2mr2865365ejc.93.1702398580756; Tue, 12 Dec 2023 08:29:40 -0800 (PST) Received: from m1x-phil.lan ([176.176.175.193]) by smtp.gmail.com with ESMTPSA id ul5-20020a170907ca8500b00a1f7b445f5dsm5241984ejc.124.2023.12.12.08.29.36 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 12 Dec 2023 08:29:40 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Tyrone Ting , =?utf-8?q?Alex_Benn=C3=A9e?= , Manos Pitsidianakis , Eduardo Habkost , Joel Stanley , Alistair Francis , Anton Johansson , Andrey Smirnov , Peter Maydell , Hao Wu , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Jean-Christophe Dubois , Igor Mitsyanko , "Edgar E. Iglesias" , Andrew Jeffery , Rob Herring , qemu-arm@nongnu.org, Mark Cave-Ayland , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 00/33] hw/cpu/arm: Remove one use of qemu_get_cpu() in A7/A15 MPCore priv Date: Tue, 12 Dec 2023 17:29:00 +0100 Message-ID: <20231212162935.42910-1-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62f; envelope-from=philmd@linaro.org; helo=mail-ej1-x62f.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Hi, When a MPCore cluster is used, the Cortex-A cores belong the the cluster container, not to the board/soc layer. This series move the creation of vCPUs to the MPCore private container. Doing so we consolidate the QOM model, moving common code in a central place (abstract MPCore parent). This eventually allow removing one qemu_get_cpu() use, which we want to remove in heterogeneous machines (machines using MPCore are candidate for heterogeneous emulation). Maybe these hw/cpu/arm/ files belong to hw/arm/... Regards, Phil. Philippe Mathieu-Daudé (33): hw/arm/boot: Propagate vCPU to arm_load_dtb() hw/arm/fsl-imx6: Add a local 'gic' variable hw/arm/fsl-imx6ul: Add a local 'gic' variable hw/arm/fsl-imx7: Add a local 'gic' variable hw/cpu: Remove dead Kconfig hw/cpu/arm: Rename 'busdev' -> 'gicsbd' in a15mp_priv_realize() hw/cpu/arm: Alias 'num-cpu' property on TYPE_REALVIEW_MPCORE hw/cpu/arm: Declare CPU QOM types using DEFINE_TYPES() macro hw/cpu/arm: Merge {a9mpcore.h, a15mpcore.h} as cortex_mpcore.h hw/cpu/arm: Introduce abstract CORTEX_MPCORE_PRIV QOM type hw/cpu/arm: Have A9MPCORE/A15MPCORE inheritate common CORTEX_MPCORE_PRIV hw/cpu/arm: Create MPCore container in QOM parent hw/cpu/arm: Handle 'num_cores' property once in MPCore parent hw/cpu/arm: Handle 'has_el2/3' properties once in MPCore parent hw/cpu/arm: Handle 'gic-irq' property once in MPCore parent hw/cpu/arm: Handle GIC once in MPCore parent hw/cpu/arm: Document more properties of CORTEX_MPCORE_PRIV QOM type hw/cpu/arm: Replace A15MPPrivState by CortexMPPrivState hw/cpu/arm: Introduce TYPE_A7MPCORE_PRIV for Cortex-A7 MPCore hw/cpu/arm: Consolidate check on max GIC spi supported hw/cpu/arm: Create CPUs once in MPCore parent hw/arm/aspeed_ast2600: Let the A7MPcore create/wire the CPU cores hw/arm/exynos4210: Let the A9MPcore create/wire the CPU cores hw/arm/fsl-imx6: Let the A9MPcore create/wire the CPU cores hw/arm/fsl-imx6ul: Let the A7MPcore create/wire the CPU cores hw/arm/fsl-imx7: Let the A7MPcore create/wire the CPU cores hw/arm/highbank: Let the A9/A15MPcore create/wire the CPU cores hw/arm/vexpress: Let the A9/A15MPcore create/wire the CPU cores hw/arm/xilinx_zynq: Let the A9MPcore create/wire the CPU cores hw/arm/npcm7xx: Let the A9MPcore create/wire the CPU cores hw/cpu/a9mpcore: Remove legacy code hw/cpu/arm: Remove 'num-cpu' property alias hw/cpu/arm: Remove use of qemu_get_cpu() in A7/A15 realize() MAINTAINERS | 3 +- include/hw/arm/aspeed_soc.h | 5 +- include/hw/arm/boot.h | 4 +- include/hw/arm/exynos4210.h | 6 +- include/hw/arm/fsl-imx6.h | 6 +- include/hw/arm/fsl-imx6ul.h | 8 +- include/hw/arm/fsl-imx7.h | 8 +- include/hw/arm/npcm7xx.h | 3 +- include/hw/cpu/a15mpcore.h | 44 ------- include/hw/cpu/a9mpcore.h | 39 ------- include/hw/cpu/cortex_mpcore.h | 135 ++++++++++++++++++++++ hw/arm/aspeed_ast2600.c | 61 ++++------ hw/arm/boot.c | 11 +- hw/arm/exynos4210.c | 60 ++++------ hw/arm/exynos4_boards.c | 6 +- hw/arm/fsl-imx6.c | 84 ++++---------- hw/arm/fsl-imx6ul.c | 65 ++++------- hw/arm/fsl-imx7.c | 103 +++++------------ hw/arm/highbank.c | 56 ++------- hw/arm/mcimx6ul-evk.c | 3 +- hw/arm/mcimx7d-sabre.c | 3 +- hw/arm/npcm7xx.c | 48 ++------ hw/arm/realview.c | 4 +- hw/arm/sabrelite.c | 4 +- hw/arm/vexpress.c | 60 +++------- hw/arm/virt.c | 2 +- hw/arm/xilinx_zynq.c | 30 ++--- hw/cpu/a15mpcore.c | 179 +++++++++++++---------------- hw/cpu/a9mpcore.c | 138 +++++++++------------- hw/cpu/arm11mpcore.c | 23 ++-- hw/cpu/cortex_mpcore.c | 202 +++++++++++++++++++++++++++++++++ hw/cpu/realview_mpcore.c | 30 ++--- hw/arm/Kconfig | 8 +- hw/cpu/Kconfig | 8 -- hw/cpu/meson.build | 1 + 35 files changed, 689 insertions(+), 761 deletions(-) delete mode 100644 include/hw/cpu/a15mpcore.h delete mode 100644 include/hw/cpu/a9mpcore.h create mode 100644 include/hw/cpu/cortex_mpcore.h create mode 100644 hw/cpu/cortex_mpcore.c delete mode 100644 hw/cpu/Kconfig