From patchwork Tue Jan 9 18:09:18 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: 761067 Delivered-To: patch@linaro.org Received: by 2002:a5d:6e02:0:b0:337:62d3:c6d5 with SMTP id h2csp1496212wrz; Tue, 9 Jan 2024 10:13:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IFgWo7vaGPxVZ7zANmHQo7ZgB+vwBPOXPoa/EW3SGG4mGvdybxHreZ4KzrIJIlJteOfAWrX X-Received: by 2002:a05:6808:1644:b0:3bb:f5a8:9798 with SMTP id az4-20020a056808164400b003bbf5a89798mr6731976oib.24.1704823982445; Tue, 09 Jan 2024 10:13:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704823982; cv=none; d=google.com; s=arc-20160816; b=qJK6Ig6c+ta9QF2fWipevwOS1XrYaDWwUbYkakM3ZwxcwILRC/97I7rUT/7X3TLq4x qPLDSwM4SfwCB/bsNMK2GihJPP0r7Mh8yDQSHDwGcMs4gcAY8f78pia0Q7O1mNDOTBEq BRq80uB/Iu/eekKenFCu/fgcoSnTtbEsO/k1A9BstD8kIJgpWSCTz1K2KUwqpig0nPh4 kpwCDBcE1frtDvGUvjzgfa6n9jWv1c9LfObPsBhJ/e2uL7sO77N6UJUXGXE6G8hAc10P uLelmHZDe+p1klCS4yu4hqUFaroGNMIdM8hbeEkdzHGIlu3Q4dmHZeXNIItrE+/MK+U3 hFCg== 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=mdirajlt6qC945MCVDYIpUTSXSVbweTZjiyf2mppVOc=; fh=v69mdd+nxs/0WeTIWzLZOPCx0ynE2o0vtvId2fSwkBY=; b=WMz4fR6zeGMS2iESAXbd1SMkY5epeusOs98vXHR6FYYh6Hs1YL/Vgd4ntqyHPplV7F phzQTNtruqP8hLtzvhXgyVkbD+xjMJYBf1b+bpZ1vJ5mGkDhM2Rlo5QRvYhoLfXyUViQ awP5IAc8i4rAlE4TN/TpMae4KP5QBZ38ZF63VvcZLKkR0H8xUgbfmjXBA236r7avccIM VxG5JRIfvnMlmd+DHZrSEJcOHlEJhC4xu/vXSTeGDOTZ+2HvRXyNfZ1WKene7CWqj4o5 cZDv9tpz63r/KU/Cf0QGynIWAgIhxzVVdYlHLerjY3o2rfubFK4vAVVCAdD5UE7LM9se PlsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=n03HaZy8; 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 x5-20020a05620a448500b0078331c5e3b6si995959qkp.231.2024.01.09.10.13.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 Jan 2024 10:13:02 -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=n03HaZy8; 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 1rNGZ4-0003Ku-Li; Tue, 09 Jan 2024 13:11:02 -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 1rNGY0-0002RY-7X for qemu-devel@nongnu.org; Tue, 09 Jan 2024 13:09:57 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rNGXy-00041S-Kb for qemu-devel@nongnu.org; Tue, 09 Jan 2024 13:09:55 -0500 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-3368ac0f74dso2517224f8f.0 for ; Tue, 09 Jan 2024 10:09:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704823793; x=1705428593; 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=mdirajlt6qC945MCVDYIpUTSXSVbweTZjiyf2mppVOc=; b=n03HaZy8dpwhV2t9I+FFWwD07mgb9tZCRvrVXgc/16pUTxILRYRnYLcqsHlme9Cg1V 9R9xeI79EZvS/OLxMAuLIVKytWVtFEK98eWOG3DzLZ9Lyzpx2yZxlOWNzPmz5pKivide t2E1NDuOXTvujE/jw/Mf9E76XEdkgh44zVYpukyttJxFetBlWgRbALHgRcpLkinvLjHa szAIImkIAwXp9qUPUnes5fOQ48aZGDo64nBW81ddrKoZaKC1Mh05157sYdhHEpODZC5V 9LRdtdu/7Kbw6hGAo7VlsFTtWltlTgRW8+iLn2hTJF2YiWrW4+ObPxElIk4nBBYLX2KK SZvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704823793; x=1705428593; 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=mdirajlt6qC945MCVDYIpUTSXSVbweTZjiyf2mppVOc=; b=ZNXgV5SkTd23AYxpdW5utWJH5SdDgV+7HkJrTzo7XY2CMLrqe8mD7zc7UC+lqxg1qi p3JRBzaAo5IMa/Suiy6ZCWyyTch5/Ra4kN/iDCKZugQA1CuqwtdhKk22pY/B8zNruIW2 NESNEx00e6j65LH6PIZe0WhqZWdGOqAzy/X70kUohTZSV4Z0W3xg2qj4Xr9JfSN1MSgb 1t2FMBB+wWg92k1sIRjr2udqRLGYcOQaLR44kMNyuxP5vxTVo2dGr6NQEvdqkTSGhqtJ OdCtBgOYdIlPYJ/zH+jr1qPnuwzxMGaq2B4TduD83Ui8g8Lc/6TuB58c8RDCubNtFq4l zYLw== X-Gm-Message-State: AOJu0YwAaDOBXGlsYMrYMqI+EupTE2HLVrgbw9FNbRmIrYyeREd7TMqy TYGXzPdaiiTkju5uMawOIylN/J4AXl4vyLPINVxPyHQrd/tGPw== X-Received: by 2002:a5d:4569:0:b0:337:509c:f1c0 with SMTP id a9-20020a5d4569000000b00337509cf1c0mr933765wrc.46.1704823792796; Tue, 09 Jan 2024 10:09:52 -0800 (PST) Received: from m1x-phil.lan (rsa59-h02-176-184-32-47.dsl.sta.abo.bbox.fr. [176.184.32.47]) by smtp.gmail.com with ESMTPSA id c2-20020a056000104200b0033642a9a1eesm2995571wrx.21.2024.01.09.10.09.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 09 Jan 2024 10:09:52 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Leif Lindholm , Radoslaw Biernacki , Kevin Wolf , Markus Armbruster , "Edgar E. Iglesias" , Igor Mitsyanko , Rob Herring , Alistair Francis , Peter Maydell , Marcin Juszkiewicz , =?utf-8?q?Philippe_Math?= =?utf-8?q?ieu-Daud=C3=A9?= Subject: [PATCH v2 03/14] hw/arm/armv7m: Ensure requested CPU type implements ARM_FEATURE_M Date: Tue, 9 Jan 2024 19:09:18 +0100 Message-ID: <20240109180930.90793-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240109180930.90793-1-philmd@linaro.org> References: <20240109180930.90793-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=philmd@linaro.org; helo=mail-wr1-x436.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 ARMV7M container can only accept M-profile CPU types. Check requested type is valid once to allow further simplifications. Suggested-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/armv7m.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c index d239468558..8900730e53 100644 --- a/hw/arm/armv7m.c +++ b/hw/arm/armv7m.c @@ -300,6 +300,10 @@ static void armv7m_realize(DeviceState *dev, Error **errp) error_propagate(errp, err); return; } + if (!arm_feature(&s->cpu->env, ARM_FEATURE_M)) { + error_setg(errp, "armv7m: CPU must be of Cortex-M family"); + return; + } cpudev = DEVICE(s->cpu); object_property_set_link(OBJECT(s->cpu), "memory", OBJECT(&s->container),