Re: [PATCH 1/2] powerpc/perf: Infrastructure to support checking of attr.config*

2021-02-24 Thread Madhavan Srinivasan
On 2/24/21 8:17 PM, Paul A. Clarke wrote: On Wed, Feb 24, 2021 at 07:58:39PM +0530, Madhavan Srinivasan wrote: Introduce code to support the checking of attr.config* for values which are reserved for a given platform. Performance Monitoring Unit (PMU) configuration registers have fileds that a

[PATCH] selftests/powerpc: Add uaccess flush test

2021-02-24 Thread Daniel Axtens
From: Thadeu Lima de Souza Cascardo Also based on the RFI and entry flush tests, it counts the L1D misses by doing a syscall that does user access: uname, in this case. Signed-off-by: Thadeu Lima de Souza Cascardo [dja: forward port, rename function] Signed-off-by: Daniel Axtens --- This app

[PATCH] docs: powerpc: Fix tables in syscall64-abi.rst

2021-02-24 Thread Andrew Donnellan
Commit 209b44c804c ("docs: powerpc: syscall64-abi.rst: fix a malformed table") attempted to fix the formatting of tables in syscall64-abi.rst, but inadvertently changed some register names. Redo the tables with the correct register names, and while we're here, clean things up to separate the regis

Re: [PATCH v6 07/10] powerpc/signal64: Replace restore_sigcontext() w/ unsafe_restore_sigcontext()

2021-02-24 Thread Christopher M. Riedl
On Tue Feb 23, 2021 at 11:36 AM CST, Christophe Leroy wrote: > > > Le 21/02/2021 à 02:23, Christopher M. Riedl a écrit : > > Previously restore_sigcontext() performed a costly KUAP switch on every > > uaccess operation. These repeated uaccess switches cause a significant > > drop in signal handling

[PATCH 3/3] powerpc/sstep: Always test lmw and stmw

2021-02-24 Thread Jordan Niethe
Load Multiple Word (lmw) and Store Multiple Word (stmw) will raise an Alignment Exception: - Little Endian mode: always - Big Endian mode: address not word aligned These conditions do not depend on cache inhibited memory. Test the alignment handler emulation of these instructions regardless of

[PATCH 2/3] selftests/powerpc: Suggest memtrace instead of /dev/mem for ci memory

2021-02-24 Thread Jordan Niethe
The suggested alternative for getting cache-inhibited memory with 'mem=' and /dev/mem is pretty hacky. Also, PAPR guests do not allow system memory to be mapped cache-inhibited so despite /dev/mem being available this will not work which can cause confusion. Instead recommend using the memtrace bu

[PATCH 1/3] powernv/memtrace: Allow mmaping trace buffers

2021-02-24 Thread Jordan Niethe
Let the memory removed from the linear mapping to be used for the trace buffers be mmaped. This is a useful way of providing cache-inhibited memory for the alignment_handler selftest. Signed-off-by: Jordan Niethe --- arch/powerpc/platforms/powernv/memtrace.c | 18 +- 1 file chang

[PATCH] powerpc/sstep: Fix VSX instruction emulation

2021-02-24 Thread Jordan Niethe
Commit af99da74333b ("powerpc/sstep: Support VSX vector paired storage access instructions") added loading and storing 32 word long data into adjacent VSRs. However the calculation used to determine if two VSRs needed to be loaded/stored inadvertently prevented the load/storing taking place for ins

[RFC PATCH 8/8] powerpc/64/asm: don't reassign labels

2021-02-24 Thread Daniel Axtens
The assembler really does not like us reassigning things to the same label: :7:9: error: invalid reassignment of non-absolute variable 'fs_label' This happens across a bunch of platforms: https://github.com/ClangBuiltLinux/linux/issues/1043 https://github.com/ClangBuiltLinux/linux/issues/1008 ht

[RFC PATCH 7/8] powerpc/purgatory: drop .machine specifier

2021-02-24 Thread Daniel Axtens
It's ignored by future versions of llvm's integrated assembler (by not -11). I'm not sure what it does for us in gas. Signed-off-by: Daniel Axtens --- arch/powerpc/purgatory/trampoline_64.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/purgatory/trampoline_64.S

[RFC PATCH 6/8] powerpc/mm/book3s64/hash: drop pre 2.06 tlbiel for clang

2021-02-24 Thread Daniel Axtens
The llvm integrated assembler does not recognise the ISA 2.05 tlbiel version. Eventually do this more smartly. Signed-off-by: Daniel Axtens --- arch/powerpc/mm/book3s64/hash_native.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/arch/powerpc/mm/book3s64/hash_native.c b/arch/po

[RFC PATCH 5/8] poweprc/lib/quad: Provide macros for lq/stq

2021-02-24 Thread Daniel Axtens
For some reason the integrated assembler in clang-11 doesn't recognise them. Eventually we should fix it there too. Signed-off-by: Daniel Axtens --- arch/powerpc/include/asm/ppc-opcode.h | 4 arch/powerpc/lib/quad.S | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) d

[RFC PATCH 4/8] powerpc/ppc_asm: use plain numbers for registers

2021-02-24 Thread Daniel Axtens
This is dumb but makes the llvm integrated assembler happy. https://github.com/ClangBuiltLinux/linux/issues/764 Signed-off-by: Daniel Axtens --- arch/powerpc/include/asm/ppc_asm.h | 64 +++--- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/arch/powerpc/in

[RFC PATCH 3/8] powerpc/head-64: do less gas-specific stuff with sections

2021-02-24 Thread Daniel Axtens
Reopening the section without specifying the same flags breaks the llvm integrated assembler. Don't do it: just specify all the flags all the time. Signed-off-by: Daniel Axtens --- arch/powerpc/include/asm/head-64.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch

[RFC PATCH 2/8] powerpc: check for support for -Wa,-m{power4,any}

2021-02-24 Thread Daniel Axtens
LLVM's integrated assembler does not like either -Wa,-mpower4 or -Wa,-many. So just don't pass them if they're not supported. Signed-off-by: Daniel Axtens --- arch/powerpc/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefil

[PATCH 1/8] powerpc/64s/exception: Clean up a missed SRR specifier

2021-02-24 Thread Daniel Axtens
Nick's patch cleaning up the SRR specifiers in exception-64s.S missed a single instance of EXC_HV_OR_STD. Clean that up. Caught by clang's integrated assembler. Fixes: 3f7fbd97d07d ("powerpc/64s/exception: Clean up SRR specifiers") Acked-by: Nicholas Piggin Signed-off-by: Daniel Axtens --- arc

[RFC PATCH 0/8] WIP support for the LLVM integrated assembler

2021-02-24 Thread Daniel Axtens
To support Clang's CFI we need LTO. For LTO, we need to be able to compile with the LLVM integrated assembler. Currently, we can't. This series gets us a bit closer, but I'm still stuck and I'm hoping someone can point me in the right direction. Patch 1 is a fix that can be merged at any time.

Re: [PATCH v6 06/10] powerpc/signal64: Replace setup_sigcontext() w/ unsafe_setup_sigcontext()

2021-02-24 Thread Christopher M. Riedl
On Tue Feb 23, 2021 at 11:12 AM CST, Christophe Leroy wrote: > > > Le 21/02/2021 à 02:23, Christopher M. Riedl a écrit : > > Previously setup_sigcontext() performed a costly KUAP switch on every > > uaccess operation. These repeated uaccess switches cause a significant > > drop in signal handling p

Re: [PATCH 12/13] KVM: PPC: Book3S HV: Move radix MMU switching together in the P9 path

2021-02-24 Thread Fabiano Rosas
Nicholas Piggin writes: > Switching the MMU from radix<->radix mode is tricky particularly as the > MMU can remain enabled and requires a certain sequence of SPR updates. > Move these together into their own functions. > > This also includes the radix TLB check / flush because it's tied in to > M

Re: [PATCH v6 01/10] powerpc/uaccess: Add unsafe_copy_from_user

2021-02-24 Thread Christopher M. Riedl
On Tue Feb 23, 2021 at 11:15 AM CST, Christophe Leroy wrote: > > > Le 21/02/2021 à 02:23, Christopher M. Riedl a écrit : > > Just wrap __copy_tofrom_user() for the usual 'unsafe' pattern which > > accepts a label to goto on error. > > > > Signed-off-by: Christopher M. Riedl > > Reviewed-by: Danie

Re: [PATCH] arch: powerpc: kernel: Change droping to dropping in the file traps.c

2021-02-24 Thread Randy Dunlap
On 2/23/21 11:55 PM, Bhaskar Chowdhury wrote: > > s/droping/dropping/ > > Signed-off-by: Bhaskar Chowdhury Acked-by: Randy Dunlap > --- > arch/powerpc/kernel/traps.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/tr

Re: [PATCH v5 2/3] KVM: PPC: Book3S HV: Add support for H_RPT_INVALIDATE

2021-02-24 Thread Fabiano Rosas
Bharata B Rao writes: > Implement H_RPT_INVALIDATE hcall and add KVM capability > KVM_CAP_PPC_RPT_INVALIDATE to indicate the support for the same. > > This hcall does two types of TLB invalidations: > > 1. Process-scoped invalidations for guests with LPCR[GTSE]=0. >This is currently not used

Re: [PATCH 1/2] powerpc/perf: Infrastructure to support checking of attr.config*

2021-02-24 Thread Paul A. Clarke
On Wed, Feb 24, 2021 at 07:58:39PM +0530, Madhavan Srinivasan wrote: > Introduce code to support the checking of attr.config* for > values which are reserved for a given platform. > Performance Monitoring Unit (PMU) configuration registers > have fileds that are reserved and specific values to bit

