Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1460429imu; Wed, 16 Jan 2019 20:32:09 -0800 (PST) X-Google-Smtp-Source: ALg8bN58hM11DLfPprit9uU72Y4+T5dUBLF2VK+oxbfqCKCSbwtImoQqh6bjvrm+7tge3mwQ4JQP X-Received: by 2002:a17:902:7443:: with SMTP id e3mr13524018plt.304.1547699529619; Wed, 16 Jan 2019 20:32:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547699529; cv=none; d=google.com; s=arc-20160816; b=qYizQbQm7sSJFOy23LYuCr5QzShgidcfwaBCC73VIBl+IzUPogUArQ2s11x/K4i1ei XxyTaomRFgwvExg3UgL1xIZnAqCBOmcYBe1pP26NMwj+KRY+KWN/CHOmjbh+v/+S8oNM EVHyVuk59b4aIf10vZ/2X0/XyE4T6QHuSanwKXdAYDwra3LxkVKPCD7HVTTgEPHPuYR8 4sANsxgf+GyZ0Ezr8IjJE5vN2ssxAF9dVTcSpN1BlMI13LZED7JyKSTyn5YvMG+vD66Z naVVsOwKIcJ/BbZUEUcs0pOJ/C6/ZO2moRtiPQNwE6DiO8s0Jb1SUDs46KPzLvLNPx+i 4CFw== 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=HpbNSVWcUJekPSVqFOJScNdnZ3sjkPNZkiSr/JTsCt4=; b=xECFfI7nnRTnmYZo22zigApKtESOoFRXqyE1C1q7UTV/Ep9ffRkD22N84LiiNPkzaV DLit9aDwoX6Rl1/nY0zlx4gTQCOFMyfgm73W4ctc+QeKK41kk7jpImSBgvtJUPFxY69L tEiiji5sO86rSMRKiUbfdOoKInf1VgE5wZErJKVmz0plDNsluQ92Aqetbt4QY0qCZa+v ICIGTlLpOrAh8uBNWd9NfZIkCSbiMxi8tvD4CWWonOrGpx9eZ/2OGqnInK9Y97mRc9CF cJTKNVyLzhXnGF2huLvez11/tgkodTZMaX5wtbPHWFjIUhL4YVgESCYrQTdSxqNN3Jlw J+cA== 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 d16si530601pfn.169.2019.01.16.20.31.53; Wed, 16 Jan 2019 20:32:09 -0800 (PST) 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 S2392964AbfAPNDh (ORCPT + 99 others); Wed, 16 Jan 2019 08:03:37 -0500 Received: from 8bytes.org ([81.169.241.247]:57960 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390275AbfAPNDh (ORCPT ); Wed, 16 Jan 2019 08:03:37 -0500 Received: by theia.8bytes.org (Postfix, from userid 1000) id D389B273; Wed, 16 Jan 2019 14:03:35 +0100 (CET) Date: Wed, 16 Jan 2019 14:03:34 +0100 From: "joro@8bytes.org" To: "Suthikulpanit, Suravee" Cc: "linux-kernel@vger.kernel.org" , "iommu@lists.linux-foundation.org" , Boris Ostrovsky , "Singh, Brijesh" Subject: Re: [PATCH] iommu/amd: Mark translation invalid during device detach Message-ID: <20190116130334.svrjkyr3dnfcj3u6@8bytes.org> References: <20190116041432.3484-1-Suravee.Suthikulpanit@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190116041432.3484-1-Suravee.Suthikulpanit@amd.com> User-Agent: NeoMutt/20170421 (1.8.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Suravee, On Wed, Jan 16, 2019 at 04:15:10AM +0000, Suthikulpanit, Suravee wrote: > From: Suravee Suthikulpanit > > When a device switches domain, IOMMU driver detach device from the old > domain, and attach device to the new domain. During this period > the host table root pointer is not set, which means DMA translation > should be marked as invalid (clear TV bit). > > So, clear the TV bit when detach the device. The TV bit will be set > again when attaching device to the new domain. Is there a specific problem with setting the TV bit? Note that the update will clear all other fields in the first 128 bits of the DTE, which means that IR, IW and Mode are all set to 0. This effectivly blocks all DMA requests from the device, which is by design. Regards, Joerg