LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] powerpc/mm: Fix hugetlb_free_pmd_range() and hugetlb_free_pud_range()
From: Michael Ellerman @ 2020-12-21 11:03 UTC (permalink / raw)
  To: Christophe Leroy, Benjamin Herrenschmidt, Michael Ellerman, qcai,
	Paul Mackerras
  Cc: linuxppc-dev, linux-kernel
In-Reply-To: <56feccd7b6fcd98e353361a233fa7bb8e67c3164.1607780469.git.christophe.leroy@csgroup.eu>

On Sat, 12 Dec 2020 13:41:25 +0000 (UTC), Christophe Leroy wrote:
> Commit 7bfe54b5f165 ("powerpc/mm: Refactor the floor/ceiling check in
> hugetlb range freeing functions") inadvertely removed the mask
> applied to start parameter in those two functions, leading to the
> following crash on power9.
> 
> [ 7703.114640][T58070] LTP: starting hugemmap05_1 (hugemmap05 -m)
> [ 7703.157792][   C99] ------------[ cut here ]------------
> [ 7703.158279][   C99] kernel BUG at arch/powerpc/mm/book3s64/pgtable.c:387!
> [ 7703.158306][   C99] Oops: Exception in kernel mode, sig: 5 [#1]
> [ 7703.158330][   C99] LE PAGE_SIZE=64K MMU=Radix SMP NR_CPUS=256 NUMA PowerNV
> [ 7703.158343][   C99] Modules linked in: vfio_pci vfio_virqfd vfio_iommu_spapr_tce vfio vfio_spapr_eeh loop kvm_hv kvm ip_tables x_tables sd_mod ahci libahci tg3 libata firmware_class libphy dm_mirror dm_region_hash dm_log dm_mod [last unloaded: dummy_del_mod]
> [ 7703.158435][   C99] CPU: 99 PID: 308 Comm: ksoftirqd/99 Tainted: G           O      5.10.0-rc7-next-20201211 #1
> [ 7703.158464][   C99] NIP:  c00000000005dbec LR: c0000000003352f4 CTR: 0000000000000000
> [ 7703.158489][   C99] REGS: c00020000bb6f830 TRAP: 0700   Tainted: G           O       (5.10.0-rc7-next-20201211)
> [ 7703.158528][   C99] MSR:  900000000282b033 <SF,HV,VEC,VSX,EE,FP,ME,IR,DR,RI,LE>  CR: 24002284  XER: 20040000
> [ 7703.158570][   C99] GPR00: c0000000003352f4 c00020000bb6fad0 c000000007f70b00 c0002000385b3ff0
> [ 7703.158570][   C99] GPR04: 0000000000000000 0000000000000003 c00020000bb6f8b4 0000000000000001
> [ 7703.158570][   C99] GPR08: 0000000000000001 0000000000000009 0000000000000008 0000000000000002
> [ 7703.158570][   C99] GPR12: 0000000024002488 c000201fff649c00 c000000007f2a20c 0000000000000000
> [ 7703.158570][   C99] GPR16: 0000000000000007 0000000000000000 c000000000194d10 c000000000194d10
> [ 7703.158570][   C99] GPR24: 0000000000000014 0000000000000015 c000201cc6e72398 c000000007fac4b4
> [ 7703.158570][   C99] GPR28: c000000007f2bf80 c000000007fac2f8 0000000000000008 c000200033870000
> [ 7703.158766][   C99] NIP [c00000000005dbec] __tlb_remove_table+0x1dc/0x1e0
> pgtable_free at arch/powerpc/mm/book3s64/pgtable.c:387
> (inlined by) __tlb_remove_table at arch/powerpc/mm/book3s64/pgtable.c:405
> [ 7703.158805][   C99] LR [c0000000003352f4] tlb_remove_table_rcu+0x54/0xa0
> [ 7703.158853][   C99] Call Trace:
> [ 7703.158872][   C99] [c00020000bb6fad0] [c00000000005db4c] __tlb_remove_table+0x13c/0x1e0 (unreliable)
> [ 7703.158890][   C99] [c00020000bb6fb00] [c0000000003352f4] tlb_remove_table_rcu+0x54/0xa0
> __tlb_remove_table_free at mm/mmu_gather.c:101
> (inlined by) tlb_remove_table_rcu at mm/mmu_gather.c:156
> [ 7703.158927][   C99] [c00020000bb6fb30] [c000000000194d7c] rcu_core+0x35c/0xbb0
> rcu_do_batch at kernel/rcu/tree.c:2502
> (inlined by) rcu_core at kernel/rcu/tree.c:2737
> [ 7703.158966][   C99] [c00020000bb6fbf0] [c00000000095a3d0] __do_softirq+0x480/0x704
> [ 7703.159006][   C99] [c00020000bb6fd10] [c0000000000cc1f4] run_ksoftirqd+0x74/0xd0
> run_ksoftirqd at kernel/softirq.c:651
> (inlined by) run_ksoftirqd at kernel/softirq.c:642
> [ 7703.159046][   C99] [c00020000bb6fd30] [c0000000001040c8] smpboot_thread_fn+0x278/0x320
> [ 7703.159096][   C99] [c00020000bb6fda0] [c0000000000fc8a4] kthread+0x1c4/0x1d0
> [ 7703.159145][   C99] [c00020000bb6fe10] [c00000000000d9fc] ret_from_kernel_thread+0x5c/0x80
> [ 7703.159183][   C99] Instruction dump:
> [ 7703.159204][   C99] 60000000 7c0802a6 3c82f8b4 7fe3fb78 38847470 f8010040 482b4fc5 60000000
> [ 7703.159248][   C99] 0fe00000 7c0802a6 fbe10028 f8010040 <0fe00000> 3c4c07f1 38422f10 7c0802a6
> [ 7703.159293][   C99] ---[ end trace 1d92a5231ba6a0d5 ]---
> 
> [...]

Applied to powerpc/next.

[1/1] powerpc/mm: Fix hugetlb_free_pmd_range() and hugetlb_free_pud_range()
      https://git.kernel.org/powerpc/c/2198d4934ee8b81341a84c9ec8bb25b4b0d02522

cheers

^ permalink raw reply

* Re: [PATCH] powerpc: force inlining of csum_partial() to avoid multiple csum_partial() with GCC10
From: Michael Ellerman @ 2020-12-21 11:03 UTC (permalink / raw)
  To: Christophe Leroy, Paul Mackerras, Benjamin Herrenschmidt,
	Michael Ellerman
  Cc: linuxppc-dev, linux-kernel
In-Reply-To: <a1d31f84ddb0926813b17fcd5cc7f3fa7b4deac2.1602759123.git.christophe.leroy@csgroup.eu>

On Thu, 15 Oct 2020 10:52:20 +0000 (UTC), Christophe Leroy wrote:
> 	ppc-linux-objdump -d vmlinux | grep -e "<csum_partial>" -e "<__csum_partial>"
> 
> With gcc9 I get:
> 
> 	c0017ef8 <__csum_partial>:
> 	c00182fc:	4b ff fb fd 	bl      c0017ef8 <__csum_partial>
> 	c0018478:	4b ff fa 80 	b       c0017ef8 <__csum_partial>
> 	c03e8458:	4b c2 fa a0 	b       c0017ef8 <__csum_partial>
> 	c03e8518:	4b c2 f9 e1 	bl      c0017ef8 <__csum_partial>
> 	c03ef410:	4b c2 8a e9 	bl      c0017ef8 <__csum_partial>
> 	c03f0b24:	4b c2 73 d5 	bl      c0017ef8 <__csum_partial>
> 	c04279a4:	4b bf 05 55 	bl      c0017ef8 <__csum_partial>
> 	c0429820:	4b be e6 d9 	bl      c0017ef8 <__csum_partial>
> 	c0429944:	4b be e5 b5 	bl      c0017ef8 <__csum_partial>
> 	c042b478:	4b be ca 81 	bl      c0017ef8 <__csum_partial>
> 	c042b554:	4b be c9 a5 	bl      c0017ef8 <__csum_partial>
> 	c045f15c:	4b bb 8d 9d 	bl      c0017ef8 <__csum_partial>
> 	c0492190:	4b b8 5d 69 	bl      c0017ef8 <__csum_partial>
> 	c0492310:	4b b8 5b e9 	bl      c0017ef8 <__csum_partial>
> 	c0495594:	4b b8 29 65 	bl      c0017ef8 <__csum_partial>
> 	c049c420:	4b b7 ba d9 	bl      c0017ef8 <__csum_partial>
> 	c049c870:	4b b7 b6 89 	bl      c0017ef8 <__csum_partial>
> 	c049c930:	4b b7 b5 c9 	bl      c0017ef8 <__csum_partial>
> 	c04a9ca0:	4b b6 e2 59 	bl      c0017ef8 <__csum_partial>
> 	c04bdde4:	4b b5 a1 15 	bl      c0017ef8 <__csum_partial>
> 	c04be480:	4b b5 9a 79 	bl      c0017ef8 <__csum_partial>
> 	c04be710:	4b b5 97 e9 	bl      c0017ef8 <__csum_partial>
> 	c04c969c:	4b b4 e8 5d 	bl      c0017ef8 <__csum_partial>
> 	c04ca2fc:	4b b4 db fd 	bl      c0017ef8 <__csum_partial>
> 	c04cf5bc:	4b b4 89 3d 	bl      c0017ef8 <__csum_partial>
> 	c04d0440:	4b b4 7a b9 	bl      c0017ef8 <__csum_partial>
> 
> [...]

Applied to powerpc/next.

[1/1] powerpc: force inlining of csum_partial() to avoid multiple csum_partial() with GCC10
      https://git.kernel.org/powerpc/c/328e7e487a464aad024fbde6663b7859df082b7b

cheers

^ permalink raw reply

* Re: [PATCH] powerpc/powernv: Rate limit opal-elog read failure message
From: Michael Ellerman @ 2020-12-21 11:03 UTC (permalink / raw)
  To: Andrew Donnellan, linuxppc-dev; +Cc: aneesh.kumar, mahesh, hegdevasant
In-Reply-To: <20201211021140.28402-1-ajd@linux.ibm.com>

On Fri, 11 Dec 2020 13:11:41 +1100, Andrew Donnellan wrote:
> Sometimes we can't read an error log from OPAL, and we print an error
> message accordingly. But the OPAL userspace tools seem to like retrying a
> lot, in which case we flood the kernel log with a lot of messages.
> 
> Change pr_err() to pr_err_ratelimited() to help with this.

Applied to powerpc/next.

[1/1] powerpc/powernv: Rate limit opal-elog read failure message
      https://git.kernel.org/powerpc/c/c88017cf2af614409da69934c1738ed5ff2f7022

cheers

^ permalink raw reply

* Re: [PATCH V3] powerpc/perf: Fix Threshold Event Counter Multiplier width for P10
From: Michael Ellerman @ 2020-12-21 11:03 UTC (permalink / raw)
  To: Athira Rajeev, mpe; +Cc: maddy, linuxppc-dev
In-Reply-To: <1608022578-1532-1-git-send-email-atrajeev@linux.vnet.ibm.com>

On Tue, 15 Dec 2020 03:56:18 -0500, Athira Rajeev wrote:
> Threshold Event Counter Multiplier (TECM) is part of Monitor Mode
> Control Register A (MMCRA). This field along with Threshold Event
> Counter Exponent (TECE) is used to get threshould counter value.
> In Power10, this is a 8bit field, so patch fixes the
> current code to modify the MMCRA[TECM] extraction macro to
> handle this change. ISA v3.1 says this is a 7 bit field but
> POWER10 it's actually 8 bits which will hopefully be fixed
> in ISA v3.1 update.

Applied to powerpc/next.

[1/1] powerpc/perf: Fix Threshold Event Counter Multiplier width for P10
      https://git.kernel.org/powerpc/c/ef0e3b650f8ddc54bb70868852f50642ee3ae765

cheers

^ permalink raw reply

* Re: [PATCH 01/23] kernel: irq: irqdescs: warn on spurious IRQ
From: Andy Shevchenko @ 2020-12-21  9:27 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Mark Rutland, Rich Felker, Catalin Marinas, Linux-SH,
	Alexander Shishkin, Linus Walleij, linux-mips, James Bottomley,
	Paul Mackerras, H. Peter Anvin, sparclinux, linux-ia64,
	Will Deacon, gerg, Linux-Arch, linux-s390, linux-c6x-dev,
	Yoshinori Sato, Jiri Olsa, Helge Deller,
	maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT),
	Bartosz Golaszewski, Tony Lindgren, Geert Uytterhoeven, msalter,
	Arnd Bergmann, linux-alpha, jacquiot.aurelien,
	open list:GPIO SUBSYSTEM, linux-m68k, Borislav Petkov,
	Namhyung Kim, Thomas Gleixner, Linux OMAP Mailing List,
	Thomas Bogendoerfer, linux-parisc,
	open list:LINUX FOR POWERPC PA SEMI PWRFICIENT,
	Linux Kernel Mailing List, Marc Zyngier,
	Enrico Weigelt, metux IT consult, David S. Miller
In-Reply-To: <87ft3zyaqa.fsf@mpe.ellerman.id.au>

On Mon, Dec 21, 2020 at 7:44 AM Michael Ellerman <mpe@ellerman.id.au> wrote:
> Andy Shevchenko <andy.shevchenko@gmail.com> writes:
> > On Fri, Dec 18, 2020 at 4:37 PM Enrico Weigelt, metux IT consult
> > <info@metux.net> wrote:
> >
> >> +               if (printk_ratelimit())
> >> +                       pr_warn("spurious IRQ: irq=%d hwirq=%d nr_irqs=%d\n",
> >> +                               irq, hwirq, nr_irqs);
> >
> > Perhaps you missed pr_warn_ratelimit() macro which is already in the
> > kernel for a long time.
>
> pr_warn_ratelimited() which calls printk_ratelimited().

I stand corrected.
Right, that's what I had in mind (actually didn't know that there are variants).

