diff mbox

powerpc: Build fix for non SPARSEMEM_VMEMAP config

Message ID 1498630168-26376-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com (mailing list archive)
State Accepted
Commit 7e7dc66adcf490a619bc3c7763a8cebadfba73e3
Headers show

Commit Message

Aneesh Kumar K.V June 28, 2017, 6:09 a.m. UTC
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 <aik@ozlabs.ru>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
---
 arch/powerpc/mm/init_64.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Alexey Kardashevskiy June 28, 2017, 7:18 a.m. UTC | #1
On 28/06/17 16:09, Aneesh Kumar K.V wrote:
> 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?

> 
> Fixes: 8e0861fa3c4ed (powerpc: Prepare to support kernel handling of IOMMU map/unmap)
> 
> Cc: Alexey Kardashevskiy <aik@ozlabs.ru>
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
> ---
>  arch/powerpc/mm/init_64.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c
> index ec84b31c6c86..3dd507b4f8cd 100644
> --- a/arch/powerpc/mm/init_64.c
> +++ b/arch/powerpc/mm/init_64.c
> @@ -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.


>  
>  struct page *realmode_pfn_to_page(unsigned long pfn)
>  {
>
Aneesh Kumar K.V June 28, 2017, 10:25 a.m. UTC | #2
On Wednesday 28 June 2017 12:48 PM, Alexey Kardashevskiy wrote:
> On 28/06/17 16:09, Aneesh Kumar K.V wrote:
>> 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 ?

> 
>>
>> Fixes: 8e0861fa3c4ed (powerpc: Prepare to support kernel handling of IOMMU map/unmap)
>>
>> Cc: Alexey Kardashevskiy <aik@ozlabs.ru>
>> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
>> ---
>>   arch/powerpc/mm/init_64.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c
>> index ec84b31c6c86..3dd507b4f8cd 100644
>> --- a/arch/powerpc/mm/init_64.c
>> +++ b/arch/powerpc/mm/init_64.c
>> @@ -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.
> 
> 
>>   
>>   struct page *realmode_pfn_to_page(unsigned long pfn)
>>   {
>>
> 
>
Michael Ellerman June 29, 2017, 5:50 a.m. UTC | #3
"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com> writes:

> On Wednesday 28 June 2017 12:48 PM, Alexey Kardashevskiy wrote:
>> On 28/06/17 16:09, Aneesh Kumar K.V wrote:
>>> 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 ?

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

cheers
Aneesh Kumar K.V July 24, 2017, 9:19 a.m. UTC | #4
Michael Ellerman <mpe@ellerman.id.au> writes:

> "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com> writes:
>
>> On Wednesday 28 June 2017 12:48 PM, Alexey Kardashevskiy wrote:
>>> On 28/06/17 16:09, Aneesh Kumar K.V wrote:
>>>> 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 ?
>
> 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
Michael Ellerman July 27, 2017, 12:37 p.m. UTC | #5
On Wed, 2017-06-28 at 06:09:28 UTC, "Aneesh Kumar K.V" wrote:
> 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 <aik@ozlabs.ru>
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/7e7dc66adcf490a619bc3c7763a8ce

cheers
diff mbox

Patch

diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c
index ec84b31c6c86..3dd507b4f8cd 100644
--- a/arch/powerpc/mm/init_64.c
+++ b/arch/powerpc/mm/init_64.c
@@ -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)
 {