Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp567692rdb; Mon, 29 Jan 2024 10:39:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IGrK4dALD/J4Z8T7GxWxW18BZl3hb7YqzcQ1CEJhCHbZHIa32RciLjV6PxNTzKexf/nX16v X-Received: by 2002:a05:6a20:a12:b0:19c:520c:c172 with SMTP id c18-20020a056a200a1200b0019c520cc172mr6559693pzb.26.1706553556552; Mon, 29 Jan 2024 10:39:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706553556; cv=pass; d=google.com; s=arc-20160816; b=HSfduF0HojhrSXlnbuIcUd/8iuLt5TIo1UobE4qKvjHOXOXDAkWKbXNHKQ3KxyMqqt DJiucqftl9plQkdBHRzUkH5rFHJtBi3lJXBu1uZPYHYYxpp6wdWB3CLpyKd1L8DH9MQ8 +MvJQcjTvLS3t5d5eg+nTUNAMosdaASApSfks3lwIKZl5JAlZI144qCpkeUWcn2OS7Lf 2jmBcswGkXCXS3g41mCksjH70jldbdc3dcntHf9WnpeHUJqBnIrwlL4ZUVJMh47bzlrE 7QpOeCcTQRgSKLWgFWFpWW21Xwz2yaL/Car+EYvsmPnWJRsZoLD3gIldz5lCNfL515Tk pRvg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=hMevwOcR//91ifPHNyoWBbf+pgyJoGwBKJoFFWSxemQ=; fh=ubcQasNvBwFsgcsrVmq5a9AMLdm8fpq76fmsS32Des8=; b=XoPlms/hGWoirdNSZvzs1OLCWeLZgXyeqAFj+TauZxLO+WTJ6XR33TAL0e2M4MSeaa a6BtHoXqSkW4O3WRZJlkqfKzqNcZeqIDnXOJlRDIAm13UyJ6sN1yHGzLd8xm5l+AUVQz BrLo/sHBFLv2IWlLT+Zza9WglNrzq9oIEG1wyDDs85qOtI3RDS5K+UqsaW31iNaVyouP 8Q/hK85u3RCoIuJQcaHvT/ZlSlP+6s+fB/lsb1z5hUTCLcEQOo4lts8esdIPqLjYJy+G 3GyC27qoyo+ptfoOTsM8KpV92VJpSQyDUxUqQbCY9uBNdCSVKpUY5nHFnXkn3QAVrgtg Ashw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ucw.cz header.s=gen1 header.b="q6idbMu/"; arc=pass (i=1 spf=pass spfdomain=ucw.cz dkim=pass dkdomain=ucw.cz dmarc=pass fromdomain=ucw.cz); spf=pass (google.com: domain of linux-kernel+bounces-43310-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-43310-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ucw.cz Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id z22-20020a637e16000000b005d8b59b8da3si4341086pgc.839.2024.01.29.10.39.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 10:39:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-43310-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@ucw.cz header.s=gen1 header.b="q6idbMu/"; arc=pass (i=1 spf=pass spfdomain=ucw.cz dkim=pass dkdomain=ucw.cz dmarc=pass fromdomain=ucw.cz); spf=pass (google.com: domain of linux-kernel+bounces-43310-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-43310-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ucw.cz Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 6FFF528A23F for ; Mon, 29 Jan 2024 18:30:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 14D3F12B75; Mon, 29 Jan 2024 18:30:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ucw.cz header.i=@ucw.cz header.b="q6idbMu/" Received: from jabberwock.ucw.cz (jabberwock.ucw.cz [46.255.230.98]) (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 D5F0414290 for ; Mon, 29 Jan 2024 18:30:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.255.230.98 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706553035; cv=none; b=TgPEo712yBAasP82aAw0rK/TEaYPK8bA+ECRTYdVFkhRdDz7VxGd9SvhqX62nwHiKvAHpGcIZrHrUyfOYULe/RnIAkc11vMK6dOHy/1ycmIGYpHLYKHQ9op+XnodHRFX0LkDs6jHVuyO0GSq5t23a+JolgKTe6qi7AhBTImFBT8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706553035; c=relaxed/simple; bh=2hXpmnPs2/nJB/+GRiV+/+t4+w9O80b41ABbW9prIic=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=H6ECKhFZHlw6qr9H09dMlnfBEOPn0CUzPwHVjLbwzdLZ61S61wghT6gSyFEMc1UYCf+7vdnWqGtGtRxMIfkJ8E6qNiddk97N64iRm0oUDotPHyIM+DfKzkRP6cXlaK5AGnI4CDnsbbktXDDlNd6Ed8DlBzkNdMW04povcxqsHV4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ucw.cz; spf=pass smtp.mailfrom=ucw.cz; dkim=pass (1024-bit key) header.d=ucw.cz header.i=@ucw.cz header.b=q6idbMu/; arc=none smtp.client-ip=46.255.230.98 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ucw.cz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ucw.cz Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 0AF441C0050; Mon, 29 Jan 2024 19:30:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ucw.cz; s=gen1; t=1706553030; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=hMevwOcR//91ifPHNyoWBbf+pgyJoGwBKJoFFWSxemQ=; b=q6idbMu/0GQVL2QXhPiXjJ3Q55PNEBKcntxQbO9hLgqR7YAPXquJ3XXvGW8OSbtdhPtCFq ow+dJFqZPnj5Amo1qY+BThnpDm9tzeeUDVZfv8wN2UmZ74ISP4uqy+xDbUky6niv+LmkMA S+PbnLQsOzRNuEHujwgmHWCr7OukAzY= Date: Mon, 29 Jan 2024 19:30:29 +0100 From: Pavel Machek To: Maxime Ripard Cc: Lucas Stach , kernel list , Milan Zamazal , Christoph Hellwig , iommu@lists.linux.dev, Will Deacon , catalin.marinas@arm.com, Bryan O'Donoghue , Andrey Konovalov , Laurent Pinchart , kieran.bingham@ideasonboard.com, Hans de Goede Subject: Re: Re: Uncached buffers from CMA DMA heap on some Arm devices? Message-ID: References: <87bk9ahex7.fsf@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="KRzS5zbXW8lXfnR6" Content-Disposition: inline In-Reply-To: --KRzS5zbXW8lXfnR6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > > Yeah, and it also does not work :-). > >=20 > > Userspace gets the buffers, and it is not really equipped to work with > > them. For example, on pinephone, memcpy() crashes on uncached > > memory. I'm pretty sure user could have some kind of kernel-crashing > > fun if he passed the uncached memory to futex or something similar. >=20 > Uncached buffers are ubiquitous on arm/arm64 so there must be something > else going on. And there's nothing to equip for, it's just a memory > array you can access in any way you want (but very slowly). Not really. Not on anything modern. ll/sc will not work, for example, than's on ARM. https://en.wikipedia.org/wiki/Load-link/store-conditional Transactional memory will not work, that was on x86. Powerpc has cacheline clearing instruction. And that's design, I'm pretty sure there are also numerous CPU errata. Best regards, Pavel --=20 People of Russia, stop Putin before his war on Ukraine escalates. --KRzS5zbXW8lXfnR6 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRPfPO7r0eAhk010v0w5/Bqldv68gUCZbfuxQAKCRAw5/Bqldv6 8jQdAKCN7cYrDkN//ulxW3YxeSqNq+i64ACfULxt7SizbmTw+uIP9DctYlZ3YaY= =b10z -----END PGP SIGNATURE----- --KRzS5zbXW8lXfnR6--