[PATCH 0/2] Fix handling of h_set_dawr

2019-06-17 Thread Suraj Jitindar Singh
Series contains 2 patches to fix the host in kernel handling of the hcall h_set_dawr. First patch from Michael Neuling is just a resend added here for clarity. Michael Neuling (1): KVM: PPC: Book3S HV: Fix r3 corruption in h_set_dabr() Suraj Jitindar Singh (1): KVM: PPC: Book3S HV: Only writ

[PATCH 1/2] KVM: PPC: Book3S HV: Fix r3 corruption in h_set_dabr()

2019-06-17 Thread Suraj Jitindar Singh
From: Michael Neuling Commit c1fe190c0672 ("powerpc: Add force enable of DAWR on P9 option") screwed up some assembler and corrupted a pointer in r3. This resulted in crashes like the below: [ 44.374746] BUG: Kernel NULL pointer dereference at 0x13bf [ 44.374848] Faulting instruction

[PATCH 2/2] KVM: PPC: Book3S HV: Only write DAWR[X] when handling h_set_dawr in real mode

2019-06-17 Thread Suraj Jitindar Singh
The hcall H_SET_DAWR is used by a guest to set the data address watchpoint register (DAWR). This hcall is handled in the host in kvmppc_h_set_dawr() which can be called in either real mode on the guest exit path from hcall_try_real_mode() in book3s_hv_rmhandlers.S, or in virtual mode when called fr

Re: [PATCH v2] perf ioctl: Add check for the sample_period value

2019-06-17 Thread Ravi Bangoria
Peter / mpe, Is the v2 looks good? If so, can anyone of you please pick this up. On 6/4/19 9:59 AM, Ravi Bangoria wrote: > perf_event_open() limits the sample_period to 63 bits. See > commit 0819b2e30ccb ("perf: Limit perf_event_attr::sample_period > to 63 bits"). Make ioctl() consistent with it.

[PATCH] ps3: Use [] to denote a flexible array member

2019-06-17 Thread Geert Uytterhoeven
Flexible array members should be denoted using [] instead of [0], else gcc will not warn when they are no longer at the end of the structure. Signed-off-by: Geert Uytterhoeven --- arch/powerpc/include/asm/ps3stor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/

[PATCH v2 0/1] Forced-wakeup for stop states on Powernv

2019-06-17 Thread Abhishek Goel
Currently, the cpuidle governors determine what idle state a idling CPU should enter into based on heuristics that depend on the idle history on that CPU. Given that no predictive heuristic is perfect, there are cases where the governor predicts a shallow idle state, hoping that the CPU will be bus

[PATCH v2 1/1] cpuidle-powernv : forced wakeup for stop states

2019-06-17 Thread Abhishek Goel
Currently, the cpuidle governors determine what idle state a idling CPU should enter into based on heuristics that depend on the idle history on that CPU. Given that no predictive heuristic is perfect, there are cases where the governor predicts a shallow idle state, hoping that the CPU will be bus

Re: [PATCH 0/2] Fix handling of h_set_dawr

2019-06-17 Thread Cédric Le Goater
On 17/06/2019 09:16, Suraj Jitindar Singh wrote: > Series contains 2 patches to fix the host in kernel handling of the hcall > h_set_dawr. > > First patch from Michael Neuling is just a resend added here for clarity. > > Michael Neuling (1): > KVM: PPC: Book3S HV: Fix r3 corruption in h_set_dab

[PATCH] ps3_gelic: Use [] to denote a flexible array member

2019-06-17 Thread Geert Uytterhoeven
Flexible array members should be denoted using [] instead of [0], else gcc will not warn when they are no longer at the end of a struct. Signed-off-by: Geert Uytterhoeven --- drivers/net/ethernet/toshiba/ps3_gelic_net.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/

[PATCH] selftests/powerpc: Add missing newline at end of file

2019-06-17 Thread Geert Uytterhoeven
"git diff" says: \ No newline at end of file after modifying the file. Signed-off-by: Geert Uytterhoeven --- tools/testing/selftests/powerpc/mm/.gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/powerpc/mm/.gitignore b/tools/testing/self

Re: [PATCH] powerpc/32s: fix suspend/resume when IBATs 4-7 are used

