[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250401091115.7691Bd6-hca@linux.ibm.com>
Date: Tue, 1 Apr 2025 11:11:15 +0200
From: Heiko Carstens <hca@...ux.ibm.com>
To: Matthew Rosato <mjrosato@...ux.ibm.com>
Cc: joro@...tes.org, will@...nel.org, robin.murphy@....com,
gerald.schaefer@...ux.ibm.com, schnelle@...ux.ibm.com,
gor@...ux.ibm.com, agordeev@...ux.ibm.com, svens@...ux.ibm.com,
borntraeger@...ux.ibm.com, clg@...hat.com, iommu@...ts.linux.dev,
linux-kernel@...r.kernel.org, linux-s390@...r.kernel.org
Subject: Re: [PATCH v4 5/5] iommu/s390: allow larger region tables
On Mon, Mar 31, 2025 at 04:21:59PM -0400, Matthew Rosato wrote:
> Extend the aperture calculation to consider sizes beyond the maximum
> size of a region third table. Attempt to always use the smallest
> table size possible to avoid unnecessary extra steps during translation.
> Update reserved region calculations to use the appropriate table size.
>
> Signed-off-by: Matthew Rosato <mjrosato@...ux.ibm.com>
> ---
> arch/s390/include/asm/pci_dma.h | 1 +
> drivers/iommu/s390-iommu.c | 71 ++++++++++++++++++++++++---------
> 2 files changed, 53 insertions(+), 19 deletions(-)
...
> + spin_lock_irqsave(&zdev->dom_lock, flags);
> + if (zdev->s390_domain->type == IOMMU_DOMAIN_BLOCKED ||
> + zdev->s390_domain->type == IOMMU_DOMAIN_IDENTITY)
> + goto out;
> +
> + s390_domain = to_s390_domain(zdev->s390_domain);
> + if (zdev->end_dma < max_tbl_size(s390_domain)) {
> + end_resv = max_tbl_size(s390_domain) - zdev->end_dma;
> + region = iommu_alloc_resv_region(zdev->end_dma + 1, end_resv,
> + 0, IOMMU_RESV_RESERVED,
> + GFP_KERNEL);
GFP_KERNEL allocation while holding a spinlock is not correct.
Powered by blists - more mailing lists