From patchwork Tue Jan 23 06:38:37 2024 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: 765182 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:10c4:b0:337:62d3:c6d5 with SMTP id b4csp1460753wrx; Mon, 22 Jan 2024 22:40:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IHbuItnBYvvIHl7PZVnp+V6PnR4M808JMD+bjGYmlJj05n/5zCWo8Gcm1dwQPt4fQfsm1AO X-Received: by 2002:a05:620a:3720:b0:783:3c48:66ff with SMTP id de32-20020a05620a372000b007833c4866ffmr6483780qkb.49.1705992033764; Mon, 22 Jan 2024 22:40:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705992033; cv=none; d=google.com; s=arc-20160816; b=Pq+qtaL/z5LWO59R70qsAKFx/2V6IasVrSbFuOBdFUZXXCEwoCgzqdZKEMYaBipJIF qgcQrgIh+d2uuMrlf/JMdRk4EMLurb96H1+I17xSxzII1VArCJFuRo4DSDhZq/A19R3k jx6TLMc+CqTaN0nSz3aKhL8ditkTnyzU67GVvsE7DDSN+29FwhmmLQOgve3Hzpfg4UKE XidXjVoxBJL1KQqWSp6lepkloEcqbsCdkKLVc1npoVrjM3xY70T9pqS0iSuoF1g78qwW Lv4vnhXDcaVz9jnTf8/zziwuZKO3jrFkRKJNcxA3JAdc2jn5Y2URwhFMapWBjjZ4lWyw o9bQ== 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=2RjX1tFrRGVlM1BwnlKhE6JoLvLjIml7FEvFQ9cMoCw=; fh=HVoLZTw5hlqqes9L9DSbvdhxOE62q72aEHLq82QYnRw=; b=o/du18HmvI+U4vwr53bvnMAFvfXii/+Wp+03J5VODLbX9rKOoafjG1qfCySeCVKYl1 8lLrSEr2xSmg+MYXyrL9A4i9y4MznUtyn1yQAszZq9X41KJ2JBOk+yzQlYHWOMBLr9xt 6KqIJX7eQ6ChbQDEDYLd6Yk7bOQgo420exgSBcIWlnBktfe06RcEF/n3TsmiRSHU3k+j BNeYSzMXwxMznqB1Hotplz/7Kbh1InGCNptGcH4OhVtJuMO1d7xqkVw2oIat9SHFV0wU +OjzTzoss33b6wZaPJVoHZOmirg2kHTPJyHU+Cacs8pTwY758IY9fOoFVaG6eZoeej0L vx4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bUtvC4xt; 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 z8-20020a05620a08c800b00781214ba84bsi7119904qkz.508.2024.01.22.22.40.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Jan 2024 22:40:33 -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=bUtvC4xt; 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 1rSARL-0003kB-IS; Tue, 23 Jan 2024 01:39:19 -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 1rSARA-0003Xg-Ew for qemu-devel@nongnu.org; Tue, 23 Jan 2024 01:39:12 -0500 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSAR6-00084v-Sa for qemu-devel@nongnu.org; Tue, 23 Jan 2024 01:39:06 -0500 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-a26ed1e05c7so433118466b.2 for ; Mon, 22 Jan 2024 22:39:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705991943; x=1706596743; 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=2RjX1tFrRGVlM1BwnlKhE6JoLvLjIml7FEvFQ9cMoCw=; b=bUtvC4xtbaL2Z5BRd/WvRIMcbQdHCbcbdut6pEPkXQhjVttlsfAdN9HACh5f96SLc/ Bb9d9pL6TRMs3PeUpZngTNxbz9QSWlE3mQZumdfqI+Y98+KwZ4FSi6tmsTUe9TAwt7Kd E6//oY7dkAK5OIaUaehWOaasXPzeT1JMB7aQ8zY8yrTRDGUf74nYav4bJifP8LzhPeRX DNOKblEF9g7tUPn2a90gcn/97C1GEcW+sIXQCftAnFxbSSVXdxJV1XsfMODf8ZoVIebM xMnnLDWC7oiaH7cTTBDyhCUBJdavBQ1oUXi+3t3/9gD1ig65q/CL1Dsi8UoGG2E0FfIb G00g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705991943; x=1706596743; 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=2RjX1tFrRGVlM1BwnlKhE6JoLvLjIml7FEvFQ9cMoCw=; b=fWudRwvK6W9ixZgQj9kegYhIwLL3Wa5UVIgpW6Vl9cM8f31AJXFOeGuxZTq6y7+JKL 2ex7K7le2orLikQ5OgK6Y/GHDNbUEqopePfj5u5Z0A/lbB08BD6HaHEo014dzcgLoYxL v7kTrxSMOqDCfw8qQevJAPPPc7IsANwhPqoOX0Xp3a7CfPLSNAwoTUqVfwl5WElkjYZs ppAEHAONcCVQE2i3VO27J2/mRUuoepcJR/fCN9W3uAU0T2Ht3o/VQtqqPnQ2lgTp0Ojh 4JtLzWIUkkgyBa8YSyjJ5q8IYPdPbUrqUhKw4VAP+fWNGcIWR9fVFI0IUEcrIxSYc5C4 9n4g== X-Gm-Message-State: AOJu0YxqirAqifCjG7GKcnXNQ3V3Hp5gdL5itKan/IlzL3YTJkWu0R07 uf3tJ6v1uNkyYusWAV1g1iseX2xLvgSU7ByF6Xt5YGLUUdsRgAo2oRGuNWKOq+KJBnUB4gi9c/I O/WE= X-Received: by 2002:a17:906:ba83:b0:a30:d603:5ed0 with SMTP id cu3-20020a170906ba8300b00a30d6035ed0mr34022ejd.144.1705991943341; Mon, 22 Jan 2024 22:39:03 -0800 (PST) Received: from m1x-phil.lan ([176.187.194.78]) by smtp.gmail.com with ESMTPSA id z19-20020a170906271300b00a2ae0aa9002sm14101678ejc.40.2024.01.22.22.39.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 22 Jan 2024 22:39:03 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , Igor Mammedov , Alistair Francis , Gavin Shan , Andrew Jeffery , =?utf-8?q?C=C3=A9dric_Le_Goat?= =?utf-8?q?er?= , qemu-arm@nongnu.org, Igor Mitsyanko , Joel Stanley , "Edgar E. Iglesias" , Rob Herring , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 3/8] hw/arm/vexpress: Check for CPU types in machine_run_board_init() Date: Tue, 23 Jan 2024 07:38:37 +0100 Message-ID: <20240123063842.35255-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240123063842.35255-1-philmd@linaro.org> References: <20240123063842.35255-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::632; envelope-from=philmd@linaro.org; helo=mail-ej1-x632.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 Restrict MachineClass::valid_cpu_types[] to the single valid CPU types. Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/vexpress.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index f1b45245d5..a3561a1b56 100644 --- a/hw/arm/vexpress.c +++ b/hw/arm/vexpress.c @@ -783,22 +783,32 @@ static void vexpress_class_init(ObjectClass *oc, void *data) static void vexpress_a9_class_init(ObjectClass *oc, void *data) { + static const char * const valid_cpu_types[] = { + ARM_CPU_TYPE_NAME("cortex-a9"), + NULL + }; MachineClass *mc = MACHINE_CLASS(oc); VexpressMachineClass *vmc = VEXPRESS_MACHINE_CLASS(oc); mc->desc = "ARM Versatile Express for Cortex-A9"; mc->default_cpu_type = ARM_CPU_TYPE_NAME("cortex-a9"); + mc->valid_cpu_types = valid_cpu_types; vmc->daughterboard = &a9_daughterboard; } static void vexpress_a15_class_init(ObjectClass *oc, void *data) { + static const char * const valid_cpu_types[] = { + ARM_CPU_TYPE_NAME("cortex-a15"), + NULL + }; MachineClass *mc = MACHINE_CLASS(oc); VexpressMachineClass *vmc = VEXPRESS_MACHINE_CLASS(oc); mc->desc = "ARM Versatile Express for Cortex-A15"; mc->default_cpu_type = ARM_CPU_TYPE_NAME("cortex-a15"); + mc->valid_cpu_types = valid_cpu_types; vmc->daughterboard = &a15_daughterboard;