2019-06-17 Thread Andreas Schwab
AS arch/powerpc/kernel/swsusp_32.o arch/powerpc/kernel/swsusp_32.S: Assembler messages: arch/powerpc/kernel/swsusp_32.S:109: Error: invalid bat number arch/powerpc/kernel/swsusp_32.S:111: Error: invalid bat number arch/powerpc/kernel/swsusp_32.S:113: Error: invalid bat number arch/powerpc/ke

Re: [PATCH] powerpc/32s: fix suspend/resume when IBATs 4-7 are used

2019-06-17 Thread Segher Boessenkool
On Mon, Jun 17, 2019 at 06:53:47PM +0200, Andreas Schwab wrote: > AS arch/powerpc/kernel/swsusp_32.o > arch/powerpc/kernel/swsusp_32.S: Assembler messages: > arch/powerpc/kernel/swsusp_32.S:109: Error: invalid bat number > arch/powerpc/kernel/swsusp_32.S:111: Error: invalid bat number (etc.)

Re: [PATCH v2] KVM: PPC: Report single stepping capability

2019-06-17 Thread Fabiano Rosas
Paul Mackerras writes: > On Wed, May 29, 2019 at 07:22:19PM -0300, Fabiano Rosas wrote: >> When calling the KVM_SET_GUEST_DEBUG ioctl, userspace might request >> the next instruction to be single stepped via the >> KVM_GUESTDBG_SINGLESTEP control bit of the kvm_guest_debug structure. >> >> We cu

[PATCH] crypto: talitos - eliminate unneeded 'done' functions at build time

2019-06-17 Thread Christophe Leroy
When building for SEC1 only, talitos2_done functions are unneeded and should go away. For this, use has_ftr_sec1() which will always return true when only SEC1 support is being built, allowing GCC to drop TALITOS2 functions. Signed-off-by: Christophe Leroy Reviewed-by: Horia Geantă --- taken o

[PATCH v4 0/4] Additional fixes on Talitos driver

