LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v5 2/6] powerpc/mm/slice: create header files dedicated to slices
From: Nicholas Piggin @ 2018-02-24  7:22 UTC (permalink / raw)
  To: Christophe Leroy
  Cc: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
	Scott Wood, aneesh.kumar, linux-kernel, linuxppc-dev
In-Reply-To: <d73e104992133e8fd17c798d817687bf2ea8b50a.1519305410.git.christophe.leroy@c-s.fr>

On Thu, 22 Feb 2018 15:27:22 +0100 (CET)
Christophe Leroy <christophe.leroy@c-s.fr> wrote:

> In preparation for the following patch which will enhance 'slices'
> for supporting PPC32 in order to fix an issue on hugepages on 8xx,
> this patch takes out of page*.h all bits related to 'slices' and put
> them into newly created slice.h header files.
> While common parts go into asm/slice.h, subarch specific
> parts go into respective books3s/64/slice.c and nohash/64/slice.c
> 'slices'
> 
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

I don't see a problem with this. Even by itself it seems like
a good cleanup.

Reviewed-by: Nicholas Piggin <npiggin@gmail.com>

> ---
>  v5: new - come from a split of patch 2 of v4
> 
>  arch/powerpc/include/asm/book3s/64/slice.h | 27 ++++++++++++++
>  arch/powerpc/include/asm/nohash/64/slice.h | 12 ++++++
>  arch/powerpc/include/asm/page.h            |  1 +
>  arch/powerpc/include/asm/page_64.h         | 59 ------------------------------
>  arch/powerpc/include/asm/slice.h           | 40 ++++++++++++++++++++
>  5 files changed, 80 insertions(+), 59 deletions(-)
>  create mode 100644 arch/powerpc/include/asm/book3s/64/slice.h
>  create mode 100644 arch/powerpc/include/asm/nohash/64/slice.h
>  create mode 100644 arch/powerpc/include/asm/slice.h
> 
> diff --git a/arch/powerpc/include/asm/book3s/64/slice.h b/arch/powerpc/include/asm/book3s/64/slice.h
> new file mode 100644
> index 000000000000..db0dedab65ee
> --- /dev/null
> +++ b/arch/powerpc/include/asm/book3s/64/slice.h
> @@ -0,0 +1,27 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +#ifndef _ASM_POWERPC_BOOK3S_64_SLICE_H
> +#define _ASM_POWERPC_BOOK3S_64_SLICE_H
> +
> +#ifdef CONFIG_PPC_MM_SLICES
> +
> +#define SLICE_LOW_SHIFT		28
> +#define SLICE_LOW_TOP		(0x100000000ul)
> +#define SLICE_NUM_LOW		(SLICE_LOW_TOP >> SLICE_LOW_SHIFT)
> +#define GET_LOW_SLICE_INDEX(addr)	((addr) >> SLICE_LOW_SHIFT)
> +
> +#define SLICE_HIGH_SHIFT	40
> +#define SLICE_NUM_HIGH		(H_PGTABLE_RANGE >> SLICE_HIGH_SHIFT)
> +#define GET_HIGH_SLICE_INDEX(addr)	((addr) >> SLICE_HIGH_SHIFT)
> +
> +#else /* CONFIG_PPC_MM_SLICES */
> +
> +#define get_slice_psize(mm, addr)	((mm)->context.user_psize)
> +#define slice_set_user_psize(mm, psize)		\
> +do {						\
> +	(mm)->context.user_psize = (psize);	\
> +	(mm)->context.sllp = SLB_VSID_USER | mmu_psize_defs[(psize)].sllp; \
> +} while (0)
> +
> +#endif /* CONFIG_PPC_MM_SLICES */
> +
> +#endif /* _ASM_POWERPC_BOOK3S_64_SLICE_H */
> diff --git a/arch/powerpc/include/asm/nohash/64/slice.h b/arch/powerpc/include/asm/nohash/64/slice.h
> new file mode 100644
> index 000000000000..ad0d6e3cc1c5
> --- /dev/null
> +++ b/arch/powerpc/include/asm/nohash/64/slice.h
> @@ -0,0 +1,12 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +#ifndef _ASM_POWERPC_NOHASH_64_SLICE_H
> +#define _ASM_POWERPC_NOHASH_64_SLICE_H
> +
> +#ifdef CONFIG_PPC_64K_PAGES
> +#define get_slice_psize(mm, addr)	MMU_PAGE_64K
> +#else /* CONFIG_PPC_64K_PAGES */
> +#define get_slice_psize(mm, addr)	MMU_PAGE_4K
> +#endif /* !CONFIG_PPC_64K_PAGES */
> +#define slice_set_user_psize(mm, psize)	do { BUG(); } while (0)
> +
> +#endif /* _ASM_POWERPC_NOHASH_64_SLICE_H */
> diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h
> index 8da5d4c1cab2..d5f1c41b7dba 100644
> --- a/arch/powerpc/include/asm/page.h
> +++ b/arch/powerpc/include/asm/page.h
> @@ -344,5 +344,6 @@ typedef struct page *pgtable_t;
>  
>  #include <asm-generic/memory_model.h>
>  #endif /* __ASSEMBLY__ */
> +#include <asm/slice.h>
>  
>  #endif /* _ASM_POWERPC_PAGE_H */
> diff --git a/arch/powerpc/include/asm/page_64.h b/arch/powerpc/include/asm/page_64.h
> index 56234c6fcd61..af04acdb873f 100644
> --- a/arch/powerpc/include/asm/page_64.h
> +++ b/arch/powerpc/include/asm/page_64.h
> @@ -86,65 +86,6 @@ extern u64 ppc64_pft_size;
>  
>  #endif /* __ASSEMBLY__ */
>  
> -#ifdef CONFIG_PPC_MM_SLICES
> -
> -#define SLICE_LOW_SHIFT		28
> -#define SLICE_HIGH_SHIFT	40
> -
> -#define SLICE_LOW_TOP		(0x100000000ul)
> -#define SLICE_NUM_LOW		(SLICE_LOW_TOP >> SLICE_LOW_SHIFT)
> -#define SLICE_NUM_HIGH		(H_PGTABLE_RANGE >> SLICE_HIGH_SHIFT)
> -
> -#define GET_LOW_SLICE_INDEX(addr)	((addr) >> SLICE_LOW_SHIFT)
> -#define GET_HIGH_SLICE_INDEX(addr)	((addr) >> SLICE_HIGH_SHIFT)
> -
> -#ifndef __ASSEMBLY__
> -struct mm_struct;
> -
> -extern unsigned long slice_get_unmapped_area(unsigned long addr,
> -					     unsigned long len,
> -					     unsigned long flags,
> -					     unsigned int psize,
> -					     int topdown);
> -
> -extern unsigned int get_slice_psize(struct mm_struct *mm,
> -				    unsigned long addr);
> -
> -extern void slice_set_user_psize(struct mm_struct *mm, unsigned int psize);
> -extern void slice_set_range_psize(struct mm_struct *mm, unsigned long start,
> -				  unsigned long len, unsigned int psize);
> -
> -#endif /* __ASSEMBLY__ */
> -#else
> -#define slice_init()
> -#ifdef CONFIG_PPC_BOOK3S_64
> -#define get_slice_psize(mm, addr)	((mm)->context.user_psize)
> -#define slice_set_user_psize(mm, psize)		\
> -do {						\
> -	(mm)->context.user_psize = (psize);	\
> -	(mm)->context.sllp = SLB_VSID_USER | mmu_psize_defs[(psize)].sllp; \
> -} while (0)
> -#else /* !CONFIG_PPC_BOOK3S_64 */
> -#ifdef CONFIG_PPC_64K_PAGES
> -#define get_slice_psize(mm, addr)	MMU_PAGE_64K
> -#else /* CONFIG_PPC_64K_PAGES */
> -#define get_slice_psize(mm, addr)	MMU_PAGE_4K
> -#endif /* !CONFIG_PPC_64K_PAGES */
> -#define slice_set_user_psize(mm, psize)	do { BUG(); } while(0)
> -#endif /* CONFIG_PPC_BOOK3S_64 */
> -
> -#define slice_set_range_psize(mm, start, len, psize)	\
> -	slice_set_user_psize((mm), (psize))
> -#endif /* CONFIG_PPC_MM_SLICES */
> -
> -#ifdef CONFIG_HUGETLB_PAGE
> -
> -#ifdef CONFIG_PPC_MM_SLICES
> -#define HAVE_ARCH_HUGETLB_UNMAPPED_AREA
> -#endif
> -
> -#endif /* !CONFIG_HUGETLB_PAGE */
> -
>  #define VM_DATA_DEFAULT_FLAGS \
>  	(is_32bit_task() ? \
>  	 VM_DATA_DEFAULT_FLAGS32 : VM_DATA_DEFAULT_FLAGS64)
> diff --git a/arch/powerpc/include/asm/slice.h b/arch/powerpc/include/asm/slice.h
> new file mode 100644
> index 000000000000..17c5a5d8c418
> --- /dev/null
> +++ b/arch/powerpc/include/asm/slice.h
> @@ -0,0 +1,40 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +#ifndef _ASM_POWERPC_SLICE_H
> +#define _ASM_POWERPC_SLICE_H
> +
> +#ifdef CONFIG_PPC_BOOK3S_64
> +#include <asm/book3s/64/slice.h>
> +#else
> +#include <asm/nohash/64/slice.h>
> +#endif
> +
> +#ifdef CONFIG_PPC_MM_SLICES
> +
> +#ifdef CONFIG_HUGETLB_PAGE
> +#define HAVE_ARCH_HUGETLB_UNMAPPED_AREA
> +#endif
> +#define HAVE_ARCH_UNMAPPED_AREA
> +#define HAVE_ARCH_UNMAPPED_AREA_TOPDOWN
> +
> +#ifndef __ASSEMBLY__
> +
> +struct mm_struct;
> +
> +unsigned long slice_get_unmapped_area(unsigned long addr, unsigned long len,
> +				      unsigned long flags, unsigned int psize,
> +				      int topdown);
> +
> +unsigned int get_slice_psize(struct mm_struct *mm, unsigned long addr);
> +
> +void slice_set_user_psize(struct mm_struct *mm, unsigned int psize);
> +void slice_set_range_psize(struct mm_struct *mm, unsigned long start,
> +			   unsigned long len, unsigned int psize);
> +#endif /* __ASSEMBLY__ */
> +
> +#else /* CONFIG_PPC_MM_SLICES */
> +
> +#define slice_set_range_psize(mm, start, len, psize)	\
> +	slice_set_user_psize((mm), (psize))
> +#endif /* CONFIG_PPC_MM_SLICES */
> +
> +#endif /* _ASM_POWERPC_SLICE_H */

