Re: [PATCH] iommu: Change kconfig around IOMMU_SVA

From: Jason Gunthorpe
Date: Fri Dec 01 2023 - 15:48:24 EST



On Tue, Nov 28, 2023 at 10:16:35AM +0800, Tina Zhang wrote:
> From: Jason Gunthorpe <jgg@xxxxxxxxxx>
>
> Linus suggested that the kconfig here is confusing:
>
> https://lore.kernel.org/all/CAHk-=wgUiAtiszwseM1p2fCJ+sC4XWQ+YN4TanFhUgvUqjr9Xw@xxxxxxxxxxxxxx/
>
> Let's break it into three kconfigs controlling distinct things:
>
> - CONFIG_IOMMU_MM_DATA controls if the mm_struct has the additional
> fields for the IOMMU. Currently only PASID, but later patches store
> a struct iommu_mm_data *
>
> - CONFIG_ARCH_HAS_CPU_PASID controls if the arch needs the scheduling bit
> for keeping track of the ENQCMD instruction. x86 will select this if
> IOMMU_SVA is enabled
>
> - IOMMU_SVA controls if the IOMMU core compiles in the SVA support code
> for iommu driver use and the IOMMU exported API
>
> This way ARM will not enable CONFIG_ARCH_HAS_CPU_PASID
>
> Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxx>
> Signed-off-by: Tina Zhang <tina.zhang@xxxxxxxxx>
> ---
> arch/Kconfig | 5 +++++
> arch/x86/Kconfig | 1 +
> arch/x86/kernel/traps.c | 2 +-
> drivers/iommu/Kconfig | 1 +
> include/linux/iommu.h | 2 +-
> include/linux/mm_types.h | 2 +-
> include/linux/sched.h | 2 +-
> kernel/fork.c | 2 +-
> mm/Kconfig | 3 +++
> mm/init-mm.c | 2 +-
> 10 files changed, 16 insertions(+), 6 deletions(-)

Try again, you need to cc the mm list and the x86 list

Jason