Skip to contentSkip to conversation

powerpc: Build fix for non SPARSEMEM_VMEMAP config

PATCH Applied Aneesh Kumar K.V 4 participants 6 messages Jun 28, 2017 – Jul 27, 2017 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc: Build fix for non SPARSEMEM_VMEMAP config

We can use pfn_to_page in realmode for other configs. Hence remove the CONFIG_FLATMEM ifdef

Fixes 8e0861fa3c4ed (powerpc: Prepare to support kernel handling of IOMMU map/unmap)
Cc Alexey Kardashevskiy <[email protected]>
---
 arch/powerpc/mm/init_64.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/mm/init_64.c +1 -1
index ec84b31c6c86..3dd507b4f8cd 100644
@@ -322,7 +322,7 @@ struct page *realmode_pfn_to_page(unsigned long pfn)
 }
 EXPORT_SYMBOL_GPL(realmode_pfn_to_page);
 
-#elif defined(CONFIG_FLATMEM)
+#else
 
 struct page *realmode_pfn_to_page(unsigned long pfn)
 {
Signature · 1 line
2.7.4
#1 lore raw
Quoted 2 lines · Aneesh Kumar K.V

We can use pfn_to_page in realmode for other configs. Hence remove the CONFIG_FLATMEM ifdef

For CONFIG_SPARSEMEM and CONFIG_DISCONTIGMEM and others (I am struggling to find the full list :) )? Are you sure about that? If I recall correctly, at the time realmode_pfn_to_page() could not work for all of them, what changed?

Quoted 14 lines
Fixes 8e0861fa3c4ed (powerpc: Prepare to support kernel handling of IOMMU map/unmap)
Cc Alexey Kardashevskiy <[email protected]>
---
 arch/powerpc/mm/init_64.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/mm/init_64.c +0 -0
index ec84b31c6c86..3dd507b4f8cd 100644

arch/powerpc/mm/init_64.c struct page *realmode_pfn_to_page(unsigned long pfn) · line 325

Quoted 5 lines
arch/powerpc/mm/init_64.c +1 -1
@@ -322,7 +322,7 @@ struct page *realmode_pfn_to_page(unsigned long pfn)
 }
 EXPORT_SYMBOL_GPL(realmode_pfn_to_page);
 
-#elif defined(CONFIG_FLATMEM)
+#else

There is also a comment at the #endif with "FLATMEM", needs to be updated.

Quoted 4 lines
arch/powerpc/mm/init_64.c +0 -0
 struct page *realmode_pfn_to_page(unsigned long pfn)
 {
 
Signature · 1 line
Alexey
#2 lore raw
Quoted 8 lines · Alexey Kardashevskiy
Quoted 2 lines · Aneesh Kumar K.V

We can use pfn_to_page in realmode for other configs. Hence remove the CONFIG_FLATMEM ifdef

For CONFIG_SPARSEMEM and CONFIG_DISCONTIGMEM and others (I am struggling to find the full list :) )? Are you sure about that? If I recall correctly, at the time realmode_pfn_to_page() could not work for all of them, what changed?

That is one thing I wanted to check. Everything other than SPARSEMEM_VMEMMAP should use linear mapping which can work with real mode also right ? Or am i missing something ?

Quoted 30 lines
Quoted 15 lines
Fixes 8e0861fa3c4ed (powerpc: Prepare to support kernel handling of IOMMU map/unmap)
Cc Alexey Kardashevskiy <[email protected]>
---
  arch/powerpc/mm/init_64.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/mm/init_64.c +0 -0
index ec84b31c6c86..3dd507b4f8cd 100644

arch/powerpc/mm/init_64.c struct page *realmode_pfn_to_page(unsigned long pfn) · line 325

Quoted 5 lines
arch/powerpc/mm/init_64.c +1 -1
@@ -322,7 +322,7 @@ struct page *realmode_pfn_to_page(unsigned long pfn)
  }
  EXPORT_SYMBOL_GPL(realmode_pfn_to_page);
 
-#elif defined(CONFIG_FLATMEM)
+#else

There is also a comment at the #endif with "FLATMEM", needs to be updated.

Quoted 4 lines
arch/powerpc/mm/init_64.c +0 -0
  struct page *realmode_pfn_to_page(unsigned long pfn)
  {
 
#3 lore raw
Quoted 5 lines · Aneesh Kumar K.V
Quoted 4 lines · Alexey Kardashevskiy
Quoted 2 lines · Aneesh Kumar K.V

We can use pfn_to_page in realmode for other configs. Hence remove the CONFIG_FLATMEM ifdef

Quoted 7 lines
Quoted 3 lines

For CONFIG_SPARSEMEM and CONFIG_DISCONTIGMEM and others (I am struggling to find the full list :) )? Are you sure about that? If I recall correctly, at the time realmode_pfn_to_page() could not work for all of them, what changed?

That is one thing I wanted to check. Everything other than SPARSEMEM_VMEMMAP should use linear mapping which can work with real mode also right ? Or am i missing something ?

I think that's right. But I'm going to make you test it anyway :)

cheers

#4 lore raw
Quoted 11 lines · Michael Ellerman
Quoted 9 lines · Aneesh Kumar K.V
Quoted 7 lines · Alexey Kardashevskiy
Quoted 2 lines · Aneesh Kumar K.V

We can use pfn_to_page in realmode for other configs. Hence remove the CONFIG_FLATMEM ifdef

For CONFIG_SPARSEMEM and CONFIG_DISCONTIGMEM and others (I am struggling to find the full list :) )? Are you sure about that? If I recall correctly, at the time realmode_pfn_to_page() could not work for all of them, what changed?

Quoted 5 lines
Quoted 3 lines

That is one thing I wanted to check. Everything other than SPARSEMEM_VMEMMAP should use linear mapping which can work with real mode also right ? Or am i missing something ?

I think that's right. But I'm going to make you test it anyway :)

Tested this by printing page->flags with FLATMEM, SPARSEMEM and SPARSEMEM_VMEMMAP in kvm real mode handler.

-aneesh