* Re: [PATCH] powerpc/pseries/svm: Make mem_encrypt.h self contained
2025-11-20 15:06 [PATCH] powerpc/pseries/svm: Make mem_encrypt.h self contained Jason Gunthorpe
@ 2025-11-20 15:09 ` Christophe Leroy
2025-11-20 16:40 ` Jason Gunthorpe
2025-11-21 7:23 ` Tian, Kevin
` (2 subsequent siblings)
3 siblings, 1 reply; 6+ messages in thread
From: Christophe Leroy @ 2025-11-20 15:09 UTC (permalink / raw)
To: Jason Gunthorpe, Joerg Roedel, linuxppc-dev, Madhavan Srinivasan,
Michael Ellerman, Nicholas Piggin
Cc: Alejandro Jimenez, Kevin Tian, kernel test robot, Pasha Tatashin,
patches, Vasant Hegde
Le 20/11/2025 à 16:06, Jason Gunthorpe a écrit :
> Add the missing forward declarations and includes so it does not have
> implicit dependencies. mem_encrypt.h is a public header imported by
> drivers. Users should not have to guess what include files are needed.
>
> Resolves a kbuild splat:
>
> In file included from drivers/iommu/generic_pt/fmt/iommu_amdv1.c:15:
> In file included from drivers/iommu/generic_pt/fmt/iommu_template.h:36:
> In file included from drivers/iommu/generic_pt/fmt/amdv1.h:23:
> In file included from include/linux/mem_encrypt.h:17:
>>> arch/powerpc/include/asm/mem_encrypt.h:13:49: warning: declaration of 'struct device' will not be visible outside of this function [-Wvisibility]
> 13 | static inline bool force_dma_unencrypted(struct device *dev)
>
> Fixes: 879ced2bab1b ("iommupt: Add the AMD IOMMU v1 page table format")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202511161358.rS5pSb3U-lkp@intel.com/
> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
> ---
> arch/powerpc/include/asm/mem_encrypt.h | 3 +++
> 1 file changed, 3 insertions(+)
>
> Joerg, can you pick this up too please?
>
> diff --git a/arch/powerpc/include/asm/mem_encrypt.h b/arch/powerpc/include/asm/mem_encrypt.h
> index 2f26b8fc8d297c..e355ca46fad933 100644
> --- a/arch/powerpc/include/asm/mem_encrypt.h
> +++ b/arch/powerpc/include/asm/mem_encrypt.h
> @@ -9,6 +9,9 @@
> #define _ASM_POWERPC_MEM_ENCRYPT_H
>
> #include <asm/svm.h>
> +#include <linux/types.h>
Why do you need linux/types.h ? Isn't the below forward declaration enough ?
> +
> +struct device;
>
> static inline bool force_dma_unencrypted(struct device *dev)
> {
>
> base-commit: 7e06063a43d317c1ca9278b6662555f687f43f03
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] powerpc/pseries/svm: Make mem_encrypt.h self contained
2025-11-20 15:09 ` Christophe Leroy
@ 2025-11-20 16:40 ` Jason Gunthorpe
0 siblings, 0 replies; 6+ messages in thread
From: Jason Gunthorpe @ 2025-11-20 16:40 UTC (permalink / raw)
To: Christophe Leroy
Cc: Joerg Roedel, linuxppc-dev, Madhavan Srinivasan, Michael Ellerman,
Nicholas Piggin, Alejandro Jimenez, Kevin Tian, kernel test robot,
Pasha Tatashin, patches, Vasant Hegde
On Thu, Nov 20, 2025 at 04:09:14PM +0100, Christophe Leroy wrote:
> > diff --git a/arch/powerpc/include/asm/mem_encrypt.h b/arch/powerpc/include/asm/mem_encrypt.h
> > index 2f26b8fc8d297c..e355ca46fad933 100644
> > --- a/arch/powerpc/include/asm/mem_encrypt.h
> > +++ b/arch/powerpc/include/asm/mem_encrypt.h
> > @@ -9,6 +9,9 @@
> > #define _ASM_POWERPC_MEM_ENCRYPT_H
> > #include <asm/svm.h>
> > +#include <linux/types.h>
>
> Why do you need linux/types.h ? Isn't the below forward declaration enough ?
For bool:
> > +
> > +struct device;
> > static inline bool force_dma_unencrypted(struct device *dev)
^^^^^^
Jason
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH] powerpc/pseries/svm: Make mem_encrypt.h self contained
2025-11-20 15:06 [PATCH] powerpc/pseries/svm: Make mem_encrypt.h self contained Jason Gunthorpe
2025-11-20 15:09 ` Christophe Leroy
@ 2025-11-21 7:23 ` Tian, Kevin
2025-11-21 7:31 ` Christophe Leroy
2025-11-21 8:18 ` Vasant Hegde
3 siblings, 0 replies; 6+ messages in thread
From: Tian, Kevin @ 2025-11-21 7:23 UTC (permalink / raw)
To: Jason Gunthorpe, Christophe Leroy, Joerg Roedel,
linuxppc-dev@lists.ozlabs.org, Madhavan Srinivasan,
Michael Ellerman, Nicholas Piggin
Cc: Alejandro Jimenez, lkp, Pasha Tatashin, patches@lists.linux.dev,
Vasant Hegde
> From: Jason Gunthorpe <jgg@nvidia.com>
> Sent: Thursday, November 20, 2025 11:07 PM
>
> Add the missing forward declarations and includes so it does not have
> implicit dependencies. mem_encrypt.h is a public header imported by
> drivers. Users should not have to guess what include files are needed.
>
> Resolves a kbuild splat:
>
> In file included from drivers/iommu/generic_pt/fmt/iommu_amdv1.c:15:
> In file included from drivers/iommu/generic_pt/fmt/iommu_template.h:36:
> In file included from drivers/iommu/generic_pt/fmt/amdv1.h:23:
> In file included from include/linux/mem_encrypt.h:17:
> >> arch/powerpc/include/asm/mem_encrypt.h:13:49: warning: declaration
> of 'struct device' will not be visible outside of this function [-Wvisibility]
> 13 | static inline bool force_dma_unencrypted(struct device *dev)
>
> Fixes: 879ced2bab1b ("iommupt: Add the AMD IOMMU v1 page table
> format")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202511161358.rS5pSb3U-
> lkp@intel.com/
> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] powerpc/pseries/svm: Make mem_encrypt.h self contained
2025-11-20 15:06 [PATCH] powerpc/pseries/svm: Make mem_encrypt.h self contained Jason Gunthorpe
2025-11-20 15:09 ` Christophe Leroy
2025-11-21 7:23 ` Tian, Kevin
@ 2025-11-21 7:31 ` Christophe Leroy
2025-11-21 8:18 ` Vasant Hegde
3 siblings, 0 replies; 6+ messages in thread
From: Christophe Leroy @ 2025-11-21 7:31 UTC (permalink / raw)
To: Jason Gunthorpe, Joerg Roedel, linuxppc-dev, Madhavan Srinivasan,
Michael Ellerman, Nicholas Piggin
Cc: Alejandro Jimenez, Kevin Tian, kernel test robot, Pasha Tatashin,
patches, Vasant Hegde
Le 20/11/2025 à 16:06, Jason Gunthorpe a écrit :
> Add the missing forward declarations and includes so it does not have
> implicit dependencies. mem_encrypt.h is a public header imported by
> drivers. Users should not have to guess what include files are needed.
>
> Resolves a kbuild splat:
>
> In file included from drivers/iommu/generic_pt/fmt/iommu_amdv1.c:15:
> In file included from drivers/iommu/generic_pt/fmt/iommu_template.h:36:
> In file included from drivers/iommu/generic_pt/fmt/amdv1.h:23:
> In file included from include/linux/mem_encrypt.h:17:
>>> arch/powerpc/include/asm/mem_encrypt.h:13:49: warning: declaration of 'struct device' will not be visible outside of this function [-Wvisibility]
> 13 | static inline bool force_dma_unencrypted(struct device *dev)
>
> Fixes: 879ced2bab1b ("iommupt: Add the AMD IOMMU v1 page table format")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202511161358.rS5pSb3U-lkp@intel.com/
> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> ---
> arch/powerpc/include/asm/mem_encrypt.h | 3 +++
> 1 file changed, 3 insertions(+)
>
> Joerg, can you pick this up too please?
>
> diff --git a/arch/powerpc/include/asm/mem_encrypt.h b/arch/powerpc/include/asm/mem_encrypt.h
> index 2f26b8fc8d297c..e355ca46fad933 100644
> --- a/arch/powerpc/include/asm/mem_encrypt.h
> +++ b/arch/powerpc/include/asm/mem_encrypt.h
> @@ -9,6 +9,9 @@
> #define _ASM_POWERPC_MEM_ENCRYPT_H
>
> #include <asm/svm.h>
> +#include <linux/types.h>
> +
> +struct device;
>
> static inline bool force_dma_unencrypted(struct device *dev)
> {
>
> base-commit: 7e06063a43d317c1ca9278b6662555f687f43f03
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] powerpc/pseries/svm: Make mem_encrypt.h self contained
2025-11-20 15:06 [PATCH] powerpc/pseries/svm: Make mem_encrypt.h self contained Jason Gunthorpe
` (2 preceding siblings ...)
2025-11-21 7:31 ` Christophe Leroy
@ 2025-11-21 8:18 ` Vasant Hegde
3 siblings, 0 replies; 6+ messages in thread
From: Vasant Hegde @ 2025-11-21 8:18 UTC (permalink / raw)
To: Jason Gunthorpe, Christophe Leroy, Joerg Roedel, linuxppc-dev,
Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin
Cc: Alejandro Jimenez, Kevin Tian, kernel test robot, Pasha Tatashin,
patches
On 11/20/2025 8:36 PM, Jason Gunthorpe wrote:
> Add the missing forward declarations and includes so it does not have
> implicit dependencies. mem_encrypt.h is a public header imported by
> drivers. Users should not have to guess what include files are needed.
>
> Resolves a kbuild splat:
>
> In file included from drivers/iommu/generic_pt/fmt/iommu_amdv1.c:15:
> In file included from drivers/iommu/generic_pt/fmt/iommu_template.h:36:
> In file included from drivers/iommu/generic_pt/fmt/amdv1.h:23:
> In file included from include/linux/mem_encrypt.h:17:
>>> arch/powerpc/include/asm/mem_encrypt.h:13:49: warning: declaration of 'struct device' will not be visible outside of this function [-Wvisibility]
> 13 | static inline bool force_dma_unencrypted(struct device *dev)
>
> Fixes: 879ced2bab1b ("iommupt: Add the AMD IOMMU v1 page table format")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202511161358.rS5pSb3U-lkp@intel.com/
> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Vasant Hegde <vasant.hegde@amd.com>
-Vasant
^ permalink raw reply [flat|nested] 6+ messages in thread