Bug 203161 - ppc64 started failing to build: error: 'MAX_PHYSMEM_BITS' undeclared
Summary: ppc64 started failing to build: error: 'MAX_PHYSMEM_BITS' undeclared
Status: CLOSED CODE_FIX
Alias: None
Product: Platform Specific/Hardware
Classification: Unclassified
Component: PPC-64 (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: platform_ppc-64
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-05 22:28 UTC by Christoph Biedl
Modified: 2019-05-14 13:27 UTC (History)
2 users (show)

See Also:
Kernel Version: 5.1-rc2
Subsystem:
Regression: Yes
Bisected commit-id:


Attachments
.config, take 2 (13.70 KB, application/x-xz)
2019-04-05 22:30 UTC, Christoph Biedl
Details

Description Christoph Biedl 2019-04-05 22:28:58 UTC
Hello,

a kernel configuration for ppc64 started failing to build between v5.1-rc1 and v5.1-rc2. Bisect led to

commit 8bc086899816214fbc6047c9c7e15fcab49552bf
Author: Ben Hutchings <ben@decadent.org.uk>
Date:   Sun Mar 17 01:17:56 2019 +0000

    powerpc/mm: Only define MAX_PHYSMEM_BITS in SPARSEMEM configurations


Syptoms: *Many* warnings like

In file included from ./arch/powerpc/include/asm/book3s/64/mmu.h:39,
                 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/seqlock.h:36,
                 from ./include/linux/time.h:6,
                 from ./include/linux/compat.h:10,
                 from arch/powerpc/kernel/asm-offsets.c:18:
./arch/powerpc/include/asm/book3s/64/mmu-hash.h:584:6: warning: "MAX_PHYSMEM_BITS" is not defined, evaluates to 0 [-Wundef]
 #if (MAX_PHYSMEM_BITS > MAX_EA_BITS_PER_CONTEXT)
      ^~~~~~~~~~~~~~~~

... and eventually abort with:

arch/powerpc/mm/slb.c: In function 'slb_allocate_kernel':
arch/powerpc/mm/slb.c:697:37: error: 'MAX_PHYSMEM_BITS' undeclared (first use in this function); did you mean 'SWP_TYPE_BITS'?
   if ((ea & ~REGION_MASK) > (1UL << MAX_PHYSMEM_BITS))
                                     ^~~~~~~~~~~~~~~~
                                     SWP_TYPE_BITS

A ppc64 configuration is attached.

FWIW, built was made using the cross compiler as provided in Debian buster. I can repeat this on native hardware upon request although I strongly doubt this makes any differences. Build command line was

make ARCH=powerpc CROSS_COMPILE=powerpc64-linux-gnu- LDFLAGS= KCPPFLAGS=-fno-pic
Comment 1 Christoph Biedl 2019-04-05 22:30:31 UTC
Created attachment 282145 [details]
.config, take 2
Comment 3 Christoph Biedl 2019-04-21 13:40:40 UTC
Was fixed in

Subject: Powerpc/mm: Define MAX_PHYSMEM_BITS for all 64-bit configs
Origin: v5.1-rc2-7-gcf7cf6977f53
Upstream-Author: Michael Ellerman <mpe@ellerman.id.au>
Date: Tue Apr 9 15:43:11 2019 +1000

    The recent commit 8bc086899816 ("powerpc/mm: Only define
    MAX_PHYSMEM_BITS in SPARSEMEM configurations") removed our definition
    of MAX_PHYSMEM_BITS when SPARSEMEM is disabled.


Hence resolving.

Note You need to log in before you can comment on or make changes to this bug.