^ permalink raw reply

* Re: [PATCH v5 3/6] powerpc/mm/slice: Enhance for supporting PPC32
From: Nicholas Piggin @ 2018-02-24  7:47 UTC (permalink / raw)
  To: Christophe Leroy
  Cc: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
	Scott Wood, aneesh.kumar, linux-kernel, linuxppc-dev
In-Reply-To: <3e9cfc87e78d61310d1b628960a465327c20d895.1519305411.git.christophe.leroy@c-s.fr>

On Thu, 22 Feb 2018 15:27:24 +0100 (CET)
Christophe Leroy <christophe.leroy@c-s.fr> wrote:

> In preparation for the following patch which will fix an issue on
> the 8xx by re-using the 'slices', this patch enhances the
> 'slices' implementation to support 32 bits CPUs.
> 
> On PPC32, the address space is limited to 4Gbytes, hence only the low
> slices will be used.
> 
> The high slices use bitmaps. As bitmap functions are not prepared to
> handle bitmaps of size 0, this patch ensures that bitmap functions
> are called only when SLICE_NUM_HIGH is not nul.
> 
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

This looks good to me, thank you for taking my feedback into account.

Is the patch split and naming good? Yes I guess so, this adds support
for ppc32 archs that select PPC_MM_SLICES, and the next one implements
it for 8xx. There looks to be some generic arch/powerpc/mm bits in the
next patch. I wonder if you would move them over? Then the next patch
could be called powerpc/8xx: ?

Anyway it's not a big deal.

Reviewed-by: Nicholas Piggin <npiggin@gmail.com>

^ permalink raw reply

* Re: [PATCH] fix double ;;s in code
From: Pavel Machek @ 2018-02-24  8:52 UTC (permalink / raw)
  To: Shawn Guo
  Cc: elfring, kernel list, vgupta, linux, oleg, catalin.marinas,
	will.deacon, paulus, benh, mpe, ard.biesheuvel, tglx, mingo, hpa,
	x86, scott.bauer, jonathan.derrick, axboe, daniel.lezcano,
	maxime.ripard, wens, alexander.deucher, christian.koenig,
	David1.Zhou, airlied, robdclark, joro, shli, kernel,
	fabio.estevam, akpm, Alexey.Brodkin, mhocko, vbabka,
	Vladislav.Zakharov, noamca, yamada.masahiro, sboyd, viresh.kumar,
	linus.walleij, heiko, aik, ruscur, david, fbarrat, alistair, robh,
	joe, harry.wentland, tony.cheng, Wenjing.Liu, airlied, Ding.Wang,
	sylvia.tsai, hersenxs.wu, Rex.Zhu, JinHuiEric.Huang,
	dan.carpenter, architt, daniel.vetter, narmstrong, ville.syrjala,
	jcrouse, aishpant, noralf, andresx7, Monk.Liu, nicolai.haehnle,
	Andrey.Grodzovsky, linux-snps-arc, linux-arm-kernel, kvm-ppc,
	linuxppc-dev, linux-efi, linux-block, amd-gfx, dri-devel,
	linux-arm-msm, freedreno, iommu, linux-raid
In-Reply-To: <20180222090932.GJ3217@dragon>