Thanks!

> And see the comment above printk_ratelimit():
>
> /*
>  * Please don't use printk_ratelimit(), because it shares ratelimiting state
>  * with all other unrelated printk_ratelimit() callsites.  Instead use
>  * printk_ratelimited() or plain old __ratelimit().
>  */


-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply

* Re: [PATCH v2] powerpc/perf/hv-24x7: Dont create sysfs event files for dummy events
From: kajoljain @ 2020-12-21  9:02 UTC (permalink / raw)
  To: Michael Ellerman, linuxppc-dev; +Cc: suka, maddy, atrajeev
In-Reply-To: <87im8vyawb.fsf@mpe.ellerman.id.au>



On 12/21/20 11:10 AM, Michael Ellerman wrote:
> Kajol Jain <kjain@linux.ibm.com> writes:
>> hv_24x7 performance monitoring unit creates list of supported events
>> from the event catalog obtained via HCALL. hv_24x7 catalog could also
>> contain invalid or dummy events (with names like FREE_* or CPM_FREE_*
>> and RESERVED*). These events do not have any hardware counters
>> backing them. So patch adds a check to string compare the event names
>> to filter out them.
>>
>> Result in power9 machine:
>>
>> Before this patch:
>> .....
>>   hv_24x7/PM_XLINK2_OUT_ODD_CYC,chip=?/              [Kernel PMU event]
>>   hv_24x7/PM_XLINK2_OUT_ODD_DATA_COUNT,chip=?/       [Kernel PMU event]
>>   hv_24x7/PM_XLINK2_OUT_ODD_TOTAL_UTIL,chip=?/       [Kernel PMU event]
>>   hv_24x7/PM_XTS_ATR_DEMAND_CHECKOUT,chip=?/         [Kernel PMU event]
>>   hv_24x7/PM_XTS_ATR_DEMAND_CHECKOUT_MISS,chip=?/    [Kernel PMU event]
>>   hv_24x7/PM_XTS_ATSD_SENT,chip=?/                   [Kernel PMU event]
>>   hv_24x7/PM_XTS_ATSD_TLBI_RCV,chip=?/               [Kernel PMU event]
>>   hv_24x7/RESERVED_NEST1,chip=?/                     [Kernel PMU event]
>>   hv_24x7/RESERVED_NEST10,chip=?/                    [Kernel PMU event]
>>   hv_24x7/RESERVED_NEST11,chip=?/                    [Kernel PMU event]
>>   hv_24x7/RESERVED_NEST12,chip=?/                    [Kernel PMU event]
>>   hv_24x7/RESERVED_NEST13,chip=?/                    [Kernel PMU event]
>> ......
>>
>> Dmesg:
>> [    0.000362] printk: console [hvc0] enabled
>> [    0.815452] hv-24x7: read 1530 catalog entries, created 537 event attrs
>> (0 failures), 275 descs
>>
>> After this patch:
>> ......
>>   hv_24x7/PM_XLINK2_OUT_ODD_AVLBL_CYC,chip=?/        [Kernel PMU event]
>>   hv_24x7/PM_XLINK2_OUT_ODD_CYC,chip=?/              [Kernel PMU event]
>>   hv_24x7/PM_XLINK2_OUT_ODD_DATA_COUNT,chip=?/       [Kernel PMU event]
>>   hv_24x7/PM_XLINK2_OUT_ODD_TOTAL_UTIL,chip=?/       [Kernel PMU event]
>>   hv_24x7/PM_XTS_ATR_DEMAND_CHECKOUT,chip=?/         [Kernel PMU event]
>>   hv_24x7/PM_XTS_ATR_DEMAND_CHECKOUT_MISS,chip=?/    [Kernel PMU event]
>>   hv_24x7/PM_XTS_ATSD_SENT,chip=?/                   [Kernel PMU event]
>>   hv_24x7/PM_XTS_ATSD_TLBI_RCV,chip=?/               [Kernel PMU event]
>>   hv_24x7/TOD,chip=?/                                [Kernel PMU event]
>> ......
>>
>> Demsg:
>> [    0.000357] printk: console [hvc0] enabled
>> [    0.808592] hv-24x7: read 1530 catalog entries, created 509 event attrs
>> (0 failures), 275 descs
>>
>> Signed-off-by: Kajol Jain <kjain@linux.ibm.com>
>> ---
>>  arch/powerpc/perf/hv-24x7.c | 17 +++++++++++++++++
>>  1 file changed, 17 insertions(+)
>>
>> ---
>> Changelog
>> v1 -> v2
>> - Include "RESERVED*" as part of the invalid event check as
>>   suggested by Madhavan Srinivasan
>> - Add new helper function "ignore_event" to check invalid/dummy
>>   events as suggested by Michael Ellerman
>> - Remove pr_info to print each invalid event as suggested by
>>   Michael Ellerman
>> ---
>> diff --git a/arch/powerpc/perf/hv-24x7.c b/arch/powerpc/perf/hv-24x7.c
>> index 6e7e820508df..1a6004d88f98 100644
>> --- a/arch/powerpc/perf/hv-24x7.c
>> +++ b/arch/powerpc/perf/hv-24x7.c
>> @@ -764,6 +764,16 @@ static ssize_t catalog_event_len_validate(struct hv_24x7_event_data *event,
>>  	return ev_len;
>>  }
>>  
>> +/*
>> + * Return true incase of invalid or dummy events with names like FREE_* or CPM_FREE_*
>> + * and RESERVED*
>> + */
>> +static bool ignore_event(const char *name)
>> +{
>> +	return (strstr(name, "FREE_") || !strncmp(name, "RESERVED", 8)) ?
>> +			true : false;
> 
> That's FREE_ anywhere in the string, which seems a bit loose.
> 
> Do we have any documentation or anything that tells us that any event
> with "FREE_" in the name will always be invalid?

Hi Michael,
      We don't have any such document which says any event with "FREE_"
in the name will be invalid. So I will replace strstr check with strcmp
to look for events with names have "FREE" or "CPM_FREE" at start.

Thanks,
Kajol Jain

> 
> cheers
> 

^ permalink raw reply

* Re: [PATCH 23/23] powerpc/pseries/eeh: Make pseries_send_allow_unfreeze() static
From: Christophe Leroy @ 2020-12-21  8:49 UTC (permalink / raw)
  To: Cédric Le Goater, linuxppc-dev; +Cc: Frederic Barrat
In-Reply-To: <20201221074222.403894-24-clg@kaod.org>



Le 21/12/2020 à 08:42, Cédric Le Goater a écrit :
> It fixes these W=1 compile error :
> 
> ../arch/powerpc/platforms/pseries/eeh_pseries.c:697:5: error: no previous prototype for ‘pseries_send_allow_unfreeze’ [-Werror=missing-prototypes]
>    697 | int pseries_send_allow_unfreeze(struct pci_dn *pdn,
>        |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> Cc: Frederic Barrat <fbarrat@linux.ibm.com>
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> ---
>   arch/powerpc/platforms/pseries/eeh_pseries.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/platforms/pseries/eeh_pseries.c b/arch/powerpc/platforms/pseries/eeh_pseries.c
> index de45ceb634f9..cb615dbd35e7 100644
> --- a/arch/powerpc/platforms/pseries/eeh_pseries.c
> +++ b/arch/powerpc/platforms/pseries/eeh_pseries.c
> @@ -694,8 +694,8 @@ static int pseries_eeh_write_config(struct eeh_dev *edev, int where, int size, u
>   }
>   
>   #ifdef CONFIG_PCI_IOV
> -int pseries_send_allow_unfreeze(struct pci_dn *pdn,
> -				u16 *vf_pe_array, int cur_vfs)
> +static int pseries_send_allow_unfreeze(struct pci_dn *pdn,
> +				       u16 *vf_pe_array, int cur_vfs)

Doesn't this fit on one line ?

>   {
>   	int rc;
>   	int ibm_allow_unfreeze = rtas_token("ibm,open-sriov-allow-unfreeze");
> 

^ permalink raw reply

* Re: [PATCH 17/23] powerpc/watchdog: Declare soft_nmi_interrupt() prototype
From: Christophe Leroy @ 2020-12-21  8:48 UTC (permalink / raw)
  To: Cédric Le Goater, linuxppc-dev; +Cc: Nicholas Piggin
In-Reply-To: <20201221074222.403894-18-clg@kaod.org>



Le 21/12/2020 à 08:42, Cédric Le Goater a écrit :
> It fixes this W=1 compile error :
> 
> ../arch/powerpc/kernel/watchdog.c:250:6: error: no previous prototype for ‘soft_nmi_interrupt’ [-Werror=missing-prototypes]
>    250 | void soft_nmi_interrupt(struct pt_regs *regs)
>        |      ^~~~~~~~~~~~~~~~~~
> 
> Cc: Nicholas Piggin <npiggin@gmail.com>
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> ---
>   arch/powerpc/include/asm/asm-prototypes.h | 1 +

This is a misuse of asm/asm-prototypes.h

This file is for prototypes of ASM functions.

See discussion at 
https://patchwork.ozlabs.org/project/linuxppc-dev/patch/1463534212-4879-2-git-send-email-dja@axtens.net/


>   arch/powerpc/kernel/watchdog.c            | 1 +
>   2 files changed, 2 insertions(+)
> 
> diff --git a/arch/powerpc/include/asm/asm-prototypes.h b/arch/powerpc/include/asm/asm-prototypes.h
> index d0b832cbbec8..0f39eefbd5a5 100644
> --- a/arch/powerpc/include/asm/asm-prototypes.h
> +++ b/arch/powerpc/include/asm/asm-prototypes.h
> @@ -84,6 +84,7 @@ void machine_check_exception(struct pt_regs *regs);
>   void emulation_assist_interrupt(struct pt_regs *regs);
>   long do_slb_fault(struct pt_regs *regs, unsigned long ea);
>   void do_bad_slb_fault(struct pt_regs *regs, unsigned long ea, long err);
> +void soft_nmi_interrupt(struct pt_regs *regs);
>   
>   /* signals, syscalls and interrupts */
>   long sys_swapcontext(struct ucontext __user *old_ctx,
> diff --git a/arch/powerpc/kernel/watchdog.c b/arch/powerpc/kernel/watchdog.c
> index af3c15a1d41e..855716f563ac 100644
> --- a/arch/powerpc/kernel/watchdog.c
> +++ b/arch/powerpc/kernel/watchdog.c
> @@ -27,6 +27,7 @@
>   #include <linux/smp.h>
>   
>   #include <asm/paca.h>
> +#include <asm/asm-prototypes.h>
>   
>   /*
>    * The powerpc watchdog ensures that each CPU is able to service timers.
> 

^ permalink raw reply

* Re: [PATCH 13/23] powerpc/mm: Move hpte_insert_repeating() prototype
From: Christophe Leroy @ 2020-12-21  8:16 UTC (permalink / raw)
  To: Cédric Le Goater, linuxppc-dev; +Cc: Aneesh Kumar K.V
In-Reply-To: <20201221074222.403894-14-clg@kaod.org>



Le 21/12/2020 à 08:42, Cédric Le Goater a écrit :
> It fixes this W=1 compile error :
> 
> ../arch/powerpc/mm/book3s64/hash_utils.c:1867:6: error: no previous prototype for ‘hpte_insert_repeating’ [-Werror=missing-prototypes]
>   1867 | long hpte_insert_repeating(unsigned long hash, unsigned long vpn,
>        |      ^~~~~~~~~~~~~~~~~~~~~
> 
> Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> ---
>   arch/powerpc/include/asm/book3s/64/mmu-hash.h | 5 +++++
>   arch/powerpc/mm/book3s64/hash_hugetlbpage.c   | 4 ----
>   2 files changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/powerpc/include/asm/book3s/64/mmu-hash.h b/arch/powerpc/include/asm/book3s/64/mmu-hash.h
> index a94fd4e0c182..76ff95950309 100644
> --- a/arch/powerpc/include/asm/book3s/64/mmu-hash.h
> +++ b/arch/powerpc/include/asm/book3s/64/mmu-hash.h
> @@ -454,6 +454,11 @@ static inline unsigned long hpt_hash(unsigned long vpn,
>   #define HPTE_NOHPTE_UPDATE	0x2
>   #define HPTE_USE_KERNEL_KEY	0x4
>   
> +extern long hpte_insert_repeating(unsigned long hash, unsigned long vpn,
> +				  unsigned long pa, unsigned long rlags,
> +				  unsigned long vflags, int psize, int ssize);
> +
> +

Don't copy the 'extern' keyword. It is useless for function prototypes.

Then you could probably fit on only two lines (nowadays 100 chars are allowed per line)


>   extern int __hash_page_4K(unsigned long ea, unsigned long access,
>   			  unsigned long vsid, pte_t *ptep, unsigned long trap,
>   			  unsigned long flags, int ssize, int subpage_prot);
> diff --git a/arch/powerpc/mm/book3s64/hash_hugetlbpage.c b/arch/powerpc/mm/book3s64/hash_hugetlbpage.c
> index b5e9fff8c217..a688e1324ae5 100644
> --- a/arch/powerpc/mm/book3s64/hash_hugetlbpage.c
> +++ b/arch/powerpc/mm/book3s64/hash_hugetlbpage.c
> @@ -16,10 +16,6 @@
>   unsigned int hpage_shift;
>   EXPORT_SYMBOL(hpage_shift);
>   
> -extern long hpte_insert_repeating(unsigned long hash, unsigned long vpn,
> -				  unsigned long pa, unsigned long rlags,
> -				  unsigned long vflags, int psize, int ssize);
> -
>   int __hash_page_huge(unsigned long ea, unsigned long access, unsigned long vsid,
>   		     pte_t *ptep, unsigned long trap, unsigned long flags,
>   		     int ssize, unsigned int shift, unsigned int mmu_psize)
> 

^ permalink raw reply

* Re: [PATCH 10/23] powerpc/optprobes: Remove unused routine patch_imm32_load_insns()
From: Christophe Leroy @ 2020-12-21  8:14 UTC (permalink / raw)
  To: Cédric Le Goater, linuxppc-dev; +Cc: Jordan Niethe
In-Reply-To: <20201221074222.403894-11-clg@kaod.org>



Le 21/12/2020 à 08:42, Cédric Le Goater a écrit :
> It fixes W=1 this compile error :

Please give more details on why it can be removed.
Has it been used in the past and its user was removed by a commit ?
Has it never been used ?

> 
> ../arch/powerpc/kernel/optprobes.c:149:6: error: no previous prototype for ‘patch_imm32_load_insns’ [-Werror=missing-prototypes]
>    149 | void patch_imm32_load_insns(unsigned int val, kprobe_opcode_t *addr)
> 
> Cc: Jordan Niethe <jniethe5@gmail.com>
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> ---
>   arch/powerpc/kernel/optprobes.c | 19 -------------------
>   1 file changed, 19 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/optprobes.c b/arch/powerpc/kernel/optprobes.c
> index 69bfe96884e2..da6b88b80ba4 100644
> --- a/arch/powerpc/kernel/optprobes.c
> +++ b/arch/powerpc/kernel/optprobes.c
> @@ -141,25 +141,6 @@ void arch_remove_optimized_kprobe(struct optimized_kprobe *op)
>   	}
>   }
>   
> -/*
> - * emulate_step() requires insn to be emulated as
> - * second parameter. Load register 'r4' with the
> - * instruction.
> - */
> -void patch_imm32_load_insns(unsigned int val, kprobe_opcode_t *addr)
> -{
> -	/* addis r4,0,(insn)@h */
> -	patch_instruction((struct ppc_inst *)addr,
> -			  ppc_inst(PPC_INST_ADDIS | ___PPC_RT(4) |
> -				   ((val >> 16) & 0xffff)));
> -	addr++;
> -
> -	/* ori r4,r4,(insn)@l */
> -	patch_instruction((struct ppc_inst *)addr,
> -			  ppc_inst(PPC_INST_ORI | ___PPC_RA(4) |
> -				   ___PPC_RS(4) | (val & 0xffff)));
> -}
> -
>   /*
>    * Generate instructions to load provided immediate 64-bit value
>    * to register 'reg' and patch these instructions at 'addr'.
> 

^ permalink raw reply

* Re: [PATCH 06/23] powerpc/setup_64: Make some routines static
From: Christophe Leroy @ 2020-12-21  8:08 UTC (permalink / raw)
  To: Cédric Le Goater, linuxppc-dev
In-Reply-To: <20201221074222.403894-7-clg@kaod.org>



Le 21/12/2020 à 08:42, Cédric Le Goater a écrit :
> Fixes these W=1 errors :

Explain why it can be made static, not just that it does fix a W=1 compile error,
because there are several possible ways to fix such a warning.

Also explain why you need to add asm/asm-prototypes.h

> 
> ../arch/powerpc/kernel/setup_64.c:261:13: error: no previous prototype for ‘record_spr_defaults’ [-Werror=missing-prototypes]
>    261 | void __init record_spr_defaults(void)
>        |             ^~~~~~~~~~~~~~~~~~~
> ../arch/powerpc/kernel/setup_64.c:1011:6: error: no previous prototype for ‘entry_flush_enable’ [-Werror=missing-prototypes]
>   1011 | void entry_flush_enable(bool enable)
>        |      ^~~~~~~~~~~~~~~~~~
> ../arch/powerpc/kernel/setup_64.c:1023:6: error: no previous prototype for ‘uaccess_flush_enable’ [-Werror=missing-prototypes]
>   1023 | void uaccess_flush_enable(bool enable)
>        |      ^~~~~~~~~~~~~~~~~~~~
> 
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> ---
>   arch/powerpc/kernel/setup_64.c | 7 ++++---
>   1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
> index c28e949cc222..560ed8b975e7 100644
> --- a/arch/powerpc/kernel/setup_64.c
> +++ b/arch/powerpc/kernel/setup_64.c
> @@ -67,6 +67,7 @@
>   #include <asm/kup.h>
>   #include <asm/early_ioremap.h>
>   #include <asm/pgalloc.h>
> +#include <asm/asm-prototypes.h>
>   
>   #include "setup.h"
>   
> @@ -258,7 +259,7 @@ static void cpu_ready_for_interrupts(void)
>   
>   unsigned long spr_default_dscr = 0;
>   
> -void __init record_spr_defaults(void)
> +static void __init record_spr_defaults(void)
>   {
>   	if (early_cpu_has_feature(CPU_FTR_DSCR))
>   		spr_default_dscr = mfspr(SPRN_DSCR);
> @@ -1008,7 +1009,7 @@ void rfi_flush_enable(bool enable)
>   	rfi_flush = enable;
>   }
>   
> -void entry_flush_enable(bool enable)
> +static void entry_flush_enable(bool enable)
>   {
>   	if (enable) {
>   		do_entry_flush_fixups(enabled_flush_types);
> @@ -1020,7 +1021,7 @@ void entry_flush_enable(bool enable)
>   	entry_flush = enable;
>   }
>   
> -void uaccess_flush_enable(bool enable)
> +static void uaccess_flush_enable(bool enable)
>   {
>   	if (enable) {
>   		do_uaccess_flush_fixups(enabled_flush_types);
> 

^ permalink raw reply

* Re: [PATCH 04/23] powerpc/pseries/ras: Make init_ras_hotplug_IRQ() static
From: Christophe Leroy @ 2020-12-21  8:07 UTC (permalink / raw)
  To: Cédric Le Goater, linuxppc-dev; +Cc: Ganesh Goudar, Mahesh Salgaonkar
In-Reply-To: <20201221074222.403894-5-clg@kaod.org>



Le 21/12/2020 à 08:42, Cédric Le Goater a écrit :
> It fixes this W=1 compile error:

Explain why it can be made static, not just that it does fix a W=1 compile error,
because there are several possible ways to fix such a warning.


> 
> ../arch/powerpc/platforms/pseries/ras.c:125:12: error: no previous prototype for ‘init_ras_hotplug_IRQ’ [-Werror=missing-prototypes]
>    125 | int __init init_ras_hotplug_IRQ(void)
>        |            ^~~~~~~~~~~~~~~~~~~~
> 
> Fixes: c9dccf1d074a ("powerpc/pseries: Enable RAS hotplug events later")
> Cc: Mahesh Salgaonkar <mahesh@linux.ibm.com>
> Cc: Ganesh Goudar <ganeshgr@linux.ibm.com>
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> ---
>   arch/powerpc/platforms/pseries/ras.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/platforms/pseries/ras.c b/arch/powerpc/platforms/pseries/ras.c
> index e27310fc1481..de0a1747cbd1 100644
> --- a/arch/powerpc/platforms/pseries/ras.c
> +++ b/arch/powerpc/platforms/pseries/ras.c
> @@ -122,7 +122,7 @@ static inline u8 rtas_mc_error_sub_type(const struct pseries_mc_errorlog *mlog)
>    * devices or systems (e.g. hugepages) that have not been initialized at the
>    * subsys stage.
>    */
> -int __init init_ras_hotplug_IRQ(void)
> +static int __init init_ras_hotplug_IRQ(void)
>   {
>   	struct device_node *np;
>   
> 

^ permalink raw reply

* Re: [PATCH 03/23] powerpc/pseries/eeh: Make pseries_pcibios_bus_add_device() static
From: Christophe Leroy @ 2020-12-21  8:07 UTC (permalink / raw)
  To: Cédric Le Goater, linuxppc-dev; +Cc: Alexey Kardashevskiy
In-Reply-To: <20201221074222.403894-4-clg@kaod.org>



Le 21/12/2020 à 08:42, Cédric Le Goater a écrit :
> It fixes this W=1 compile error:

Explain why it can be made static, not just that it does fix a W=1 compile error,
because there are several possible ways to fix such a warning.

> 
> ../arch/powerpc/platforms/pseries/eeh_pseries.c:46:6: error: no previous prototype for ‘pseries_pcibios_bus_add_device’ [-Werror=missing-prototypes]
>     46 | void pseries_pcibios_bus_add_device(struct pci_dev *pdev)
>        |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> Fixes: dae7253f9f78 ("powerpc/pseries: Add pseries SR-IOV Machine dependent calls")
> Cc: Alexey Kardashevskiy <aik@ozlabs.ru>
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> ---
>   arch/powerpc/platforms/pseries/eeh_pseries.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/platforms/pseries/eeh_pseries.c b/arch/powerpc/platforms/pseries/eeh_pseries.c
> index cf024fa37bda..de45ceb634f9 100644
> --- a/arch/powerpc/platforms/pseries/eeh_pseries.c
> +++ b/arch/powerpc/platforms/pseries/eeh_pseries.c
> @@ -43,7 +43,7 @@ static int ibm_get_config_addr_info;
>   static int ibm_get_config_addr_info2;
>   static int ibm_configure_pe;
>   
> -void pseries_pcibios_bus_add_device(struct pci_dev *pdev)
> +static void pseries_pcibios_bus_add_device(struct pci_dev *pdev)
>   {
>   	struct pci_dn *pdn = pci_get_pdn(pdev);
>   
> 

^ permalink raw reply

* Re: [PATCH 02/23] powerpc/pseries/ras: Remove unused variable 'status'
From: Christophe Leroy @ 2020-12-21  8:06 UTC (permalink / raw)
  To: Cédric Le Goater, linuxppc-dev; +Cc: Ganesh Goudar, Mahesh Salgaonkar
In-Reply-To: <20201221074222.403894-3-clg@kaod.org>



Le 21/12/2020 à 08:42, Cédric Le Goater a écrit :
> The last use of 'status' was removed in 2012. Remove the variable to
> fix this W=1 compile error.
> 
> ../arch/powerpc/platforms/pseries/ras.c: In function ‘ras_epow_interrupt’:
> ../arch/powerpc/platforms/pseries/ras.c:318:6: error: variable ‘status’ set but not used [-Werror=unused-but-set-variable]
>    318 |  int status;
>        |      ^~~~~~
> 
> Fixes: 55fc0c561742 ("powerpc/pseries: Parse and handle EPOW interrupts")
> Cc: Mahesh Salgaonkar <mahesh@linux.ibm.com>
> Cc: Ganesh Goudar <ganeshgr@linux.ibm.com>
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> ---
>   arch/powerpc/platforms/pseries/ras.c | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/powerpc/platforms/pseries/ras.c b/arch/powerpc/platforms/pseries/ras.c
> index 149cec2212e6..e27310fc1481 100644
> --- a/arch/powerpc/platforms/pseries/ras.c
> +++ b/arch/powerpc/platforms/pseries/ras.c
> @@ -315,11 +315,10 @@ static irqreturn_t ras_hotplug_interrupt(int irq, void *dev_id)
>   /* Handle environmental and power warning (EPOW) interrupts. */
>   static irqreturn_t ras_epow_interrupt(int irq, void *dev_id)
>   {
> -	int status;
>   	int state;
>   	int critical;
>   
> -	status = rtas_get_sensor_fast(EPOW_SENSOR_TOKEN, EPOW_SENSOR_INDEX,
> +	rtas_get_sensor_fast(EPOW_SENSOR_TOKEN, EPOW_SENSOR_INDEX,
>   				      &state);

Should fit on a single line now.

>   
>   	if (state > 3)
> @@ -329,7 +328,7 @@ static irqreturn_t ras_epow_interrupt(int irq, void *dev_id)
>   
>   	spin_lock(&ras_log_buf_lock);
>   
> -	status = rtas_call(ras_check_exception_token, 6, 1, NULL,
> +	rtas_call(ras_check_exception_token, 6, 1, NULL,
>   			   RTAS_VECTOR_EXTERNAL_INTERRUPT,
>   			   virq_to_hw(irq),
>   			   RTAS_EPOW_WARNING,
> 

Take the opportunity to reduce the number of lines taken by the instruction (should fit on two 
lines) and get arguments of the second line properly aligned to the open parenthesis.

^ permalink raw reply

* [PATCH 20/23] KVM: PPC: Book3S HV: Declare some prototypes
From: Cédric Le Goater @ 2020-12-21  7:42 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Cédric Le Goater
In-Reply-To: <20201221074222.403894-1-clg@kaod.org>

This fixes these W=1 compile errors:

../arch/powerpc/kvm/book3s_hv_builtin.c:425:6: error: no previous prototype for ‘kvmppc_read_intr’ [-Werror=missing-prototypes]
  425 | long kvmppc_read_intr(void)
      |      ^~~~~~~~~~~~~~~~
../arch/powerpc/kvm/book3s_hv_builtin.c:652:6: error: no previous prototype for ‘kvmppc_bad_interrupt’ [-Werror=missing-prototypes]
  652 | void kvmppc_bad_interrupt(struct pt_regs *regs)
      |      ^~~~~~~~~~~~~~~~~~~~
../arch/powerpc/kvm/book3s_hv_builtin.c:695:6: error: no previous prototype for ‘kvmhv_p9_set_lpcr’ [-Werror=missing-prototypes]
  695 | void kvmhv_p9_set_lpcr(struct kvm_split_mode *sip)
      |      ^~~~~~~~~~~~~~~~~
../arch/powerpc/kvm/book3s_hv_builtin.c:740:6: error: no previous prototype for ‘kvmhv_p9_restore_lpcr’ [-Werror=missing-prototypes]
  740 | void kvmhv_p9_restore_lpcr(struct kvm_split_mode *sip)
      |      ^~~~~~~~~~~~~~~~~~~~~
../arch/powerpc/kvm/book3s_hv_builtin.c:768:6: error: no previous prototype for ‘kvmppc_set_msr_hv’ [-Werror=missing-prototypes]
  768 | void kvmppc_set_msr_hv(struct kvm_vcpu *vcpu, u64 msr)
      |      ^~~~~~~~~~~~~~~~~
../arch/powerpc/kvm/book3s_hv_builtin.c:817:6: error: no previous prototype for ‘kvmppc_inject_interrupt_hv’ [-Werror=missing-prototypes]
  817 | void kvmppc_inject_interrupt_hv(struct kvm_vcpu *vcpu, int vec, u64 srr1_flags)

Cc: Paul Mackerras <paulus@ozlabs.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 arch/powerpc/include/asm/kvm_book3s.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/powerpc/include/asm/kvm_book3s.h b/arch/powerpc/include/asm/kvm_book3s.h
index d32ec9ae73bd..2f5f919f6cd3 100644
--- a/arch/powerpc/include/asm/kvm_book3s.h
+++ b/arch/powerpc/include/asm/kvm_book3s.h
@@ -277,6 +277,13 @@ extern int kvmppc_hcall_impl_hv_realmode(unsigned long cmd);
 extern void kvmppc_copy_to_svcpu(struct kvm_vcpu *vcpu);
 extern void kvmppc_copy_from_svcpu(struct kvm_vcpu *vcpu);
 
+long kvmppc_read_intr(void);
+void kvmppc_bad_interrupt(struct pt_regs *regs);
+void kvmhv_p9_set_lpcr(struct kvm_split_mode *sip);
+void kvmhv_p9_restore_lpcr(struct kvm_split_mode *sip);
+void kvmppc_set_msr_hv(struct kvm_vcpu *vcpu, u64 msr);
+void kvmppc_inject_interrupt_hv(struct kvm_vcpu *vcpu, int vec, u64 srr1_flags);
+
 #ifdef CONFIG_PPC_TRANSACTIONAL_MEM
 void kvmppc_save_tm_pr(struct kvm_vcpu *vcpu);
 void kvmppc_restore_tm_pr(struct kvm_vcpu *vcpu);
-- 
2.26.2


^ permalink raw reply related

* [PATCH 23/23] powerpc/pseries/eeh: Make pseries_send_allow_unfreeze() static
From: Cédric Le Goater @ 2020-12-21  7:42 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Frederic Barrat, Cédric Le Goater
In-Reply-To: <20201221074222.403894-1-clg@kaod.org>

It fixes these W=1 compile error :

../arch/powerpc/platforms/pseries/eeh_pseries.c:697:5: error: no previous prototype for ‘pseries_send_allow_unfreeze’ [-Werror=missing-prototypes]
  697 | int pseries_send_allow_unfreeze(struct pci_dn *pdn,
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~

Cc: Frederic Barrat <fbarrat@linux.ibm.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 arch/powerpc/platforms/pseries/eeh_pseries.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/eeh_pseries.c b/arch/powerpc/platforms/pseries/eeh_pseries.c
index de45ceb634f9..cb615dbd35e7 100644
--- a/arch/powerpc/platforms/pseries/eeh_pseries.c
+++ b/arch/powerpc/platforms/pseries/eeh_pseries.c
@@ -694,8 +694,8 @@ static int pseries_eeh_write_config(struct eeh_dev *edev, int where, int size, u
 }
 
 #ifdef CONFIG_PCI_IOV
-int pseries_send_allow_unfreeze(struct pci_dn *pdn,
-				u16 *vf_pe_array, int cur_vfs)
+static int pseries_send_allow_unfreeze(struct pci_dn *pdn,
+				       u16 *vf_pe_array, int cur_vfs)
 {
 	int rc;
 	int ibm_allow_unfreeze = rtas_token("ibm,open-sriov-allow-unfreeze");
-- 
2.26.2


^ permalink raw reply related

* [PATCH 19/23] KVM: PPC: Book3S HV: Include prototypes
From: Cédric Le Goater @ 2020-12-21  7:42 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Cédric Le Goater
In-Reply-To: <20201221074222.403894-1-clg@kaod.org>

It fixes these W=1 compile errors :

 CC [M]  arch/powerpc/kvm/book3s_64_mmu_hv.o
../arch/powerpc/kvm/book3s_64_mmu_hv.c:879:5: error: no previous prototype for ‘kvm_unmap_hva_range_hv’ [-Werror=missing-prototypes]
  879 | int kvm_unmap_hva_range_hv(struct kvm *kvm, unsigned long start, unsigned long end)
      |     ^~~~~~~~~~~~~~~~~~~~~~
../arch/powerpc/kvm/book3s_64_mmu_hv.c:888:6: error: no previous prototype for ‘kvmppc_core_flush_memslot_hv’ [-Werror=missing-prototypes]
  888 | void kvmppc_core_flush_memslot_hv(struct kvm *kvm,
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../arch/powerpc/kvm/book3s_64_mmu_hv.c:970:5: error: no previous prototype for ‘kvm_age_hva_hv’ [-Werror=missing-prototypes]
  970 | int kvm_age_hva_hv(struct kvm *kvm, unsigned long start, unsigned long end)
      |     ^~~~~~~~~~~~~~
../arch/powerpc/kvm/book3s_64_mmu_hv.c:1011:5: error: no previous prototype for ‘kvm_test_age_hva_hv’ [-Werror=missing-prototypes]
 1011 | int kvm_test_age_hva_hv(struct kvm *kvm, unsigned long hva)
      |     ^~~~~~~~~~~~~~~~~~~
../arch/powerpc/kvm/book3s_64_mmu_hv.c:1019:6: error: no previous prototype for ‘kvm_set_spte_hva_hv’ [-Werror=missing-prototypes]
 1019 | void kvm_set_spte_hva_hv(struct kvm *kvm, unsigned long hva, pte_t pte)
      |      ^~~~~~~~~~~~~~~~~~~

Cc: Paul Mackerras <paulus@ozlabs.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 arch/powerpc/kvm/book3s_64_mmu_hv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/kvm/book3s_64_mmu_hv.c b/arch/powerpc/kvm/book3s_64_mmu_hv.c
index 38ea396a23d6..c77f2d4f44ca 100644
--- a/arch/powerpc/kvm/book3s_64_mmu_hv.c
+++ b/arch/powerpc/kvm/book3s_64_mmu_hv.c
@@ -27,6 +27,7 @@
 #include <asm/cputable.h>
 #include <asm/pte-walk.h>
 
+#include "book3s.h"
 #include "trace_hv.h"
 
 //#define DEBUG_RESIZE_HPT	1
-- 
2.26.2


^ permalink raw reply related

* [PATCH 17/23] powerpc/watchdog: Declare soft_nmi_interrupt() prototype
From: Cédric Le Goater @ 2020-12-21  7:42 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Cédric Le Goater, Nicholas Piggin
In-Reply-To: <20201221074222.403894-1-clg@kaod.org>

It fixes this W=1 compile error :

../arch/powerpc/kernel/watchdog.c:250:6: error: no previous prototype for ‘soft_nmi_interrupt’ [-Werror=missing-prototypes]
  250 | void soft_nmi_interrupt(struct pt_regs *regs)
      |      ^~~~~~~~~~~~~~~~~~

Cc: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 arch/powerpc/include/asm/asm-prototypes.h | 1 +
 arch/powerpc/kernel/watchdog.c            | 1 +
 2 files changed, 2 insertions(+)

diff --git a/arch/powerpc/include/asm/asm-prototypes.h b/arch/powerpc/include/asm/asm-prototypes.h
index d0b832cbbec8..0f39eefbd5a5 100644
--- a/arch/powerpc/include/asm/asm-prototypes.h
+++ b/arch/powerpc/include/asm/asm-prototypes.h
@@ -84,6 +84,7 @@ void machine_check_exception(struct pt_regs *regs);
 void emulation_assist_interrupt(struct pt_regs *regs);
 long do_slb_fault(struct pt_regs *regs, unsigned long ea);
 void do_bad_slb_fault(struct pt_regs *regs, unsigned long ea, long err);
+void soft_nmi_interrupt(struct pt_regs *regs);
 
 /* signals, syscalls and interrupts */
 long sys_swapcontext(struct ucontext __user *old_ctx,
diff --git a/arch/powerpc/kernel/watchdog.c b/arch/powerpc/kernel/watchdog.c
index af3c15a1d41e..855716f563ac 100644
--- a/arch/powerpc/kernel/watchdog.c
+++ b/arch/powerpc/kernel/watchdog.c
@@ -27,6 +27,7 @@
 #include <linux/smp.h>
 
 #include <asm/paca.h>
+#include <asm/asm-prototypes.h>
 
 /*
  * The powerpc watchdog ensures that each CPU is able to service timers.
-- 
2.26.2


^ permalink raw reply related

* [PATCH 15/23] powerpc/mm/hugetlb: Make pseries_alloc_bootmem_huge_page() static
From: Cédric Le Goater @ 2020-12-21  7:42 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Cédric Le Goater, Aneesh Kumar K.V
In-Reply-To: <20201221074222.403894-1-clg@kaod.org>

It fixes this W=1 compile error :

../arch/powerpc/mm/hugetlbpage.c:220:12: error: no previous prototype for ‘pseries_alloc_bootmem_huge_page’ [-Werror=missing-prototypes]
  220 | int __init pseries_alloc_bootmem_huge_page(struct hstate *hstate)
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 arch/powerpc/mm/hugetlbpage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
index 8b3cc4d688e8..4e7d9b91f1da 100644
--- a/arch/powerpc/mm/hugetlbpage.c
+++ b/arch/powerpc/mm/hugetlbpage.c
@@ -217,7 +217,7 @@ void __init pseries_add_gpage(u64 addr, u64 page_size, unsigned long number_of_p
 	}
 }
 
-int __init pseries_alloc_bootmem_huge_page(struct hstate *hstate)
+static int __init pseries_alloc_bootmem_huge_page(struct hstate *hstate)
 {
 	struct huge_bootmem_page *m;
 	if (nr_gpages == 0)
-- 
2.26.2


^ permalink raw reply related

* [PATCH 16/23] powerpc/mm: Declare arch_report_meminfo() prototype.
From: Cédric Le Goater @ 2020-12-21  7:42 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Cédric Le Goater, Aneesh Kumar K.V
In-Reply-To: <20201221074222.403894-1-clg@kaod.org>

It fixes this W=1 compile error :

../arch/powerpc/mm/book3s64/pgtable.c:411:6: error: no previous prototype for ‘arch_report_meminfo’ [-Werror=missing-prototypes]
  411 | void arch_report_meminfo(struct seq_file *m)
      |      ^~~~~~~~~~~~~~~~~~~

Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 arch/powerpc/include/asm/pgtable.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/powerpc/include/asm/pgtable.h b/arch/powerpc/include/asm/pgtable.h
index f7613f43c9cf..4eed82172e33 100644
--- a/arch/powerpc/include/asm/pgtable.h
+++ b/arch/powerpc/include/asm/pgtable.h
@@ -162,6 +162,9 @@ static inline bool is_ioremap_addr(const void *x)
 
 	return addr >= IOREMAP_BASE && addr < IOREMAP_END;
 }
+
+struct seq_file;
+void arch_report_meminfo(struct seq_file *m);
 #endif /* CONFIG_PPC64 */
 
 #endif /* __ASSEMBLY__ */
-- 
2.26.2


^ permalink raw reply related

* [PATCH 14/23] powerpc/mm: Declare preload_new_slb_context() prototype
From: Cédric Le Goater @ 2020-12-21  7:42 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Cédric Le Goater, Aneesh Kumar K.V
In-Reply-To: <20201221074222.403894-1-clg@kaod.org>

It fixes this W=1 compile error :

../arch/powerpc/mm/book3s64/slb.c:380:6: error: no previous prototype for ‘preload_new_slb_context’ [-Werror=missing-prototypes]
  380 | void preload_new_slb_context(unsigned long start, unsigned long sp)
      |      ^~~~~~~~~~~~~~~~~~~~~~~

Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 arch/powerpc/include/asm/book3s/64/mmu-hash.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/include/asm/book3s/64/mmu-hash.h b/arch/powerpc/include/asm/book3s/64/mmu-hash.h
index 76ff95950309..3e6e4e4b8ea1 100644
--- a/arch/powerpc/include/asm/book3s/64/mmu-hash.h
+++ b/arch/powerpc/include/asm/book3s/64/mmu-hash.h
@@ -529,6 +529,7 @@ void slb_dump_contents(struct slb_entry *slb_ptr);
 
 extern void slb_vmalloc_update(void);
 extern void slb_set_size(u16 size);
+void preload_new_slb_context(unsigned long start, unsigned long sp);
 #endif /* __ASSEMBLY__ */
 
 /*
-- 
2.26.2


^ permalink raw reply related

* [PATCH 10/23] powerpc/optprobes: Remove unused routine patch_imm32_load_insns()
From: Cédric Le Goater @ 2020-12-21  7:42 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Cédric Le Goater, Jordan Niethe
In-Reply-To: <20201221074222.403894-1-clg@kaod.org>

It fixes W=1 this compile error :

../arch/powerpc/kernel/optprobes.c:149:6: error: no previous prototype for ‘patch_imm32_load_insns’ [-Werror=missing-prototypes]
  149 | void patch_imm32_load_insns(unsigned int val, kprobe_opcode_t *addr)

Cc: Jordan Niethe <jniethe5@gmail.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 arch/powerpc/kernel/optprobes.c | 19 -------------------
 1 file changed, 19 deletions(-)

diff --git a/arch/powerpc/kernel/optprobes.c b/arch/powerpc/kernel/optprobes.c
index 69bfe96884e2..da6b88b80ba4 100644
--- a/arch/powerpc/kernel/optprobes.c
+++ b/arch/powerpc/kernel/optprobes.c
@@ -141,25 +141,6 @@ void arch_remove_optimized_kprobe(struct optimized_kprobe *op)
 	}
 }
 
-/*
- * emulate_step() requires insn to be emulated as
- * second parameter. Load register 'r4' with the
- * instruction.
- */
-void patch_imm32_load_insns(unsigned int val, kprobe_opcode_t *addr)
-{
-	/* addis r4,0,(insn)@h */
-	patch_instruction((struct ppc_inst *)addr,
-			  ppc_inst(PPC_INST_ADDIS | ___PPC_RT(4) |
-				   ((val >> 16) & 0xffff)));
-	addr++;
-
-	/* ori r4,r4,(insn)@l */
-	patch_instruction((struct ppc_inst *)addr,
-			  ppc_inst(PPC_INST_ORI | ___PPC_RA(4) |
-				   ___PPC_RS(4) | (val & 0xffff)));
-}
-
 /*
  * Generate instructions to load provided immediate 64-bit value
  * to register 'reg' and patch these instructions at 'addr'.
-- 
2.26.2


^ permalink raw reply related

* [PATCH 21/23] powerpc/pseries: Make IOV setup routines static
From: Cédric Le Goater @ 2020-12-21  7:42 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Frederic Barrat, Cédric Le Goater
In-Reply-To: <20201221074222.403894-1-clg@kaod.org>

It fixes these W=1 compile errors :

../arch/powerpc/platforms/pseries/setup.c:610:17: error: no previous prototype for ‘pseries_get_iov_fw_value’ [-Werror=missing-prototypes]
  610 | resource_size_t pseries_get_iov_fw_value(struct pci_dev *dev, int resno,
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~
../arch/powerpc/platforms/pseries/setup.c:646:6: error: no previous prototype for ‘of_pci_set_vf_bar_size’ [-Werror=missing-prototypes]
  646 | void of_pci_set_vf_bar_size(struct pci_dev *dev, const int *indexes)
      |      ^~~~~~~~~~~~~~~~~~~~~~
../arch/powerpc/platforms/pseries/setup.c:668:6: error: no previous prototype for ‘of_pci_parse_iov_addrs’ [-Werror=missing-prototypes]
  668 | void of_pci_parse_iov_addrs(struct pci_dev *dev, const int *indexes)
      |      ^~~~~~~~~~~~~~~~~~~~~~

Cc: Frederic Barrat <fbarrat@linux.ibm.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 arch/powerpc/platforms/pseries/setup.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index 090c13f6c881..0272aa4e74e3 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -607,8 +607,8 @@ enum get_iov_fw_value_index {
 	WDW_SIZE      = 3     /*  Get Window Size */
 };
 
-resource_size_t pseries_get_iov_fw_value(struct pci_dev *dev, int resno,
-					 enum get_iov_fw_value_index value)
+static resource_size_t pseries_get_iov_fw_value(struct pci_dev *dev, int resno,
+						enum get_iov_fw_value_index value)
 {
 	const int *indexes;
 	struct device_node *dn = pci_device_to_OF_node(dev);
@@ -643,7 +643,7 @@ resource_size_t pseries_get_iov_fw_value(struct pci_dev *dev, int resno,
 	return ret;
 }
 
-void of_pci_set_vf_bar_size(struct pci_dev *dev, const int *indexes)
+static void of_pci_set_vf_bar_size(struct pci_dev *dev, const int *indexes)
 {
 	struct resource *res;
 	resource_size_t base, size;
@@ -665,7 +665,7 @@ void of_pci_set_vf_bar_size(struct pci_dev *dev, const int *indexes)
 	}
 }
 
-void of_pci_parse_iov_addrs(struct pci_dev *dev, const int *indexes)
+static void of_pci_parse_iov_addrs(struct pci_dev *dev, const int *indexes)
 {
 	struct resource *res, *root, *conflict;
 	resource_size_t base, size;
-- 
2.26.2


^ permalink raw reply related

* [PATCH 11/23] powerpc/optprobes: Make patch_imm64_load_insns() static
From: Cédric Le Goater @ 2020-12-21  7:42 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Cédric Le Goater, Jordan Niethe
In-Reply-To: <20201221074222.403894-1-clg@kaod.org>

It fixes W=1 this compile error :

../arch/powerpc/kernel/optprobes.c:149:6: error: no previous prototype for ‘patch_imm64_load_insns’ [-Werror=missing-prototypes]
  149 | void patch_imm64_load_insns(unsigned int val, kprobe_opcode_t *addr)

Cc: Jordan Niethe <jniethe5@gmail.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 arch/powerpc/kernel/optprobes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/optprobes.c b/arch/powerpc/kernel/optprobes.c
index da6b88b80ba4..7f7cdbeacd1a 100644
--- a/arch/powerpc/kernel/optprobes.c
+++ b/arch/powerpc/kernel/optprobes.c
@@ -145,7 +145,7 @@ void arch_remove_optimized_kprobe(struct optimized_kprobe *op)
  * Generate instructions to load provided immediate 64-bit value
  * to register 'reg' and patch these instructions at 'addr'.
  */
-void patch_imm64_load_insns(unsigned long val, int reg, kprobe_opcode_t *addr)
+static void patch_imm64_load_insns(unsigned long val, int reg, kprobe_opcode_t *addr)
 {
 	/* lis reg,(op)@highest */
 	patch_instruction((struct ppc_inst *)addr,
-- 
2.26.2


^ permalink raw reply related

* [PATCH 07/23] powerpc/mce: Include prototypes
From: Cédric Le Goater @ 2020-12-21  7:42 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Ganesh Goudar, Cédric Le Goater, Mahesh Salgaonkar
In-Reply-To: <20201221074222.403894-1-clg@kaod.org>

It fixes these W=1 compile errors :

../arch/powerpc/kernel/mce.c:591:14: error: no previous prototype for ‘machine_check_early’ [-Werror=missing-prototypes]
  591 | long notrace machine_check_early(struct pt_regs *regs)
      |              ^~~~~~~~~~~~~~~~~~~
../arch/powerpc/kernel/mce.c:725:6: error: no previous prototype for ‘hmi_exception_realmode’ [-Werror=missing-prototypes]
  725 | long hmi_exception_realmode(struct pt_regs *regs)
      |      ^~~~~~~~~~~~~~~~~~~~~~

Cc: Ganesh Goudar <ganeshgr@linux.ibm.com>
Cc: Mahesh Salgaonkar <mahesh@linux.ibm.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 arch/powerpc/kernel/mce.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/kernel/mce.c b/arch/powerpc/kernel/mce.c
index 9f3e133b57b7..c381dc2f9858 100644
--- a/arch/powerpc/kernel/mce.c
+++ b/arch/powerpc/kernel/mce.c
@@ -21,6 +21,7 @@
 #include <asm/machdep.h>
 #include <asm/mce.h>
 #include <asm/nmi.h>
+#include <asm/asm-prototypes.h>
 
 static DEFINE_PER_CPU(int, mce_nest_count);
 static DEFINE_PER_CPU(struct machine_check_event[MAX_MC_EVT], mce_event);
-- 
2.26.2


^ 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