diff mbox

mm: export symbol dependencies of is_zero_pfn()

Message ID 1410553043-575-1-git-send-email-ard.biesheuvel@linaro.org (mailing list archive)
State New, archived
Headers show

Commit Message

Ard Biesheuvel Sept. 12, 2014, 8:17 p.m. UTC
In order to make the static inline function is_zero_pfn() callable by
modules, export its symbol dependencies 'zero_pfn' and (for s390 and
mips) 'zero_page_mask'.

We need this for KVM, as CONFIG_KVM is a tristate for all supported
architectures except ARM and arm64, and testing a pfn whether it refers
to the zero page is required to correctly distinguish the zero page
from other special RAM ranges that may also have the PG_reserved bit
set, but need to be treated as MMIO memory.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 arch/mips/mm/init.c | 1 +
 arch/s390/mm/init.c | 1 +
 mm/memory.c         | 2 ++
 3 files changed, 4 insertions(+)

Comments

Andrew Morton Sept. 12, 2014, 9:14 p.m. UTC | #1
On Fri, 12 Sep 2014 22:17:23 +0200 Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:

> In order to make the static inline function is_zero_pfn() callable by
> modules, export its symbol dependencies 'zero_pfn' and (for s390 and
> mips) 'zero_page_mask'.

So hexagon and score get the export if/when needed.

> We need this for KVM, as CONFIG_KVM is a tristate for all supported
> architectures except ARM and arm64, and testing a pfn whether it refers
> to the zero page is required to correctly distinguish the zero page
> from other special RAM ranges that may also have the PG_reserved bit
> set, but need to be treated as MMIO memory.
> 
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
>  arch/mips/mm/init.c | 1 +
>  arch/s390/mm/init.c | 1 +
>  mm/memory.c         | 2 ++

Looks OK to me.  Please include the patch in whichever tree is is that
needs it, and merge it up via that tree.

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ard Biesheuvel Sept. 12, 2014, 9:19 p.m. UTC | #2
On 12 September 2014 23:14, Andrew Morton <akpm@linux-foundation.org> wrote:
> On Fri, 12 Sep 2014 22:17:23 +0200 Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
>
>> In order to make the static inline function is_zero_pfn() callable by
>> modules, export its symbol dependencies 'zero_pfn' and (for s390 and
>> mips) 'zero_page_mask'.
>
> So hexagon and score get the export if/when needed.
>

Exactly.

>> We need this for KVM, as CONFIG_KVM is a tristate for all supported
>> architectures except ARM and arm64, and testing a pfn whether it refers
>> to the zero page is required to correctly distinguish the zero page
>> from other special RAM ranges that may also have the PG_reserved bit
>> set, but need to be treated as MMIO memory.
>>
>> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>> ---
>>  arch/mips/mm/init.c | 1 +
>>  arch/s390/mm/init.c | 1 +
>>  mm/memory.c         | 2 ++
>
> Looks OK to me.  Please include the patch in whichever tree is is that
> needs it, and merge it up via that tree.
>

Thanks.

@Paolo: could you please take this (with Andrew's ack), and put it
before the patch you took earlier today?

Thanks,
Ard.
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Paolo Bonzini Sept. 14, 2014, 2:23 p.m. UTC | #3
Il 12/09/2014 23:19, Ard Biesheuvel ha scritto:
> On 12 September 2014 23:14, Andrew Morton <akpm@linux-foundation.org> wrote:
>> On Fri, 12 Sep 2014 22:17:23 +0200 Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
>>
>>> In order to make the static inline function is_zero_pfn() callable by
>>> modules, export its symbol dependencies 'zero_pfn' and (for s390 and
>>> mips) 'zero_page_mask'.
>>
>> So hexagon and score get the export if/when needed.
>>
> 
> Exactly.
> 
>>> We need this for KVM, as CONFIG_KVM is a tristate for all supported
>>> architectures except ARM and arm64, and testing a pfn whether it refers
>>> to the zero page is required to correctly distinguish the zero page
>>> from other special RAM ranges that may also have the PG_reserved bit
>>> set, but need to be treated as MMIO memory.
>>>
>>> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>>> ---
>>>  arch/mips/mm/init.c | 1 +
>>>  arch/s390/mm/init.c | 1 +
>>>  mm/memory.c         | 2 ++
>>
>> Looks OK to me.  Please include the patch in whichever tree is is that
>> needs it, and merge it up via that tree.
>>
> 
> Thanks.
> 
> @Paolo: could you please take this (with Andrew's ack), and put it
> before the patch you took earlier today?

Yes, will do.

Paolo

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index 571aab064936..f42e35e42790 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -53,6 +53,7 @@ 
  */
 unsigned long empty_zero_page, zero_page_mask;
 EXPORT_SYMBOL_GPL(empty_zero_page);
+EXPORT_SYMBOL(zero_page_mask);
 
 /*
  * Not static inline because used by IP27 special magic initialization code
diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c
index 0c1073ed1e84..c7235e01fd67 100644
--- a/arch/s390/mm/init.c
+++ b/arch/s390/mm/init.c
@@ -43,6 +43,7 @@  pgd_t swapper_pg_dir[PTRS_PER_PGD] __attribute__((__aligned__(PAGE_SIZE)));
 
 unsigned long empty_zero_page, zero_page_mask;
 EXPORT_SYMBOL(empty_zero_page);
+EXPORT_SYMBOL(zero_page_mask);
 
 static void __init setup_zero_pages(void)
 {
diff --git a/mm/memory.c b/mm/memory.c
index adeac306610f..d17f1bcd2a91 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -118,6 +118,8 @@  __setup("norandmaps", disable_randmaps);
 unsigned long zero_pfn __read_mostly;
 unsigned long highest_memmap_pfn __read_mostly;
 
+EXPORT_SYMBOL(zero_pfn);
+
 /*
  * CONFIG_MMU architectures set up ZERO_PAGE in their paging_init()
  */