Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3847959pxb; Tue, 17 Nov 2020 05:18:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJzepr1jKaUGZ1dTVVcHbLlwGEiMbpXsq0azmGJ89v+TGqwqfpGJwnzC/JKI/e1CKfa0HY/A X-Received: by 2002:a17:906:74c6:: with SMTP id z6mr19944234ejl.448.1605619125974; Tue, 17 Nov 2020 05:18:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605619125; cv=none; d=google.com; s=arc-20160816; b=XhoNjrxYQdmw32kyJTot9imaE7n2MxnAml1wrMrVAimTPF2973QwQAYjs8/0UBMlPe 6cv6I3xJhD28dVLk8iZGudhC+c3RU6+fRfYoO+kuLS4+rwx785k2eFwd6ow+P+VU4Eze dSXXMYP9FcJXGWlyv07UpfuZwBkmqcdXm7Y9lxC52e3JouThLPIL5CUEZ9D/UTCzJftM zE+OEAB+9BlhiEv5FZHVFnNSmymOUCwys6Ay2ec6T6KoUof7I+7iveB0kR/lymjUuSQ5 BAaDyfLRqRKMLB2Bk7ASnbVEGtc/d9Mjb5YmhQ3t6PrC/1thot4l8LpABmsTWlmXWmPf +CIg== 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=HANw/Pwl3vD8FdA7S7IFyI7wIkpzCsziYVr0NLuVGWA=; b=cwtdtfw70IIMuHI4YTbcg85Y5z/CBt8olgvJ5tICre01i632Z0Yu7vz5Znx3D7TD0f /6AtuZUMyRcztncYoYfB4m4KjZIPJIBhiDuPK8wh2kedlk0IazSGC7eLVconPeh+xlB8 7LfXXzip309hZy2ZidOQmnpg5ofyXX7A/o/B2bUdpJg2MhhlaSppNaAPYuDLtHwBnQ8I OByax0bKZW1fw47OYP6OQ1gVgd4U1EFBumw3vht5HywbqHDQLE80zmdrxqmMFlcZ1AUq 8qIpYnxErKJ87MDNytKl+Qp0RARpw7Ibj5brkppoCI5cGWJn3OgTe6z9yheTBdRVQubs DjyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dI0UaDom; 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 q1si13982003edc.21.2020.11.17.05.18.22; Tue, 17 Nov 2020 05:18:45 -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=dI0UaDom; 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 S1730095AbgKQNOr (ORCPT + 99 others); Tue, 17 Nov 2020 08:14:47 -0500 Received: from mail.kernel.org ([198.145.29.99]:45852 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730092AbgKQNOp (ORCPT ); Tue, 17 Nov 2020 08:14:45 -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 C511B2151B; Tue, 17 Nov 2020 13:14:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605618884; bh=NPaSKJTvN4c3s11lbTYIx43YmOXM/GFbTl+nQoi5tIg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dI0UaDom3T4/fMSEbgW1MnQf5/1+wVmd+1FbBFT9k0uFYNzCVK+dC0+ejP+djaRAZ iYjbXeLqJJvSUcplqyQHzH9i7nBABmDZ6lpvWKLmIaSLIKy9knFL/d8PxLLWhBfFfx pPgCA0RCsocdWjsf+D36JjmYlwfLHjEcX58dPsP0= 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.14 33/85] iommu/amd: Increase interrupt remapping table limit to 512 entries Date: Tue, 17 Nov 2020 14:05:02 +0100 Message-Id: <20201117122112.656240647@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201117122111.018425544@linuxfoundation.org> References: <20201117122111.018425544@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 74c8638aac2b9..ac3cac052af9d 100644 --- a/drivers/iommu/amd_iommu_types.h +++ b/drivers/iommu/amd_iommu_types.h @@ -404,7 +404,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