[-- Attachment #1: Type: text/plain, Size: 1190 bytes --]

Hi!

> > diff --git a/drivers/soc/imx/gpc.c b/drivers/soc/imx/gpc.c
> > index 53f7275..cfb42f5 100644
> > --- a/drivers/soc/imx/gpc.c
> > +++ b/drivers/soc/imx/gpc.c
> > @@ -348,7 +348,7 @@ static int imx_gpc_old_dt_init(struct device *dev, struct regmap *regmap,
> >  		if (i == 1) {
> >  			domain->supply = devm_regulator_get(dev, "pu");
> >  			if (IS_ERR(domain->supply))
> > -				return PTR_ERR(domain->supply);;
> > +				return PTR_ERR(domain->supply);
> >  
> >  			ret = imx_pgc_get_clocks(dev, domain);
> >  			if (ret)
> > 
> 
> Considering the controversy how the changes should be merged, I'm going
> to send a separate patch just for IMX GPC driver with a reported-by-you
> tag.  Thanks for catching this.

That works for me.

Alternatively... Andrew Morton merged the patch to his -mm tree
(thanks!), so you don't need to take any action, and it will be
eventually fixed.

If you merge your own version of the patch, that's ok, too, since
Andrew will just drop his version.

Best regards,
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply

* Re: [PATCH] fix double ;;s in code
From: Shawn Guo @ 2018-02-24  8:56 UTC (permalink / raw)
  To: Pavel Machek
  Cc: elfring, kernel list, vgupta, linux, oleg, catalin.marinas,
	will.deacon, paulus, benh, mpe, ard.biesheuvel, tglx, mingo, hpa,
	x86, scott.bauer, jonathan.derrick, axboe, daniel.lezcano,
	maxime.ripard, wens, alexander.deucher, christian.koenig,
	David1.Zhou, airlied, robdclark, joro, shli, kernel,
	fabio.estevam, akpm, Alexey.Brodkin, mhocko, vbabka,
	Vladislav.Zakharov, noamca, yamada.masahiro, sboyd, viresh.kumar,
	linus.walleij, heiko, aik, ruscur, david, fbarrat, alistair, robh,
	joe, harry.wentland, tony.cheng, Wenjing.Liu, airlied, Ding.Wang,
	sylvia.tsai, hersenxs.wu, Rex.Zhu, JinHuiEric.Huang,
	dan.carpenter, architt, daniel.vetter, narmstrong, ville.syrjala,
	jcrouse, aishpant, noralf, andresx7, Monk.Liu, nicolai.haehnle,
	Andrey.Grodzovsky, linux-snps-arc, linux-arm-kernel, kvm-ppc,
	linuxppc-dev, linux-efi, linux-block, amd-gfx, dri-devel,
	linux-arm-msm, freedreno, iommu, linux-raid
In-Reply-To: <20180224085227.GA12996@amd>

On Sat, Feb 24, 2018 at 09:52:27AM +0100, Pavel Machek wrote:
> Hi!
> 
> > > diff --git a/drivers/soc/imx/gpc.c b/drivers/soc/imx/gpc.c
> > > index 53f7275..cfb42f5 100644
> > > --- a/drivers/soc/imx/gpc.c
> > > +++ b/drivers/soc/imx/gpc.c
> > > @@ -348,7 +348,7 @@ static int imx_gpc_old_dt_init(struct device *dev, struct regmap *regmap,
> > >  		if (i == 1) {
> > >  			domain->supply = devm_regulator_get(dev, "pu");
> > >  			if (IS_ERR(domain->supply))
> > > -				return PTR_ERR(domain->supply);;
> > > +				return PTR_ERR(domain->supply);
> > >  
> > >  			ret = imx_pgc_get_clocks(dev, domain);
> > >  			if (ret)
> > > 
> > 
> > Considering the controversy how the changes should be merged, I'm going
> > to send a separate patch just for IMX GPC driver with a reported-by-you
> > tag.  Thanks for catching this.
> 
> That works for me.
> 
> Alternatively... Andrew Morton merged the patch to his -mm tree
> (thanks!), so you don't need to take any action, and it will be
> eventually fixed.

Okay, I'm dropping my patch from IMX tree.

Shawn

^ permalink raw reply

* Re: [PATCH 0/5] PPC32/ioremap: Use memblock API to check for RAM
From: Jonathan Neuschäfer @ 2018-02-24 13:48 UTC (permalink / raw)
  To: Christophe LEROY
  Cc: Jonathan Neuschäfer, linuxppc-dev, linux-kernel,
	Michael Ellerman, linux-mm, Joel Stanley
In-Reply-To: <ca471c17-d2a7-e8e6-2d5a-a5a534e7e6d9@c-s.fr>

[-- Attachment #1: Type: text/plain, Size: 950 bytes --]

On Fri, Feb 23, 2018 at 09:01:17AM +0100, Christophe LEROY wrote:
> 
> 
> Le 22/02/2018 à 13:15, Jonathan Neuschäfer a écrit :
> > This patchset solves the same problem as my previous one[1] but follows
> > a rather different approach. Instead of implementing DISCONTIGMEM for
> > PowerPC32, I simply switched the "is this RAM" check in __ioremap_caller
> > to the existing page_is_ram function, and unified page_is_ram to search
> > memblock.memory on PPC64 and PPC32.
> > 
> > The intended result is, as before, that my Wii can allocate the MMIO
> > range of its GPIO controller, which was previously not possible, because
> > the reserved memory hack (__allow_ioremap_reserved) didn't affect the
> > API in kernel/resource.c.
> > 
> > Thanks to Christophe Leroy for reviewing the previous patchset.
> 
> I tested your new serie, it doesn't break my 8xx so it is OK for me.

Thanks for testing it!


Jonathan Neuschäfer

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply

* Re: [PATCH 1/3] ftrace: Add module to ftrace_make_call() parameters
From: kbuild test robot @ 2018-02-25 11:53 UTC (permalink / raw)
  To: Alexander Sverdlin
  Cc: kbuild-all, Steven Rostedt, Ingo Molnar, linux-arm-kernel,
	linux-kernel, Alexander Sverdlin, Russell King, Catalin Marinas,
	Will Deacon, Steven Miao, Tony Luck, Fenghua Yu, James Hogan,
	Michal Simek, Ralf Baechle, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, Martin Schwidefsky,
	Heiko Carstens, Yoshinori Sato, Rich Felker, David S. Miller,
	Chris Metcalf, Thomas Gleixner, H. Peter Anvin, x86,
	adi-buildroot-devel, linux-ia64, linux-metag, linux-mips,
	linuxppc-dev, linux-s390, linux-sh, sparclinux
In-Reply-To: <20180223165849.16388-2-alexander.sverdlin@nokia.com>

[-- Attachment #1: Type: text/plain, Size: 8111 bytes --]

Hi Alexander,

I love your patch! Yet something to improve:

[auto build test ERROR on tip/perf/core]
[also build test ERROR on v4.16-rc2 next-20180223]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Alexander-Sverdlin/ARM-Implement-MODULE_PLT-support-in-FTRACE/20180225-191957
config: x86_64-randconfig-x011-201808 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All error/warnings (new ones prefixed by >>):

   kernel/trace/ftrace.c: In function 'ftrace_module_enable':
>> kernel/trace/ftrace.c:5851:39: error: passing argument 1 of '__ftrace_replace_code' from incompatible pointer type [-Werror=incompatible-pointer-types]
       int failed = __ftrace_replace_code(rec, 1);
                                          ^~~
   kernel/trace/ftrace.c:2424:1: note: expected 'struct module *' but argument is of type 'struct dyn_ftrace *'
    __ftrace_replace_code(struct module *mod, struct dyn_ftrace *rec, int enable)
    ^~~~~~~~~~~~~~~~~~~~~
>> kernel/trace/ftrace.c:5851:44: warning: passing argument 2 of '__ftrace_replace_code' makes pointer from integer without a cast [-Wint-conversion]
       int failed = __ftrace_replace_code(rec, 1);
                                               ^
   kernel/trace/ftrace.c:2424:1: note: expected 'struct dyn_ftrace *' but argument is of type 'int'
    __ftrace_replace_code(struct module *mod, struct dyn_ftrace *rec, int enable)
    ^~~~~~~~~~~~~~~~~~~~~
>> kernel/trace/ftrace.c:5851:17: error: too few arguments to function '__ftrace_replace_code'
       int failed = __ftrace_replace_code(rec, 1);
                    ^~~~~~~~~~~~~~~~~~~~~
   kernel/trace/ftrace.c:2424:1: note: declared here
    __ftrace_replace_code(struct module *mod, struct dyn_ftrace *rec, int enable)
    ^~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +/__ftrace_replace_code +5851 kernel/trace/ftrace.c

93eb677d Steven Rostedt           2009-04-15  5797  
7dcd182b Jessica Yu               2016-02-16  5798  void ftrace_module_enable(struct module *mod)
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5799) {
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5800) 	struct dyn_ftrace *rec;
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5801) 	struct ftrace_page *pg;
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5802) 
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5803) 	mutex_lock(&ftrace_lock);
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5804) 
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5805) 	if (ftrace_disabled)
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5806) 		goto out_unlock;
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5807) 
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5808) 	/*
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5809) 	 * If the tracing is enabled, go ahead and enable the record.
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5810) 	 *
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5811) 	 * The reason not to enable the record immediatelly is the
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5812) 	 * inherent check of ftrace_make_nop/ftrace_make_call for
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5813) 	 * correct previous instructions.  Making first the NOP
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5814) 	 * conversion puts the module to the correct state, thus
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5815) 	 * passing the ftrace_make_call check.
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5816) 	 *
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5817) 	 * We also delay this to after the module code already set the
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5818) 	 * text to read-only, as we now need to set it back to read-write
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5819) 	 * so that we can modify the text.
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5820) 	 */
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5821) 	if (ftrace_start_up)
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5822) 		ftrace_arch_code_modify_prepare();
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5823) 
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5824) 	do_for_each_ftrace_rec(pg, rec) {
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5825) 		int cnt;
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5826) 		/*
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5827) 		 * do_for_each_ftrace_rec() is a double loop.
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5828) 		 * module text shares the pg. If a record is
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5829) 		 * not part of this module, then skip this pg,
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5830) 		 * which the "break" will do.
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5831) 		 */
3e234289 Steven Rostedt (VMware   2017-03-03  5832) 		if (!within_module_core(rec->ip, mod) &&
3e234289 Steven Rostedt (VMware   2017-03-03  5833) 		    !within_module_init(rec->ip, mod))
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5834) 			break;
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5835) 
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5836) 		cnt = 0;
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5837) 
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5838) 		/*
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5839) 		 * When adding a module, we need to check if tracers are
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5840) 		 * currently enabled and if they are, and can trace this record,
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5841) 		 * we need to enable the module functions as well as update the
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5842) 		 * reference counts for those function records.
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5843) 		 */
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5844) 		if (ftrace_start_up)
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5845) 			cnt += referenced_filters(rec);
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5846) 
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5847) 		/* This clears FTRACE_FL_DISABLED */
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5848) 		rec->flags = cnt;
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5849) 
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5850) 		if (ftrace_start_up && cnt) {
b7ffffbb Steven Rostedt (Red Hat  2016-01-07 @5851) 			int failed = __ftrace_replace_code(rec, 1);
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5852) 			if (failed) {
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5853) 				ftrace_bug(failed, rec);
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5854) 				goto out_loop;
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5855) 			}
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5856) 		}
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5857) 
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5858) 	} while_for_each_ftrace_rec();
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5859) 
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5860)  out_loop:
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5861) 	if (ftrace_start_up)
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5862) 		ftrace_arch_code_modify_post_process();
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5863) 
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5864)  out_unlock:
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5865) 	mutex_unlock(&ftrace_lock);
d7fbf8df Steven Rostedt (VMware   2017-06-26  5866) 
d7fbf8df Steven Rostedt (VMware   2017-06-26  5867) 	process_cached_mods(mod->name);
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5868) }
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5869) 

:::::: The code at line 5851 was first introduced by commit
:::::: b7ffffbb46f205e7727a18bcc7a46c3c2b534f7c ftrace: Add infrastructure for delayed enabling of module functions

