Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3861031pxb; Tue, 17 Nov 2020 05:37:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJxtTsyPghqd8NxotvqmqbIym4zN9idCfKwK0er4Yivhze1emJue0phVh6nVxCzyeYtZLDYX X-Received: by 2002:aa7:db48:: with SMTP id n8mr21490427edt.123.1605620253557; Tue, 17 Nov 2020 05:37:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605620253; cv=none; d=google.com; s=arc-20160816; b=MpuXEg21MMpLAncq+aN7PFbWLg3FBk2oNsaQkgglae025Xn0R8vP2g7sNZIRYeRZxJ qhTNFwv5wDMWxrqY7CNHiFPZZrdzTDpTIB6VBe+370a/d01gmkw+oI2lt1MxruJSWhzU Zc5GQzGGU0iUCGS6CgeB0GlfT0XaYl3K8mVZsJ95Uy3/LeSX/GAQ7pUcftn6FAN0SfYt ZpdNL/OqJ6Mx9BQUGppFdoKYtX3iniD2aquA2O43kzgBpKOnLTFmguPdkEh3jbpkxB7t zkEOXiH4l6IxQ0E1e1o7wuRSloRnl9oUFXM9VjSo7GdwEpPfgctQOPMC+fD3yJcpnjw/ ObOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=oT0XEQoWxBCcWIkTU8SMnOFq+jO48sTqI2Nft1TmoYg=; b=Aii4uJlBIpx6vt9OpkkIEUoXNyzN0uVDOqlOv3Psa7eo63wagOngtKqz+is/oUleyl +KrPtLwFfaWCMTEF4iONz1kYLIW1qmPIeLqrSvZBazETwDaKMDB77Pgx7Ztlz+VPoZgV x8kT5WmETS6ctQ15EUMR0hdML8UoYwHL/NggJUG7pO1u9jJv1zwyrmmPbHhIKLCr/EpK DfM1F+O4STzIpKGwBbAgXjxECYIOGlzCXpGkd1r/7zcuJb88F2mqWPq+V9Dw7Kp+PEt2 qngI1/dIBFgh8gDGRe4sZqyCGKHsMoZxaJzs6Acwb6Ft6NwWgCfbe4kvs8SLk3huT5IC ov4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zBLRCFto; 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=fail (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 co2si694326edb.217.2020.11.17.05.37.10; Tue, 17 Nov 2020 05:37:33 -0800 (PST) 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=@kernel.org header.s=default header.b=zBLRCFto; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732448AbgKQNfV (ORCPT + 99 others); Tue, 17 Nov 2020 08:35:21 -0500 Received: from mail.kernel.org ([198.145.29.99]:45906 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731994AbgKQNfQ (ORCPT ); Tue, 17 Nov 2020 08:35:16 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BF8C72466D; Tue, 17 Nov 2020 13:35:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605620116; bh=mtHbPxmO8/SXbwr3c28X6K9sCjhcZI9tCY8owme2DYY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zBLRCFtoAZO+Yb91sTgHskMNN5g6TaZ5Nsp2uAGJ9JIeDnQC9zS3j/P353aAdlTW0 Cv9pPlXwLkGiHH3jpJf2gd0gszQsTA3uOx5aJhRZl+qnxqwWZ5qXAtcxyvdDmaqFeh zLcbLyy7LfXbl4H99sTNUjSxKymjC4zY7MZYj1xA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Suravee Suthikulpanit , Joerg Roedel , Sasha Levin Subject: [PATCH 5.9 112/255] iommu/amd: Increase interrupt remapping table limit to 512 entries Date: Tue, 17 Nov 2020 14:04:12 +0100 Message-Id: <20201117122144.405685547@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201117122138.925150709@linuxfoundation.org> References: <20201117122138.925150709@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Suravee Suthikulpanit [ Upstream commit 73db2fc595f358460ce32bcaa3be1f0cce4a2db1 ] Certain device drivers allocate IO queues on a per-cpu basis. On AMD EPYC platform, which can support up-to 256 cpu threads, this can exceed the current MAX_IRQ_PER_TABLE limit of 256, and result in the error message: AMD-Vi: Failed to allocate IRTE This has been observed with certain NVME devices. AMD IOMMU hardware can actually support upto 512 interrupt remapping table entries. Therefore, update the driver to match the hardware limit. Please note that this also increases the size of interrupt remapping table to 8KB per device when using the 128-bit IRTE format. Signed-off-by: Suravee Suthikulpanit Link: https://lore.kernel.org/r/20201015025002.87997-1-suravee.suthikulpanit@amd.com Signed-off-by: Joerg Roedel Signed-off-by: Sasha Levin --- drivers/iommu/amd/amd_iommu_types.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/amd/amd_iommu_types.h b/drivers/iommu/amd/amd_iommu_types.h index 30a5d412255a4..427484c455891 100644 --- a/drivers/iommu/amd/amd_iommu_types.h +++ b/drivers/iommu/amd/amd_iommu_types.h @@ -406,7 +406,11 @@ extern bool amd_iommu_np_cache; /* Only true if all IOMMUs support device IOTLBs */ extern bool amd_iommu_iotlb_sup; -#define MAX_IRQS_PER_TABLE 256 +/* + * AMD IOMMU hardware only support 512 IRTEs despite + * the architectural limitation of 2048 entries. + */ +#define MAX_IRQS_PER_TABLE 512 #define IRQ_TABLE_ALIGNMENT 128 struct irq_remap_table { -- 2.27.0