Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3852660pxb; Tue, 17 Nov 2020 05:25:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJz6ULWRZ/ftohNQR1WhjlSredSTmVQQ8p5qIX7kWqVhCXY1ZFbOIJ7f8VJmBlvyunrTafGU X-Received: by 2002:a50:fc98:: with SMTP id f24mr11723755edq.169.1605619518222; Tue, 17 Nov 2020 05:25:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605619518; cv=none; d=google.com; s=arc-20160816; b=S3vU78jmn+5Z9jWjULGkA94HejpCJkuR2dER4EUcIaR4gO9/WdZ/GDQ6LYQpyT5+/p TN5hWrqZULz4D+DR2rn1Ws4DsasoPh68h5q7vohuQy1klDf/vVwsi56mKgZE7fpbt8eu V/JrBymb5i+Yj5ho5HOSjLMw4FqzL7rcSkaSYtZvYBZJjisWnjt+6H84WwWiuQv6oWnc ezrf/mXnlOJs6bjM6jkehWj9nXolyqIwtvKuT9LbwEyWBKpzrHZaJ25awfdPG2BlGfSa ZxsslsU6mJEBHlM3nUV33r3WHsDGpAM98nwidSxOVqKx/em2LUFMbRB7jcHSPYRTXvv/ SwHw== 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=N+MIimLI3m384c/lGK+rMBQ7rIs7/HhsUPYrh9QLqU4=; b=KfO6qjXZucNrN+QttH9tkSYCpbfCIdbN8d2cI06shpOJhR2WgjvdOOMqtbXPlWOuka 4TcV5SmfpV9LYviMidsiTzc2NHNcuidREfhnnHs/h417JhOgTKWQe/L4UT4my8mzfVha E0ekb8lZSjCF//UFBJf6DcExLcyI6FaQkVcdBTOa6NzEPq9ANYotr7c/g2gcpOhLghno LvpKuJDtYYTRwiy+1Eczxwyh2q3ZH2arpKJZND4VWOPnD73LwU6dsPdxl2imcexRomxH T4S4t/lLrKq+fwfDSnPKOrBHTM31lBhz/NZrjkw2FupCBMXr49Gzoqf4Qj17JScnF5gS T51A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1MoptByz; 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 hs16si7434142ejc.314.2020.11.17.05.24.54; Tue, 17 Nov 2020 05:25:18 -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=1MoptByz; 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 S1730777AbgKQNUk (ORCPT + 99 others); Tue, 17 Nov 2020 08:20:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:53990 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730745AbgKQNU2 (ORCPT ); Tue, 17 Nov 2020 08:20: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 9E7AC206D5; Tue, 17 Nov 2020 13:20:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605619228; bh=Ejy93RLnNmUphyjzU+ljQMEPhyJJaHefgobGx91pGyQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1MoptByzGaCdUxAZXEPG9pA0Tmg1h6Q+MCHvc4vl4PkQU2qDDACqPYpptQiiLcOVq CRISpVgtNCDnD32BUEtqs8BevsyRnnBi8Y3BnkZ6JHFatOKneuJe+Hp20LQ+L34WTa NvhmZJdbVcN/AI9E1N8+EWzNLgJrahfWa2jyK7UQ= 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.19 043/101] iommu/amd: Increase interrupt remapping table limit to 512 entries Date: Tue, 17 Nov 2020 14:05:10 +0100 Message-Id: <20201117122115.191217891@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201117122113.128215851@linuxfoundation.org> References: <20201117122113.128215851@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 859b06424e5c4..df6f3cc958e5e 100644 --- a/drivers/iommu/amd_iommu_types.h +++ b/drivers/iommu/amd_iommu_types.h @@ -410,7 +410,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