All of lore.kernel.org
 help / color / mirror / Atom feed
* enabling kvm w/SPLIT_PTLOCK_CPUS > NR_CPUS fails to build in pgtable.c
@ 2014-12-31  5:56 Mike Frysinger
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Frysinger @ 2014-12-31  5:56 UTC (permalink / raw)
  To: linux-s390

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: multipart/mixed; boundary="--GyRA7555PLgSTuth", Size: 2007 bytes --]


--GyRA7555PLgSTuth
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

i've configured my kernel to have:
	CONFIG_KVM=3Dy
	CONFIG_NR_CPUS=3D2
	CONFIG_SPLIT_PTLOCK_CPUS=3D4

and that makes the build very unhappy:
	  CC      arch/s390/mm/pgtable.o
	arch/s390/mm/pgtable.c: In function =E2=80=98__gmap_segment_gaddr=E2=80=99:
	arch/s390/mm/pgtable.c:327:2: error: implicit declaration of function=20
	=E2=80=98pmd_to_page=E2=80=99 [-Werror=3Dimplicit-function-declaration]
	  page =3D pmd_to_page((pmd_t *) entry);
	  ^

this is because include/linux/mm_types.h has:
	#define USE_SPLIT_PMD_PTLOCKS	(USE_SPLIT_PTE_PTLOCKS && \
			IS_ENABLED(CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK))

and include/linux/mm.h has:
	#if USE_SPLIT_PMD_PTLOCKS
	static struct page *pmd_to_page(pmd_t *pmd)
	...

i did set NR_CPUS down on purpose (this system only has two cpus), but=20
apparently tweaking SPLIT_PTLOCK_CPUS isn't an option :).  in mm/Kconfig:
	config SPLIT_PTLOCK_CPUS
		int
		default "4"
-mike

--GyRA7555PLgSTuth
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBAgAGBQJUo5ArAAoJEEFjO5/oN/WBqBAP/3u2ZRVeWDeCy1yjSKxFC4nA
UG6iilpYCjmcIrAkSH90ATEkazyDwgeAVvaYaXbnX7mAoYSaz1l7CbtK8/kMLqqm
U5Sz0qHAmbFMhKufczKDZp4IzrXOXooy3hVdBJKuOPr2+hdNr6Zs4KYFnp5bQdgQ
q8dJMJ1XEmVUyn6VcDzU3E+KvS6/WaBwBP51mHSUdbHQfbeI4ufrGm0aZ+vLwcpA
weI98vx8Vq2fxyQxcMAEAn5Z5H2kK6gJ8Aup1nr3p6lgdMv9qB9VW0jRACsN6VZo
7Wth0Lxko9TbMuOO0y6VSpzj/9xGMWStNM7xdxIjRq7XjGmBNA77TzyFw1Bo3abr
x2a1ExPSw+3bN4f/XhZySeObkfoNvJ4hr8aZxLATgbtFYZitUiGSx4FXdwG6YFjQ
d8Jy3AS9V7Fp7QLEd+ZQOeW8ygrHb+dYcU/DTaGAy+tx+2mut/DKN59e95/icows
UV2JHtmaqQrzrDcM25NjkYk+7bqk2Csy9uEre6a6XB3x7enWc9pmi1eZwXVSv8Qd
xd46ZzBW7Xar1Ae3MT++XbIBPSGAzWinSH4qhzUEQ+V7bKr7cqNpvYfL6pxJ37zg
OqwIv6Yy4qnGKKInQdJTuuZ9+Su/kJ9AJUhCGgAxHNyQisvSZ9yU15QcGMnRO95Y
h/ZXXDIIkBnUeEzHkQua
=ZKud
-----END PGP SIGNATURE-----

--GyRA7555PLgSTuth--

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: enabling kvm w/SPLIT_PTLOCK_CPUS > NR_CPUS fails to build in pgtable.c
       [not found] <20150102103136.GB4059@osiris>
@ 2015-01-05  8:57 ` Martin Schwidefsky
  0 siblings, 0 replies; 2+ messages in thread
From: Martin Schwidefsky @ 2015-01-05  8:57 UTC (permalink / raw)
  To: linux-s390

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2221 bytes --]

On Fri, 2 Jan 2015 11:31:36 +0100
Heiko Carstens <heiko.carstens@de.ibm.com> wrote:

> On Wed, Dec 31, 2014 at 12:56:59AM -0500, Mike Frysinger wrote:
> > i've configured my kernel to have:
> > 	CONFIG_KVM=y
> > 	CONFIG_NR_CPUS=2
> > 	CONFIG_SPLIT_PTLOCK_CPUS=4
> > 
> > and 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.h has:
> > 	#define USE_SPLIT_PMD_PTLOCKS	(USE_SPLIT_PTE_PTLOCKS && \
> > 			IS_ENABLED(CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK))
> > 
> > and include/linux/mm.h has:
> > 	#if USE_SPLIT_PMD_PTLOCKS
> > 	static struct page *pmd_to_page(pmd_t *pmd)
> > 	...
> > 
> > i did set NR_CPUS down on purpose (this system only has two cpus), but 
> > apparently tweaking SPLIT_PTLOCK_CPUS isn'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:)
> 
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index f80d0194c9bc..4ee25aea7861 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -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)
>  {
>  	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.

-- 
blue skies,
   Martin.

"Reality continues to ruin my life." - Calvin.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-01-05  8:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-31  5:56 enabling kvm w/SPLIT_PTLOCK_CPUS > NR_CPUS fails to build in pgtable.c Mike Frysinger
     [not found] <20150102103136.GB4059@osiris>
2015-01-05  8:57 ` Martin Schwidefsky

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.