:::::: TO: Steven Rostedt (Red Hat) <rostedt@goodmis.org>
:::::: CC: Steven Rostedt <rostedt@goodmis.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 27148 bytes --]

^ permalink raw reply

* Re: [PATCH v12 1/3] mm, powerpc, x86: define VM_PKEY_BITx bits if CONFIG_ARCH_HAS_PKEYS is enabled
From: Aneesh Kumar K.V @ 2018-02-25 11:57 UTC (permalink / raw)
  To: Ram Pai, kbuild test robot
  Cc: kbuild-all, mpe, mingo, akpm, linuxppc-dev, linux-mm, x86,
	linux-arch, linux-kernel, dave.hansen, benh, paulus, khandual,
	bsingharora, hbabu, mhocko, bauerman, ebiederm, corbet, arnd,
	fweimer, msuchanek
In-Reply-To: <20180224010511.GK5559@ram.oc3035372033.ibm.com>



On 02/24/2018 06:35 AM, Ram Pai wrote:
> On Fri, Feb 23, 2018 at 03:11:45PM +0800, kbuild test robot wrote:
>> Hi Ram,
>>
>> Thank you for the patch! Yet something to improve:
>>
>> [auto build test ERROR on linus/master]
>> [also build test ERROR on v4.16-rc2 next-20180222]
>> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
>>
>>          chmod +x ~/bin/make.cross
> ...snip..
>>          # save the attached .config to linux build tree
>>          make.cross ARCH=powerpc
>>
>> Note: the linux-review/Ram-Pai/mm-x86-powerpc-Enhancements-to-Memory-Protection-Keys/20180223-042743 HEAD c5692bca45543c242ffca15c811923e4c548ed19 builds fine.
>>        It only hurts bisectibility.
> 
> oops, it broke git-bisect on powerpc :-(
> The following change will fix it. This should nail it down.
> 
> diff --git a/arch/powerpc/include/asm/pkeys.h
> b/arch/powerpc/include/asm/pkeys.h
> index 0409c80..0b3b669 100644
> --- a/arch/powerpc/include/asm/pkeys.h
> +++ b/arch/powerpc/include/asm/pkeys.h
> @@ -25,6 +25,7 @@
>   # define VM_PKEY_BIT1  VM_HIGH_ARCH_1
>   # define VM_PKEY_BIT2  VM_HIGH_ARCH_2
>   # define VM_PKEY_BIT3  VM_HIGH_ARCH_3
>   # define VM_PKEY_BIT4  VM_HIGH_ARCH_4
> +#elif !defined(VM_PKEY_BIT4)
> +# define VM_PKEY_BIT4  VM_HIGH_ARCH_4
> #endif
> 

Why don't you remove this powerpc definition completely in this patch? 
Also move that comment above #define. The comments are not specific to
BIT1

@@ -231,9 +231,10 @@ extern int overcommit_kbytes_handler(struct 
ctl_table *, int, void __user *,
  #ifdef CONFIG_ARCH_HAS_PKEYS
  # define VM_PKEY_SHIFT	VM_HIGH_ARCH_BIT_0
  # define VM_PKEY_BIT0	VM_HIGH_ARCH_0	/* A protection key is a 4-bit 
value */
-# define VM_PKEY_BIT1	VM_HIGH_ARCH_1
+# define VM_PKEY_BIT1	VM_HIGH_ARCH_1	/* on x86 and 5-bit value on ppc64 
   */
  # define VM_PKEY_BIT2	VM_HIGH_ARCH_2
  # define VM_PKEY_BIT3	VM_HIGH_ARCH_3
+# define VM_PKEY_BIT4	VM_HIGH_ARCH_4
  #endif /* CONFIG_ARCH_HAS_PKEYS */



-aneesh

^ permalink raw reply

* Re: [PATCH 1/3] ftrace: Add module to ftrace_make_call() parameters
From: kbuild test robot @ 2018-02-25 14:57 UTC (permalink / raw)
  To: Alexander Sverdlin
  Cc: kbuild-all, Steven Rostedt, Ingo Molnar, linux-arm-kernel,
	linux-kernel, Alexander Sverdlin, Russell King, Catalin Marinas,
	Will Deacon, Steven Miao, Tony Luck, Fenghua Yu, James Hogan,
	Michal Simek, Ralf Baechle, Benjamin Herrenschmidt,
	Paul Mackerras, Michael Ellerman, Martin Schwidefsky,
	Heiko Carstens, Yoshinori Sato, Rich Felker, David S. Miller,
	Chris Metcalf, Thomas Gleixner, H. Peter Anvin, x86,
	adi-buildroot-devel, linux-ia64, linux-metag, linux-mips,
	linuxppc-dev, linux-s390, linux-sh, sparclinux
In-Reply-To: <20180223165849.16388-2-alexander.sverdlin@nokia.com>

[-- Attachment #1: Type: text/plain, Size: 7929 bytes --]

Hi Alexander,

I love your patch! Perhaps something to improve:

[auto build test WARNING on tip/perf/core]
[also build test WARNING on v4.16-rc2 next-20180223]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Alexander-Sverdlin/ARM-Implement-MODULE_PLT-support-in-FTRACE/20180225-191957
config: i386-randconfig-h1-02251623 (attached as .config)
compiler: gcc-4.9 (Debian 4.9.4-2) 4.9.4
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All warnings (new ones prefixed by >>):

   kernel/trace/ftrace.c: In function 'ftrace_module_enable':
>> kernel/trace/ftrace.c:5851:39: warning: passing argument 1 of '__ftrace_replace_code' from incompatible pointer type
       int failed = __ftrace_replace_code(rec, 1);
                                          ^
   kernel/trace/ftrace.c:2424:1: note: expected 'struct module *' but argument is of type 'struct dyn_ftrace *'
    __ftrace_replace_code(struct module *mod, struct dyn_ftrace *rec, int enable)
    ^
   kernel/trace/ftrace.c:5851:44: warning: passing argument 2 of '__ftrace_replace_code' makes pointer from integer without a cast
       int failed = __ftrace_replace_code(rec, 1);
                                               ^
   kernel/trace/ftrace.c:2424:1: note: expected 'struct dyn_ftrace *' but argument is of type 'int'
    __ftrace_replace_code(struct module *mod, struct dyn_ftrace *rec, int enable)
    ^
   kernel/trace/ftrace.c:5851:17: error: too few arguments to function '__ftrace_replace_code'
       int failed = __ftrace_replace_code(rec, 1);
                    ^
   kernel/trace/ftrace.c:2424:1: note: declared here
    __ftrace_replace_code(struct module *mod, struct dyn_ftrace *rec, int enable)
    ^

vim +/__ftrace_replace_code +5851 kernel/trace/ftrace.c

93eb677d Steven Rostedt           2009-04-15  5797  
7dcd182b Jessica Yu               2016-02-16  5798  void ftrace_module_enable(struct module *mod)
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5799) {
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5800) 	struct dyn_ftrace *rec;
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5801) 	struct ftrace_page *pg;
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5802) 
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5803) 	mutex_lock(&ftrace_lock);
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5804) 
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5805) 	if (ftrace_disabled)
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5806) 		goto out_unlock;
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5807) 
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5808) 	/*
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5809) 	 * If the tracing is enabled, go ahead and enable the record.
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5810) 	 *
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5811) 	 * The reason not to enable the record immediatelly is the
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5812) 	 * inherent check of ftrace_make_nop/ftrace_make_call for
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5813) 	 * correct previous instructions.  Making first the NOP
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5814) 	 * conversion puts the module to the correct state, thus
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5815) 	 * passing the ftrace_make_call check.
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5816) 	 *
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5817) 	 * We also delay this to after the module code already set the
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5818) 	 * text to read-only, as we now need to set it back to read-write
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5819) 	 * so that we can modify the text.
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5820) 	 */
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5821) 	if (ftrace_start_up)
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5822) 		ftrace_arch_code_modify_prepare();
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5823) 
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5824) 	do_for_each_ftrace_rec(pg, rec) {
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5825) 		int cnt;
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5826) 		/*
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5827) 		 * do_for_each_ftrace_rec() is a double loop.
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5828) 		 * module text shares the pg. If a record is
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5829) 		 * not part of this module, then skip this pg,
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5830) 		 * which the "break" will do.
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5831) 		 */
3e234289 Steven Rostedt (VMware   2017-03-03  5832) 		if (!within_module_core(rec->ip, mod) &&
3e234289 Steven Rostedt (VMware   2017-03-03  5833) 		    !within_module_init(rec->ip, mod))
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5834) 			break;
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5835) 
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5836) 		cnt = 0;
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5837) 
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5838) 		/*
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5839) 		 * When adding a module, we need to check if tracers are
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5840) 		 * currently enabled and if they are, and can trace this record,
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5841) 		 * we need to enable the module functions as well as update the
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5842) 		 * reference counts for those function records.
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5843) 		 */
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5844) 		if (ftrace_start_up)
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5845) 			cnt += referenced_filters(rec);
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5846) 
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5847) 		/* This clears FTRACE_FL_DISABLED */
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5848) 		rec->flags = cnt;
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5849) 
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5850) 		if (ftrace_start_up && cnt) {
b7ffffbb Steven Rostedt (Red Hat  2016-01-07 @5851) 			int failed = __ftrace_replace_code(rec, 1);
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5852) 			if (failed) {
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5853) 				ftrace_bug(failed, rec);
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5854) 				goto out_loop;
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5855) 			}
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5856) 		}
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5857) 
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5858) 	} while_for_each_ftrace_rec();
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5859) 
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5860)  out_loop:
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5861) 	if (ftrace_start_up)
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5862) 		ftrace_arch_code_modify_post_process();
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5863) 
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5864)  out_unlock:
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5865) 	mutex_unlock(&ftrace_lock);
d7fbf8df Steven Rostedt (VMware   2017-06-26  5866) 
d7fbf8df Steven Rostedt (VMware   2017-06-26  5867) 	process_cached_mods(mod->name);
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5868) }
b7ffffbb Steven Rostedt (Red Hat  2016-01-07  5869) 

