Received: by 2002:ab2:7104:0:b0:1f7:f6c3:9cb1 with SMTP id z4csp4582lql; Tue, 7 May 2024 08:19:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUmbnyIdb2a+ztVEG3n4m7YWIcFLWM/VecndQORepGJNqGz8oURoM8/GuzMH1SQubRUmKi64LBgmRjIWQvpxmGMg1DxdThuyaNLbcl8aw== X-Google-Smtp-Source: AGHT+IGmnbDzz3LlPUF9aww0Tv0kDnH5y4sZ/reBPxfVjX+RsME66rfpvqeOpqpZWNLsczcjbjtw X-Received: by 2002:a50:8e47:0:b0:572:475c:a38e with SMTP id 4fb4d7f45d1cf-5731d9d898fmr36025a12.19.1715095199304; Tue, 07 May 2024 08:19:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715095199; cv=pass; d=google.com; s=arc-20160816; b=kqv+GVM3jxEwQLJCPBr1myuwmuhxCkDiwONTMjxteT7jeUtgB2G3M0JK+wQfYHchvv m6JjNxhXJipY+DVQjU7pLYUPPieW3mYVdSNfknHvgWvk7VByh9n33nfQrboxUX6A5B96 OEVrebIWcCAxKs708Co6mzOZii70Xv7OXB/cKE0PrWzgBMm5gjPg1kCp/PPHtNiR/rfY a2URbx4l8ICoCrioAhfcKRHln4JM0yCIoRV/LmjrmLTRcWq33mW6zNAJ28X3le5GR9PO VIUDEDMeGKtvhUfCn2Aa2ekvdWXTNq1qsDXJ1dgYCSWnUEKLCWg6NKfLntu3pj3DPDJD LftQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=3ysPCrT6aDiInuFk99HtusnAXRwhdESoITC61IbLRas=; fh=J941C3ft2YVIy/tuqptGWJHxhJMDklXUpHN0/vABNUE=; b=dvgO8Igb1yQPd+kzIFckYQcqCiuhYZP8L0IbqTwwOnmUUmRpG5blLc236OCG64PHIu yMjJWrdh/tKPK9+WJoIVldhchFdWrkh89d+hxybGgqQWQizfSx8TekZJ6SXNxkne4gmP TYfqx6JYIwx/SLg5CWVfasK2dyQABoITM3prMWqEdOFHHUouMNYBOye2L36Gb7LicMrt KCQGpJTLzomzNEVwQiNhJd4ZrCYReL6J+xuSY0RC8pL4VWmfM2jhKN+gQnNL0cSCBbQH V/j3XqPSMVixE1u95Ab4luJAvhXPIQ9+SpynOwExreFBDp6/vcp/pBMCEt7RnPGLj3d0 eO8A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NBs9kHyG; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-171682-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171682-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id bm22-20020a0564020b1600b00572a75d5fbbsi6028369edb.400.2024.05.07.08.19.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 08:19:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-171682-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NBs9kHyG; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-171682-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171682-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 am.mirrors.kernel.org (Postfix) with ESMTPS id D791F1F218C5 for ; Tue, 7 May 2024 15:19:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7B1ED168B0E; Tue, 7 May 2024 15:19:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="NBs9kHyG" Received: from mail-yb1-f169.google.com (mail-yb1-f169.google.com [209.85.219.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 43B1C14EC79 for ; Tue, 7 May 2024 15:19:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715095172; cv=none; b=QnyxvPve9pn6z/h9qs27IY+NykB2fyHmGfrYfczqXqggCX4M3Gj63Ywe2yxB6Sb17pzKnweNdzXnJd0bLY2mGR4gnrWXc+E3s+ExShAR8JpOT8yIIOVIk9HYY0rD4wgkuFSe1s+Eed+/uCR4N254Ba1jvM1+MDxnlRDGLxOAuaQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715095172; c=relaxed/simple; bh=/wEyjI5m2O8HKuKdgtP+XsFBKrfzCPrB269/6Nd2+YM=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=fpkcHPAnaoiNTqBwW6+L/5+pWNsuOJDgLAOt1U5h5P/k2ew+ABCMLMcXLvBu9EIjhJefGRBsZdM6I2UcDC8HZgDbvM/FxZvA5CqhKpqKv81YUpjRwqm3nIuz59zDvxGxQSw4fRtvgzCWhDRPKN38e2n2aExC/ELlcj51bB6cwLc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=NBs9kHyG; arc=none smtp.client-ip=209.85.219.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-yb1-f169.google.com with SMTP id 3f1490d57ef6-de46b113a5dso3318784276.3 for ; Tue, 07 May 2024 08:19:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715095170; x=1715699970; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=3ysPCrT6aDiInuFk99HtusnAXRwhdESoITC61IbLRas=; b=NBs9kHyGPLxxXrDFj1qW08YcW8p+bdkBM/KlzVlb5f3MAHLqlIECJj/LN+xOPeHO5Y 5e7gIKrTKfyuttAIw47A8EESpV/EWuTANdN0/Kzgu2teN+CB/uk8FXunzGKSgy6tj6if JAhoKcle40muA964rUqWwy89x2WY6sVEUcZiNb2u3Nr0eVzSlJGMMe+SAC8KFK1JXLXC nTPMah/fGWR92pj80GIykY2caaW+Vv57YrFYWb0LeZ+DfChS4jNnsGtuHPygmY7LGctH avKAZ1GbXrr87ENVIEnylKzeiujtodMysob+sXG/z1LV05VI/3jAa2M7vFHLlDpzCwVe dXow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715095170; x=1715699970; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=3ysPCrT6aDiInuFk99HtusnAXRwhdESoITC61IbLRas=; b=qckOiIOvUv5R5tw3cJ8C9/Bz/2COglWxq51Qnqq75AZdhpck/0eb+5ICU5nIMneiEB QDCZADU3RR/WiDRsjb7Vb7zrlPj38zyVTNb+PLp8hYBJ6Q6HMviZQl0UG59FnEDkAZmO 6K60JE77SoiI3XZJpadGoUpz8xjcQ0469mGf2clyYCgU1cMhdR2klwKqASwKvjEZrzNH QWG80b4QvBguKBVI+EUm4RCli9qpgiPyHcKFN9stXJtoK2hcMlLvTDpvBAy7kKksu6VO +85di50yefh5VkeDj636lYXtcfGrzSTLS3MP3wOkcIXD2dGrd+cYb2Q2I9cwu1Kv/wG/ KQXA== X-Forwarded-Encrypted: i=1; AJvYcCVHZxkJS3659LLzj/iNPok9U5OUFVdmxq06gpENXTQyw+M4SdhA7b/gx7j7rbXG16S+HDIds8m/99N0xRz/j0ddfOge4oCaIa1zPVrX X-Gm-Message-State: AOJu0YxEY1z3wnHsnNUrI6Q+KipfLWyFaZ84BccWxzhICgyKm52b9v3r tPb3JKNd/f1gEO+IxgYnUtSCzZxOr7hdYS53Bc8cAB5hxvz0OnUeoHpOhDviEJ/X1gUw0lAxT/5 Y5ZUhdLPJfVufn25qxPmQY0cvOu/aJ+n+mnXjXA== X-Received: by 2002:a05:6902:2187:b0:de6:327:fa2 with SMTP id dl7-20020a056902218700b00de603270fa2mr15626519ybb.8.1715095170220; Tue, 07 May 2024 08:19:30 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <3c0c7e7e-1530-411b-b7a4-9f13e0ff1f9e@redhat.com> In-Reply-To: From: Dmitry Baryshkov Date: Tue, 7 May 2024 18:19:18 +0300 Message-ID: Subject: Re: Safety of opening up /dev/dma_heap/* to physically present users (udev uaccess tag) ? To: "Bryan O'Donoghue" Cc: Hans de Goede , Sumit Semwal , Benjamin Gaignard , Brian Starkey , John Stultz , "T.J. Mercier" , =?UTF-8?Q?Christian_K=C3=B6nig?= , Lennart Poettering , Robert Mader , Sebastien Bacher , Linux Media Mailing List , "dri-devel@lists.freedesktop.org" , linaro-mm-sig@lists.linaro.org, Linux Kernel Mailing List , Milan Zamazal , Maxime Ripard , Andrey Konovalov Content-Type: text/plain; charset="UTF-8" On Tue, 7 May 2024 at 18:15, Bryan O'Donoghue wrote: > > On 07/05/2024 16:09, Dmitry Baryshkov wrote: > > Ah, I see. Then why do you require the DMA-ble buffer at all? If you are > > providing data to VPU or DRM, then you should be able to get the buffer > > from the data-consuming device. > > Because we don't necessarily know what the consuming device is, if any. > > Could be VPU, could be Zoom/Hangouts via pipewire, could for argument > sake be GPU or DSP. > > Also if we introduce a dependency on another device to allocate the > output buffers - say always taking the output buffer from the GPU, then > we've added another dependency which is more difficult to guarantee > across different arches. Yes. And it should be expected. It's a consumer who knows the restrictions on the buffer. As I wrote, Zoom/Hangouts should not require a DMA buffer at all. Applications should be able to allocate the buffer out of the generic memory. GPUs might also have different requirements. Consider GPUs with VRAM. It might be beneficial to allocate a buffer out of VRAM rather than generic DMA mem. -- With best wishes Dmitry