Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp763456ybl; Fri, 9 Aug 2019 13:33:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqyf27j5il9wR5j6zFoXcg0uAhqfKpVeSGoemxvxbaRqvYWRHwH6TcM5Te2gl7oo2k0inZrV X-Received: by 2002:a63:c006:: with SMTP id h6mr18860505pgg.290.1565382784249; Fri, 09 Aug 2019 13:33:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565382784; cv=none; d=google.com; s=arc-20160816; b=ghY6Y1weYWWMkMv3sLWcOVds4gGgq7dJag3s1F8Ap8QdUVoRi0dP76TshNjtqv0n40 b6Y7pO1E/iBNY0kaoXarc/0fOx0K9HfPepAXWWhdqLfs4NR/fyBdM3koHwzNRJjGHpku eIJxxUg6TNZbwyR3oZvBLJnpEw4jtxzsWz2bEH6VIOuvt/UJ82OJGk2QKXqW8/sKSw0n ut0QLheuvt9YwVDPJlN5a17PcLV9YI5VcdyW6IJsXLEoHDBvJ/Ep9NFwdjTR7UZlWivy w9d5rm2KLJCKxBolG3bcMSAQPNXTl1tV/GtTjxr8IPY6HTGoolVgC12sGYHWSsFzPVBj Lf5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=lhdwejz0Q7ZN2hAJ30O4nKyxnLfAAcrR9fXYC/Tf7zs=; b=UDQ6xFVitnJ3Sl2TuKWC74znGvUpERT6p6hDt8plk4AAFo187LnKia4FKRbkdOHM+q VfBlw6+vc4f0zJC7KaeOWXAfYDcrcMW818msfIB5slrZxDR3IY6E9dqM7x6kS4kUZdyP cnUncHcS5+8k4Dw2TvmYCCaNb0lJ43+X5y1BsGASIY+Aklidd8r65YZTsC6Z7voBckDd JkixS7kdPjM3cUjYaSwBC/kwRB5XC/sa13zfArPDB9cRKd/drg2DoCfuVgI7dohzBkP7 BEc/h0Hm6km3TblzzFjfo/n0FQ7n69WCCywA5VUQRIKn14VB9Kwu0TqUIrHiSN3mxA0h MAJA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id g10si5164725pjp.74.2019.08.09.13.32.48; Fri, 09 Aug 2019 13:33:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1727275AbfHIUcK (ORCPT + 99 others); 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