Skip to contentSkip to conversation

x86/headers: Remove "#include <asm/pgtable.h>" from set_memory.h

PATCH In review Thomas Huth 2 participants 3 messages Apr 9 – Aug 20 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/headers: Remove "#include <asm/pgtable.h>" from set_memory.h

From: Thomas Huth <[email protected]>

The "#include <asm/pgtable.h>" has been added to set_memory.h in commit e1e6cd01d933 ("Revert "x86/mm: Remove unused __set_memory_prot()"") to provide the "pgprot_t" type in the prototype of __set_memory_prot(). Later, the prototype of __set_memory_prot() has been removed again, see commit 8a4e92b3260a ("x86/crash: Use set_memory_p() instead of __set_memory_prot()"), but the pgtable.h line has been left in the header. Thus, since it's not required here anymore, remove it now from set_memory.h. However, there is a indirect dependency on pgtable.h in the sev.h header file instead, so we now have to include it there to avoid that the build breaks.

---
 arch/x86/include/asm/set_memory.h | 1 -
 arch/x86/include/asm/sev.h        | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)
arch/x86/include/asm/set_memory.h +0 -1
index 4362c26aa992d..8d9f1c9aaa4ce 100644
@@ -4,7 +4,6 @@
 
 #include <asm/page.h>
 #include <asm-generic/set_memory.h>
-#include <asm/pgtable.h>
 
 #define set_memory_rox set_memory_rox
 int set_memory_rox(unsigned long addr, int numpages);
arch/x86/include/asm/sev.h +1 -0
index 0e6c0940100f3..3936c821d6b0a 100644
@@ -14,6 +14,7 @@
 #include <asm/insn.h>
 #include <asm/sev-common.h>
 #include <asm/coco.h>
+#include <asm/pgtable.h>
 #include <asm/set_memory.h>
 #include <asm/svm.h>
 
Signature · 1 line
2.53.0
Acked-by on v1 1/1
#1 lore raw
Quoted 46 lines · Thomas Huth

From: Thomas Huth <[email protected]>

The "#include <asm/pgtable.h>" has been added to set_memory.h in commit e1e6cd01d933 ("Revert "x86/mm: Remove unused __set_memory_prot()"") to provide the "pgprot_t" type in the prototype of __set_memory_prot(). Later, the prototype of __set_memory_prot() has been removed again, see commit 8a4e92b3260a ("x86/crash: Use set_memory_p() instead of __set_memory_prot()"), but the pgtable.h line has been left in the header. Thus, since it's not required here anymore, remove it now from set_memory.h. However, there is a indirect dependency on pgtable.h in the sev.h header file instead, so we now have to include it there to avoid that the build breaks.

---
arch/x86/include/asm/set_memory.h | 1 -
arch/x86/include/asm/sev.h | 1 +

2 files changed, 1 insertion(+), 1 deletion(-)
arch/x86/include/asm/set_memory.h +0 -1
index 4362c26aa992d..8d9f1c9aaa4ce 100644
@@ -4,7 +4,6 @@
 
 #include <asm/page.h>
 #include <asm-generic/set_memory.h>
-#include <asm/pgtable.h>
 
 #define set_memory_rox set_memory_rox
 int set_memory_rox(unsigned long addr, int numpages);
arch/x86/include/asm/sev.h +1 -0
index 0e6c0940100f3..3936c821d6b0a 100644
@@ -14,6 +14,7 @@
 #include <asm/insn.h>
 #include <asm/sev-common.h>
 #include <asm/coco.h>
+#include <asm/pgtable.h>
 #include <asm/set_memory.h>
 #include <asm/svm.h>
 
Signature · 1 line
2.53.0

I forgot to drop unneeded pgtable.h. Thanks for addressing it!

Signature · 2 lines
Best regards,
Coiby
#2 lore raw
Quoted 44 lines · Coiby Xu
Quoted 43 lines · Thomas Huth

From: Thomas Huth <[email protected]>

The "#include <asm/pgtable.h>" has been added to set_memory.h in commit e1e6cd01d933 ("Revert "x86/mm: Remove unused __set_memory_prot()"") to provide the "pgprot_t" type in the prototype of __set_memory_prot(). Later, the prototype of __set_memory_prot() has been removed again, see commit 8a4e92b3260a ("x86/crash: Use set_memory_p() instead of __set_memory_prot()"), but the pgtable.h line has been left in the header. Thus, since it's not required here anymore, remove it now from set_memory.h. However, there is a indirect dependency on pgtable.h in the sev.h header file instead, so we now have to include it there to avoid that the build breaks.

---
arch/x86/include/asm/set_memory.h | 1 -
arch/x86/include/asm/sev.h        | 1 +

2 files changed, 1 insertion(+), 1 deletion(-)
arch/x86/include/asm/set_memory.h +0 -1
index 4362c26aa992d..8d9f1c9aaa4ce 100644
@@ -4,7 +4,6 @@
 
 #include <asm/page.h>
 #include <asm-generic/set_memory.h>
-#include <asm/pgtable.h>
 
 #define set_memory_rox set_memory_rox
 int set_memory_rox(unsigned long addr, int numpages);
arch/x86/include/asm/sev.h +1 -0
index 0e6c0940100f3..3936c821d6b0a 100644
@@ -14,6 +14,7 @@
 #include <asm/insn.h>
 #include <asm/sev-common.h>
 #include <asm/coco.h>
+#include <asm/pgtable.h>
 #include <asm/set_memory.h>
 #include <asm/svm.h>
 
Quoted 7 lines
Quoted 3 lines
Signature · 1 line
2.53.0

I forgot to drop unneeded pgtable.h. Thanks for addressing it!

Friendly ping! Could anybody pick this up?

Thanks,
Thomas