From: Ben Hutchings <ben@decadent.org.uk>
To: Andreas Schwab <schwab@linux-m68k.org>,
Michael Ellerman <patch-notifications@ellerman.id.au>
Cc: Paul Mackerras <paulus@samba.org>, linuxppc-dev@lists.ozlabs.org
Subject: Re: powerpc/mm: Only define MAX_PHYSMEM_BITS in SPARSEMEM configurations
Date: Sun, 24 Mar 2019 23:05:14 +0000 [thread overview]
Message-ID: <eb21be1ac183dd206da3a389b426707c535c463c.camel@decadent.org.uk> (raw)
In-Reply-To: <87k1gnq5lp.fsf@igel.home>
[-- Attachment #1: Type: text/plain, Size: 3363 bytes --]
On Sun, 2019-03-24 at 23:18 +0100, Andreas Schwab wrote:
> On Mär 22 2019, Michael Ellerman <patch-notifications@ellerman.id.au> wrote:
>
> > On Sun, 2019-03-17 at 01:17:56 UTC, Ben Hutchings wrote:
> > > MAX_PHYSMEM_BITS only needs to be defined if CONFIG_SPARSEMEM is
> > > enabled, and that was the case before commit 4ffe713b7587
> > > ("powerpc/mm: Increase the max addressable memory to 2PB").
> > >
> > > On 32-bit systems, where CONFIG_SPARSEMEM is not enabled, we now
> > > define it as 46. That is larger than the real number of physical
> > > address bits, and breaks calculations in zsmalloc:
> > >
> > > mm/zsmalloc.c:130:49: warning: right shift count is negative [-Wshift-count-negative]
> > > MAX(32, (ZS_MAX_PAGES_PER_ZSPAGE << PAGE_SHIFT >> OBJ_INDEX_BITS))
> > > ^~
> > > ...
> > > mm/zsmalloc.c:253:21: error: variably modified 'size_class' at file scope
> > > struct size_class *size_class[ZS_SIZE_CLASSES];
> > > ^~~~~~~~~~
> > >
> > > Fixes: 4ffe713b7587 ("powerpc/mm: Increase the max addressable memory to 2PB")
> > > Cc: stable@vger.kernel.org
> > > Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> >
> > Applied to powerpc fixes, thanks.
> >
> > https://git.kernel.org/powerpc/c/8bc086899816214fbc6047c9c7e15fca
>
> In file included from ./arch/powerpc/include/asm/book3s/64/mmu.h:39:0,
> from ./arch/powerpc/include/asm/mmu.h:360,
> from ./arch/powerpc/include/asm/lppaca.h:36,
> from ./arch/powerpc/include/asm/paca.h:21,
> from ./arch/powerpc/include/asm/current.h:16,
> from ./include/linux/thread_info.h:21,
> from ./include/asm-generic/preempt.h:5,
> from ./arch/powerpc/include/generated/asm/preempt.h:1,
> from ./include/linux/preempt.h:78,
> from ./include/linux/spinlock.h:51,
> from ./include/linux/mmzone.h:8,
> from ./include/linux/gfp.h:6,
> from ./include/linux/slab.h:15,
> from ./include/linux/crypto.h:24,
> from ./include/crypto/algapi.h:15,
> from ./include/crypto/internal/hash.h:16,
> from arch/powerpc/crypto/md5-glue.c:15:
> ./arch/powerpc/include/asm/book3s/64/mmu-hash.h:584:6: error: "MAX_PHYSMEM_BITS" is not defined [-Werror=undef]
> #if (MAX_PHYSMEM_BITS > MAX_EA_BITS_PER_CONTEXT)
> ^
Presumably you have CONFIG_PPC_BOOK3S_64 enabled and CONFIG_SPARSEMEM
disabled? Was this configuration actually usable?
I think this would fix the build failure:
--- a/arch/powerpc/include/asm/mmu.h
+++ b/arch/powerpc/include/asm/mmu.h
@@ -341,7 +341,7 @@ static inline u16 get_mm_addr_key(struct mm_struct
*mm, unsigned long address)
#if defined(CONFIG_SPARSEMEM_VMEMMAP) &&
defined(CONFIG_SPARSEMEM_EXTREME) && \
defined (CONFIG_PPC_64K_PAGES)
#define MAX_PHYSMEM_BITS 51
-#elif defined(CONFIG_SPARSEMEM)
+#elif defined(CONFIG_PPC64)
#define MAX_PHYSMEM_BITS 46
#endif
--- END ---
but whether the result will actually *work*, I don't know.
Ben.
--
Ben Hutchings
Larkinson's Law: All laws are basically false.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2019-03-24 23:07 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-17 1:17 [PATCH] powerpc/mm: Only define MAX_PHYSMEM_BITS in SPARSEMEM configurations Ben Hutchings
2019-03-22 12:21 ` Michael Ellerman
[not found] ` <44QjSh4zGhz9sV2__48832.6491251186$1553257542$gmane$org@ozlabs.org>
2019-03-24 22:18 ` Andreas Schwab
2019-03-24 23:05 ` Ben Hutchings [this message]
2019-03-25 0:03 ` Andreas Schwab
2019-03-25 3:54 ` Ben Hutchings
2019-03-25 11:35 ` Michael Ellerman
2019-03-25 12:03 ` Christophe Leroy
2019-03-25 20:12 ` Andreas Schwab
2019-04-02 12:57 ` Aneesh Kumar K.V
2019-03-25 8:54 Rui Salvaterra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=eb21be1ac183dd206da3a389b426707c535c463c.camel@decadent.org.uk \
--to=ben@decadent.org.uk \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=patch-notifications@ellerman.id.au \
--cc=paulus@samba.org \
--cc=schwab@linux-m68k.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).