From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C821EC433FF for ; Fri, 9 Aug 2019 20:32:13 +0000 (UTC) Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A22A8214C6 for ; Fri, 9 Aug 2019 20:32:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A22A8214C6 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=8bytes.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 4F57ACB0; Fri, 9 Aug 2019 20:32:13 +0000 (UTC) Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 8E1E2CA5 for ; Fri, 9 Aug 2019 20:32:11 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from theia.8bytes.org (8bytes.org [81.169.241.247]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id DD1B167F for ; Fri, 9 Aug 2019 20:32:10 +0000 (UTC) Received: by theia.8bytes.org (Postfix, from userid 1000) id DA0543D0; Fri, 9 Aug 2019 22:32:08 +0200 (CEST) Date: Fri, 9 Aug 2019 22:32:08 +0200 From: Joerg Roedel To: "Lendacky, Thomas" Subject: Re: [PATCH 3/3] iommu: Disable passthrough mode when SME is active Message-ID: <20190809203208.GB1213@8bytes.org> References: <20190809152233.2829-1-joro@8bytes.org> <20190809152233.2829-4-joro@8bytes.org> <7f383631-ce2c-e7c2-ceff-e7418bf8ff29@amd.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <7f383631-ce2c-e7c2-ceff-e7418bf8ff29@amd.com> User-Agent: Mutt/1.9.4 (2018-02-28) Cc: "iommu@lists.linux-foundation.org" , Joerg Roedel , "bp@alien8.de" , "linux-kernel@vger.kernel.org" X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: iommu-bounces@lists.linux-foundation.org Errors-To: iommu-bounces@lists.linux-foundation.org Hey Tom, On Fri, Aug 09, 2019 at 04:50:48PM +0000, Lendacky, Thomas wrote: > On 8/9/19 10:22 AM, Joerg Roedel wrote: > > + if ((iommu_def_domain_type == IOMMU_DOMAIN_IDENTITY) && > > + sme_active()) { > > + pr_info("SME detected - Disabling default IOMMU passthrough\n"); > > + iommu_def_domain_type = IOMMU_DOMAIN_DMA; > > Should this also clear the iommu_pass_through variable (the one set by the > iommu kernel parameter in arch/x86/kernel/pci-dma.c)? This code is used on different architectures, so I can't cleanly access architecture specific variables here. > I guess this is more applicable to the original patchset that created the > CONFIG_IOMMU_DEFAULT_PASSTHROUGH option, but should the default > passthrough support be modified so that you don't have to specify multiple > kernel parameters to change it? > > Right now, if CONFIG_IOMMU_DEFAULT_PASSTHROUGH is set to yes, you can't > just specify iommu=nopt to enable the IOMMU. You have to also specify > iommu.passthrough=0. Do we want to fix that so that just specifying > iommu=nopt or iommu.passthrough=0 does what is needed? Yeah, that is currently a mess and I think cleaning that up is at least partly in the scope of this patch-set. I'll look into that next week. Regards, Joerg _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2DC3C433FF for ; Fri, 9 Aug 2019 20:32:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ABE642166E for ; Fri, 9 Aug 2019 20:32:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727649AbfHIUcK (ORCPT ); Fri, 9 Aug 2019 16:32:10 -0400 Received: from 8bytes.org ([81.169.241.247]:48622 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725860AbfHIUcK (ORCPT ); Fri, 9 Aug 2019 16:32:10 -0400 Received: by theia.8bytes.org (Postfix, from userid 1000) id DA0543D0; Fri, 9 Aug 2019 22:32:08 +0200 (CEST) Date: Fri, 9 Aug 2019 22:32:08 +0200 From: Joerg Roedel To: "Lendacky, Thomas" Cc: "iommu@lists.linux-foundation.org" , "linux-kernel@vger.kernel.org" , "Suthikulpanit, Suravee" , "bp@alien8.de" , Joerg Roedel Subject: Re: [PATCH 3/3] iommu: Disable passthrough mode when SME is active Message-ID: <20190809203208.GB1213@8bytes.org> References: <20190809152233.2829-1-joro@8bytes.org> <20190809152233.2829-4-joro@8bytes.org> <7f383631-ce2c-e7c2-ceff-e7418bf8ff29@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7f383631-ce2c-e7c2-ceff-e7418bf8ff29@amd.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hey Tom, On Fri, Aug 09, 2019 at 04:50:48PM +0000, Lendacky, Thomas wrote: > On 8/9/19 10:22 AM, Joerg Roedel wrote: > > + if ((iommu_def_domain_type == IOMMU_DOMAIN_IDENTITY) && > > + sme_active()) { > > + pr_info("SME detected - Disabling default IOMMU passthrough\n"); > > + iommu_def_domain_type = IOMMU_DOMAIN_DMA; > > Should this also clear the iommu_pass_through variable (the one set by the > iommu kernel parameter in arch/x86/kernel/pci-dma.c)? This code is used on different architectures, so I can't cleanly access architecture specific variables here. > I guess this is more applicable to the original patchset that created the > CONFIG_IOMMU_DEFAULT_PASSTHROUGH option, but should the default > passthrough support be modified so that you don't have to specify multiple > kernel parameters to change it? > > Right now, if CONFIG_IOMMU_DEFAULT_PASSTHROUGH is set to yes, you can't > just specify iommu=nopt to enable the IOMMU. You have to also specify > iommu.passthrough=0. Do we want to fix that so that just specifying > iommu=nopt or iommu.passthrough=0 does what is needed? Yeah, that is currently a mess and I think cleaning that up is at least partly in the scope of this patch-set. I'll look into that next week. Regards, Joerg