:::::: The code at line 5851 was first introduced by commit
:::::: b7ffffbb46f205e7727a18bcc7a46c3c2b534f7c ftrace: Add infrastructure for delayed enabling of module functions

:::::: TO: Steven Rostedt (Red Hat) <rostedt@goodmis.org>
:::::: CC: Steven Rostedt <rostedt@goodmis.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 28472 bytes --]

^ permalink raw reply

* [PATCH 00/21] powerpc/gamecube: make W=1 compilation errors free
From: Mathieu Malaterre @ 2018-02-25 17:22 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Benjamin Herrenschmidt, Paul Mackerras, Jiri Slaby, linuxppc-dev,
	linux-kernel, Mathieu Malaterre

I started working on warnings treated as error on ppc32. As a first step,
here is a set of patches to make gamecube error free when using W=1:

$ make ARCH=powerpc gamecube_defconfig
$ make -j8 ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu- W=1

Using:

$ powerpc-linux-gnu-gcc --version
powerpc-linux-gnu-gcc (Debian 6.3.0-18) 6.3.0 20170516


Mathieu Malaterre (21):
  powerpc: Remove warning on array size when empty
  powerpc: Move the inline keyword at the beginning of function
    declaration
  powerpc: Mark the variable earlycon_acpi_spcr_enable maybe_unused
  powerpc: Mark both tmp variables as unused
  powerpc: Avoid comparison of unsigned long >= 0 in pfn_valid
  powerpc: Avoid comparison of unsigned long >= 0 in __access_ok
  powerpc: Make functions flipper_pic_init & ug_udbg_putc static
  powerpc: Make function __giveup_fpu static
  powerpc: Make function save_all static
  powerpc: Add missing prototype for slb_miss_bad_addr
  powerpc: Add missing prototype for hdec_interrupt
  powerpc: Add missing prototype for time_init
  powerpc: Add missing prototype for arch_dup_task_struct
  powerpc: Add missing prototype for arch_irq_work_raise
  powerpc: Add missing prototype for MMU_setup
  powerpc: Add missing prototype for init_IRQ
  powerpc: Add missing prototype for sys_debug_setcontext
  powerpc: Add missing prototypes for sys_sigreturn & sys_rt_sigreturn
  powerpc: Add missing prototypes for hw_breakpoint_handler &
    arch_unregister_hw_breakpoint
  powerpc: Add missing prototypes for ppc_select & ppc_fadvise64_64
  powerpc: Add missing prototypes in setup_32.c

 arch/powerpc/include/asm/asm-prototypes.h          | 9 +++++++++
 arch/powerpc/include/asm/hw_breakpoint.h           | 2 ++
 arch/powerpc/include/asm/irq.h                     | 1 +
 arch/powerpc/include/asm/irq_work.h                | 1 +
 arch/powerpc/include/asm/page.h                    | 3 ++-
 arch/powerpc/include/asm/thread_info.h             | 1 +
 arch/powerpc/include/asm/time.h                    | 2 ++
 arch/powerpc/include/asm/uaccess.h                 | 2 +-
 arch/powerpc/kernel/process.c                      | 4 ++--
 arch/powerpc/kernel/prom.c                         | 3 +--
 arch/powerpc/kernel/setup.h                        | 5 +++++
 arch/powerpc/kernel/setup_32.c                     | 2 ++
 arch/powerpc/kernel/signal.h                       | 5 +++++
 arch/powerpc/kernel/signal_32.c                    | 4 ++--
 arch/powerpc/lib/sstep.c                           | 4 ++--
 arch/powerpc/mm/init_32.c                          | 1 +
 arch/powerpc/platforms/embedded6xx/flipper-pic.c   | 2 +-
 arch/powerpc/platforms/embedded6xx/usbgecko_udbg.c | 2 +-
 include/linux/serial_core.h                        | 1 +
 19 files changed, 42 insertions(+), 12 deletions(-)

-- 
2.11.0

^ permalink raw reply

* [PATCH 01/21] powerpc: Remove warning on array size when empty
From: Mathieu Malaterre @ 2018-02-25 17:22 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Benjamin Herrenschmidt, Paul Mackerras, Jiri Slaby, linuxppc-dev,
	linux-kernel, Mathieu Malaterre
In-Reply-To: <20180225172236.29650-1-malat@debian.org>

When neither CONFIG_ALTIVEC, nor CONFIG_VSX or CONFIG_PPC64 is defined, the
array feature_properties is defined as an empty array, which in turn
triggers the following warning (treated as error on W=1):

  CC      arch/powerpc/kernel/prom.o
