From: Madhavan Srinivasan <maddy@linux.ibm.com>
To: Stephen Brennan <stephen.s.brennan@oracle.com>,
stable@vger.kernel.org, Michael Ellerman <mpe@ellerman.id.au>
Cc: Sasha Levin <sashal@kernel.org>,
Gaurav Batra <gbatra@linux.ibm.com>,
Christophe Leroy <christophe.leroy@csgroup.eu>,
Nicholas Piggin <npiggin@gmail.com>,
linuxppc-dev@lists.ozlabs.org,
Shivaprasad G Bhat <sbhat@linux.ibm.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH 6.6.y 1/1] powerpc/pseries/iommu: Restore CONFIG_IOMMU_API dependency
Date: Tue, 10 Nov 2026 10:31:05 +0530 [thread overview]
Message-ID: <281fc2a2-c86c-4c49-a789-f303c7bdf768@linux.ibm.com> (raw)
In-Reply-To: <20261105232402.4033385-2-stephen.s.brennan@oracle.com>
On 11/6/26 4:54 AM, Stephen Brennan wrote:
> In stable v6.6.161 there is a build error with ppc64 when
> CONFIG_IOMMU_API is not enabled:
>
> arch/powerpc/platforms/pseries/iommu.c: In function 'iommu_take_ownership':
> arch/powerpc/platforms/pseries/iommu.c:69:25: error: 'struct iommu_table_ops' has no member named 'xchg_no_kill'
> 69 | if (!tbl->it_ops->xchg_no_kill)
> | ^~
> AS arch/powerpc/lib/copy_mc_64.o
> arch/powerpc/platforms/pseries/iommu.c: At top level:
> arch/powerpc/platforms/pseries/iommu.c:1787:37: error: 'spapr_tce_table_group_ops' defined but not used [-Werror=unused-variable]
> 1787 | static struct iommu_table_group_ops spapr_tce_table_group_ops = {
> | ^~~~~~~~~~~~~~~~~~~~~~~~~
> cc1: all warnings being treated as errors
>
> This is due to stable v6.6.161 commit 1e9dfe15404d ("powerpc/iommu: Move
> pSeries specific functions to pseries/iommu.c"). It was included as a
> stable-dep-of commit 8f70caad82e9 ("powerpc/pseries/iommu: IOMMU
> incorrectly marks MMIO range in DDW").
>
> It was backported without its associated fix: commit af199e6ca29c
> ("powerpc/pseries/iommu: Define spapr_tce_table_group_ops only with
> CONFIG_IOMMU_API").
>
> The code was supposed to only build under CONFIG_IOMMU_API, but the new
> location doesn't have this condition. Unfortunately, the fixing commit
> comes after a fairly large refactor, and doesn't apply on v6.16.161.
> Instead, apply the ifdefs where they would belong prior to the refactor.
Looks fine to me
Acked-by: Madhavan Srinivasan <maddy@linux.ibm.com>
> Signed-off-by: Stephen Brennan <stephen.s.brennan@oracle.com>
> ---
> arch/powerpc/platforms/pseries/iommu.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
> index 6a45e3e86f79b..a79927e870a87 100644
> --- a/arch/powerpc/platforms/pseries/iommu.c
> +++ b/arch/powerpc/platforms/pseries/iommu.c
> @@ -54,6 +54,7 @@ enum {
> DDW_EXT_QUERY_OUT_SIZE = 2
> };
>
> +#ifdef CONFIG_IOMMU_API
> static int iommu_take_ownership(struct iommu_table *tbl)
> {
> unsigned long flags, i, sz = (tbl->it_size + 7) >> 3;
> @@ -104,6 +105,7 @@ static void iommu_release_ownership(struct iommu_table *tbl)
> spin_unlock(&tbl->pools[i].lock);
> spin_unlock_irqrestore(&tbl->large_pool.lock, flags);
> }
> +#endif
>
> static struct iommu_table *iommu_pseries_alloc_table(int node)
> {
> @@ -118,7 +120,9 @@ static struct iommu_table *iommu_pseries_alloc_table(int node)
> return tbl;
> }
>
> +#ifdef CONFIG_IOMMU_API
> static struct iommu_table_group_ops spapr_tce_table_group_ops;
> +#endif
>
> static struct iommu_table_group *iommu_pseries_alloc_group(int node)
> {
> @@ -1702,6 +1706,7 @@ static bool iommu_bypass_supported_pSeriesLP(struct pci_dev *pdev, u64 dma_mask)
> return false;
> }
>
> +#ifdef CONFIG_IOMMU_API
> /*
> * A simple iommu_table_group_ops which only allows reusing the existing
> * iommu_table. This handles VFIO for POWER7 or the nested KVM.
> @@ -1792,6 +1797,7 @@ static struct iommu_table_group_ops spapr_tce_table_group_ops = {
> .take_ownership = spapr_tce_take_ownership,
> .release_ownership = spapr_tce_release_ownership,
> };
> +#endif
>
> static int iommu_mem_notifier(struct notifier_block *nb, unsigned long action,
> void *data)
prev parent reply other threads:[~2026-11-10 5:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-05 23:24 [PATCH 6.6.y 0/1] Fix ppc64 build error introduced in v6.6.161 Stephen Brennan
2026-11-05 23:24 ` [PATCH 6.6.y 1/1] powerpc/pseries/iommu: Restore CONFIG_IOMMU_API dependency Stephen Brennan
2026-11-06 16:35 ` Sasha Levin
2026-11-10 5:01 ` Madhavan Srinivasan [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=281fc2a2-c86c-4c49-a789-f303c7bdf768@linux.ibm.com \
--to=maddy@linux.ibm.com \
--cc=christophe.leroy@csgroup.eu \
--cc=gbatra@linux.ibm.com \
--cc=gregkh@linuxfoundation.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
--cc=sashal@kernel.org \
--cc=sbhat@linux.ibm.com \
--cc=stable@vger.kernel.org \
--cc=stephen.s.brennan@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox