From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030216AbcGKHUI (ORCPT ); Mon, 11 Jul 2016 03:20:08 -0400 Received: from 8bytes.org ([81.169.241.247]:60978 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757510AbcGKHUF (ORCPT ); Mon, 11 Jul 2016 03:20:05 -0400 Date: Mon, 11 Jul 2016 09:19:59 +0200 From: Joerg Roedel To: Wan Zongshun Cc: iommu@lists.linux-foundation.org, Joerg Roedel , linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] iommu/amd: Fix unity mapping initialization race Message-ID: <20160711071959.GB12639@8bytes.org> References: <1467820838-5059-1-git-send-email-joro@8bytes.org> <57823445.1020808@iommu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <57823445.1020808@iommu.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jul 10, 2016 at 07:40:53PM +0800, Wan Zongshun wrote: > Do you mean we need enable the V and TV bits to DTE entry after all > DTEs tables were initialized completely? Yes, this is what my patch does and what fixes the bug that was reported on machines which have unity-mapping entries. > I checked this function 'init_device_table_dma', and find it just set > V and TV bit, to set translation info valid and DTE bits127:1 valid. Right, if no other bits are set this blocks all DMA from the gives device-id. > So I just think all things it should to do are to allow DMA access, > GPA-to-SPA translation should be active, why you add function > comments below is to not allow DMA access and suppress all page > faults? > > /* > * Init the device table to not allow DMA access for devices and > * suppress all page faults > */ Yeah, that comment needs to be updated. Not all DMA is blocked and page-faults are not suppressed at all. Thanks for noticing. Joerg