From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from DB3PR0202CU003.outbound.protection.outlook.com (mail-northeuropeazon11010046.outbound.protection.outlook.com [52.101.84.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 81C602FBDF2 for ; Mon, 19 Jan 2026 07:30:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.84.46 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768807827; cv=fail; b=hjHjgQKj3+l7+q5Dd0EXGejbsauyizfoPMjwiojopMAmBmNtgiztXhIXHuDiXgvy0s5qX5HZcnbS0jXJZOtJSuo2ZOJ40Y34c0t9VlQiLol05pjOix2GY3Jyu92fa9n5LzREQgIJU10SBLTQOc3/sa3SANrV8dQLcRonxu1m2KM= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768807827; c=relaxed/simple; bh=XmRkLoBVNk2Vr13kDW2yMhroyzZamp3I4qG/Bb6a47w=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=YUIWuZFR4Yf7K0JHKnWRW9cCEh+v4wiRHOmiIUY2UHKDK3HAMXKsk+q5jf/8+T9mgwOXBq5HDItLKQ+e/jwDFH2s+NRX+41SVvgDgz1UMV6c5qHGGaEYpke3yiLggF5uixDIt6C8Msg/kpecmrr6r8X/+IgV8ZK5jG7FAgPy1Co= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mobileye.com; spf=pass smtp.mailfrom=mobileye.com; dkim=pass (1024-bit key) header.d=mobileye.com header.i=@mobileye.com header.b=kkXM/Io9; arc=fail smtp.client-ip=52.101.84.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mobileye.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mobileye.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mobileye.com header.i=@mobileye.com header.b="kkXM/Io9" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=HM2xViUue5Oxn819UsI2iwGBkU/WyqAAS5/fV4FaO+7sjD+ZOknHPEaJDP2f0zhMEBEsV1Dywh8OJBA8u08NqLKplkOAjEJ0bx9DVG4sf/5vEN54uxnaxTvlrV5+EgwEHrhCgaVr6anYQEdyii0OLq0CJQutDo1w1rjiTzptDKePXuqEwYmrQabONHG6y2ujlmUHM+7H3UDty2JTYYZG1bEIZ/5cZ9885L58upnCQs1WZKIMmMs/dNLBwHuL38lws1wyDNJJxzqBOQMPH4r+Em0cDr4Z10fS3tX5oXRaWkFciOBu1Vwz628wtANrA1RYJiNPOLJsIZ6fHSDubdvkrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=XmRkLoBVNk2Vr13kDW2yMhroyzZamp3I4qG/Bb6a47w=; b=mCYSfMI4rmBrSuwSzivkmwV8f+hldvWgcOJDZQKuAKWFc/qUGAt2lufr6rI8z2rc/KafqK42yLDNZalSZHWT8rrq3avnL5+vguycwByYvXRR44pIjT4xWAqXMtStaWCcdGGmm8IjMTtbVrnb1dvR8d+BQqvoJarb+dq1fij3cVeXEnSg4szGxrzr0zrDv/KPHHQPTyreN3RGLlVNg2CHlFGAKL9VmzkH6/2ycKKn9Dk+aTNvFNFgN6p/6qD3II++rdDYRUMN9ELg68F0yypLU1tvvdXi1Lr0yzV70pqYrBrTmmu2G3LYa2E7nVc4ozu+YfnRepTCAJAGzf0sumMbJA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mobileye.com; dmarc=pass action=none header.from=mobileye.com; dkim=pass header.d=mobileye.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mobileye.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XmRkLoBVNk2Vr13kDW2yMhroyzZamp3I4qG/Bb6a47w=; b=kkXM/Io9Hm+4FFKxaWD0SkT0x2XTLkxwyU5XEslHDv3EiiOJCzMUz5tqOpWUYg4hoY8eXXSY9/9ieeJxKr22mH4iVY9tPCm67JGSy+DDmyluHzOj1SmqipP2aoyvWNoraHzI9KNI2BI6syP6Hp4lHBNWqHNhVkSBoPdybv825jA= Received: from AM7PR09MB4183.eurprd09.prod.outlook.com (2603:10a6:20b:11f::9) by GVXPR09MB7149.eurprd09.prod.outlook.com (2603:10a6:150:1b8::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9542.7; Mon, 19 Jan 2026 07:30:16 +0000 Received: from AS2PR09MB6296.eurprd09.prod.outlook.com ([fe80::4e7:45ef:d8f1:6fbb]) by AM7PR09MB4183.eurprd09.prod.outlook.com ([fe80::4e7:45ef:d8f1:6fbb%4]) with mapi id 15.20.9542.007; Mon, 19 Jan 2026 07:30:16 +0000 From: Vladimir Kondratiev To: Paul Walmsley , Palmer Dabbelt CC: Will Deacon , Peter Zijlstra , Boqun Feng , Mark Rutland , Gary Guo , Albert Ou , Alexandre Ghiti , Yury Norov , Rasmus Villemoes , Chao-ying Fu , Aleksandar Rikalo , Aleksa Paunovic , "linux-kernel@vger.kernel.org" , "linux-riscv@lists.infradead.org" , "torvalds@linux-foundation.org" , "olof@lixom.net" Subject: Re: [PATCH] riscv: support CPUs having only "zalrsc" but no "zaamo" Thread-Topic: [PATCH] riscv: support CPUs having only "zalrsc" but no "zaamo" Thread-Index: AQHchScIwaUkg3MdjkegNUlaat/TfbVVnPAAgAJx3CY= Date: Mon, 19 Jan 2026 07:29:16 +0000 Message-ID: References: <20260114072552.731974-1-vladimir.kondratiev@mobileye.com> <8afa0702-4d30-86e2-5afb-a7c113a92dec@kernel.org> In-Reply-To: <8afa0702-4d30-86e2-5afb-a7c113a92dec@kernel.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=mobileye.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: AM7PR09MB4183:EE_|GVXPR09MB7149:EE_ x-ms-office365-filtering-correlation-id: 76cd04a2-c974-4ceb-da21-08de572c976a x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|1800799024|366016|7416014|376014|38070700021; x-microsoft-antispam-message-info: =?iso-8859-1?Q?Ww+9yy/9pr/gEmMd02LFZ11+0Yd7X+1S0i7WDChmPMdQAsnOsRdItpWE16?= =?iso-8859-1?Q?REaiPvn3aez6cAkfV1eJVOQ4rqayp6/0TW+vPetpOGLKAbgmojLcRCxyg5?= =?iso-8859-1?Q?vnsphUrdiTdtrxPKOk7Kbz33hEppOy0modbMfKI1tpn7at385QBmvHBSLI?= =?iso-8859-1?Q?5cK5Yy9C04AnT4Cu3KhkRnRXER/bsN4CIVCzg0mGdS8Kud4KUcHVipbwrk?= =?iso-8859-1?Q?UITZx31YN4Km3aO/yDZ1mHk/cqr4qHJmkdJbwLO5GiX1VNnJtVWbrrA9Rc?= =?iso-8859-1?Q?CYtR2TBTGweCigJfYLTs1r1sqDqas1VjJKiEF9Qt+C8GI6x3oVcK4F8hYE?= =?iso-8859-1?Q?71jf4a4O1eS/eMCZHYf4D64WIbQJ63rYhY7GjaPbeG1/SVCtZS15S68AdM?= =?iso-8859-1?Q?926Qg0+xWpr6aS/RAOijazypg9+qtm4TivTS1B+wRTupjhEbnRGJzE+lLa?= =?iso-8859-1?Q?kNorU0v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qZaKs+3LwSTTz7d?= =?iso-8859-1?Q?u+8lvvzKaA3+ic/5N5biQQGmeYGSzC79iknddnhZP3TZYlmChYLTUl/c/i?= =?iso-8859-1?Q?Yu7zsF/1oj991aQRs76dglxduvoumqh2E26e0fbnH/KxjCd3EIFjQp18ca?= =?iso-8859-1?Q?oXhNzdKh+oGoMngW6n5L/O9zcngD0/Q+sDXwCXk7KeGUqR435RE+eCUxQZ?= =?iso-8859-1?Q?HP0KrB/NW6F02K9O/nU5mv31CL0EYAH+c3S1CIPn/Pj2njojwEhxL2vvGl?= =?iso-8859-1?Q?raWWTi19sl5nFq7oUCi+w4Jqs2gCdaLMHHN9SVcqUk4XTMPJtnNVR2eW/D?= =?iso-8859-1?Q?7nTr+eyWa4rVpIbDAdg=3D?= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM7PR09MB4183.eurprd09.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(7416014)(376014)(38070700021);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?Ra3fH5cA021BRxkSNqsCpcVeP04FhLclAABscaGDIjmI4S/9nP0YI1ovp9?= =?iso-8859-1?Q?Yq051fHWm02uqIxP7XuD2RYawBzEYx65jw5i1t3CDLWAT/v++rIOUoGTUn?= =?iso-8859-1?Q?7qJTOugBgGrl4JwNZf9ES+yXbA1yIBPF7lxb2cYhcuy81OELxoAD/HgQU0?= =?iso-8859-1?Q?8fFa0dRr3KrNw/4iG3B9IADO/VZJjFFqrgRkj7R9UoPnKjeHlxrPrj3vYz?= =?iso-8859-1?Q?g6mw79bYgtaf+3Xv427n9AI2qCeFxLTBytvwwqe2nFRxNVVj9btoj67YKQ?= =?iso-8859-1?Q?TyOEf9g4V5Ec0A4ZFYem2x4zQ3sJMIoFLyYC6pPxSFROZbwDFJA+a38iUV?= =?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6AEgPl7Jl73qt+9dy?= =?iso-8859-1?Q?zzMUZ0gb9dXzvPtePqTUwH9ZQTY1VbHdFdx8mBhNuNKU6l2SN8gISJAvRO?= =?iso-8859-1?Q?Log/4X0FkgPWG9R6WUWHWIaSV6L+W79R9cqOn9/3gRMQTsyM73UX0eEp/o?= =?iso-8859-1?Q?WlJwO5LkKL2I5g/078xIaurAOEb7zAVX34A76BWmc5k1eHgIsfedQ/hVIc?= =?iso-8859-1?Q?GRLsKP0xRItJuMorJ5ZOBmMepCdIY3ElMPzWqpG8nupQwUDmMVdTS5I+P9?= =?iso-8859-1?Q?9dv8V3jWPpIol/q6ob1LJcvRLf07mjreL3OjboH9ltOx1FMyf46fSxHJOJ?= =?iso-8859-1?Q?PrsXneO85Hzwok6ct2izhJ0uD57Q6KxY8Ew9125GVkDmI12TJUKtE1Cwh2?= =?iso-8859-1?Q?zYJisYmgL0eI3N5KA5Hk2zWbaFqwOD2pdTF4QrGF31qnZX9/sqEgLX1nEK?= =?iso-8859-1?Q?b8Q1e830YyaTZr2GTRdcYLMyskFfs2NbWSaVOemfHS4Oz/8zZPlyyFcMaJ?= =?iso-8859-1?Q?GTEatoU5F2peyzchjY5AFu8GxbvxnqrH6wCbq77zEsSs8U?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-OriginatorOrg: mobileye.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AM7PR09MB4183.eurprd09.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 76cd04a2-c974-4ceb-da21-08de572c976a X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Jan 2026 07:29:16.0963 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4f85ba13-6953-46a6-9c5b-7599fd80e9aa X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: cpZXcFe8wMod7bMgUo2CdfaOm1+Zya8GnyYnoMmt/MmLWglwQeR0H6HbI1oKEJCmUJrZxOJj6UqyWBO+HrjTCA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR09MB7149 > > Historically, "a" was first, and Linux was relying on "a";=0A= > > then "zaamo"/"zalrsc" was introduced. It is possible to implement=0A= > > most atomic operations with either AMO or LR/SC. AMO if more efficient= =0A= > > however more complex flows are possible with LR/SC only.=0A= > >=0A= > > Platforms supporting only part of atomics starting to appear.=0A= > > Notable is MIPS P8700 CPU [1] having only "zalrsc".=0A= > =0A= > Are there any others?=0A= =0A= I don't know, I am working with the Mobileye platform only=0A= =0A= > Are development boards available yet for these kinds of designs?=0A= =0A= Sorry, no. Mobileye does not release (as of now) boards to the public, it= =0A= works only with automotive companies=0A= =0A= =0A= > > Implementation is generic, inspired by the patch [2]=0A= > > by developers listed below, implementing similar patch as errata=0A= > > for the MIPS P8700 CPU=0A= > =0A= > This doesn't look like an erratum.=A0 The designers of this core just cho= se=0A= > not to implement A support in this CPU, and that's why that AMO_II bit=0A= > exists in the mipsconfig6 register, correct?=0A= =0A= Absolutely agree; this is why I re-factored this as a generic feature=0A= rather than errata.=0A= =0A= =0A= > I guess the proposal here is for the upstream kernel community to weaken= =0A= > our A support requirement to support these special cores that only suppor= t=0A= > LR/SC?=A0=0A= =0A= Yes indeed. In fact, any AMO instruction may be re-implemented as an LR/SC= =0A= sequence provided memory area is LR/SC capable; opposite is not true.=0A= Actually "a" is not a real requirement to implement atomics, we just need= =0A= some way to do so, and "LR/SC only" is sufficient.=0A= =0A= > If so, I suppose the question is, should anyone in the upstream kernel=0A= > community care about this case?=A0 It wouldn't be enough for the kernel= =0A= > alone to support this.=A0 A special userspace would also be needed.=0A= =0A= Userspace should provide "-march=3Drv64imc_zalrsc" instead of "-march=3Drv6= 4imac"=0A= for all compilation; this will instruct compiler to use LR/SC for atomic_t = and alike=0A= =0A= =0A= > If we take these changes, it increases the complexity of the upstream=0A= > kernel, and increases our testing matrix as maintainers (and, in theory,= =0A= > for any patch submitters, who should theoretically be testing their work= =0A= > on the configurations that we support).=A0 It's not clear what the gain= =0A= > would be for the broader community.=A0 As maintainers, we're already=0A= > considering stripping out other code that doesn't seem to have significan= t=0A= > community support, like no-MMU, for similar reasons.=0A= > =0A= > On the other hand, if boards with Zalrsc-only cores seemed popular in the= =0A= > marketplace, and some sort of support existed in common userspaces, such= =0A= > that we could be sure that there was some sort of commitment to maintain= =0A= > this across the entire ecosystem, the discussion could be more favorable,= =0A= > I guess?=0A= =0A= I understand the argument, but I can't say for all risc-v community or how= =0A= important is Mobileye chip to justify special support.=0A= CPU vendor is MIPS, perhaps they can share arguments about decision to=0A= implement only LR/SC but not AMO.=0A= Good if people crafting LR/SC only platforms will comment here. =0A= =0A= > =0A= > Palmer might have some other thoughts here.=0A= =0A= Thanks, Vladimir=0A=