Re: [RESEND PATCH v4 05/11] powerpc/64s: Add ability to skip SLB preload

2021-06-30 Thread Christopher M. Riedl
On Thu Jul 1, 2021 at 1:04 AM CDT, Nicholas Piggin wrote: > Excerpts from Christopher M. Riedl's message of July 1, 2021 3:28 pm: > > On Wed Jun 30, 2021 at 11:15 PM CDT, Nicholas Piggin wrote: > >> Excerpts from Christopher M. Riedl's message of July 1, 2021 1:48 pm: > >> > On Sun Jun 20, 2021 at

Re: [RESEND PATCH v4 08/11] powerpc: Initialize and use a temporary mm for patching

2021-06-30 Thread Nicholas Piggin
Excerpts from Christopher M. Riedl's message of May 6, 2021 2:34 pm: > When code patching a STRICT_KERNEL_RWX kernel the page containing the > address to be patched is temporarily mapped as writeable. Currently, a > per-cpu vmalloc patch area is used for this purpose. While the patch > area is per-

Re: [RESEND PATCH v4 05/11] powerpc/64s: Add ability to skip SLB preload

2021-06-30 Thread Nicholas Piggin
Excerpts from Christopher M. Riedl's message of July 1, 2021 3:28 pm: > On Wed Jun 30, 2021 at 11:15 PM CDT, Nicholas Piggin wrote: >> Excerpts from Christopher M. Riedl's message of July 1, 2021 1:48 pm: >> > On Sun Jun 20, 2021 at 10:13 PM CDT, Daniel Axtens wrote: >> >> "Christopher M. Riedl" w

Re: [PATCH v6 0/3] Introduce 64b relocatable kernel

2021-06-30 Thread Palmer Dabbelt
On Thu, 17 Jun 2021 06:33:48 PDT (-0700), a...@ghiti.fr wrote: Le 18/05/2021 à 12:12, Alexandre Ghiti a écrit : After multiple attempts, this patchset is now based on the fact that the 64b kernel mapping was moved outside the linear mapping. The first patch allows to build relocatable kernels b

Re: [RESEND PATCH v4 05/11] powerpc/64s: Add ability to skip SLB preload

2021-06-30 Thread Christopher M. Riedl
On Wed Jun 30, 2021 at 11:15 PM CDT, Nicholas Piggin wrote: > Excerpts from Christopher M. Riedl's message of July 1, 2021 1:48 pm: > > On Sun Jun 20, 2021 at 10:13 PM CDT, Daniel Axtens wrote: > >> "Christopher M. Riedl" writes: > >> > >> > Switching to a different mm with Hash translation causes

Re: [RESEND PATCH v4 08/11] powerpc: Initialize and use a temporary mm for patching

