From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) (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 3095618B0A for ; Wed, 29 Jul 2026 00:10:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785283829; cv=none; b=cYiSrTK9pI4jD7A6pXtDq+V0vOiTNUnax6yHRjn2tfyfD2MYalFruslcgxKqyQxCPVXw+3GntbUNdjKJWTMyuilDUN9F4UqGhVw2e7mXDCZhiunMiEhGWaskbxf77sBmNtvZ5bLOeM3MNZE5ddoljc18+3PNyzW44lIvtjdWJeQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785283829; c=relaxed/simple; bh=KkoSOGKlusTnK+ZdAUdTrIWUD8iRGveY1t8vcyjuTsw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=IiRtm/xEBNF/Dj4laEVndSkll8VuDgggZWdP+vnOwc3OOUFWaok5a9Z7ht/26JE5swa6wYQiRNcSoQQJ+JDU7wsTLNXVjUVuvvp6Ojb0nwVQdqSh5nBPbHe+m2ZynTDuwuqbnCg1L/ohPKNCFItjz5vO4E1bvdSDx0iJOnElzUo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca; spf=pass smtp.mailfrom=ziepe.ca; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b=mcmqTg/t; arc=none smtp.client-ip=209.85.214.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="mcmqTg/t" Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-2caed617615so5269905ad.3 for ; Tue, 28 Jul 2026 17:10:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1785283827; x=1785888627; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=n+eyuJJuDqUpzb7f6fRfbazX81T9EOhy1ShTPafeE64=; b=mcmqTg/tliJWARI6Xx5X7AbBYrtWQX7fnTqiuElsOYvgdgarsyfBYplGI4hZo0PNpa 1zE0AtUsPYovco3czerA678MPnF0+kyxmGL3g2zAjbpb2owQAKK29cxqy2yisRJevX7w HIkMJiWnLDitLX12vlOFPE0hLfN5vzx8srC4B9GCQTRfStpbDlFbxuhZC/R/pp6EeYoX 8eEFBgnzeV7tbV1Xe/Ef4U2L0/Gb6Iq4RwxW9bydPFn2B39MS/lpUZjB4Fv5uNBPyzpq QCljYFaqkGnm5PmgPJxZIhFIjQwX6nlb4Q6F5vnZ92B0tjKhvshpn1zSGpZvpGilRJ4x JRBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785283827; x=1785888627; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=n+eyuJJuDqUpzb7f6fRfbazX81T9EOhy1ShTPafeE64=; b=GNAKSYzmoaP8xlSuSH90lBFQ6FfVshSwLsJeCWhE8H3flZSEEPczbRhqZfvHOPMpJL gsuKCj5giGbSEse7cPdqW2WGewUaPcmQxUml8e7zoS63W4xwhahTk1E3PhNsMZ0/QUz5 kI8kkbkKxXcRWGazSmxy73qLEIhCnkY1b5t8cIIXFZAPotGTJydzGFUO0nIdZUVTPZqc Nx86gAGTguGvVvRNH2fxeiICc/jAMkRIJ1kB1pI9Sed9ZyqYss0jDBUIkVIJLDnvcoC1 x2DDbE1hwRMQMDlks3a8+6TdhhBjZUcZ0LFP8pDDTyIzTT5sbrHMSvDj5LGvaEV89l7a pcDQ== X-Forwarded-Encrypted: i=1; AHgh+RpGFdE6GJgUk1PfHRGHQOROBGl6Kq7gpMd4c4hKmchjvWNFopEQXirWAsUGS0afI6J6OYT7qo8ZJmlA0YY=@vger.kernel.org X-Gm-Message-State: AOJu0YxuoUzokiTPnknsOkhSuM8j8o5BbYsGBAKqY+ed1frEH31BhgvQ RwPwoNs/k5gn2Vtk5sOVRXdv2ejEriXAAvIjK8s/0707f/sFztPF7l9hTJwFWYY3AyE= X-Gm-Gg: AR+sD11DX1gU4OdGqviebqvI/OlL46PiImbWxiQJ9alxbrA2JVp8y+vlraE1VMvIAO9 PCv/JBLMpAQrPjv9olts8qkuW4ssy/qUgc3hCZ0yN45+AUwT/jBJcR+Roeq4DptQjH1Z2wl88PK Lm9VQKKSzGyGzdq9N4OsXGH8yX7n1Yx9GuVUezlryF12OGGc7fev5xERmWuRVNaELKWmPNFU39J 0Gg+bnL7p0vn00MhpAP48/+elSYb4Kwmkk/Aip+ZKAqcCN8yzqiNZkSfe2OsRdjcaL4e7x7iVMt RFqeDd5os3YcigOpwPZs6BQG6DikFfZnZywOsraeHb09aZ39RLQ3cxsAYb5Mp8iVBrrgHd5nACp h8diWjuOteH7DN6VJd+8/Aoayq09m14TXOZrMODRzatRHqYZp7PJIYvgKWhkc2msafL0yDdKlwY GtD+jaPzPC4PJ6ZINnSNYHUX++p80va86zoX7nMzJhTrsLZoeunntEpMRTSrLcR59p X-Received: by 2002:a17:903:46cd:b0:2cc:f7c6:8353 with SMTP id d9443c01a7336-2d015da2cdcmr51336395ad.41.1785283827557; Tue, 28 Jul 2026 17:10:27 -0700 (PDT) Received: from ziepe.ca (d50-92-54-205.bchsia.telus.net. [50.92.54.205]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2d022a4596esm2962495ad.23.2026.07.28.17.10.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jul 2026 17:10:26 -0700 (PDT) Received: from jgg by jggl with local (Exim 4.95) (envelope-from ) id 1worsQ-0002DH-GU; Tue, 28 Jul 2026 21:10:26 -0300 Date: Tue, 28 Jul 2026 21:10:26 -0300 From: Jason Gunthorpe To: Robin Murphy Cc: Daniel Drake , "Joerg Roedel (AMD)" , Will Deacon , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Florian Fainelli , Broadcom internal kernel review list , iommu@lists.linux.dev, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, nick.hollinghurst@raspberrypi.com Subject: Re: [PATCH v2 4/5] iommu: Add Broadcom BCM2712 IOMMU driver Message-ID: References: <20260727-bcm2712-iommu-submit-v2-0-0247b5c03de8@reactivated.net> <20260727-bcm2712-iommu-submit-v2-4-0247b5c03de8@reactivated.net> <3e7ba95b-51e7-48e4-aea5-f86db1739ac2@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3e7ba95b-51e7-48e4-aea5-f86db1739ac2@arm.com> On Tue, Jul 28, 2026 at 11:51:04AM +0100, Robin Murphy wrote: > > + ret = pt_iommu_bcm2712_init(&domain->pt, &cfg, GFP_KERNEL); > > + if (ret) > > + goto err; > > + > > + /* Set up a default (error) page used to catch illegal reads/writes */ > > + domain->default_page = iommu_alloc_pages_sz(GFP_KERNEL, PAGE_SIZE); > > + if (!domain->default_page) > > + goto err; > > + > > + domain->base.geometry.aperture_start = BCM2712_APERTURE_BASE; > > + domain->base.geometry.aperture_end = BCM2712_APERTURE_END - 1; > > + domain->base.geometry.force_aperture = true; > > ...and thus (as things stand) this is a lie :( Well, it shouldn't be here, the iommupt core code should be setting this from its own internal information. If there is something missing to add in the full_va_prefix we should fix it. But, AFAIK this is the correct way to declare a page table that has a range of IOVA - which I think is what this is doing.. > If you want to operate like an IOMMU, then the translation aperture and the > bypass window should really be mutually-exclusive; I think it is operating like an iommu.. It uses generic_single_device_group() so there is only ever one translation. If identity is attached then it clears MMMU_CTRL_OPERATING_FLAGS which I guess fully disables the IOVA aperture If paging is attached then it sets MMMU_CTRL_OPERATING_FLAGS and places the aperture at 40G. Based on the comments about blocking I wonder if the "bypass" even works when paging is on? If blocking is attached then it sets MMMU_CTRL_OPERATING_FLAGS with some 0 address cap which aborts everything? It looks to me like some of those comments and choices don't reflect what the driver actually does. Since there is only ever one translation we never need to be worried about where the aperture is, it could be anything so long as the HW gives it priority to bypass. Could the aperture be placed at 0 with the bypass fully disabled? Then it would basically be a normal iommu. Jason