Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4206614pxu; Wed, 9 Dec 2020 10:54:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJwFjzTyhw7yMvIWrMx3deujUDXg4fLinsdxT30hGZayrN0YDNl1IZTZKXor2KdEyoT+aMl/ X-Received: by 2002:a05:6402:1a2f:: with SMTP id be15mr3369176edb.209.1607540080116; Wed, 09 Dec 2020 10:54:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607540080; cv=none; d=google.com; s=arc-20160816; b=NKqRfbtOYWzJ8JrU59TZd3I8KzUhY0I5RJcrK7HIkj4Zt6hcFevDYJl9mwx3HNAxSs GUFrr3z0RX2BcF1lZ/EgFaWOsyViBoJI7dXCqwqIQ4mAnrNe1TJLy7RpO6xa0DPyUgSt jZcx8UlhAbjrfvPlCthn4AItNJMS00QeqLjfY/U4wI1rN1XOBDMAsd8FOO7IUXgcHUrq 9TxIXj2ZqNkVjWU7ISlLvXNM3NYot9Ru7VoUryox5cacSfu1kao6HQ2VxZ5sE8GAkMSH tLT1vWtjz1ODwENELFHDft8Hf7IQ3HBJYwr2paVPygIA89KD+yMqPoIrU2I+mBMFbXTJ zQKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from :dkim-signature:date; bh=IJW6plZvcB320+C9i7B6vclJvoeRPMzZsrhKTwB7P7o=; b=AMIKZC0c8LZz8CfcuLpA6OphG9PmbM0yxa9SPrx9ZuVrqPUda5pFxfJmcPiQjGD6+z E4Et1xL5dG9BL23yRGcVXloCFaQkZ1Gawi1jKq8ZoTblyoAFIxuk6M7HSG964sqXl42k ALYhNl1oZjxEOwN7x9FLqXz/GaOsJVMtNCZR7gcznV5pvT16GKTKXnUQrBYjPH2ftvJE flyUvnS8yNTxNBDLDG6f8mfLCNKCUUfQxSfHxzRODK4HESaxzb9AcrjjIbOeO+CZ4uMb 9jgjbpbAJDhpsn+kqDaqNowRt8V3udAfvpunplOtfc4an2F6c+4hflrFt2i0DfYCotWi 2ZqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=h514HCk5; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t20si1220740ejd.719.2020.12.09.10.54.17; Wed, 09 Dec 2020 10:54:40 -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=k20201202 header.b=h514HCk5; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387481AbgLISvG (ORCPT + 99 others); Wed, 9 Dec 2020 13:51:06 -0500 Received: from mail.kernel.org ([198.145.29.99]:44662 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732952AbgLISvG (ORCPT ); Wed, 9 Dec 2020 13:51:06 -0500 Date: Wed, 9 Dec 2020 18:50:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1607539825; bh=SmGD0Wngs0iUrS/PQuc7mTBZo1p0nDrXrdnb6+e6Q8c=; h=From:To:Cc:Subject:References:In-Reply-To:From; b=h514HCk5J29VZl6jAzdiaTmwdyhtAwB4Efnqyjv0E9sWa6jSVwwpeEPdOChE15rDt EyFwPWhGW160CrgbIKrD6eZWty4qYvBEIgOgNbweHYTIZyf0wBHumOmMfxShsgtDS+ QtDnSjmM4+HYYK/sPYDLh+DSXvxU9aWpoNlziEZhgWbO4wpPo2fmYWlpSJ/6V/ItVP t7MxYJioTGYWd7Ynq/eA+SW2X7DIJhIuIngVnMWEJ4mB1AdKQUr7BaHrOZskK2bbra JUWvs2RVNBrWFfpR5AO7TE5yszlzeF9G7ShZW7zyH14dzX+syRLZrkbsxrcc0IDwDF nOd6FHcGNHrWQ== From: Will Deacon To: Linus Torvalds Cc: Suravee Suthikulpanit , iommu , Linux Kernel Mailing List , Joerg Roedel , Alex Williamson , Robin Murphy , Lu Baolu Subject: Re: [GIT PULL] IOMMU fix for 5.10 (-final) Message-ID: <20201209185020.GC8778@willie-the-truck> References: <20201209141237.GA8092@willie-the-truck> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 09, 2020 at 10:07:46AM -0800, Linus Torvalds wrote: > On Wed, Dec 9, 2020 at 6:12 AM Will Deacon wrote: > > > > Please pull this one-liner AMD IOMMU fix for 5.10. It's actually a fix > > for a fix, where the size of the interrupt remapping table was increased > > but a related constant for the size of the interrupt table was forgotten. > > Pulled. Thanks. > However, why didn't this then add some sanity checking for the two > different #defines to be in sync? > > IOW, something like > > #define AMD_IOMMU_IRQ_TABLE_SHIFT 9 > > #define MAX_IRQS_PER_TABLE (1 << AMD_IOMMU_IRQ_TABLE_SHIFT) > #define DTE_IRQ_TABLE_LEN ((u64)AMD_IOMMU_IRQ_TABLE_SHIFT << 1) > > or whatever. Hmm? This looks like a worthwhile change to me, but I don't have any hardware so I've been very reluctant to make even "obvious" driver changes here. Suravee -- please can you post a patch implementing the above? > That way this won't happen again, but perhaps equally importantly the > linkage will be more clear, and there won't be those random constants. > > Naming above is probably garbage - I assume there's some actual > architectural name for that irq table length field in the DTE? The one in the spec is even better: "IntTabLen". Will