Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3881315pxb; Tue, 17 Nov 2020 06:07:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJyA7txbsAZUFgFiRdtaMqLUcuM/VJbwEEdKKbYhaY+rnmcrgJVvphfQJy9Tor7S5HRbTfcX X-Received: by 2002:adf:a191:: with SMTP id u17mr10471247wru.421.1605622023057; Tue, 17 Nov 2020 06:07:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605622023; cv=none; d=google.com; s=arc-20160816; b=drCdaCWpBEhS1cJwGA2Y2WhujYRzH+9bWaxGkXkWVDv3CbUMuL38h/RCO76Fh5omu2 ri0YtzKIe3pnj9VLcjYsenS1unj4V274RCxkCPO13ORTAtXmbMTv9wrw+TsQ6k/mN0no D+pO0OpX0XvBoFNpYyedUX3Quqjo70xBqbwbqngUCqxSEB7D+ouhzoom735pQZXhf5dF p7rXlogeE2rjN/lJWdDwoyg/3GNHi4ym0kJPEoZUPTL2JdoRrHZjoTZs7X8dzB/V9V3p QnasinmR6fTh0lnvUmqRIwV6EKrRHtpEcXWpgRmX13YCCn03ktgocTEbkkuMoJjjxtzM mfbg== 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=QR5pEwaQb14pDgj0Uy2baJ5zolMgZXHx0McwP3vYRZc=; b=HIymjPsTTz/LBQTGidk0QqJFBsjm7kDZtdE8GIg2ANaqaOeiljHiHnmiyz+Mf5w1VG Ki0YhIzFC6Bf10AlAK8jSdo4IRHXGT9XIl0dy+Yj/Ji3M5ShCN1o1fkrd14/aUY1Aae/ hgntzYH3N7XiSZhAdP0bV2ybAmwlTKqQO5S3uSTJ4GgaTKcr3b5bUsPAWpk5eP9+YGw7 CJfxgy6vkSOhxDJgF7yogYsB/+pgW4NqBawa6aFf3uZ/suNcC4H8dqWlKsiwCjQGMVTx Mme/1BBBBkyH+jXBNNpIzeM3Rgb8wb6k2iEbSYmq60oj+fyegZh3XAkQDh7Y/DW/xssf StXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rDeodMik; 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 m28si883642edb.246.2020.11.17.06.06.39; Tue, 17 Nov 2020 06:07:03 -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=rDeodMik; 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 S1729611AbgKQODy (ORCPT + 99 others); Tue, 17 Nov 2020 09:03:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:41054 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729634AbgKQNL2 (ORCPT ); Tue, 17 Nov 2020 08:11:28 -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 947042151B; Tue, 17 Nov 2020 13:11:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605618688; bh=3uCbvFkz7ftTmGmmmbXlOs5RjKWiK5OgCyKJxqptNqY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rDeodMik0+gGOBbT4zutl2dWw/qZUyEU7z1mpZQqnguTnaWCIvKVL+n2pZSUSD9hD RtNXbCki0psWTAZ1HD2FF/uVgvJCWAQ6YzZDjvUkr/+GViYmeDL/RSrLjmdNsQ34GJ R35LlcidviBWsOkmDiCYAaLNUM11JplyV9z4ABxc= 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 4.9 35/78] iommu/amd: Increase interrupt remapping table limit to 512 entries Date: Tue, 17 Nov 2020 14:05:01 +0100 Message-Id: <20201117122110.824580079@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201117122109.116890262@linuxfoundation.org> References: <20201117122109.116890262@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_iommu_types.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/amd_iommu_types.h b/drivers/iommu/amd_iommu_types.h index da3fbf82d1cf4..e19c05d9e84ba 100644 --- a/drivers/iommu/amd_iommu_types.h +++ b/drivers/iommu/amd_iommu_types.h @@ -383,7 +383,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