Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp387881pxf; Wed, 17 Mar 2021 07:26:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+Sq+Ue2/Re0HBkm1JV9UU8/BB1jUG/T1nEjnbgPgSW7NZM1A+yHYYCv2O2ZoohE8rEp4y X-Received: by 2002:aa7:c1d8:: with SMTP id d24mr32330077edp.290.1615991208754; Wed, 17 Mar 2021 07:26:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615991208; cv=none; d=google.com; s=arc-20160816; b=llag6sjWqRJfAnw4gVGlnj0dafxb0pRpmyGG5VISsJNFPyDiCqRBZsR23VK3anwFnS zB41rRPesgJaUjjGJOFu+4Pzsrr7oapyi7cCcrBL9yQ1KfB9ZdlEB6aQbRYHXgSX5/ln N4UTqbBzbmUdLIWeVXEDjD0tRY7QXFBlW/0s1Un46VTT1w+iAhW/w0B0ofbokqyHLVYr zfqDjDmaUOmrDkErMlr1nsjiqWdVZiURXZmMtPDCrxpTvIYUdrrnkr0426AMzqHWX7/3 UOOBPcLFKxwbKZrU8E1lIwikDFkbpMqucSHT8Ef1JE0pYQ/Y1ZvAOOZKsXKGkPYfueAX faBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=UjuBq8miYx/4CDQ2BaVD7f+NH7Mbl+aX1V+/S2Wpf3g=; b=qtgVYpRClBbg+YnS0IhmnXT7yh5U+snvnjPqUveVyDoHaJAJmWc8ZSjOIbFXBUuHVu xFOWa/ekKE84Ax6X8XAOQkvArvoX/7ZliZlIuOT7FlIkvgmGi2NAbodhIDf3D2uBwdBr sqzDsHuEfCNGMT633j0dfiTnwLYNECdi5GQ1PPLh2Z6bAdtmmllYkHXY5W/f7kBrwdUu aEugk5eo/PcaJaxaYZHFt4Ln+EpBXPb3C88sdro8Yh0va62gDa+3YVZqw6ARSyq9LDfJ nDxUFg7N364W3AjH1fm+i+7jWy93uiD8XtjdgNR0eBOnHGG+C8q6XZ0mz7K3vq0z0VW7 KFDw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d2si16118139edx.95.2021.03.17.07.26.26; Wed, 17 Mar 2021 07:26:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231396AbhCQOZF (ORCPT + 99 others); Wed, 17 Mar 2021 10:25:05 -0400 Received: from 8bytes.org ([81.169.241.247]:59472 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231786AbhCQOYt (ORCPT ); Wed, 17 Mar 2021 10:24:49 -0400 Received: by theia.8bytes.org (Postfix, from userid 1000) id B857A3A4; Wed, 17 Mar 2021 15:24:47 +0100 (CET) Date: Wed, 17 Mar 2021 15:24:46 +0100 From: Joerg Roedel To: David Woodhouse Cc: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Huang Rui , Suravee Suthikulpanit , Alex Deucher , Xiaojian Du , Joerg Roedel , stable@vger.kernel.org Subject: Re: [PATCH 2/3] iommu/amd: Don't call early_amd_iommu_init() when AMD IOMMU is disabled Message-ID: References: <20210317091037.31374-1-joro@8bytes.org> <20210317091037.31374-3-joro@8bytes.org> <449d4a2d192d23eb504e43b13c35c326f2d0309a.camel@infradead.org> <3014DA56-84D8-474B-94FE-6FDBB6241F9F@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3014DA56-84D8-474B-94FE-6FDBB6241F9F@infradead.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 17, 2021 at 01:37:16PM +0000, David Woodhouse wrote: > If we can get to the point where we don't even need to check > amd_iommu_irq_remap in the ...select() function because the IRQ domain > is never even registered in the case where the flag ends up false, all > the better :) This should already be achieved with this patch :) But the check is still needed if something goes wrong during IOMMU initialization. In this case the IOMMUs are teared down and the memory is freed. But the IRQ domains stay registered for now, mostly because the upper-level APIs to register them lack a deregister function. I havn't looked into the details yet whether it is suffient to call irq_domain_remove() on a domain created with arch_create_remap_msi_irq_domain() for example. This needs more research on my side :) Regards, Joerg