From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=210.118.77.11 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796224584; b=FZYyFiPhX4GCsejtzrVvM1RzOHWR8un/Vxs4ALLwUDDou30oaLvaGZ2G1pWcDJEfron7 dDbSmB1Pqvp5MdndD1/WTwmnCRW/hUyeR22OP32srwZxhIrgWX09v3ghMqBBX/8mvpR3Q iDbLeOxytV9AjJ61H0+/MXqbjaq7eHAiJmDVwKKBB25Ku3/IUlFbBZoRNVbbARdI8cumJ UvOiQP5Kj0PSv68IRiSZMPECMrbFyyK7XcGUd97XWrcTX0fbsJR01B1MzIqoXzFZRhMym cDdH+VZ0edVf9rzBXl8qdLtFvhtgsGhgELEI5cn681rh+wjlc8HjM1Ho/Q/PU2F7SSQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796224584; h=DMARC-Filter:Received:DKIM-Filter:DKIM-Signature:Received:Received: Message-ID:Date:MIME-Version:User-Agent:Subject:To:Cc: Content-Language:From:In-Reply-To:Content-Transfer-Encoding: X-CMS-MailID:X-Msg-Generator:Content-Type:X-RootMTR:X-EPHeader: X-CMS-RootMailID:References; bh=yBCtVYIJQISW7YhqGBT5swU4Wo/M5GVpktzOchstFC0=; b=LhBJrmEjTZFe5yaRddr8t+UW8sJlnnH13M0Y+Bn8sU2CdKzOsDf/Sto9Zd4AzZhnq3Zq V4Z0QR3VmRY9zL5DQ3m69gQKcbGzJWV1dzbPjyQpoa2E5HJ6UuPkdDqVuXwd+IXirvvDw JmslszFmmEDfosVCoOLsGyXDeNtLbWdh4mB8jCSFETH6J6RqSlGXyBLWmGVyUREXsLRgs 5boeQeRCUKULlgDyBP0y/ZFVKmImjqSKaTAVp8Of8Plf2XMlg/fa9TAeagbG4XsE/SdGx iOAm1vuEMqVsYYA3hbKP5VkEwkz8iDm5p8bmkO9ELGN1bXEXD8vZ0w8a/TpF5+1jQTQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass header.d=samsung.com header.i=@samsung.com header.a=rsa-sha256 header.s=mail20170921 header.b="W+OzmS/C"; arc=none smtp.remote-ip=210.118.77.11 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D1B78606A327 for ; Wed, 2 Dec 2026 15:16:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D1B78606A327 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=samsung.com header.i=@samsung.com header.a=rsa-sha256 header.s=mail20170921 header.b=W+OzmS/C Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20261202151620euoutp01d78e5b8c260a760b71958a332db37e26~teL1NEv3f0032000320euoutp01W for ; Wed, 2 Dec 2026 15:16:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20261202151620euoutp01d78e5b8c260a760b71958a332db37e26~teL1NEv3f0032000320euoutp01W DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1796224580; bh=yBCtVYIJQISW7YhqGBT5swU4Wo/M5GVpktzOchstFC0=; h=Date:Subject:To:Cc:From:In-Reply-To:References:From; b=W+OzmS/CZcVF0yQ1qsotaGMq0S5RRA9/fnzc1+picmC0qfpVcmpULdTDozOZrKQCC iFiQ9ENsyjuXlbq9v5PA2Jm0T4vWh5/Qi6jwYymyzU+WmQSzJTntOwLKf1+AVXlQQG 9aASE312qfvSEk0g1e4ysnWnympV7Z310dMyrijM= Received: from eusmtip1.samsung.com (unknown [203.254.199.221]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20261202151620eucas1p2f73d141154163ce115e0623c8e7c8b8a~teL0ubY5U1981919819eucas1p2t; Wed, 2 Dec 2026 15:16:20 +0000 (GMT) Received: from [106.210.134.192] (unknown [106.210.134.192]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20261202151619eusmtip175497445bdbc009fca91b15a7c877d8c~teLziXwHJ3171231712eusmtip1M; Wed, 2 Dec 2026 15:16:18 +0000 (GMT) Message-ID: Date: Wed, 2 Dec 2026 16:16:18 +0100 X-Mailing-List: kvm@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Betterbird (Windows) Subject: Re: [PATCH 1/4] media: venus: use dma_iova_size() to check the reserved IOVA size To: Jason Gunthorpe , Bryan O'Donoghue Cc: Vikash Garodia , iommu@lists.linux.dev, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Robin Murphy , Joerg Roedel , Will Deacon , Leon Romanovsky , Sibi Sankar , Honglei Huang , prakash.gupta@oss.qualcomm.com, Alex Williamson , Dikshita Agarwal , Abhinav Kumar , Mauro Carvalho Chehab , Hans Verkuil , stable@vger.kernel.org Content-Language: en-US From: Marek Szyprowski In-Reply-To: <20261130195457.GW114472@nvidia.com> Content-Transfer-Encoding: 8bit X-CMS-MailID: 20261202151620eucas1p2f73d141154163ce115e0623c8e7c8b8a X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20261127115859eucas1p1ae20b01eec39080daf19dbd71aba10e9 X-EPHeader: CA X-CMS-RootMailID: 20261127115859eucas1p1ae20b01eec39080daf19dbd71aba10e9 References: <20261127115849.2780625-1-m.szyprowski@samsung.com> <20261127115849.2780625-2-m.szyprowski@samsung.com> <20261127142912.GK114472@nvidia.com> <20261127172626.GQ114472@nvidia.com> <0b76ccad-877d-41b9-a7a6-02266a7bfd56@oss.qualcomm.com> <21a54a2a-9df8-49c7-a7a2-e0cadd075270@kernel.org> <20261130195457.GW114472@nvidia.com> On 30.11.2026 20:54, Jason Gunthorpe wrote: > On Mon, Nov 30, 2026 at 01:10:03AM +0000, Bryan O'Donoghue wrote: > >> The other direction is to have venus and iris register their own IOMMU >> domain and then the address allocator they will provide places the floor at >> 600MB for the SID. >> >> Jason, do you think this is the right approach ? > There is yet another thread about this too, and you shouldn't this > because you loose the DMA API and all the cache flushing it gives. > > I suggested that people who want this should follow the old design of > PASID to get a dummy struct device just for the DMA API to use with > its own private iommu domain. > > However, that still leaves us with the issue here that the DMA API is > not aware of the weird HW limitation. > >> drivers/media/platform/nvidia/tegra-vde/ >> >> vde->domain = iommu_paging_domain_alloc(dev); >> if (IS_ERR(vde->domain)) { >> err = PTR_ERR(vde->domain); >> vde->domain = NULL; >> goto put_group; >> } >> >> err = iova_cache_get(); >> if (err) >> goto free_domain; >> >> order = __ffs(vde->domain->pgsize_bitmap); >> init_iova_domain(&vde->iova, 1UL << order, 0); >> >> err = iommu_attach_group(vde->domain, vde->group); >> if (err) >> goto put_iova; >> >> /* >> * We're using some static addresses that are not accessible by VDE >> * to trap invalid memory accesses. >> */ >> shift = iova_shift(&vde->iova); >> iova = reserve_iova(&vde->iova, 0x60000000 >> shift, >> 0x70000000 >> shift); > Is this HW or software that is motivating this carve out? I was never > clear on that.. If I got it right, the addresses below 600M have special meaning for the hw, so it is the driver role to avoid putting generic buffers there. IMHO it is not strictly a HW limitation and I'm not sure if the early mentioned device-tree based approach is the right way of solving this. Best regards -- Marek Szyprowski, PhD Samsung R&D Institute Poland