From patchwork Tue Dec 12 16:29:33 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: 753112 Delivered-To: patch@linaro.org Received: by 2002:a5d:4c83:0:b0:333:3a04:f257 with SMTP id z3csp2012855wrs; Tue, 12 Dec 2023 08:35:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IEwG6CP+IYwSQd+xWmhBOgCVSqYiAdCYmSLaVdO80dgD45WEAt2QXfJd8sBhCU+ZTJ7hAXm X-Received: by 2002:a05:6871:452:b0:1fb:75b:2b92 with SMTP id e18-20020a056871045200b001fb075b2b92mr3748204oag.78.1702398943629; Tue, 12 Dec 2023 08:35:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702398943; cv=none; d=google.com; s=arc-20160816; b=xi0/uBCGEXvQRF0dhB3qOOz+vUs5pwVthdaPG1ekHdiP4CTpu0V3mEAzKuUKbln/s7 3AQXAR3QlIk+GWVuWPvK9Wah2UM2OqThEVdStKlQJNUB0ZNE9sXcEVEaJyVaqxYCC3qz crib0i7eaSVP76tzIgARwa6yFp1l8Xy73413R7IloQ2fxy1VdCsNmetA8QeOd7H/Dt9s wYeuZgfIkl5wg4Ty41zcTW7rK2o1uwrNpOPEtc/RtcfJwEA4N37PTxZcE36HxXD1JjgG gNmyW93hOlzwL/m+Qs0GBBP4vkL2eTbnsn36vj4B1NML+4RzAjthwWLI5Wwmui1dmQN2 nEOQ== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=StICgPk89ZsN/BIJTPTbcQmjR7zrsjp+vJLVxNH++7g=; fh=CkupYgn1Qmdh7jizui9HJgGegpqbRR5NXz1VyjRE1Hs=; b=va2ecDwTA4+1Kj5+8TgjJyMgQ2du2nXbVetSjgXmJqSbpFp/n8A00UU627p57HxkQW CVMfIMergnXs8WmIN78MaxNXHIMPrn/ykIfJMghlpymioGj0N8pE0+LJ9nlOonjlv8Le tbFf+h7PLz/0nwFz5PxKc8NlvUrqZ/Xc6mJWfDG9ouYn69yEAabFMd2xzZn07n/r8dyB EDyjGMG9PIsiHrjj5Hibu4mOPBwFGX53s2EDFJUF/duf6bjWkaVgKkcJJphDZ5l236Yu ZRKjomb9ZiXpYkVSh6YqRHfM7WYiWYRbnxafeo/X2SjZhOmniGn8Ns9sNRdhnaMuKz8T O5SQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wW78ArTj; 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 fz6-20020a05622a5a8600b0042578b77421si11373551qtb.550.2023.12.12.08.35.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Dec 2023 08:35:43 -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=wW78ArTj; 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 1rD5hh-0004Ld-1b; Tue, 12 Dec 2023 11:33:53 -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 1rD5hW-0003vr-Mf for qemu-devel@nongnu.org; Tue, 12 Dec 2023 11:33:42 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rD5hU-00084G-M5 for qemu-devel@nongnu.org; Tue, 12 Dec 2023 11:33:42 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-40c31f18274so54060365e9.0 for ; Tue, 12 Dec 2023 08:33:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1702398817; x=1703003617; 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=StICgPk89ZsN/BIJTPTbcQmjR7zrsjp+vJLVxNH++7g=; b=wW78ArTjZHWQUFImP32sph0nt4Ov1g0D3Vdo+j8086myT0z5mFKRgfQ8Ryi/smS4Tw wQy2ezVYacx5Xi52Z6+w2xMJ3aeD4C5KxtpO0k+zJVvt9ydaJvu1m78DrhZQGMfavBmi 6/aDKRRZ8D3hpOC0xoI2orghpoiOTf1stOGTv2A1kLWDbARf56ELZPU7+kNNmBuVaFgZ x20Pf4AL7Rud8k5SKHxKvYByy2VSUqe7ei4a3PeHVg/+cv0L4vWMVw8onWHqH3wYpvRC lbVGFeAoK2LiIh2YhbM/PWqkkdGLjjhjofF6r0fogV7+d7n8zMI7htA35ywv07PMbHnL 7hDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702398817; x=1703003617; 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=StICgPk89ZsN/BIJTPTbcQmjR7zrsjp+vJLVxNH++7g=; b=xJtc5cQUqkdh/8TklL6aS4ym+jMGndIxg+mPiIGjhs9ncidU8Jd6/WrBz3sSAYsnBA gGdohfhp1greYLeTaR++PkGFpC929UnLk5UvsbASjl+Cm2pf1bLx3hk5IqRCLRYfuCWe fP4jJanZhlnGz8Zppt157DyvcM0L1v++oOj0ZAwUnJzxS5omUS8gembRurg1zgat6id9 AHsPTXu/8DKF7QTRfAGehw+5fZyTNOwuj9XbXYJszCqKR6ydux/qmHzdQBqlCsgjNITG Wl8drq0ZOd+rY4JLzA3XikVddfMacQ0KjMFfQQBPoEd2SeY1APhlsruGj2UCBuzpNFhR Ccuw== X-Gm-Message-State: AOJu0Yx7Id8yYSFPvX72zqXWS3dE5VALn5YcGbMZ08XpcIesv9uZpxbD ua7VgmZ2u9vK/Irdpf+QmMEJI9BJ5lFrumxHoDo= X-Received: by 2002:a05:600c:2146:b0:40c:2b26:970f with SMTP id v6-20020a05600c214600b0040c2b26970fmr3255515wml.198.1702398817653; Tue, 12 Dec 2023 08:33:37 -0800 (PST) Received: from m1x-phil.lan ([176.176.175.193]) by smtp.gmail.com with ESMTPSA id v13-20020a5d590d000000b003363469490asm1384996wrd.111.2023.12.12.08.33.35 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 12 Dec 2023 08:33:37 -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 33/33] hw/cpu/arm: Remove use of qemu_get_cpu() in A7/A15 realize() Date: Tue, 12 Dec 2023 17:29:33 +0100 Message-ID: <20231212162935.42910-34-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231212162935.42910-1-philmd@linaro.org> References: <20231212162935.42910-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, 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 Previous commits (in particular "Create CPUs once in MPCore parent") allowed creating the MPCore private container vCPUs within the container. We don't need to call qemu_get_cpu(), which is unsafe in hegerogeneous context. Directly access the CortexMPPrivState::cpu array. Signed-off-by: Philippe Mathieu-Daudé --- hw/cpu/a15mpcore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/cpu/a15mpcore.c b/hw/cpu/a15mpcore.c index 5f28a97adb..8dccf15103 100644 --- a/hw/cpu/a15mpcore.c +++ b/hw/cpu/a15mpcore.c @@ -44,7 +44,7 @@ static void a15mp_priv_realize(DeviceState *dev, Error **errp) * appropriate GIC PPI inputs */ for (i = 0; i < c->num_cores; i++) { - DeviceState *cpudev = DEVICE(qemu_get_cpu(i)); + DeviceState *cpudev = DEVICE(c->cpu[i]); int ppibase = c->gic_spi_num - 32 + i * 32; int irq; /* Mapping from the output timer irq lines from the CPU to the