2021-06-30 Thread Christopher M. Riedl
On Sun Jun 20, 2021 at 10:19 PM CDT, Daniel Axtens wrote: > Hi Chris, > > > + /* > > +* Choose a randomized, page-aligned address from the range: > > +* [PAGE_SIZE, DEFAULT_MAP_WINDOW - PAGE_SIZE] > > +* The lower address bound is PAGE_SIZE to avoid the zero-page. > > +* The upper

[PATCH v2 1/2] sched/topology: Skip updating masks for non-online nodes

2021-06-30 Thread Srikar Dronamraju
Currently scheduler doesn't check if node is online before adding CPUs to the node mask. However on some architectures, node distance is only available for nodes that are online. Its not sure how much to rely on the node distance, when one of the nodes is offline. If said node distance is fake (si

[PATCH v2 2/2] powerpc/numa: Fill distance_lookup_table for offline nodes

2021-06-30 Thread Srikar Dronamraju
Currently scheduler populates the distance map by looking at distance of each node from all other nodes. This should work for most architectures and platforms. Scheduler expects unique number of node distances to be available at boot. It uses node distance to calculate this unique node distances.

[PATCH v2 0/2] Skip numa distance for offline nodes

2021-06-30 Thread Srikar Dronamraju
Changelog v1->v2: v1: http://lore.kernel.org/lkml/20210520154427.1041031-1-sri...@linux.vnet.ibm.com/t/#u - Update the numa masks, whenever 1st CPU is added to cpuless node - Populate all possible nodes distances in boot in a powerpc specific function Geetika reported yet another trace while doin

Re: [RESEND PATCH v4 05/11] powerpc/64s: Add ability to skip SLB preload

2021-06-30 Thread Nicholas Piggin
Excerpts from Christopher M. Riedl's message of July 1, 2021 1:48 pm: > On Sun Jun 20, 2021 at 10:13 PM CDT, Daniel Axtens wrote: >> "Christopher M. Riedl" writes: >> >> > Switching to a different mm with Hash translation causes SLB entries to >> > be preloaded from the current thread_info. This r

Re: [RESEND PATCH v4 05/11] powerpc/64s: Add ability to skip SLB preload

2021-06-30 Thread Christopher M. Riedl
On Sun Jun 20, 2021 at 10:13 PM CDT, Daniel Axtens wrote: > "Christopher M. Riedl" writes: > > > Switching to a different mm with Hash translation causes SLB entries to > > be preloaded from the current thread_info. This reduces SLB faults, for > > example when threads share a common mm but operat

[powerpc:merge] BUILD SUCCESS 086d9878e1092e7e69a69676ee9ec792690abb1d

2021-06-30 Thread kernel test robot
onfig mips allmodconfig powerpc allyesconfig powerpc allmodconfig powerpc allnoconfig x86_64 randconfig-a002-20210630 x86_64 randconfig-a001-20210630 x86_64 randconfig-a004-20210

[powerpc:next] BUILD REGRESSION 91fc46eced0f70526d74468ac6c932c90a8585b3

2021-06-30 Thread kernel test robot
/platforms/pseries/vas.c:186:13: warning: no previous prototype for 'pseries_vas_fault_thread_fn' [-Wmissing-prototypes] Error/Warning ids grouped by kconfigs: gcc_recent_errors `-- powerpc64-randconfig-r034-20210630 `-- arch-powerpc-platforms-pseries-vas.c:warning:no-

Re: [PATCH v3 3/9] powerpc/64e: remove implicit soft-masking and interrupt exit restart logic

2021-06-30 Thread Nicholas Piggin
Excerpts from Christophe Leroy's message of June 30, 2021 5:56 pm: > > > Le 30/06/2021 à 09:46, Nicholas Piggin a écrit : >> The implicit soft-masking to speed up interrupt return was going to be >> used by 64e as well, but it has not been extensively tested on that >> platform and is not conside

Re: [RFC PATCH 19/43] KVM: PPC: Book3S HV P9: Add kvmppc_stop_thread to match kvmppc_start_thread

2021-06-30 Thread Fabiano Rosas
Nicholas Piggin writes: > Small cleanup makes it a bit easier to match up entry and exit > operations. > > Signed-off-by: Nicholas Piggin Reviewed-by: Fabiano Rosas > --- > arch/powerpc/kvm/book3s_hv.c | 11 +-- > 1 file changed, 9 insertions(+), 2 deletions(-) > > diff --git a/arch/

Re: [RFC PATCH 07/43] KVM: PPC: Book3S HV: POWER10 enable HAIL when running radix guests

2021-06-30 Thread Fabiano Rosas
Nicholas Piggin writes: > HV interrupts may be taken with the MMU enabled when radix guests are > running. Enable LPCR[HAIL] on ISA v3.1 processors for radix guests. > Make this depend on the host LPCR[HAIL] being enabled. Currently that is > always enabled, but having this test means any issue t

Re: [RFC PATCH 08/43] powerpc/64s: Keep AMOR SPR a constant ~0 at runtime

2021-06-30 Thread Fabiano Rosas
Nicholas Piggin writes: > This register controls supervisor SPR modifications, and as such is only > relevant for KVM. KVM always sets AMOR to ~0 on guest entry, and never > restores it coming back out to the host, so it can be kept constant and > avoid the mtSPR in KVM guest entry. > > -21 cycle

Re: [RFC PATCH 38/43] KVM: PPC: Book3S HV P9: Test dawr_enabled() before saving host DAWR SPRs

2021-06-30 Thread Fabiano Rosas
Nicholas Piggin writes: > Some of the DAWR SPR access is already predicated on dawr_enabled(), > apply this to the remainder of the accesses. > > Signed-off-by: Nicholas Piggin > --- > arch/powerpc/kvm/book3s_hv_p9_entry.c | 34 --- > 1 file changed, 20 insertions(+), 14

Re: [RFC PATCH 01/43] powerpc/64s: Remove WORT SPR from POWER9/10

2021-06-30 Thread Fabiano Rosas
Nicholas Piggin writes: > This register is not architected and not implemented in POWER9 or 10, > it just reads back zeroes for compatibility. > > -78 cycles (9255) cycles POWER9 virt-mode NULL hcall > > Signed-off-by: Nicholas Piggin Reviewed-by: Fabiano Rosas > --- > arch/powerpc/kvm/book3

Re: [PATCH v15 06/12] swiotlb: Use is_swiotlb_force_bounce for swiotlb data bouncing

2021-06-30 Thread Nathan Chancellor
Hi Will and Claire, On Wed, Jun 30, 2021 at 12:43:48PM +0100, Will Deacon wrote: > On Wed, Jun 30, 2021 at 05:17:27PM +0800, Claire Chang wrote: > > On Wed, Jun 30, 2021 at 9:43 AM Nathan Chancellor wrote: > > > > > > On Thu, Jun 24, 2021 at 11:55:20PM +0800, Claire Chang wrote: > > > > Propagate

Re: [PATCH] powerpc/32s: Fix setup_{kuap/kuep}() on SMP

2021-06-30 Thread Michael Ellerman
On Mon, 28 Jun 2021 06:56:11 + (UTC), Christophe Leroy wrote: > On SMP, setup_kup() is also called from start_secondary(). > > start_secondary() is not an __init function. > > Remove the __init marker from setup_kuep() and and setup_kuap(). Applied to powerpc/next. [1/1] powerpc/32s: Fix se

Re: [PATCH v3 0/9] powerpc: fast interrupt exit bug and misc fixes

2021-06-30 Thread Michael Ellerman
On Wed, 30 Jun 2021 17:46:12 +1000, Nicholas Piggin wrote: > This is a bunch of fixes for powerpc next, mostly a nasty hole in fast > interrupt exit code found by Sachin and some other bits along the way > while looking at it. > > Since v2: > - Fixed 64e patch 3 to really set exit_must_hard_disabl

Re: [PATCH v2] powerpc/4xx: Fix setup_kuep() on SMP

2021-06-30 Thread Michael Ellerman
On Tue, 29 Jun 2021 12:24:21 + (UTC), Christophe Leroy wrote: > On SMP, setup_kuep() is also called from start_secondary() since > commit 86f46f343272 ("powerpc/32s: Initialise KUAP and KUEP in C"). > > start_secondary() is not an __init function. > > Remove the __init marker from setup_kuep(

Re: [PATCH] crypto: DRBG - select SHA512

2021-06-30 Thread Sachin Sant
> On 30-Jun-2021, at 4:02 PM, Stephan Mueller wrote: > > With the swtich to use HMAC(SHA-512) as the default DRBG type, the > configuration must now also select SHA-512. > > Fixes: 9b7b94683a9b "crypto: DRBG - switch to HMAC SHA512 DRBG as default > DRBG" > Reported-by: Sachin Sant > Signed-o

[PATCH] powerpc/papr_scm: Move duplicate definitions to common header files

2021-06-30 Thread Shivaprasad G Bhat
The papr_scm uses PDSM structures like nd_papr_pdsm_health as the PDSM payload which would be reused by ndtest. Since ndtest is arch independent, move the PDSM header from arch/powerpc/include/uapi/ to the generic include/uapi/linux directory. Also, there are some #defines common between papr_scm

Re: [PATCH v15 06/12] swiotlb: Use is_swiotlb_force_bounce for swiotlb data bouncing

2021-06-30 Thread Will Deacon
On Wed, Jun 30, 2021 at 05:17:27PM +0800, Claire Chang wrote: > On Wed, Jun 30, 2021 at 9:43 AM Nathan Chancellor wrote: > > > > On Thu, Jun 24, 2021 at 11:55:20PM +0800, Claire Chang wrote: > > > Propagate the swiotlb_force into io_tlb_default_mem->force_bounce and > > > use it to determine wheth

[PATCH] crypto: DRBG - select SHA512

2021-06-30 Thread Stephan Mueller
With the swtich to use HMAC(SHA-512) as the default DRBG type, the configuration must now also select SHA-512. Fixes: 9b7b94683a9b "crypto: DRBG - switch to HMAC SHA512 DRBG as default DRBG" Reported-by: Sachin Sant Signed-off-by: Stephan Mueller --- crypto/Kconfig | 2 +- 1 file changed, 1 ins

Re: [PATCH v15 06/12] swiotlb: Use is_swiotlb_force_bounce for swiotlb data bouncing

2021-06-30 Thread Claire Chang
On Wed, Jun 30, 2021 at 9:43 AM Nathan Chancellor wrote: > > On Thu, Jun 24, 2021 at 11:55:20PM +0800, Claire Chang wrote: > > Propagate the swiotlb_force into io_tlb_default_mem->force_bounce and > > use it to determine whether to bounce the data or not. This will be > > useful later to allow for

Re: [PATCH v3 3/9] powerpc/64e: remove implicit soft-masking and interrupt exit restart logic

2021-06-30 Thread Christophe Leroy
Le 30/06/2021 à 09:46, Nicholas Piggin a écrit : The implicit soft-masking to speed up interrupt return was going to be used by 64e as well, but it has not been extensively tested on that platform and is not considered ready. It was intended to be disabled before merge. Disable it for now. Mo

[PATCH v3 9/9] powerpc/64s: move ret_from_fork etc above __end_soft_masked

2021-06-30 Thread Nicholas Piggin
Code which runs with interrupts enabled should be moved above __end_soft_masked where possible, because maskable interrupts that hit below that symbol will need to consult the soft mask table, which is an extra cost. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/interrupt_64.S | 52

[PATCH v3 8/9] powerpc/64s/interrupt: clean up interrupt return labels

2021-06-30 Thread Nicholas Piggin
Normal kernel-interrupt exits can get interrupt_return_srr_user_restart in their backtrace, which is an unusual and notable function, and it is part of the user-interrupt exit path, which is doubly confusing. Add non-local labels for both user and kernel interrupt exit cases to address this and ma

[PATCH v3 7/9] powerpc/64/interrupt: add missing kprobe annotations on interrupt exit symbols

2021-06-30 Thread Nicholas Piggin
If one interrupt exit symbol must not be kprobed, none of them can be, without more justification for why it's safe. Disallow kprobing on any of the (non-local) labels in the exit paths. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/interrupt_64.S | 6 ++ 1 file changed, 6 insertion

[PATCH v3 6/9] powerpc/64: enable MSR[EE] in irq replay pt_regs

2021-06-30 Thread Nicholas Piggin
Similar to commit 2b48e96be2f9f ("powerpc/64: fix irq replay pt_regs->softe value"), enable MSR_EE in pt_regs->msr. This makes the regs look more normal. It also allows some extra debug checks to be added to interrupt handler entry. Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/int

[PATCH v3 5/9] powerpc/64s/interrupt: preserve regs->softe for NMI interrupts

2021-06-30 Thread Nicholas Piggin
If an NMI interrupt hits in an implicit soft-masked region, regs->softe is modified to reflect that. This may not be necessary for correctness at the moment, but it is less surprising and it's unhelpful when debugging or adding checks. Make sure this is changed back to how it was found before retu

[PATCH v3 4/9] powerpc/64s: add a table of implicit soft-masked addresses

2021-06-30 Thread Nicholas Piggin
Commit 9d1988ca87dd ("powerpc/64: treat low kernel text as irqs soft-masked") ends up catching too much code, including ret_from_fork, and parts of interrupt and syscall return that do not expect to be interrupts to be soft-masked. If an interrupt gets marked pending, and then the code proceeds out

[PATCH v3 3/9] powerpc/64e: remove implicit soft-masking and interrupt exit restart logic

2021-06-30 Thread Nicholas Piggin
The implicit soft-masking to speed up interrupt return was going to be used by 64e as well, but it has not been extensively tested on that platform and is not considered ready. It was intended to be disabled before merge. Disable it for now. Most of the restart code is common with 64s, so with mor

[PATCH v3 0/9] powerpc: fast interrupt exit bug and misc fixes

2021-06-30 Thread Nicholas Piggin
This is a bunch of fixes for powerpc next, mostly a nasty hole in fast interrupt exit code found by Sachin and some other bits along the way while looking at it. Since v2: - Fixed 64e patch 3 to really set exit_must_hard_disable. - Reworded some changelogs. Since v1: - Fixed a bisection compile e

[PATCH v3 2/9] powerpc/64e: fix CONFIG_RELOCATABLE build warnings

2021-06-30 Thread Nicholas Piggin
CONFIG_RELOCATABLE=y causes build warnings from unresolved relocations. Fix these by using TOC addressing for these cases. Commit 24d33ac5b8ff ("powerpc/64s: Make prom_init require RELOCATABLE") caused some 64e configs to select RELOCATABLE resulting in these warnings, but the underlying issue was

[PATCH v3 1/9] powerpc/64s: fix hash page fault interrupt handler

2021-06-30 Thread Nicholas Piggin
The early bad fault or key fault test in do_hash_fault() ends up calling into ___do_page_fault without having gone through an interrupt handler wrapper (except the initial _RAW one). This can end up calling local irq functions while the interrupt has not been reconciled, which will likely cause cra

[powerpc][5.13.0-next20210629] Kernel WARN crypto/testmgr.c:5653 during boot

2021-06-30 Thread Sachin Sant
While booting 5.13.0-next20210629 on a Power server, following warning is seen: [0.076955] DRBG: could not allocate digest TFM handle: hmac(sha512) [0.076960] alg: drbg: Failed to reset rng [0.076963] alg: drbg: Test 0 failed for drbg_nopr_hmac_sha512 [0.076967] [ cut h