[PATCH 2/2] powerpc/perf: Add platform specific check_attr_config

2021-02-24 Thread Madhavan Srinivasan
Add platform specific attr.config value checks. Patch includes checks for power9 and power10 platforms. Signed-off-by: Madhavan Srinivasan --- arch/powerpc/perf/isa207-common.c | 41 +++ arch/powerpc/perf/isa207-common.h | 2 ++ arch/powerpc/perf/power10-pmu.c | 13

[PATCH 1/2] powerpc/perf: Infrastructure to support checking of attr.config*

2021-02-24 Thread Madhavan Srinivasan
Introduce code to support the checking of attr.config* for values which are reserved for a given platform. Performance Monitoring Unit (PMU) configuration registers have fileds that are reserved and specific values to bit fields as reserved. Writing a none zero values in these fields or writing inv

[PATCH] powerpc/perf: prevent mixed EBB and non-EBB events

2021-02-24 Thread Thadeu Lima de Souza Cascardo
EBB events must be under exclusive groups, so there is no mix of EBB and non-EBB events on the same PMU. This requirement worked fine as perf core would not allow other pinned events to be scheduled together with exclusive events. This assumption was broken by commit 1908dc911792 ("perf: Tweak per

Re: [PASEMI] Nemo board doesn't boot anymore because of moving pas_pci_init

2021-02-24 Thread Christian Zigotzky
On 24 February 21 at 03:17am, Oliver O'Halloran wrote: On Wed, Feb 24, 2021 at 11:55 AM Michael Ellerman wrote: Olof Johansson writes: Hi, On Tue, Feb 23, 2021 at 1:43 PM Christian Zigotzky wrote: Hello, The Nemo board [1] with a P.A. Semi PA6T SoC doesn't boot anymore because of moving "

Re: [PATCH] powerpc/perf: Fix handling of privilege level checks in perf interrupt context

2021-02-24 Thread Athira Rajeev
> On 23-Feb-2021, at 6:24 PM, Michael Ellerman wrote: > > Peter Zijlstra writes: >> On Tue, Feb 23, 2021 at 01:31:49AM -0500, Athira Rajeev wrote: >>> Running "perf mem record" in powerpc platforms with selinux enabled >>> resulted in soft lockup's. Below call-trace was seen in the logs: > ..

Re: [PATCH v2] vio: make remove callback return void

2021-02-24 Thread Anatoly Pugachev
On Wed, Feb 24, 2021 at 11:17 AM Uwe Kleine-König wrote: > > The driver core ignores the return value of struct bus_type::remove() > because there is only little that can be done. To simplify the quest to > make this function return void, let struct vio_driver::remove() return > void, too. All us

[PATCH v5 3/3] KVM: PPC: Book3S HV: Use H_RPT_INVALIDATE in nested KVM

2021-02-24 Thread Bharata B Rao
In the nested KVM case, replace H_TLB_INVALIDATE by the new hcall H_RPT_INVALIDATE if available. The availability of this hcall is determined from "hcall-rpt-invalidate" string in ibm,hypertas-functions DT property. Signed-off-by: Bharata B Rao Reviewed-by: Fabiano Rosas --- arch/powerpc/kvm/bo

[PATCH v5 1/3] powerpc/book3s64/radix: Add H_RPT_INVALIDATE pgsize encodings to mmu_psize_def

2021-02-24 Thread Bharata B Rao
Add a field to mmu_psize_def to store the page size encodings of H_RPT_INVALIDATE hcall. Initialize this while scanning the radix AP encodings. This will be used when invalidating with required page size encoding in the hcall. Signed-off-by: Bharata B Rao --- arch/powerpc/include/asm/book3s/64/m

[PATCH v5 2/3] KVM: PPC: Book3S HV: Add support for H_RPT_INVALIDATE

2021-02-24 Thread Bharata B Rao
Implement H_RPT_INVALIDATE hcall and add KVM capability KVM_CAP_PPC_RPT_INVALIDATE to indicate the support for the same. This hcall does two types of TLB invalidations: 1. Process-scoped invalidations for guests with LPCR[GTSE]=0. This is currently not used in KVM as GTSE is not usually dis

[PATCH v5 0/3] Support for H_RPT_INVALIDATE in PowerPC KVM

2021-02-24 Thread Bharata B Rao
This patchset adds support for the new hcall H_RPT_INVALIDATE and replaces the nested tlb flush calls with this new hcall if support for the same exists. Changes in v5: - - Included the h_rpt_invalidate page size information within mmu_pszie_defs[] as per David Gibson's suggestion. -

Is unrecoverable_exception() really an interrupt handler ?

2021-02-24 Thread Christophe Leroy
Hi Nick, You defined unrecoverable_exeption() as an interrupt handler in interrupt.h I think there are several issues around that: - do_bad_slb_fault() which is also an interrupt handler calls unrecoverable_exeption() - in exception-64s.S, unrecoverable_exeption() is called after machine_chec