[PATCH v3] powerpc/mce: log the error for all unrecoverable errors

2023-02-01 Thread Ganesh Goudar
For all unrecoverable errors we are missing to log the error, Since machine_check_log_err() is not getting called for unrecoverable errors. machine_check_log_err() is called from deferred handler, To run deferred handlers we have to do irq work raise from the exception handler. For recoverable err

Re: [PATCH v2] powerpc/mce: log the error for all unrecoverable errors

2023-02-01 Thread Ganesh G R
On 1/31/23 4:59 PM, Michael Ellerman wrote: Ganesh Goudar writes: For all unrecoverable errors we are missing to log the error, Since machine_check_log_err() is not getting called for unrecoverable errors. Raise irq work in save_mce_event() for unrecoverable errors, So that we log the error

[PATCH v2 1/9] powerpc: Remove __kernel_text_address() in show_instructions()

2023-02-01 Thread Christophe Leroy
That test was introducted in 2006 by commit 00ae36de49cc ("[POWERPC] Better check in show_instructions"). At that time, there was no BPF progs. As seen in message of commit 89d21e259a94 ("powerpc/bpf/32: Fix Oops on tail call tests"), when a page fault occurs in test_bpf.ko for instance, the code

[PATCH v2 2/9] powerpc/bpf/32: No need to zeroise r4 when not doing tail call

