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=-10.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 16D32C43460 for ; Wed, 14 Apr 2021 06:41:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E852C61222 for ; Wed, 14 Apr 2021 06:41:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345603AbhDNGmD (ORCPT ); Wed, 14 Apr 2021 02:42:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:41182 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232403AbhDNGmA (ORCPT ); Wed, 14 Apr 2021 02:42:00 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E2CDC6120E; Wed, 14 Apr 2021 06:41:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618382499; bh=kA8zOgdDuts/SjL+HhXf1S6TGSm7w76OyzQRoZXsuFY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=d4jaPQmIJT2wWYTgZX2W1xgXbF3Kuwhz1fUFxu7OMfRZDLjJdAyCBOQffWnZpbZ7S f/XC9+6Sgvt2QcL4Zks0/4rFGbOXv5PV0QaVmcM6yYr7p7Aotzn9s/BreAbiF+ux8Q tC1mpZl1xDMjTUmtlo0mnYZpAloE6cIP9bwddcSc= Date: Wed, 14 Apr 2021 08:41:35 +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 > > --- Also when you resend this, please state the commit that this fixes, as this must be a regression, right? What kernel version did this previous work for? thanks, greg k-h 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=-8.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 7D092C433ED for ; Wed, 14 Apr 2021 06:41:45 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (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 EF694613C7 for ; Wed, 14 Apr 2021 06:41:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EF694613C7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id BCC3E4015F; Wed, 14 Apr 2021 06:41:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id f7Hs1EqWgdvw; Wed, 14 Apr 2021 06:41:43 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp2.osuosl.org (Postfix) with ESMTP id 6A29E400F3; Wed, 14 Apr 2021 06:41:43 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 23021C000C; Wed, 14 Apr 2021 06:41:43 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id E03F3C000A for ; Wed, 14 Apr 2021 06:41:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id B89E2845F6 for ; Wed, 14 Apr 2021 06:41:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp1.osuosl.org (amavisd-new); dkim=pass (1024-bit key) header.d=linuxfoundation.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id khK56Riypccy for ; Wed, 14 Apr 2021 06:41:41 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp1.osuosl.org (Postfix) with ESMTPS id 2C4B6845F5 for ; Wed, 14 Apr 2021 06:41:40 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id E2CDC6120E; Wed, 14 Apr 2021 06:41:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618382499; bh=kA8zOgdDuts/SjL+HhXf1S6TGSm7w76OyzQRoZXsuFY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=d4jaPQmIJT2wWYTgZX2W1xgXbF3Kuwhz1fUFxu7OMfRZDLjJdAyCBOQffWnZpbZ7S f/XC9+6Sgvt2QcL4Zks0/4rFGbOXv5PV0QaVmcM6yYr7p7Aotzn9s/BreAbiF+ux8Q tC1mpZl1xDMjTUmtlo0mnYZpAloE6cIP9bwddcSc= Date: Wed, 14 Apr 2021 08:41:35 +0200 From: Greg KH To: Saeed Mirzamohammadi 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-Disposition: inline In-Reply-To: <20210412202736.70765-1-saeed.mirzamohammadi@oracle.com> Cc: saeed.mirzamohammadi@oracle.com, Camille Lu , linux-kernel@vger.kernel.org, stable@vger.kernel.org, iommu@lists.linux-foundation.org, David Woodhouse X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 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 Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" 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 > > --- Also when you resend this, please state the commit that this fixes, as this must be a regression, right? What kernel version did this previous work for? thanks, greg k-h _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu