From nobody Mon Nov 23 05:12:09 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=univ-lille.fr ARC-Seal: i=1; a=rsa-sha256; t=1790761609; cv=none; d=zohomail.com; s=zohoarc; b=Z6nONbAPvygq5E854PbZPW52khH8d6HubX5KCYILjG173JwVyP38zLFct3kKBPf5v+l/8fVddlZ1rXt3/UXJnnzPteHRycGzjPrjkdPdNQW3k9cCVkwX2ZcfdzowmfpculAdV4TyRnsRBXCs71eHv2wmA8xwPSFyAf2nzzrKQOM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1790761609; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=J0JC4Z4YoBOLybTqcPKjx2Vwsqnqk9HFBSo0Nm+WJTY=; b=dSZM333D2eIYABDljm5qu53F8q6aYoH30coIth29guJg9yNc746L6IJEpdxTReZxdnAnU6R+IMcTnKjPrwJCaSZEZVvtsfVPiEbluiYTSXzfV6yA2zgLUwUNh7c/mq14fe+UBKAUhU7EeGEJYxbPPvR9PV/SyV2eBfUWQGwvrpw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17907616091231002.2808593462261; Wed, 30 Sep 2026 02:46:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xBqtA-0006AD-LU; Wed, 30 Sep 2026 05:46:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xBqt9-00069l-6g; Wed, 30 Sep 2026 05:46:11 -0400 Received: from smtp-out-1.univ-lille.fr ([194.254.129.82]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xBqt7-0000R5-AQ; Wed, 30 Sep 2026 05:46:10 -0400 Received: from smtp02.univ-lille.fr (smtp02.univ-lille.fr [194.254.129.96]) by smtp-out-1.univ-lille.fr (Postfix) with ESMTPS id 4hvqtN46gPzBqZ9; Wed, 30 Sep 2026 11:46:04 +0200 (CEST) Received: from localhost.localdomain (unknown [134.206.233.118]) (Authenticated sender: gilles.grimaud) by smtp02.univ-lille.fr (Postfix) with ESMTPSA id 4hvqtN33pbz6snq; Wed, 30 Sep 2026 11:46:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=univ-lille.fr; s=dkim; t=1790761564; bh=J0JC4Z4YoBOLybTqcPKjx2Vwsqnqk9HFBSo0Nm+WJTY=; h=From:To:Cc:Subject:Date:From; b=zH96aNk+cECczR9YcjmWJ7GmBUYyDSLNwSl4UsMYUxCNR7NEoj5hJaTWO0VGt9+YZ HmE279Phgcu82sTBqkf2SsVj8XrzpeRuVzb79PdW0T33V4wPmuMTno/Ul4Iz19qvVE xOnmgUZKRWkcs8/V2zD/xLscF5Qh5sz1bow86P0AKLnedArqfAyjedsB9yr3jUGaci OLw7LOx336uk5ghU9JfCbL60oWcUThVjtV4FoFz1qZ5HR5PfSlVhP9dWcP0TRmjK/R inJorkCGZf0Ywtog7SOk447xs9lKPkpbkSzo8ep1KY8p4LS0Yu2NA2IUTaZK2BGq5C wEhVh7jP22Ksg== From: Gilles Grimaud To: Peter Maydell Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org, Gilles Grimaud Subject: [PATCH] target/arm: add Cortex-M0+ CPU type Date: Wed, 30 Sep 2026 11:46:03 +0200 Message-ID: <20260930094603.35969-1-gilles.grimaud@univ-lille.fr> X-Mailer: git-send-email 2.55.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=194.254.129.82; envelope-from=gilles.grimaud@univ-lille.fr; helo=smtp-out-1.univ-lille.fr X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @univ-lille.fr) X-ZM-MESSAGEID: 1790761612765158500 Content-Type: text/plain; charset="utf-8" The Armv6-M Unprivileged/Privileged Extension is optional. While the Cortex-M0 does not implement it, the Cortex-M0+ may - and the RP2040 Cortex-M0+ configuration in particular provides this extension. Add the cortex-m0plus CPU type, reusing the existing Cortex-M0 initialization logic. Enable ARM_FEATURE_M_UNPRIV, introduced by commit 285e929908 ("target/arm: model Cortex-M0+ privilege extension"), and set the Cortex-M0+ MIDR used by the RP2040. Signed-off-by: Gilles Grimaud --- The Cortex-M0+ CPU type was previously included in: [RFC PATCH v1 2/6] target/arm: model Cortex-M0+ privilege extension https://lore.kernel.org/qemu-devel/20260914192323.29250-3-gilles.grimaud@= univ-lille.fr/ It is now submitted separately following review feedback. target/arm/tcg/cpu-v7m.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/target/arm/tcg/cpu-v7m.c b/target/arm/tcg/cpu-v7m.c index 48b31d5eac..ac99c93ec3 100644 --- a/target/arm/tcg/cpu-v7m.c +++ b/target/arm/tcg/cpu-v7m.c @@ -76,6 +76,15 @@ static void cortex_m0_initfn(Object *obj) SET_IDREG(isar, ID_ISAR6, 0x00000000); } =20 +static void cortex_m0plus_initfn(Object *obj) +{ + ARMCPU *cpu =3D ARM_CPU(obj); + + cortex_m0_initfn(obj); + set_feature(&cpu->env, ARM_FEATURE_M_UNPRIV); + cpu->midr =3D 0x410cc601; +} + static void cortex_m3_initfn(Object *obj) { ARMCPU *cpu =3D ARM_CPU(obj); @@ -325,6 +334,8 @@ static void arm_v7m_class_init(ObjectClass *oc, const v= oid *data) static const ARMCPUInfo arm_v7m_cpus[] =3D { { .name =3D "cortex-m0", .initfn =3D cortex_m0_initfn, .class_init =3D arm_v7m_class_init }, + { .name =3D "cortex-m0plus", .initfn =3D cortex_m0plus_initfn, + .class_init =3D arm_v7m_class_init }, { .name =3D "cortex-m3", .initfn =3D cortex_m3_initfn, .class_init =3D arm_v7m_class_init }, { .name =3D "cortex-m4", .initfn =3D cortex_m4_initfn, --=20 2.55.0