Skip to contentSkip to conversation

x86/mm: fix compilation error for unknown type name pgprot_t

PATCH In review Abhishek Sahu 2 participants 5 messages Apr 20, 2020 – May 13, 2020 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/mm: fix compilation error for unknown type name pgprot_t

commit 30796e18c299 ("x86/mm: introduce __set_memory_prot()") added the function __set_memory_prot() which uses pgprot_t in function prototype. The currently included header files in <arch/x86/include/asm/set_memory.h> do not include type name pgprot_t. The pgprot_t is defined in <asm/pgtable_types.h>.

Fixes 30796e18c299 ("x86/mm: introduce __set_memory_prot()")
---
 arch/x86/include/asm/set_memory.h | 1 +
 1 file changed, 1 insertion(+)
arch/x86/include/asm/set_memory.h +1 -0
index ec2c0a094b5d..3138087b0d9a 100644
@@ -3,6 +3,7 @@
 #define _ASM_X86_SET_MEMORY_H
 
 #include <asm/page.h>
+#include <asm/pgtable_types.h>
 #include <asm-generic/set_memory.h>
 
 /*
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Abhishek Sahu

commit 30796e18c299 ("x86/mm: introduce __set_memory_prot()") added the function __set_memory_prot() which uses pgprot_t in function prototype. The currently included header files in <arch/x86/include/asm/set_memory.h> do not include type name pgprot_t. The pgprot_t is defined in <asm/pgtable_types.h>.

Fixes 30796e18c299 ("x86/mm: introduce __set_memory_prot()")

I assume this is only hit with a specific driver or something that includes set_memory.h without including pgtable_types.h before hand.

It certainly compiles fine for me and the kbuild robot has had lots of time to test it with random configs.

Thanks,

Logan

#2 lore raw
Quoted 13 lines · Logan Gunthorpe

External email: Use caution opening links or attachments

Quoted 8 lines · Abhishek Sahu

commit 30796e18c299 ("x86/mm: introduce __set_memory_prot()") added the function __set_memory_prot() which uses pgprot_t in function prototype. The currently included header files in <arch/x86/include/asm/set_memory.h> do not include type name pgprot_t. The pgprot_t is defined in <asm/pgtable_types.h>.

Fixes 30796e18c299 ("x86/mm: introduce __set_memory_prot()")
Quoted 7 lines

I assume this is only hit with a specific driver or something that includes set_memory.h without including pgtable_types.h before hand.

It certainly compiles fine for me and the kbuild robot has had lots of time to test it with random configs.

Thanks Logan.

Yes. The mainline is compiling fine with default config. This problem is coming while compiling Out of tree NVIDIA driver. But this problem can happen for the drivers which don't include <pgtable_types.h>. I am not sure if this problem will come with some other configs. Normally, the header files should not be dependent upon the callers.

Regards,
Abhishek

#3 lore raw
Quoted 19 lines · Abhishek Sahu
Quoted 10 lines · Logan Gunthorpe
Quoted 8 lines · Abhishek Sahu

commit 30796e18c299 ("x86/mm: introduce __set_memory_prot()") added the function __set_memory_prot() which uses pgprot_t in function prototype. The currently included header files in <arch/x86/include/asm/set_memory.h> do not include type name pgprot_t. The pgprot_t is defined in <asm/pgtable_types.h>.

Fixes 30796e18c299 ("x86/mm: introduce __set_memory_prot()")
Quoted 7 lines

I assume this is only hit with a specific driver or something that includes set_memory.h without including pgtable_types.h before hand.

It certainly compiles fine for me and the kbuild robot has had lots of time to test it with random configs.

Quoted 9 lines

Thanks Logan.

Yes. The mainline is compiling fine with default config. This problem is coming while compiling Out of tree NVIDIA driver. But this problem can happen for the drivers which don't include <pgtable_types.h>. I am not sure if this problem will come with some other configs. Normally, the header files should not be dependent upon the callers.

Is it possible to get this patch merged for next rc of 5.7. This issue started coming from 5.7-rc1.

Thanks,
Abhishek

#4 lore raw
Quoted 30 lines · Abhishek Sahu
Quoted 19 lines · Abhishek Sahu
Quoted 10 lines · Logan Gunthorpe
Quoted 8 lines · Abhishek Sahu

commit 30796e18c299 ("x86/mm: introduce __set_memory_prot()") added the function __set_memory_prot() which uses pgprot_t in function prototype. The currently included header files in <arch/x86/include/asm/set_memory.h> do not include type name pgprot_t. The pgprot_t is defined in <asm/pgtable_types.h>.

Fixes 30796e18c299 ("x86/mm: introduce __set_memory_prot()")
Quoted 7 lines

I assume this is only hit with a specific driver or something that includes set_memory.h without including pgtable_types.h before hand.

It certainly compiles fine for me and the kbuild robot has had lots of time to test it with random configs.

Quoted 9 lines

Thanks Logan.

Yes. The mainline is compiling fine with default config. This problem is coming while compiling Out of tree NVIDIA driver. But this problem can happen for the drivers which don't include <pgtable_types.h>. I am not sure if this problem will come with some other configs. Normally, the header files should not be dependent upon the callers.

Quoted 3 lines

Is it possible to get this patch merged for next rc of 5.7. This issue started coming from 5.7-rc1.

Could someone help in reviewing and getting this merged in the next rc of 5.7 version. The NVIDIA driver compilation is failing from 5.7-rc1. This issue can happen for any other driver also which is not including <asm/pgtable_types.h> in the driver.

Thanks,
Abhishek