arch/powerpc/kernel/prom.c: In function ‘check_cpu_feature_properties’:
arch/powerpc/kernel/prom.c:298:16: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
  for (i = 0; i < ARRAY_SIZE(feature_properties); ++i, ++fp) {
                ^
cc1: all warnings being treated as errors

Signed-off-by: Mathieu Malaterre <malat@debian.org>
---
 arch/powerpc/kernel/prom.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 4dffef947b8a..6e8e4122820e 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -291,11 +291,10 @@ static inline void identical_pvr_fixup(unsigned long node)
 
 static void __init check_cpu_feature_properties(unsigned long node)
 {
-	unsigned long i;
 	struct feature_property *fp = feature_properties;
 	const __be32 *prop;
 
-	for (i = 0; i < ARRAY_SIZE(feature_properties); ++i, ++fp) {
+	for (; fp != feature_properties + ARRAY_SIZE(feature_properties); ++fp) {
 		prop = of_get_flat_dt_prop(node, fp->name, NULL);
 		if (prop && be32_to_cpup(prop) >= fp->min_value) {
 			cur_cpu_spec->cpu_features |= fp->cpu_feature;
-- 
2.11.0

^ permalink raw reply related

* [PATCH 02/21] powerpc: Move the inline keyword at the beginning of function declaration
From: Mathieu Malaterre @ 2018-02-25 17:22 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Benjamin Herrenschmidt, Paul Mackerras, Jiri Slaby, linuxppc-dev,
	linux-kernel, Mathieu Malaterre
In-Reply-To: <20180225172236.29650-1-malat@debian.org>

The inline keyword was not at the beginning of the function declaration.
Fix the following warning (treated as error in W=1)

  CC      kernel/sys.o
arch/powerpc/lib/sstep.c:283:1: error: ‘inline’ is not at beginning of declaration [-Werror=old-style-declaration]
 static int nokprobe_inline copy_mem_in(u8 *dest, unsigned long ea, int nb,
 ^~~~~~
arch/powerpc/lib/sstep.c:388:1: error: ‘inline’ is not at beginning of declaration [-Werror=old-style-declaration]
 static int nokprobe_inline copy_mem_out(u8 *dest, unsigned long ea, int nb,
 ^~~~~~
  CC      arch/powerpc/kernel/setup_32.o

Signed-off-by: Mathieu Malaterre <malat@debian.org>
---
 arch/powerpc/lib/sstep.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c
index 70274b7b4773..34d68f1b1b40 100644
--- a/arch/powerpc/lib/sstep.c
+++ b/arch/powerpc/lib/sstep.c
@@ -280,7 +280,7 @@ static nokprobe_inline int read_mem_aligned(unsigned long *dest,
  * Copy from userspace to a buffer, using the largest possible
  * aligned accesses, up to sizeof(long).
  */
-static int nokprobe_inline copy_mem_in(u8 *dest, unsigned long ea, int nb,
+static nokprobe_inline int copy_mem_in(u8 *dest, unsigned long ea, int nb,
 				       struct pt_regs *regs)
 {
 	int err = 0;
@@ -385,7 +385,7 @@ static nokprobe_inline int write_mem_aligned(unsigned long val,
  * Copy from a buffer to userspace, using the largest possible
  * aligned accesses, up to sizeof(long).
  */
-static int nokprobe_inline copy_mem_out(u8 *dest, unsigned long ea, int nb,
+static nokprobe_inline int copy_mem_out(u8 *dest, unsigned long ea, int nb,
 					struct pt_regs *regs)
 {
 	int err = 0;
-- 
2.11.0

^ permalink raw reply related

* [PATCH 03/21] powerpc: Mark the variable earlycon_acpi_spcr_enable maybe_unused
From: Mathieu Malaterre @ 2018-02-25 17:22 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Benjamin Herrenschmidt, Paul Mackerras, Jiri Slaby, linuxppc-dev,
	linux-kernel, Mathieu Malaterre
In-Reply-To: <20180225172236.29650-1-malat@debian.org>

Re-use the object-like macro EARLYCON_USED_OR_UNUSED to mark
`earlycon_acpi_spcr_enable` as maybe_unused.

Fix the following warning (treated as error in W=1)

  CC      arch/powerpc/kernel/setup-common.o
In file included from ./include/linux/serial_8250.h:14:0,
                 from arch/powerpc/kernel/setup-common.c:33:
./include/linux/serial_core.h:382:19: error: ‘earlycon_acpi_spcr_enable’ defined but not used [-Werror=unused-const-variable=]
 static const bool earlycon_acpi_spcr_enable;
                   ^~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Signed-off-by: Mathieu Malaterre <malat@debian.org>
---
 include/linux/serial_core.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index b32df49a3bd5..4d14ecd7dbe8 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -379,6 +379,7 @@ extern int of_setup_earlycon(const struct earlycon_id *match,
 extern bool earlycon_acpi_spcr_enable __initdata;
 int setup_earlycon(char *buf);
 #else
+EARLYCON_USED_OR_UNUSED
 static const bool earlycon_acpi_spcr_enable;
 static inline int setup_earlycon(char *buf) { return 0; }
 #endif
-- 
2.11.0

^ permalink raw reply related

* [PATCH 04/21] powerpc: Mark both tmp variables as unused
From: Mathieu Malaterre @ 2018-02-25 17:22 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Benjamin Herrenschmidt, Paul Mackerras, Jiri Slaby, linuxppc-dev,
	linux-kernel, Mathieu Malaterre
In-Reply-To: <20180225172236.29650-1-malat@debian.org>

Since the value of `tmp` is never intended to be read, declare both `tmp`
variables as unused. Fix warning (treated as error in W=1):

  CC      arch/powerpc/kernel/signal_32.o
arch/powerpc/kernel/signal_32.c: In function ‘sys_swapcontext’:
arch/powerpc/kernel/signal_32.c:1048:16: error: variable ‘tmp’ set but not used [-Werror=unused-but-set-variable]
  unsigned char tmp;
                ^~~
arch/powerpc/kernel/signal_32.c: In function ‘sys_debug_setcontext’:
arch/powerpc/kernel/signal_32.c:1234:16: error: variable ‘tmp’ set but not used [-Werror=unused-but-set-variable]
  unsigned char tmp;
                ^~~
cc1: all warnings being treated as errors

Signed-off-by: Mathieu Malaterre <malat@debian.org>
---
 arch/powerpc/kernel/signal_32.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c
index a46de0035214..492f03451877 100644
--- a/arch/powerpc/kernel/signal_32.c
+++ b/arch/powerpc/kernel/signal_32.c
@@ -1045,7 +1045,7 @@ long sys_swapcontext(struct ucontext __user *old_ctx,
 		     struct ucontext __user *new_ctx,
 		     int ctx_size, int r6, int r7, int r8, struct pt_regs *regs)
 {
-	unsigned char tmp;
+	unsigned char tmp __maybe_unused;
 	int ctx_has_vsx_region = 0;
 
 #ifdef CONFIG_PPC64
@@ -1231,7 +1231,7 @@ int sys_debug_setcontext(struct ucontext __user *ctx,
 {
 	struct sig_dbg_op op;
 	int i;
-	unsigned char tmp;
+	unsigned char tmp __maybe_unused;
 	unsigned long new_msr = regs->msr;
 #ifdef CONFIG_PPC_ADV_DEBUG_REGS
 	unsigned long new_dbcr0 = current->thread.debug.dbcr0;
-- 
2.11.0

^ permalink raw reply related

* [PATCH 05/21] powerpc: Avoid comparison of unsigned long >= 0 in pfn_valid
From: Mathieu Malaterre @ 2018-02-25 17:22 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Benjamin Herrenschmidt, Paul Mackerras, Jiri Slaby, linuxppc-dev,
	linux-kernel, Mathieu Malaterre
In-Reply-To: <20180225172236.29650-1-malat@debian.org>

Rewrite comparison since all values compared are of type `unsigned long`.

Fix a warning (treated as error in W=1):

  CC      arch/powerpc/kernel/irq.o
In file included from ./include/linux/bug.h:5:0,
                 from ./include/linux/cpumask.h:13,
                 from ./include/linux/smp.h:13,
                 from ./include/linux/kernel_stat.h:5,
                 from arch/powerpc/kernel/irq.c:35:
./include/linux/dma-mapping.h: In function ‘dma_map_resource’:
./arch/powerpc/include/asm/page.h:129:32: error: comparison of unsigned expression >= 0 is always true [-Werror=type-limits]
 #define pfn_valid(pfn)  ((pfn) >= ARCH_PFN_OFFSET && (pfn) < max_mapnr)
                                ^
Suggested-by: Segher Boessenkool <segher@kernel.crashing.org>
Signed-off-by: Mathieu Malaterre <malat@debian.org>
---
 arch/powerpc/include/asm/page.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/include/asm/page.h b/arch/powerpc/include/asm/page.h
index 8da5d4c1cab2..19dea64e7ed2 100644
--- a/arch/powerpc/include/asm/page.h
+++ b/arch/powerpc/include/asm/page.h
@@ -126,7 +126,8 @@ extern long long virt_phys_offset;
 
 #ifdef CONFIG_FLATMEM
 #define ARCH_PFN_OFFSET		((unsigned long)(MEMORY_START >> PAGE_SHIFT))
-#define pfn_valid(pfn)		((pfn) >= ARCH_PFN_OFFSET && (pfn) < max_mapnr)
+#define pfn_valid(pfn) \
+		(((pfn) - ARCH_PFN_OFFSET) < (max_mapnr - ARCH_PFN_OFFSET))
 #endif
 
 #define virt_to_pfn(kaddr)	(__pa(kaddr) >> PAGE_SHIFT)
-- 
2.11.0

^ permalink raw reply related

* [PATCH 06/21] powerpc: Avoid comparison of unsigned long >= 0 in __access_ok
From: Mathieu Malaterre @ 2018-02-25 17:22 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Benjamin Herrenschmidt, Paul Mackerras, Jiri Slaby, linuxppc-dev,
	linux-kernel, Mathieu Malaterre
In-Reply-To: <20180225172236.29650-1-malat@debian.org>

Rewrite check size - 1 <= Y as size < Y since `size` is unsigned value.
Fix warning (treated as error in W=1):

  CC      arch/powerpc/kernel/signal_32.o
In file included from ./include/linux/uaccess.h:14:0,
                 from ./include/asm-generic/termios-base.h:8,
                 from ./arch/powerpc/include/asm/termios.h:20,
                 from ./include/uapi/linux/termios.h:6,
                 from ./include/linux/tty.h:7,
                 from arch/powerpc/kernel/signal_32.c:36:
./include/asm-generic/termios-base.h: In function ‘user_termio_to_kernel_termios’:
./arch/powerpc/include/asm/uaccess.h:52:35: error: comparison of unsigned expression >= 0 is always true [-Werror=type-limits]
   (((size) == 0) || (((size) - 1) <= ((segment).seg - (addr)))))
                                   ^
./arch/powerpc/include/asm/uaccess.h:58:3: note: in expansion of macro ‘__access_ok’
   __access_ok((__force unsigned long)(addr), (size), get_fs()))
   ^~~~~~~~~~~
./arch/powerpc/include/asm/uaccess.h:262:6: note: in expansion of macro ‘access_ok’
  if (access_ok(VERIFY_READ, __gu_addr, (size)))   \
      ^~~~~~~~~
./arch/powerpc/include/asm/uaccess.h:80:2: note: in expansion of macro ‘__get_user_check’
  __get_user_check((x), (ptr), sizeof(*(ptr)))
  ^~~~~~~~~~~~~~~~
./include/asm-generic/termios-base.h:36:6: note: in expansion of macro ‘get_user’
  if (get_user(termios->c_line, &termio->c_line) < 0)
      ^~~~~~~~
[...]
cc1: all warnings being treated as errors

Signed-off-by: Mathieu Malaterre <malat@debian.org>
---
 arch/powerpc/include/asm/uaccess.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/include/asm/uaccess.h b/arch/powerpc/include/asm/uaccess.h
index 51bfeb8777f0..fadc406bd39d 100644
--- a/arch/powerpc/include/asm/uaccess.h
+++ b/arch/powerpc/include/asm/uaccess.h
@@ -49,7 +49,7 @@
 
 #define __access_ok(addr, size, segment)	\
 	(((addr) <= (segment).seg) &&		\
-	 (((size) == 0) || (((size) - 1) <= ((segment).seg - (addr)))))
+	 (((size) == 0) || ((size) < ((segment).seg - (addr)))))
 
 #endif
 
-- 
2.11.0

^ permalink raw reply related

* [PATCH 07/21] powerpc: Make functions flipper_pic_init & ug_udbg_putc static
From: Mathieu Malaterre @ 2018-02-25 17:22 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Benjamin Herrenschmidt, Paul Mackerras, Jiri Slaby, linuxppc-dev,
	linux-kernel, Mathieu Malaterre
In-Reply-To: <20180225172236.29650-1-malat@debian.org>

Change signature of two functions, adding static keyword to prevent the
following two warnings (treated as errors on W=1):

  CC      kernel/sys.o
arch/powerpc/platforms/embedded6xx/flipper-pic.c:135:28: error: no previous prototype for ‘flipper_pic_init’ [-Werror=missing-prototypes]
 struct irq_domain * __init flipper_pic_init(struct device_node *np)
                            ^~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

and

  CC      arch/powerpc/platforms/embedded6xx/usbgecko_udbg.o
arch/powerpc/platforms/embedded6xx/usbgecko_udbg.c:172:6: error: no previous prototype for ‘ug_udbg_putc’ [-Werror=missing-prototypes]
 void ug_udbg_putc(char ch)
      ^~~~~~~~~~~~
cc1: all warnings being treated as errors

Signed-off-by: Mathieu Malaterre <malat@debian.org>
---
 arch/powerpc/platforms/embedded6xx/flipper-pic.c   | 2 +-
 arch/powerpc/platforms/embedded6xx/usbgecko_udbg.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/embedded6xx/flipper-pic.c b/arch/powerpc/platforms/embedded6xx/flipper-pic.c
index ade83829d5e8..7206f3f573d4 100644
--- a/arch/powerpc/platforms/embedded6xx/flipper-pic.c
+++ b/arch/powerpc/platforms/embedded6xx/flipper-pic.c
@@ -132,7 +132,7 @@ static void __flipper_quiesce(void __iomem *io_base)
 	out_be32(io_base + FLIPPER_ICR, 0xffffffff);
 }
 
-struct irq_domain * __init flipper_pic_init(struct device_node *np)
+static struct irq_domain * __init flipper_pic_init(struct device_node *np)
 {
 	struct device_node *pi;
 	struct irq_domain *irq_domain = NULL;
diff --git a/arch/powerpc/platforms/embedded6xx/usbgecko_udbg.c b/arch/powerpc/platforms/embedded6xx/usbgecko_udbg.c
index 7feb325b636b..5c7e7ce6dbab 100644
--- a/arch/powerpc/platforms/embedded6xx/usbgecko_udbg.c
+++ b/arch/powerpc/platforms/embedded6xx/usbgecko_udbg.c
@@ -169,7 +169,7 @@ static int ug_getc(void)
 /*
  * Transmits a character.
  */
-void ug_udbg_putc(char ch)
+static void ug_udbg_putc(char ch)
 {
 	ug_putc(ch);
 }
-- 
2.11.0

^ permalink raw reply related

* [PATCH 08/21] powerpc: Make function __giveup_fpu static
From: Mathieu Malaterre @ 2018-02-25 17:22 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Benjamin Herrenschmidt, Paul Mackerras, Jiri Slaby, linuxppc-dev,
	linux-kernel, Mathieu Malaterre
In-Reply-To: <20180225172236.29650-1-malat@debian.org>

When CONFIG_PPC_FPU is defined the prototype exposed in asm/switch_to.h is:

  extern void giveup_fpu(struct task_struct *);

Change the function prototype of __giveup_fpu to static. Fix warning
(treated as error in W=1):

  CC      arch/powerpc/kernel/process.o
arch/powerpc/kernel/process.c:176:6: error: no previous prototype for ‘__giveup_fpu’ [-Werror=missing-prototypes]
 void __giveup_fpu(struct task_struct *tsk)
      ^~~~~~~~~~~~
cc1: all warnings being treated as errors

Signed-off-by: Mathieu Malaterre <malat@debian.org>
---
 arch/powerpc/kernel/process.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 1738c4127b32..3ac98c0463d6 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -173,7 +173,7 @@ void __msr_check_and_clear(unsigned long bits)
 EXPORT_SYMBOL(__msr_check_and_clear);
 
 #ifdef CONFIG_PPC_FPU
-void __giveup_fpu(struct task_struct *tsk)
+static void __giveup_fpu(struct task_struct *tsk)
 {
 	unsigned long msr;
 
-- 
2.11.0

^ permalink raw reply related

* [PATCH 09/21] powerpc: Make function save_all static
From: Mathieu Malaterre @ 2018-02-25 17:22 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Benjamin Herrenschmidt, Paul Mackerras, Jiri Slaby, linuxppc-dev,
	linux-kernel, Mathieu Malaterre
In-Reply-To: <20180225172236.29650-1-malat@debian.org>

Since function `save_all` is not meant to be exported, change the signature
to `static`. Fix warning (treated as error with W=1):

  CC      arch/powerpc/kernel/process.o
arch/powerpc/kernel/process.c:559:6: error: no previous prototype for ‘save_all’ [-Werror=missing-prototypes]
 void save_all(struct task_struct *tsk)
      ^~~~~~~~
cc1: all warnings being treated as errors

Signed-off-by: Mathieu Malaterre <malat@debian.org>
---
 arch/powerpc/kernel/process.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 3ac98c0463d6..ec4f363ebb89 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -556,7 +556,7 @@ void restore_math(struct pt_regs *regs)
 	regs->msr = msr;
 }
 
-void save_all(struct task_struct *tsk)
+static void save_all(struct task_struct *tsk)
 {
 	unsigned long usermsr;
 
-- 
2.11.0

^ permalink raw reply related

* [PATCH 10/21] powerpc: Add missing prototype for slb_miss_bad_addr
From: Mathieu Malaterre @ 2018-02-25 17:22 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Benjamin Herrenschmidt, Paul Mackerras, Jiri Slaby, linuxppc-dev,
	linux-kernel, Mathieu Malaterre
In-Reply-To: <20180225172236.29650-1-malat@debian.org>

In commit f0f558b131db ("powerpc/mm: Preserve CFAR value on SLB miss caused
by access to bogus address"), the function slb_miss_bad_addr was added
without a prototype. This commit adds it.

Fix a warning (treated as error in W=1):

  CC      arch/powerpc/kernel/traps.o
arch/powerpc/kernel/traps.c:1498:6: error: no previous prototype for ‘slb_miss_bad_addr’ [-Werror=missing-prototypes]
 void slb_miss_bad_addr(struct pt_regs *regs)
      ^~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Signed-off-by: Mathieu Malaterre <malat@debian.org>
---
 arch/powerpc/include/asm/asm-prototypes.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/include/asm/asm-prototypes.h b/arch/powerpc/include/asm/asm-prototypes.h
index 7330150bfe34..0af1925e30db 100644
--- a/arch/powerpc/include/asm/asm-prototypes.h
+++ b/arch/powerpc/include/asm/asm-prototypes.h
@@ -62,6 +62,7 @@ void RunModeException(struct pt_regs *regs);
 void single_step_exception(struct pt_regs *regs);
 void program_check_exception(struct pt_regs *regs);
 void alignment_exception(struct pt_regs *regs);
+void slb_miss_bad_addr(struct pt_regs *regs);
 void StackOverflow(struct pt_regs *regs);
 void nonrecoverable_exception(struct pt_regs *regs);
 void kernel_fp_unavailable_exception(struct pt_regs *regs);
-- 
2.11.0

^ permalink raw reply related

* [PATCH 11/21] powerpc: Add missing prototype for hdec_interrupt
From: Mathieu Malaterre @ 2018-02-25 17:22 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Benjamin Herrenschmidt, Paul Mackerras, Jiri Slaby, linuxppc-dev,
	linux-kernel, Mathieu Malaterre
In-Reply-To: <20180225172236.29650-1-malat@debian.org>

In commit dabe859ec636 ("powerpc: Give hypervisor decrementer interrupts
their own handler") an empty body function was added, but no prototype was
declared. Fix warning (treated as error in W=1):

  CC      arch/powerpc/kernel/time.o
arch/powerpc/kernel/time.c:629:6: error: no previous prototype for ‘hdec_interrupt’ [-Werror=missing-prototypes]
 void hdec_interrupt(struct pt_regs *regs)
      ^~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Signed-off-by: Mathieu Malaterre <malat@debian.org>
---
 arch/powerpc/include/asm/time.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/include/asm/time.h b/arch/powerpc/include/asm/time.h
index b240666b7bc1..a7a8a9ac5991 100644
--- a/arch/powerpc/include/asm/time.h
+++ b/arch/powerpc/include/asm/time.h
@@ -31,6 +31,7 @@ extern void to_tm(int tim, struct rtc_time * tm);
 extern void tick_broadcast_ipi_handler(void);
 
 extern void generic_calibrate_decr(void);
+extern void hdec_interrupt(struct pt_regs *regs);
 
 /* Some sane defaults: 125 MHz timebase, 1GHz processor */
 extern unsigned long ppc_proc_freq;
-- 
2.11.0

^ permalink raw reply related

* [PATCH 12/21] powerpc: Add missing prototype for time_init
From: Mathieu Malaterre @ 2018-02-25 17:22 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Benjamin Herrenschmidt, Paul Mackerras, Jiri Slaby, linuxppc-dev,
	linux-kernel, Mathieu Malaterre
In-Reply-To: <20180225172236.29650-1-malat@debian.org>

The function time_init did not have a prototype defined in the time.h
header. Fix the following warning (treated as error in W=1):

  CC      arch/powerpc/kernel/time.o
arch/powerpc/kernel/time.c:1068:13: error: no previous prototype for ‘time_init’ [-Werror=missing-prototypes]
 void __init time_init(void)
             ^~~~~~~~~
cc1: all warnings being treated as errors

Signed-off-by: Mathieu Malaterre <malat@debian.org>
---
 arch/powerpc/include/asm/time.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/include/asm/time.h b/arch/powerpc/include/asm/time.h
index a7a8a9ac5991..828ebe7ba7dc 100644
--- a/arch/powerpc/include/asm/time.h
+++ b/arch/powerpc/include/asm/time.h
@@ -205,6 +205,7 @@ struct cpu_usage {
 DECLARE_PER_CPU(struct cpu_usage, cpu_usage_array);
 
 extern void secondary_cpu_time_init(void);
+extern void __init time_init(void);
 
 DECLARE_PER_CPU(u64, decrementers_next_tb);
 
-- 
2.11.0

^ permalink raw reply related

* [PATCH 13/21] powerpc: Add missing prototype for arch_dup_task_struct
From: Mathieu Malaterre @ 2018-02-25 17:22 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Benjamin Herrenschmidt, Paul Mackerras, Jiri Slaby, linuxppc-dev,
	linux-kernel, Mathieu Malaterre
In-Reply-To: <20180225172236.29650-1-malat@debian.org>

In commit 55ccf3fe3f9a ("fork: move the real prepare_to_copy() users to
arch_dup_task_struct()") a new arch_dup_task_struct was added without a
prototype declared in thread_info.h header. Fix the following warning
(treated as error in W=1):

  CC      arch/powerpc/kernel/process.o
arch/powerpc/kernel/process.c:1609:5: error: no previous prototype for ‘arch_dup_task_struct’ [-Werror=missing-prototypes]
 int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
     ^~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Signed-off-by: Mathieu Malaterre <malat@debian.org>
---
 arch/powerpc/include/asm/thread_info.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/include/asm/thread_info.h b/arch/powerpc/include/asm/thread_info.h
index 4a12c00f8de3..5964145db03d 100644
--- a/arch/powerpc/include/asm/thread_info.h
+++ b/arch/powerpc/include/asm/thread_info.h
@@ -70,6 +70,7 @@ static inline struct thread_info *current_thread_info(void)
 	return (struct thread_info *)val;
 }
 
+extern int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src);
 #endif /* __ASSEMBLY__ */
 
 /*
-- 
2.11.0

^ permalink raw reply related

* [PATCH 14/21] powerpc: Add missing prototype for arch_irq_work_raise
From: Mathieu Malaterre @ 2018-02-25 17:22 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Benjamin Herrenschmidt, Paul Mackerras, Jiri Slaby, linuxppc-dev,
	linux-kernel, Mathieu Malaterre
In-Reply-To: <20180225172236.29650-1-malat@debian.org>

In commit 4f8b50bbbe63 ("irq_work, ppc: Fix up arch hooks") a new function
arch_irq_work_raise was added without a prototype in header irq_work.h.

Fix the following warning (treated as error in W=1):

  CC      arch/powerpc/kernel/time.o
arch/powerpc/kernel/time.c:523:6: error: no previous prototype for ‘arch_irq_work_raise’ [-Werror=missing-prototypes]
 void arch_irq_work_raise(void)
      ^~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Signed-off-by: Mathieu Malaterre <malat@debian.org>
---
 arch/powerpc/include/asm/irq_work.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/include/asm/irq_work.h b/arch/powerpc/include/asm/irq_work.h
index c6d3078bd8c3..b8b0be8f1a07 100644
--- a/arch/powerpc/include/asm/irq_work.h
+++ b/arch/powerpc/include/asm/irq_work.h
@@ -6,5 +6,6 @@ static inline bool arch_irq_work_has_interrupt(void)
 {
 	return true;
 }
+extern void arch_irq_work_raise(void);
 
 #endif /* _ASM_POWERPC_IRQ_WORK_H */
-- 
2.11.0

^ permalink raw reply related

* [PATCH 15/21] powerpc: Add missing prototype for MMU_setup
From: Mathieu Malaterre @ 2018-02-25 17:22 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Benjamin Herrenschmidt, Paul Mackerras, Jiri Slaby, linuxppc-dev,
	linux-kernel, Mathieu Malaterre
In-Reply-To: <20180225172236.29650-1-malat@debian.org>

Add a function declaration for MMU_setup at the beginning of the file to
fix a warning (treated as error in W=1):

  CC      kernel/sys.o
arch/powerpc/mm/init_32.c:102:13: error: no previous prototype for ‘MMU_setup’ [-Werror=missing-prototypes]
 void __init MMU_setup(void)
             ^~~~~~~~~
cc1: all warnings being treated as errors

Signed-off-by: Mathieu Malaterre <malat@debian.org>
---
 arch/powerpc/mm/init_32.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/mm/init_32.c b/arch/powerpc/mm/init_32.c
index 6419b33ca309..e88bcad9a63b 100644
--- a/arch/powerpc/mm/init_32.c
+++ b/arch/powerpc/mm/init_32.c
@@ -79,6 +79,7 @@ EXPORT_SYMBOL(agp_special_page);
 #endif
 
 void MMU_init(void);
+void __init MMU_setup(void);
 
 /*
  * this tells the system to map all of ram with the segregs
-- 
2.11.0

^ permalink raw reply related

* [PATCH 16/21] powerpc: Add missing prototype for init_IRQ
From: Mathieu Malaterre @ 2018-02-25 17:22 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Benjamin Herrenschmidt, Paul Mackerras, Jiri Slaby, linuxppc-dev,
	linux-kernel, Mathieu Malaterre
In-Reply-To: <20180225172236.29650-1-malat@debian.org>

A function init_IRQ was added without a prototype declared in header irq.h.
Fix the following warning (treated as error in W=1):

  CC      arch/powerpc/kernel/irq.o
arch/powerpc/kernel/irq.c:662:13: error: no previous prototype for ‘init_IRQ’ [-Werror=missing-prototypes]
 void __init init_IRQ(void)
             ^~~~~~~~
cc1: all warnings being treated as errors

Signed-off-by: Mathieu Malaterre <malat@debian.org>
---
 arch/powerpc/include/asm/irq.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/include/asm/irq.h b/arch/powerpc/include/asm/irq.h
index e8e3a0a04eb0..ee39ce56b2a2 100644
--- a/arch/powerpc/include/asm/irq.h
+++ b/arch/powerpc/include/asm/irq.h
@@ -66,6 +66,7 @@ extern void irq_ctx_init(void);
 extern void call_do_softirq(struct thread_info *tp);
 extern void call_do_irq(struct pt_regs *regs, struct thread_info *tp);
 extern void do_IRQ(struct pt_regs *regs);
+extern void __init init_IRQ(void);
 extern void __do_irq(struct pt_regs *regs);
 
 int irq_choose_cpu(const struct cpumask *mask);
-- 
2.11.0

^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox