From patchwork Tue Jan 23 22:25:07 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: 765207 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:10c4:b0:337:62d3:c6d5 with SMTP id b4csp1834199wrx; Tue, 23 Jan 2024 14:26:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IE4xbzrOInqGq9yCxaXBXV24eXeYLiafxUAT3WFmJIGl6aI75LWYo+ORo9dlWPFDbYfoWVL X-Received: by 2002:a05:622a:1906:b0:429:f43b:4ccf with SMTP id w6-20020a05622a190600b00429f43b4ccfmr1615596qtc.50.1706048783779; Tue, 23 Jan 2024 14:26:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706048783; cv=none; d=google.com; s=arc-20160816; b=sUTOTjrfA96Q5hFM9JqYO/VYXUKh+pK90t2nXk/KJddg9QBnOJ32Dzd0KeIi8ky8Ue Hpmqjo0fd//ZurJfD0nZjX4QhpO0v2BQDzq8bINVOZ1LwVt6Oj8lHUzRCt7i1lX8vKHp OpdcW0pURydW1cBICzpUWgIGPAzQNDdCHn9TxXc2fZOMLX5NsuKKcA5k0+IYDjzQbdZG 9cc6Lan5+XyuXDrRfXfAplFVPI7Ii/kTVljWqDuZnb0j11t6fTP1bu4rUG4Di+sSTo/P mZOGiC4+BAY3kLrDYtefMVXw6CuMsZuy6HcMwEoQCgZnQ08FZjqC5+7OhGUEeDkPs6X/ h4qw== 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=vCRQ4SxBRaw/scGiJ+6DsMj2AC960SBJLYr7612eZsc=; b=KbsG7ceRWPx/GVRmSgTzzcF3nKJb7tPnnxqbHHxC2RUTzV76zBRK5U5e6WLHvjTJ+R Vu0enamuNjRidhD0QAbs3fGAFyIyAATD5xKe1iL2DCw34woXwdY6f0Lr3f7jIUdK+QSP zmxQsHTTq7Gf89+rsMio3XtWf1fc1jjpiXZwaY7vlW+/DlfQ8typVVvq2ZbSn8q1hbGu pgIbsW2cKaZnGijqdkAzR5tigAmnI/yBqZ3VuF4UAJQ+cV9h5VqW0ykP8s7IrgUC8QBq mX7HLH8XaF8bQANfrTQdpusuqG3Qj7z2lQaWPbvNEUrPUGN5oODnjqjKDYLgEgwcydvn S5Og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TUc19tHZ; 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 w15-20020a05622a134f00b0042a3f51127esi5396722qtk.492.2024.01.23.14.26.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 23 Jan 2024 14:26:23 -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=TUc19tHZ; 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 1rSPDH-0005qK-0c; Tue, 23 Jan 2024 17:25:47 -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 1rSPDF-0005hr-2U for qemu-devel@nongnu.org; Tue, 23 Jan 2024 17:25:45 -0500 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSPDC-0000zJ-RW for qemu-devel@nongnu.org; Tue, 23 Jan 2024 17:25:44 -0500 Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-a293f2280c7so501945666b.1 for ; Tue, 23 Jan 2024 14:25:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706048741; x=1706653541; 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=TUc19tHZjyl4FfUjXYKcFb56jSJO7LiGv+PpiXnYJ3C3ywjCMi5rBdmJ0lOv0TBpEE 0KOfNhBgAfzuDI9yH/iPHhSm3jONaFEEoBH2RTH1SJFT809eGdYJhbnefSyFDEBjdXZV 9EJxyWEZs5D5O/fyfspUAU6ZkRvh94mXFw6Z+gb4hm7im67XIbk9fUnQeT8J02Doq7it vtH/DMx4d2FCHcfrRMru30iBpR1E7Fu3bfL1XusCEiWyxuAwwzevvpp9OzDwton2+ox3 LrIFrJ9y5KNCk0yPirt0XH5+51bWGglt7aRd9hRgp/eSVLnAa5Xa3GZ9x48Qi3MZi5QV xNHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706048741; x=1706653541; 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=TLvQs2UnsV4X7iv8V/Xx65CW9KZHAv2vhzo17lrIkYDmrvPFKkWyTYCFVh8ayxw11/ DVApECUNG6laSSixlbbDAdv3f9AlwoWq23GLth3gMMMEd2y0BERmwEbOKUYGTDgpcXq8 mrlPSXxKpWLIqAd9e/YRtQQgFws0VDs82rmbXnnGJrx7N8T4IPVJkegIfkOkrTvPJ0lG rM2VzDlUKAy6yqM6fS0ibHRsagk83xNMnuSy+akDB9JBPeqZqVO2kntO671x9mpoxmut nNpL3Ua4vzYbB4nrpzyje+ws4hM0OwqdEBj0CIIWs8Fug4eRXhKlq9x2oDa+pXeSWuTG qeow== X-Gm-Message-State: AOJu0YzB58oMMwx9p2QGF3CCWQnk9BSaaoOcWO2Tr2iyUPOO4HYfhF07 PaXCrrBYU6cmWMySWYFwEcLLxt3bv0cjLo9MlNMCp/lUcsJx9dlxIr3fyJEIRFmqeyFLB63wkVH Z X-Received: by 2002:a17:907:8749:b0:a31:408:e4e5 with SMTP id qo9-20020a170907874900b00a310408e4e5mr146355ejc.178.1706048741114; Tue, 23 Jan 2024 14:25:41 -0800 (PST) Received: from m1x-phil.lan ([176.187.194.78]) by smtp.gmail.com with ESMTPSA id x1-20020a1709064bc100b00a2c70caccbasm14539348ejv.107.2024.01.23.14.25.39 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 23 Jan 2024 14:25:40 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-arm@nongnu.org, Igor Mitsyanko , Rob Herring , Joel Stanley , "Edgar E. Iglesias" , =?utf-8?q?C=C3=A9dric_Le_Go?= =?utf-8?q?ater?= , Andrew Jeffery , Gavin Shan , Alistair Francis , Igor Mammedov , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 5/6] hw/arm/vexpress: Check for CPU types in machine_run_board_init() Date: Tue, 23 Jan 2024 23:25:07 +0100 Message-ID: <20240123222508.13826-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240123222508.13826-1-philmd@linaro.org> References: <20240123222508.13826-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=philmd@linaro.org; helo=mail-ej1-x630.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=ham 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é Reviewed-by: Richard Henderson Reviewed-by: Gavin Shan --- 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;