Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2637165pxb; Tue, 13 Apr 2021 06:46:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2NEY+AOX4kYrY5xUnJFqy+rgbq/NHtDGUoX2sVMS7WhCtIuJEU3/zemun0CkNV98LBFPn X-Received: by 2002:a63:ff4d:: with SMTP id s13mr32566210pgk.310.1618321604350; Tue, 13 Apr 2021 06:46:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618321604; cv=none; d=google.com; s=arc-20160816; b=byjIKIBSLUxbqxs42GRn07UfOpKwI6xwDvSZ/5oLAXrlTpjytoFu88Ta/I4L1tHkwj GqcnH8hVJ/Kn1UspLPwfZOh026tJm+Qw+kJtXC5CxWgDqQjah8E1TAqFp9fz7jZd2pZe qayK/vdlJKjDqzjdoib8/hG92O9Db0K7y71l7w/dPptSg1/1ehTVgihh4pY1Os3/NCtP 78YTkdvBLvSIA/9bsN95d8+Eajh/IrPx2nxA3p5EYCUfKo7iMVm/QW0wBA7G3PAVxwK7 aBjt59dWFWv0iPr0ks8La5LNI6UDuRuSGqeXoMvftPnSMLoMjyJyOt9LShEUtREBAWUa ypog== 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:dkim-signature; bh=YbOHtM3CuE8phRVepT8HFF3mXyYEgBOppdpfTnN1HWQ=; b=B2fNOIg3D6as1dBv/6PjH9NX3EYpN/XV8w5wQY7/EOY0f4Jn1NFQha3uGD7zOW/Npj 5WT8/XDE3p7ixp28vPrAJjy2/3kLhTOyOeHu0e7/YWkyRItmbVhAijW41Q6tFBIN6jj1 bGcJ1AmwFfH+wVz7MXfCzQL2iEpzWnrHkex5mF8PTL+efto09pPvqEpJ2IsFymoBaF+o A0LhZ5Uddlu6NYCKeU03/zEG150ThuuzOAyzN/Y8pqeYSoIkN8uphDRWR15ADhfl9hfz sGs1rGiI+u0asCU04ik5EookpeoBSJfUyCBn+ZDjPzjezZULkXz9FA6KAerT2/DFj4dM hLrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=v2rJrZ0v; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p185si15882944pgp.320.2021.04.13.06.46.31; Tue, 13 Apr 2021 06:46:44 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=v2rJrZ0v; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238607AbhDMHcz (ORCPT + 99 others); Tue, 13 Apr 2021 03:32:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:35322 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237776AbhDMHcu (ORCPT ); Tue, 13 Apr 2021 03:32:50 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D341761019; Tue, 13 Apr 2021 07:32:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618299151; bh=NXAlmsVssbNaMP8SFM64V4f9tP7FA7/C7BSu9Mpzc0w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=v2rJrZ0vpAWX4TqaQkiHsp6irNdzTpp1FDSIB4nWJQztQAuv+ESx2iir5UghNQwzA fNY5+fmQT8yCkgJj4A3k079sj9tT7LNRFk1TFNsnXe9KpANuxGlDzYL+CNQPLBlMPv 0iB9fFmw8KUz0NGfs+bvU2JzrVp+6fzMX2pmYotI= Date: Tue, 13 Apr 2021 09:32:28 +0200 From: Greg KH To: Saeed Mirzamohammadi Cc: saeed.mirzamohammadi@oracle.com, stable@vger.kernel.org, Camille Lu , Lu Baolu , David Woodhouse , Joerg Roedel , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 5.4 v3 1/1] iommu/vt-d: Fix agaw for a supported 48 bit guest address width Message-ID: References: <20210412202736.70765-1-saeed.mirzamohammadi@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210412202736.70765-1-saeed.mirzamohammadi@oracle.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 12, 2021 at 01:27:35PM -0700, Saeed Mirzamohammadi wrote: > The IOMMU driver calculates the guest addressability for a DMA request > based on the value of the mgaw reported from the IOMMU. However, this > is a fused value and as mentioned in the spec, the guest width > should be calculated based on the minimum of supported adjusted guest > address width (SAGAW) and MGAW. > > This is from specification: > "Guest addressability for a given DMA request is limited to the > minimum of the value reported through this field and the adjusted > guest address width of the corresponding page-table structure. > (Adjusted guest address widths supported by hardware are reported > through the SAGAW field)." > > This causes domain initialization to fail and following > errors appear for EHCI PCI driver: > > [ 2.486393] ehci-pci 0000:01:00.4: EHCI Host Controller > [ 2.486624] ehci-pci 0000:01:00.4: new USB bus registered, assigned bus > number 1 > [ 2.489127] ehci-pci 0000:01:00.4: DMAR: Allocating domain failed > [ 2.489350] ehci-pci 0000:01:00.4: DMAR: 32bit DMA uses non-identity > mapping > [ 2.489359] ehci-pci 0000:01:00.4: can't setup: -12 > [ 2.489531] ehci-pci 0000:01:00.4: USB bus 1 deregistered > [ 2.490023] ehci-pci 0000:01:00.4: init 0000:01:00.4 fail, -12 > [ 2.490358] ehci-pci: probe of 0000:01:00.4 failed with error -12 > > This issue happens when the value of the sagaw corresponds to a > 48-bit agaw. This fix updates the calculation of the agaw based on > the minimum of IOMMU's sagaw value and MGAW. > > Cc: stable@vger.kernel.org > Signed-off-by: Saeed Mirzamohammadi > Tested-by: Camille Lu > Reviewed-by: Lu Baolu What is the git commit id of this patch in Linus's tree? thanks, greg k-h