2023-02-01 Thread Christophe Leroy
r4 is cleared at function entry and used as tail call count. But when the function does not perform tail call, r4 is ignored, so no need to clear it. Replace it by a NOP in that case. Signed-off-by: Christophe Leroy --- arch/powerpc/net/bpf_jit_comp32.c | 5 - 1 file changed, 4 insertions(

[PATCH v2 3/9] powerpc/bpf/32: Only set a stack frame when necessary

2023-02-01 Thread Christophe Leroy
Until now a stack frame was set at all time due to the need to keep tail call counter in the stack. But since commit fa025537f584 ("powerpc/bpf/32: Fix Oops on tail call tests"), the tail call counter is passed via register r4. It is therefore not necessary anymore to have a stack frame for that.

[PATCH v2 7/9] powerpc/bpf/32: Optimise some particular const operations

2023-02-01 Thread Christophe Leroy
Simplify multiplications and divisions with constants when the constant is 1 or -1. When the constant is a power of 2, replace them by bit shits. Signed-off-by: Christophe Leroy --- arch/powerpc/net/bpf_jit_comp32.c | 23 --- 1 file changed, 20 insertions(+), 3 deletions(-)

[PATCH v2 9/9] powerpc/bpf/32: perform three operands ALU operations

2023-02-01 Thread Christophe Leroy
When an ALU instruction is preceded by a MOV instruction that just moves a source register into the destination register of the ALU, replace that MOV+ALU instructions by an ALU operation taking the source of the MOV as second source instead of using its destination. Before the change, code could l

[PATCH v2 5/9] powerpc/bpf: Perform complete extra passes to update addresses

2023-02-01 Thread Christophe Leroy
BPF core calls the jit compiler again for an extra pass in order to properly set subprog addresses. Unlike other architectures, powerpc only updates the addresses during that extra pass. It means that holes must have been left in the code in order to enable the maximum possible instruction size.

[PATCH v2 8/9] powerpc/bpf/32: introduce a second source register for ALU operations

2023-02-01 Thread Christophe Leroy
At the time being, all ALU operation are performed with same L-source and destination, requiring the L-source to be moved into destination via a separate register move, like: 70: 7f c6 f3 78 mr r6,r30 74: 7f a5 eb 78 mr r5,r29 78: 30 c6 ff f4 addic r6,r6,-12 7

[PATCH v2 4/9] powerpc/bpf/32: BPF prog is never called with more than one arg

2023-02-01 Thread Christophe Leroy
BPF progs are never called with more than one argument, plus the tail call count as a second argument when needed. So, no need to retrieve 9th and 10th argument (5th 64 bits argument) from the stack in prologue. Signed-off-by: Christophe Leroy --- arch/powerpc/net/bpf_jit_comp32.c | 6 -- 1

[PATCH v2 6/9] powerpc/bpf: Only pad length-variable code at initial pass

2023-02-01 Thread Christophe Leroy
Now that two real additional passes are performed in case of extra pass requested by BPF core, padding is not needed anymore except during initial pass done before memory allocation to count maximum possible program size. So, only do the padding when 'image' is NULL. Signed-off-by: Christophe Ler

Re: [PATCH] powerpc/tlb: Implement book3s/32/tlbflush.h local_flush_tlb_page_psize

2023-02-01 Thread Christophe Leroy
Le 31/01/2023 à 22:58, Benjamin Gray a écrit : > On Tue, 2023-01-31 at 06:33 +, Christophe Leroy wrote: >> I still think it is not the correct fix. You are putting the problem >> under the carpet instead of fixing it. There are many other places >> where >> radix_enabled() or other mmu_has_fe

Re: [PATCH 0/7] hvcs: Various hvcs device hotplug fixes

2023-02-01 Thread Christophe Leroy
Le 30/01/2023 à 23:43, Brian King a écrit : > This patch series fixes a number of issues with hotplugging > hvcs devices including memory leaks as well as, the inability > to reconnect to a console device after it has been hot added > back, since it was not getting cleaned up properly on the > ho

[PATCH 1/2] powerpc/64: Set default CPU in Kconfig

2023-02-01 Thread Naresh Kamboju
64le, future make[2]: *** [/builds/linux/scripts/Makefile.build:252: scripts/mod/empty.o] Error 1 Reported-by: Linux Kernel Functional Testing https://qa-reports.linaro.org/lkft/linux-next-master/build/next-20230201/testrun/14479384/suite/build/test/clang-nightly-tqm8xx_defconfig/history/ The

Re: [PATCH 1/2] powerpc/64: Set default CPU in Kconfig

2023-02-01 Thread Christophe Leroy
00 ec603e native power3 power4 power5 power5+ power6 power6x power7 power8 powerpc powerpc64 powerpc64le rs64 titan How do you tell CLANG that you are building for powerpc 8xx ? > > > Reported-by: Linux Kernel Functional Testing > > https://qa-reports.linaro.org/lkft/linu

Re: [PATCH v4 4/7] mm: replace vma->vm_flags direct modifications with modifier calls

2023-02-01 Thread Hyeonggon Yoo
On Tue, Jan 31, 2023 at 10:54:22AM -0800, Suren Baghdasaryan wrote: > On Tue, Jan 31, 2023 at 12:32 AM Hyeonggon Yoo <42.hye...@gmail.com> wrote: > > > > On Thu, Jan 26, 2023 at 11:37:49AM -0800, Suren Baghdasaryan wrote: > > > Replace direct modifications to vma->vm_flags with calls to modifier >

Re: [PATCH] powerpc/hv-24x7: Fix pvr check when setting interface version

2023-02-01 Thread Sachin Sant
> On 01-Feb-2023, at 12:18 AM, Kajol Jain wrote: > > Commit ec3eb9d941a9 ("powerpc/perf: Use PVR rather than > oprofile field to determine CPU version") added usage > of pvr value instead of oprofile field to determine the > platform. In hv-24x7 pmu driver code, pvr check uses PVR_POWER8 > whe

[PATCH v3] powerpc: macio: Make remove callback of macio driver void returned

2023-02-01 Thread Dawei Li
Commit fc7a6209d571 ("bus: Make remove callback return void") forces bus_type::remove be void-returned, it doesn't make much sense for any bus based driver implementing remove callbalk to return non-void to its caller. This change is for macio bus based drivers. Signed-off-by: Dawei Li --- v2 ->

Re: [PATCH 0/7] hvcs: Various hvcs device hotplug fixes

2023-02-01 Thread Brian King
On 2/1/23 4:32 AM, Christophe Leroy wrote: > > > Le 30/01/2023 à 23:43, Brian King a écrit : >> This patch series fixes a number of issues with hotplugging >> hvcs devices including memory leaks as well as, the inability >> to reconnect to a console device after it has been hot added >> back, sin

[PATCH v4] of: Make OF framebuffer device names unique

2023-02-01 Thread Rob Herring
From: Michal Suchanek Since Linux 5.19 this error is observed: sysfs: cannot create duplicate filename '/devices/platform/of-display' This is because multiple devices with the same name 'of-display' are created on the same bus. Update the code to create numbered device names for the displays.

Re: [PATCH 1/2] powerpc/64: Set default CPU in Kconfig

2023-02-01 Thread Nick Desaulniers
r4 power5 > power5+ power6 power6x power7 power8 powerpc powerpc64 powerpc64le rs64 > titan > > How do you tell CLANG that you are building for powerpc 8xx ? + Nemanjai, Qiongsi, > > > > > > > Reported-by: Linux Kernel Functional Testing > > > > https

[PATCH 1/2] tests/shell: Add check for perf data file in record+probe_libc_inet_pton test

2023-02-01 Thread Athira Rajeev
"probe libc's inet_pton & backtrace it with ping" test installs a uprobe and uses perf record/script to check the backtrace. Currently even if the "perf record" fails, the test reports success. Logs below: # ./perf test -v "probe libc's inet_pton & backtrace it with ping" 81: probe libc's inet_p

[PATCH 2/2] tests/shell: Fix perf test shell to check for libtracevent support

2023-02-01 Thread Athira Rajeev
Test “Use vfs_getname probe to get syscall args filenames” fails in environment with missing libtraceevent support as below: 82: Use vfs_getname probe to get syscall args filenames : --- start --- test child forked, pid 304726 Recording open file: event syntax error: 'probe:vfs_getnam

Re: [PATCH v5 00/15] jevents/pmu-events improvements

2023-02-01 Thread John Garry
On 31/01/2023 00:39, Ian Rogers wrote: Thanks John, will fix. Is there anything else? Do you think that pmu-events/__pycache__/metric.cpython-36.pyc should be deleted with a make clean? I would expect stuff like this to be deleted (with a clean), but I am not sure if we have a policy on this (py

Re: [PATCH v5 10/15] perf jevents: Generate metrics and events as separate tables

2023-02-01 Thread John Garry
On 30/01/2023 22:54, Ian Rogers wrote: This is almost identical to generated perf_pmu__find_events_table(), except we return a pmu_metrics_table * (instead of a pmu_events_table *) and also return the metric table member (instead of event table). But the definitions are: /* Struct used to make t

[PATCH] drm/amdgpu: drop the long-double-128 powerpc check/hack

2023-02-01 Thread Daniel Kolesa
Commit c653c591789b ("drm/amdgpu: Re-enable DCN for 64-bit powerpc") introduced this check as a workaround for the driver not building with toolchains that default to 64-bit long double. The reason things worked on 128-bit-long-double toolchains and not otherwise was however largely accidental. Th

RE: [PATCH] drm/amdgpu: drop the long-double-128 powerpc check/hack

2023-02-01 Thread Deucher, Alexander
[Public] > -Original Message- > From: amd-gfx On Behalf Of > Daniel Kolesa > Sent: Wednesday, February 1, 2023 1:46 PM > To: linuxppc-dev@lists.ozlabs.org > Cc: d...@danny.cz; sta...@vger.kernel.org; > tpear...@raptorengineering.com; amd-...@lists.freedesktop.org; > alexdeuc...@gmail.com;

[PATCH 0/6] hvcs: Various hvcs device hotplug fixes

2023-02-01 Thread Brian King
This patch series fixes a number of issues with hotplugging hvcs devices including memory leaks as well as, the inability to reconnect to a console device after it has been hot added back, since it was not getting cleaned up properly on the hotplug remove path. Brian King (6): hvcs: Fix hvcs por

[PATCH 2/6] hvcs: Remove sysfs file prior to vio unregister

2023-02-01 Thread Brian King
This moves the removal of the rescan sysfs attribute to occur before the call to unregister the vio to ensure the removal does not fail due to the vio driver already being freed. Signed-off-by: Brian King --- drivers/tty/hvc/hvcs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff

[PATCH 4/6] hvcs: Get reference to tty in remove

2023-02-01 Thread Brian King
Grab a reference to the tty when removing the hvcs to ensure it does not get freed unexpectedly. Signed-off-by: Brian King --- drivers/tty/hvc/hvcs.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/tty/hvc/hvcs.c b/drivers/tty/hvc/hvcs.c index 9c5887d0c882..b28d

[PATCH 1/6] hvcs: Fix hvcs port reference counting

2023-02-01 Thread Brian King
The hvcs driver only ever gets two references to the port. One at initialization time, and one at install time. Remove the code that was trying to do multiple port puts for each open, which would result in more puts than gets. Signed-off-by: Brian King --- drivers/tty/hvc/hvcs.c | 18 ---

[PATCH 3/6] hvcs: Remove sysfs group earlier

2023-02-01 Thread Brian King
Cleanup the sysfs group earlier in remove. This eliminates errors coming from kernfs when attempting to remove a console device that is in use. Signed-off-by: Brian King --- drivers/tty/hvc/hvcs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/hvc/hvcs.c b/dr

[PATCH 5/6] hvcs: Use vhangup in hotplug remove

2023-02-01 Thread Brian King
When hotplug removing an hvcs device, we need to ensure the hangup processing is done prior to exiting the remove function, so use tty_vhangup to do the hangup processing directly rather than using tty_hangup which simply schedules the hangup work for later execution. Signed-off-by: Brian King --

[PATCH 6/6] hvcs: Synchronize hotplug remove with port free

2023-02-01 Thread Brian King
Synchronizes hotplug remove with the freeing of the port. This ensures we have freed all the memory associated with this port and are not leaking memory. Signed-off-by: Brian King --- drivers/tty/hvc/hvcs.c | 26 +++--- 1 file changed, 15 insertions(+), 11 deletions(-) diff

[PATCH] powerpc: Fix device node refcounting

2023-02-01 Thread Brian King
While testing fixes to the hvcs hotplug code, kmemleak was reporting potential memory leaks. This was tracked down to the struct device_node object associated with the hvcs device. Looking at the leaked object in crash showed that the kref in the kobject in the device_node had a reference count of

Re: [PATCH 3/6] hvcs: Remove sysfs group earlier

2023-02-01 Thread Greg KH
On Wed, Feb 01, 2023 at 01:57:40PM -0600, Brian King wrote: > Cleanup the sysfs group earlier in remove. This eliminates > errors coming from kernfs when attempting to remove a console > device that is in use. > > Signed-off-by: Brian King > --- > drivers/tty/hvc/hvcs.c | 4 ++-- > 1 file change

Re: [PATCH 2/6] hvcs: Remove sysfs file prior to vio unregister

2023-02-01 Thread Greg KH
On Wed, Feb 01, 2023 at 01:57:39PM -0600, Brian King wrote: > This moves the removal of the rescan sysfs attribute to occur > before the call to unregister the vio to ensure the removal > does not fail due to the vio driver already being freed. > > Signed-off-by: Brian King > --- > drivers/tty/h

Re: [PATCH v3] powerpc: macio: Make remove callback of macio driver void returned

2023-02-01 Thread Damien Le Moal
On 2/1/23 23:36, Dawei Li wrote: > Commit fc7a6209d571 ("bus: Make remove callback return void") forces > bus_type::remove be void-returned, it doesn't make much sense for any > bus based driver implementing remove callbalk to return non-void to > its caller. > > This change is for macio bus based

Re: [PATCH v1 3/5] powerpc/64: Replace -mcpu=e500mc64 by -mcpu=e5500

2023-02-01 Thread Pali Rohár
On Tuesday 20 December 2022 21:15:08 Pali Rohár wrote: > On Monday 19 December 2022 19:45:58 Christophe Leroy wrote: > > E500MC64 is a processor pre-dating E5500 that has never been > > commercialised. Use -mcpu=e5500 for E5500 core. > > > > More details at https://gcc.gnu.org/PR108149 > > > > Si

[powerpc:next-test 14/40] pci.c:undefined reference to `pci_create_OF_bus_map'

2023-02-01 Thread kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next-test head: 9ffcf6a19dbb2a24de2c2d7b2af1e130986cd565 commit: 869363998da87c80c16ff1221e95b41b2d3cceb2 [14/40] powerpc/pci: Allow to disable filling deprecated pci-OF-bus-map config: powerpc-allmodconfig (https://down

Re: [powerpc:next-test 14/40] pci.c:undefined reference to `pci_create_OF_bus_map'

2023-02-01 Thread Pali Rohár
On Thursday 02 February 2023 07:51:23 kernel test robot wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git > next-test > head: 9ffcf6a19dbb2a24de2c2d7b2af1e130986cd565 > commit: 869363998da87c80c16ff1221e95b41b2d3cceb2 [14/40] powerpc/pci: Allow > to disable fill

Re: [PATCH 1/2] tests/shell: Add check for perf data file in record+probe_libc_inet_pton test

2023-02-01 Thread Arnaldo Carvalho de Melo
Em Wed, Feb 01, 2023 at 11:34:20PM +0530, Athira Rajeev escreveu: > "probe libc's inet_pton & backtrace it with ping" test > installs a uprobe and uses perf record/script to check > the backtrace. Currently even if the "perf record" fails, > the test reports success. Logs below: > > # ./perf test

Re: [PATCH] tools/perf: Fix usage of perf probe when libtraceevent is missing

2023-02-01 Thread Arnaldo Carvalho de Melo
Em Tue, Jan 31, 2023 at 07:17:48PM +0530, Athira Rajeev escreveu: > While parsing the tracepoint events in parse_events_add_tracepoint() > function, code checks for HAVE_LIBTRACEEVENT support. This is needed > since libtraceevent is necessary for tracepoint. But while adding > probe points, check f

Re: [PATCH] tests/bpf: Fix the bpf test to check for libtraceevent support

2023-02-01 Thread Arnaldo Carvalho de Melo
Em Tue, Jan 31, 2023 at 07:20:01PM +0530, Athira Rajeev escreveu: > "bpf" tests fails in environment with missing libtraceevent > support as below: > > # ./perf test 36 > 36: BPF filter : > 36.1: Basic BPF filtering

[powerpc:fixes-test] BUILD SUCCESS fc546faa559538fb312c77e055243ece18ab3288

2023-02-01 Thread kernel test robot
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git fixes-test branch HEAD: fc546faa559538fb312c77e055243ece18ab3288 powerpc/kexec_file: Count hot-pluggable memory in FDT estimate elapsed time: 873m configs tested: 39 configs skipped: 127 The following configs have

Re: [PATCH 00/34] selftests: Fix incorrect kernel headers search path

2023-02-01 Thread Shuah Khan
Hi Mathieu, On 1/30/23 15:29, Shuah Khan wrote: On 1/27/23 06:57, Mathieu Desnoyers wrote: Hi, This series fixes incorrect kernel header search path in kernel selftests. Near the end of the series, a few changes are not tagged as "Fixes" because the current behavior is to rely on the kernel s

Re: [PATCH v2 1/4] powerpc/rtas: unexport 'rtas' symbol

2023-02-01 Thread Andrew Donnellan
On Tue, 2023-01-24 at 08:04 -0600, Nathan Lynch wrote: > No modular code needs access to the 'rtas' struct, so remove the > symbol export. > > Suggested-by: Michael Ellerman > Signed-off-by: Nathan Lynch A quick grep suggests that this is correct, and any modular code that wants access to the r

Re: [PATCH v2 2/4] powerpc/rtas: make all exports GPL

2023-02-01 Thread Andrew Donnellan
On Tue, 2023-01-24 at 08:04 -0600, Nathan Lynch wrote: > The first symbol exports of RTAS functions and data came with the > (now > removed) scanlog driver in 2003: > > https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git/commit/?id=f92e361842d5251e50562b09664082dcbd0548bb > > At the

Re: [PATCH 1/2] tests/shell: Add check for perf data file in record+probe_libc_inet_pton test

2023-02-01 Thread Athira Rajeev
> On 02-Feb-2023, at 6:10 AM, Arnaldo Carvalho de Melo wrote: > > Em Wed, Feb 01, 2023 at 11:34:20PM +0530, Athira Rajeev escreveu: >> "probe libc's inet_pton & backtrace it with ping" test >> installs a uprobe and uses perf record/script to check >> the backtrace. Currently even if the "perf

Re: [PATCH] tools/perf: Fix usage of perf probe when libtraceevent is missing

2023-02-01 Thread Athira Rajeev
> On 02-Feb-2023, at 6:20 AM, Arnaldo Carvalho de Melo wrote: > > Em Tue, Jan 31, 2023 at 07:17:48PM +0530, Athira Rajeev escreveu: >> While parsing the tracepoint events in parse_events_add_tracepoint() >> function, code checks for HAVE_LIBTRACEEVENT support. This is needed >> since libtracee

Re: [PATCH v2 3/4] powerpc/rtas: remove lock and args fields from global rtas struct

2023-02-01 Thread Andrew Donnellan
On Tue, 2023-01-24 at 08:04 -0600, Nathan Lynch wrote: > Only code internal to the RTAS subsystem needs access to the central > lock and parameter block. Remove these from the globally visible > 'rtas' struct and make them file-static in rtas.c. > > Some changed lines in rtas_call() lack appropria

Re: [PATCH] powerpc/kexec_file: Fix division by zero in extra size estimation

2023-02-01 Thread Hari Bathini
Thanks for the fix, Michael. On 30/01/23 7:17 am, Michael Ellerman wrote: In kexec_extra_fdt_size_ppc64() there's logic to estimate how much extra space will be needed in the device tree for some memory related properties. That logic uses the size of RAM divided by drmem_lmb_size() to do the es

Re: [PATCH v2 4/4] powerpc/rtas: upgrade internal arch spinlocks

2023-02-01 Thread Andrew Donnellan
On Tue, 2023-01-24 at 08:04 -0600, Nathan Lynch wrote: > At the time commit f97bb36f705d ("powerpc/rtas: Turn rtas lock into a > raw spinlock") was written, the spinlock lockup detection code called > __delay(), which will not make progress if the timebase is not > advancing. Since the interprocess