enabling kvm w/SPLIT_PTLOCK_CPUS > NR_CPUS fails to build in pgtable.c
Quoted 44 lines · On Fri, 2 Jan 2015 11:31:36 +0100 Heiko Carstens <[email protected]>…
Quoted 22 lines · Mike Frysinger
i've configured my kernel to have:
CONFIG_KVM=y
CONFIG_NR_CPUS=2
CONFIG_SPLIT_PTLOCK_CPUS=4and that makes the build very unhappy:
CC arch/s390/mm/pgtable.o arch/s390/mm/pgtable.c: In function ���__gmap_segment_gaddr���: arch/s390/mm/pgtable.c:327:2: error: implicit declaration of function ���pmd_to_page��� [-Werror=implicit-function-declaration] page = pmd_to_page((pmd_t *) entry); ^this is because
include/linux/mm_types.hhas:#define USE_SPLIT_PMD_PTLOCKS (USE_SPLIT_PTE_PTLOCKS && \ IS_ENABLED(CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK))and
include/linux/mm.hhas:#if USE_SPLIT_PMD_PTLOCKS static struct page *pmd_to_page(pmd_t *pmd) ...Quoted 6 lines
i did set
NR_CPUSdown on purpose (this system only has two cpus), but apparently tweakingSPLIT_PTLOCK_CPUSisn't an option :). in mm/Kconfig:config SPLIT_PTLOCK_CPUS int default "4"-mike
Thanks for reporting. The patch below should fix it (adding Martin to To:)
include/linux/mm.h +1
-3@@ -1555,14 +1555,14 @@ static inline void pgtable_page_dtor(struct page *page) ((unlikely (pmd_none (*(pmd))) &&__pte_alloc_kernel (pmd, address))? \ NULL: pte_offset_kernel(pmd, address)) -#if USE_SPLIT_PMD_PTLOCKS - -static struct page *pmd_to_page (pmd_t *pmd) +static inline struct page *pmd_to_page (pmd_t *pmd)
include/linux/mm.h static inline void pgtable_page_dtor(struct page *page) · line 1568
Quoted 10 lines
include/linux/mm.h +2
-0{unsigned long mask = ~(PTRS_PER_PMD *sizeof (pmd_t) -1 );return virt_to_page ((void *)((unsigned long ) pmd & mask)); } +#if USE_SPLIT_PMD_PTLOCKS +static inline spinlock_t *pmd_lockptr (struct mm_struct *mm,pmd_t *pmd) {return ptlock_ptr (pmd_to_page (pmd));
That looks good, there is no reason why the pmd_to_page helper should be conditional on the USE_SPLIT_PMD_PTLOCKS define.
Signature · 4 lines
blue skies, Martin. "Reality continues to ruin my life." - Calvin.