2019-06-17 Thread Christophe Leroy
This series is the last set of fixes for the Talitos driver. We now get a fully clean boot on both SEC1 (SEC1.2 on mpc885) and SEC2 (SEC2.2 on mpc8321E) with CONFIG_CRYPTO_MANAGER_EXTRA_TESTS: [3.385197] bus: 'platform': really_probe: probing driver talitos with device ff02.crypto [3

[PATCH v4 1/4] lib/scatterlist: Fix mapping iterator when sg->offset is greater than PAGE_SIZE

2019-06-17 Thread Christophe Leroy
All mapping iterator logic is based on the assumption that sg->offset is always lower than PAGE_SIZE. But there are situations where sg->offset is such that the SG item is on the second page. In that case sg_copy_to_buffer() fails properly copying the data into the buffer. One of the reason is tha

[PATCH v4 2/4] crypto: talitos - move struct talitos_edesc into talitos.h

2019-06-17 Thread Christophe Leroy
Moves struct talitos_edesc into talitos.h so that it can be used from any place in talitos.c It will be required for next patch ("crypto: talitos - fix hash on SEC1") Signed-off-by: Christophe Leroy Cc: sta...@vger.kernel.org --- drivers/crypto/talitos.c | 30 -- dri

[PATCH v4 4/4] crypto: talitos - drop icv_ool

2019-06-17 Thread Christophe Leroy
icv_ool is not used anymore, drop it. Fixes: e345177ded17 ("crypto: talitos - fix AEAD processing.") Signed-off-by: Christophe Leroy --- drivers/crypto/talitos.c | 3 --- drivers/crypto/talitos.h | 2 -- 2 files changed, 5 deletions(-) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/tali

[PATCH v4 3/4] crypto: talitos - fix hash on SEC1.

2019-06-17 Thread Christophe Leroy
On SEC1, hash provides wrong result when performing hashing in several steps with input data SG list has more than one element. This was detected with CONFIG_CRYPTO_MANAGER_EXTRA_TESTS: [ 44.185947] alg: hash: md5-talitos test failed (wrong result) on test vector 6, cfg="random: may_sleep use_f

[PATCH] powerpc/mm/32s: fix condition that is always true

2019-06-17 Thread Andreas Schwab
Move a misplaced paren that makes the condition always true. Fixes: 63b2bc619565 ("powerpc/mm/32s: Use BATs for STRICT_KERNEL_RWX") Signed-off-by: Andreas Schwab --- arch/powerpc/mm/pgtable_32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/mm/pgtable_32.c b/ar

[PATCH] selftests/powerpc: Fix earlyclobber in tm-vmxcopy

2019-06-17 Thread Gustavo Romero
In some cases, compiler can allocate the same register for operand 'res' and 'vecoutptr', resulting in segfault at 'stxvd2x 40,0,%[vecoutptr]' because base register will contain 1, yielding a false-positive. This is because output 'res' must be marked as an earlyclobber operand so it may not overl

[PATCH v2] powerpc/32s: fix suspend/resume when IBATs 4-7 are used

2019-06-17 Thread Christophe Leroy
Previously, only IBAT1 and IBAT2 were used to map kernel linear mem. Since commit 63b2bc619565 ("powerpc/mm/32s: Use BATs for STRICT_KERNEL_RWX"), we may have all 8 BATs used for mapping kernel text. But the suspend/restore functions only save/restore BATs 0 to 3, and clears BATs 4 to 7. Make susp

Re: [PATCH] powerpc/mm/32s: fix condition that is always true

2019-06-17 Thread Christophe Leroy
Le 17/06/2019 à 23:22, Andreas Schwab a écrit : Move a misplaced paren that makes the condition always true. Fixes: 63b2bc619565 ("powerpc/mm/32s: Use BATs for STRICT_KERNEL_RWX") Signed-off-by: Andreas Schwab Reviewed-by: Christophe Leroy --- arch/powerpc/mm/pgtable_32.c | 2 +- 1 f

Re: Re: [PATCH v3 4/9] KVM: PPC: Ultravisor: Add generic ultravisor call handler

2019-06-17 Thread Ram Pai
On Mon, Jun 17, 2019 at 12:06:32PM +1000, Paul Mackerras wrote: > On Thu, Jun 06, 2019 at 02:36:09PM -0300, Claudio Carvalho wrote: > > From: Ram Pai > > > > Add the ucall() function, which can be used to make ultravisor calls > > with varied number of in and out arguments. Ultravisor calls can b

Re: [PATCH] ocxl: Allow contexts to be attached with a NULL mm

2019-06-17 Thread Andrew Donnellan
On 17/6/19 2:41 pm, Alastair D'Silva wrote: From: Alastair D'Silva If an OpenCAPI context is to be used directly by a kernel driver, there may not be a suitable mm to use. The patch makes the mm parameter to ocxl_context_attach optional. Signed-off-by: Alastair D'Silva The one issue I can

Re: [PATCH v1 1/6] mm: Section numbers use the type "unsigned long"

2019-06-17 Thread Andrew Morton
On Sat, 15 Jun 2019 10:06:54 +0200 Christophe Leroy wrote: > > > Le 14/06/2019 à 21:00, Andrew Morton a écrit : > > On Fri, 14 Jun 2019 12:01:09 +0200 David Hildenbrand > > wrote: > > > >> We are using a mixture of "int" and "unsigned long". Let's make this > >> consistent by using "unsigne

Re: [PATCH kernel] powerpc/pci/of: Parse unassigned resources

2019-06-17 Thread Sam Bobroff
On Fri, Jun 14, 2019 at 01:18:28PM +1000, Alexey Kardashevskiy wrote: > > > On 14/06/2019 12:59, Alexey Kardashevskiy wrote: > > The pseries platform uses the PCI_PROBE_DEVTREE method of PCI probing > > which is basically reading "assigned-addresses" of every PCI device. > > However if the proper

Re: [PATCH kernel v3 0/3] powerpc/ioda2: Yet another attempt to allow DMA masks between 32 and 59

2019-06-17 Thread Shawn Anastasio
On 6/12/19 2:15 PM, Shawn Anastasio wrote: On 6/12/19 2:07 AM, Alexey Kardashevskiy wrote: On 12/06/2019 15:05, Shawn Anastasio wrote: On 6/5/19 11:11 PM, Shawn Anastasio wrote: On 5/30/19 2:03 AM, Alexey Kardashevskiy wrote: This is an attempt to allow DMA masks between 32..59 which are not

[PATCH 0/5] Powerpc/hw-breakpoint: Fixes plus Code refactor

2019-06-17 Thread Ravi Bangoria
patch 1-3: Code refactor patch 4: Speedup disabling breakpoint patch 5: Fix length calculation for unaligned targets Ravi Bangoria (5): Powerpc/hw-breakpoint: Replace stale do_dabr() with do_break() Powerpc/hw-breakpoint: Refactor hw_breakpoint_arch_parse() Powerpc/hw-breakpoint: Refactor se

[PATCH 1/5] Powerpc/hw-breakpoint: Replace stale do_dabr() with do_break()

2019-06-17 Thread Ravi Bangoria
do_dabr() was renamed with do_break() long ago. But I still see some comments mentioning do_dabr(). Replace it. Signed-off-by: Ravi Bangoria --- arch/powerpc/kernel/hw_breakpoint.c | 2 +- arch/powerpc/kernel/ptrace.c| 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/

[PATCH 2/5] Powerpc/hw-breakpoint: Refactor hw_breakpoint_arch_parse()

2019-06-17 Thread Ravi Bangoria
Move feature availability check at the start of the function. Rearrange comment to it's associated code. Use hw->address and hw->len in the 512 bytes boundary check(to write if statement in a single line). Add spacing between code blocks. Signed-off-by: Ravi Bangoria --- arch/powerpc/kernel/hw_b

[PATCH 3/5] Powerpc/hw-breakpoint: Refactor set_dawr()

2019-06-17 Thread Ravi Bangoria
Remove unnecessary comments. Code itself is self explanatory. And, ISA already talks about MRD field. I Don't think we need to re-describe it. Signed-off-by: Ravi Bangoria --- arch/powerpc/kernel/process.c | 17 + 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/arc

[PATCH 4/5] Powerpc/hw-breakpoint: Optimize disable path

2019-06-17 Thread Ravi Bangoria
Directly setting dawr and dawrx with 0 should be enough to disable watchpoint. No need to reset individual bits in variable and then set in hw. Signed-off-by: Ravi Bangoria --- arch/powerpc/include/asm/hw_breakpoint.h | 3 ++- arch/powerpc/kernel/process.c| 12 2 files

[PATCH 5/5] Powerpc/Watchpoint: Fix length calculation for unaligned target

2019-06-17 Thread Ravi Bangoria
Watchpoint match range is always doubleword(8 bytes) aligned on powerpc. If the given range is crossing doubleword boundary, we need to increase the length such that next doubleword also get covered. Ex, address len = 6 bytes |=. |v--|--v-

[PATCH] powerpc/mm: Ensure Huge-page memory is free before allocation

2019-06-17 Thread Vaibhav Jain
We recently discovered an bug where physical memory meant for allocation of Huge-pages was inadvertently allocated by another component during early boot. The behavior of memblock_reserve() where it wont indicate whether an existing reserved block overlaps with the requested reservation only makes

Re: [PATCH 0/5] Powerpc/hw-breakpoint: Fixes plus Code refactor

2019-06-17 Thread Christophe Leroy
Le 18/06/2019 à 06:27, Ravi Bangoria a écrit : patch 1-3: Code refactor patch 4: Speedup disabling breakpoint patch 5: Fix length calculation for unaligned targets While you are playing with hw breakpoints, did you have a look at https://github.com/linuxppc/issues/issues/38 ? Christophe

Re: [PATCH 1/5] Powerpc/hw-breakpoint: Replace stale do_dabr() with do_break()

2019-06-17 Thread Michael Neuling
> Subject: Powerpc/hw-breakpoint: Replace stale do_dabr() with do_break() Can you add the word "comment" to this subject. Currently it implies there are code changes here. Mikey On Tue, 2019-06-18 at 09:57 +0530, Ravi Bangoria wrote: > do_dabr() was renamed with do_break() long ago. But I still

Re: [PATCH 3/5] Powerpc/hw-breakpoint: Refactor set_dawr()

2019-06-17 Thread Michael Neuling
This is going to collide with this patch https://patchwork.ozlabs.org/patch/1109594/ Mikey On Tue, 2019-06-18 at 09:57 +0530, Ravi Bangoria wrote: > Remove unnecessary comments. Code itself is self explanatory. > And, ISA already talks about MRD field. I Don't think we need > to re-describe it.

Re: [PATCH 1/5] Powerpc/hw-breakpoint: Replace stale do_dabr() with do_break()

2019-06-17 Thread Christophe Leroy
The subject text should mention you are changing comments. Here it suggests you are changing code text. Le 18/06/2019 à 06:27, Ravi Bangoria a écrit : do_dabr() was renamed with do_break() long ago. But I still see some comments mentioning do_dabr(). Replace it. s/Replace it/Replace them/ Ch

Re: [PATCH 4/5] Powerpc/hw-breakpoint: Optimize disable path

2019-06-17 Thread Michael Neuling
On Tue, 2019-06-18 at 09:57 +0530, Ravi Bangoria wrote: > Directly setting dawr and dawrx with 0 should be enough to > disable watchpoint. No need to reset individual bits in > variable and then set in hw. This seems like a pointless optimisation to me. I'm all for adding more code/complexity if

Re: [PATCH 0/5] Powerpc/hw-breakpoint: Fixes plus Code refactor

2019-06-17 Thread Michael Neuling
On Tue, 2019-06-18 at 08:01 +0200, Christophe Leroy wrote: > > Le 18/06/2019 à 06:27, Ravi Bangoria a écrit : > > patch 1-3: Code refactor > > patch 4: Speedup disabling breakpoint > > patch 5: Fix length calculation for unaligned targets > > While you are playing with hw breakpoints, did you hav

Re: [PATCH 2/5] Powerpc/hw-breakpoint: Refactor hw_breakpoint_arch_parse()

2019-06-17 Thread Christophe Leroy
Le 18/06/2019 à 06:27, Ravi Bangoria a écrit : Move feature availability check at the start of the function. Rearrange comment to it's associated code. Use hw->address and hw->len in the 512 bytes boundary check(to write if statement in a single line). Add spacing between code blocks. Are th

Re: [PATCH 3/5] Powerpc/hw-breakpoint: Refactor set_dawr()

2019-06-17 Thread Christophe Leroy
Le 18/06/2019 à 06:27, Ravi Bangoria a écrit : Remove unnecessary comments. Code itself is self explanatory. And, ISA already talks about MRD field. I Don't think we need to re-describe it. In an RFC patch you may "don't think". But in the final patch you need to make a decision and write it

Re: [PATCH 4/5] Powerpc/hw-breakpoint: Optimize disable path

2019-06-17 Thread Christophe Leroy
Le 18/06/2019 à 06:27, Ravi Bangoria a écrit : Directly setting dawr and dawrx with 0 should be enough to disable watchpoint. No need to reset individual bits in variable and then set in hw. Signed-off-by: Ravi Bangoria --- arch/powerpc/include/asm/hw_breakpoint.h | 3 ++- arch/powerpc/k

Re: [PATCH kernel v3 0/3] powerpc/ioda2: Yet another attempt to allow DMA masks between 32 and 59

2019-06-17 Thread Alexey Kardashevskiy
On 18/06/2019 14:26, Shawn Anastasio wrote: > On 6/12/19 2:15 PM, Shawn Anastasio wrote: >> On 6/12/19 2:07 AM, Alexey Kardashevskiy wrote: >>> >>> >>> On 12/06/2019 15:05, Shawn Anastasio wrote: On 6/5/19 11:11 PM, Shawn Anastasio wrote: > On 5/30/19 2:03 AM, Alexey Kardashevskiy wrote

Re: [PATCH 0/1] PPC32: fix ptrace() access to FPU registers

2019-06-17 Thread Daniel Axtens
Radu Rendec writes: > On Mon, 2019-06-17 at 11:19 +1000, Daniel Axtens wrote: >> Radu Rendec < >> radu.ren...@gmail.com >> > writes: >> >> > Hi Everyone, >> > >> > I'm following up on the ptrace() problem that I reported a few days ago. >> > I believe my version of the code handles all cases co

Re: [PATCH 5/5] Powerpc/Watchpoint: Fix length calculation for unaligned target

2019-06-17 Thread Christophe Leroy
Le 18/06/2019 à 06:27, Ravi Bangoria a écrit : Watchpoint match range is always doubleword(8 bytes) aligned on powerpc. If the given range is crossing doubleword boundary, we need to increase the length such that next doubleword also get covered. Ex, address len = 6 bytes