INIT: PANIC: segmentation violation! sleeping for 30 seconds.

2009-10-26 Thread Breno Leitao
Hi, I just put a upstream kernel(rc5) on a specific machine I have (Power5), and I got the following error: INIT: PANIC: segmentation violation! sleeping for 30 seconds. init has generated signal 11 but has no handler for it init used greatest stack depth: 6240 bytes left Kernel panic - not

[RFC PATCH] PCI-E broken on PPC (regression)

2010-01-25 Thread Breno Leitao
Hello, I found that qlge is broken on PPC, and it got broken after commit 06a1cbafb253c4c60d6a54a994887f5fbceabcc0. It happens because dev-pcie is not set on PPC, because the function set_pcie_port_type(), who sets dev-pcie, is not being called on PPC PCI code. So, I have two ideas to fix it,

Re: [PATCH 1/3] powerpc/pci: Add calls to set_pcie_port_type() and set_pcie_hotplug_bridge()

2010-02-01 Thread Breno Leitao
Hi Ben, Benjamin Herrenschmidt wrote: Breno, can you test ? Also if you could give a quick spin to the other ones too make sure they don't break anything else, it would be great ! I tested and also asked my team to test and the changes work fine, fixing the problem. Also, we did a regression

[PATCH] eeh: Fixing a bug when pci structure is null

2010-02-02 Thread Breno Leitao
+0x100/0x1a0 [c003a80dff90] [c0031f1c] .kernel_thread+0x54/0x70 The bug occurs because pci_name() tries to access a null pointer. This patch just guarantee that pci_name() is not called on Null pointers. Signed-off-by: Breno Leitao lei...@linux.vnet.ibm.com Signed-off-by: Linas

[PATCH] eeh: Fixing a bug when pci structure is null

2010-02-03 Thread Breno Leitao
[c003a80dff90] [c0031f1c] .kernel_thread+0x54/0x70 The bug occurs because pci_name() tries to access a null pointer. This patch just guarantee that pci_name() is not called on Null pointers. Signed-off-by: Breno Leitao lei...@linux.vnet.ibm.com Signed-off-by: Linas Vepstas linasveps

Re: [PATCH] eeh: Fixing a bug when pci structure is null

2010-02-19 Thread Breno Leitao
Hi Ben, I'd like to ask about this patch ? Should I re-submit ? Thanks, Breno Leitao wrote: During a EEH recover, the pci_dev structure can be null, mainly if an eeh event is detected during cpi config operation. In this case, the pci_dev will not be known (and will be null) the kernel

Re: [RFC/PATCH 0/3] sched: allow arch override of cpu power

2008-06-26 Thread Breno Leitao
: 5000.001000MHz revision: 3.2 (pvr 003e 0302) ... Note that the IRQ are balanced among the 8 CPUs, and the machine is idle. Do you know why I get this difference? Something wrong with the test? Thanks - Breno Leitao Linux Technology Center Brazil Phone: +55-16-8115-3915 (T/L: 839-1293) [EMAIL PROTECTED

Different SIGSEGV codes (x86 and ppc64le)

2016-01-19 Thread Breno Leitao
During some debugging, we found that during a stack overflow, the SIGSEGV code returned is different on Power and Intel. We were able to narrow down the test case to the follow simple code: https://github.com/leitao/stack/blob/master/overflow.c On Power, the SIGSEV si->si_code is 2

[PATCH 3/3] powerpc/xmon: Disable tracing on xmon by default

2017-07-31 Thread Breno Leitao
it by default, showing a better trace output of the failing functions just before it gets into xmon. Signed-off-by: Breno Leitao <lei...@debian.org> --- arch/powerpc/xmon/xmon.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c

[PATCH 1/3] powerpc/xmon: Dump ftrace buffers for the current CPU

2017-07-31 Thread Breno Leitao
for the current CPU. Signed-off-by: Breno Leitao <lei...@debian.org> --- arch/powerpc/xmon/xmon.c | 22 +++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index 08e367e3e8c3..0cbd910193fa 100644 ---

[PATCH 2/3] powerpc/xmon: Disable and enable tracing command

2017-07-31 Thread Breno Leitao
inside xmon. Signed-off-by: Breno Leitao <lei...@debian.org> --- arch/powerpc/xmon/xmon.c | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index 0cbd910193fa..19276d2f2f25 100644 --- a/arch/powerpc/xmon/

[PATCH v3 2/2] powerpc/xmon: Disable tracing when entering xmon

2017-08-02 Thread Breno Leitao
'). Signed-off-by: Breno Leitao <lei...@debian.org> Acked-by: Naveen N. Rao <naveen.n@linux.vnet.ibm.com> --- arch/powerpc/xmon/xmon.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index e0522f60f0ee..d038e7d

[PATCH v3 1/2] powerpc/xmon: Dump ftrace buffers for the current CPU only

2017-08-02 Thread Breno Leitao
for the current CPU. Signed-off-by: Breno Leitao <lei...@debian.org> Acked-by: Naveen N. Rao <naveen.n@linux.vnet.ibm.com> --- arch/powerpc/xmon/xmon.c | 22 +++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/

Re: [PATCH v3 1/2] powerpc/xmon: Dump ftrace buffers for the current CPU only

2017-08-14 Thread Breno Leitao
Hello Michael, On Mon, Aug 14, 2017 at 11:00:07PM +1000, Michael Ellerman wrote: > Breno Leitao <lei...@debian.org> writes: > > @@ -2231,6 +2232,19 @@ static void xmon_rawdump (unsigned long adrs, long > > ndump) > > printf("\n"); > >

Re: [PATCH 1/2] powerpc/tm: fix live state of vs0/32 in tm_reclaim

2017-06-30 Thread Breno Leitao
Thanks Gustavo for the patch. On Thu, Jun 29, 2017 at 08:39:23PM -0400, Gustavo Romero wrote: > Currently tm_reclaim() can return with a corrupted vs0 (fp0) or vs32 (v0) > due to the fact vs0 is used to save FPSCR and vs32 is used to save VSCR. > > Later, we recheckpoint trusting that the live

Re: [PATCH] powerpc/tm: fix live state of vs0/32 in tm_reclaim

2017-07-05 Thread Breno Leitao
Hi Michael, On Wed, Jul 05, 2017 at 11:02:41AM +1000, Michael Neuling wrote: > On Tue, 2017-07-04 at 16:45 -0400, Gustavo Romero wrote: > > Currently tm_reclaim() can return with a corrupted vs0 (fp0) or vs32 (v0) > > due to the fact vs0 is used to save FPSCR and vs32 is used to save VSCR. > >

Re: [PATCH 2/3] powerpc/xmon: Disable and enable tracing command

2017-08-01 Thread Breno Leitao
Hi Naveen, On Tue, Aug 01, 2017 at 12:10:24PM +0530, Naveen N. Rao wrote: > On 2017/07/31 02:22PM, Breno Leitao wrote: > > If tracing is enabled and you get into xmon, the tracing buffer > > continues to be updated, causing possible loss of data due to buffer > > overflow an

[PATCH 2/2] powerpc/xmon: Disable tracing when entering xmon

2017-08-02 Thread Breno Leitao
'). Signed-off-by: Breno Leitao <lei...@debian.org> --- arch/powerpc/xmon/xmon.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index 0cbd910193fa..0b766d7780fa 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerp

[PATCH 1/2] powerpc/xmon: Dump ftrace buffers for the current CPU

2017-08-02 Thread Breno Leitao
for the current CPU. Signed-off-by: Breno Leitao <lei...@debian.org> --- arch/powerpc/xmon/xmon.c | 22 +++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index 08e367e3e8c3..0cbd910193fa 100644 --- a/arch/powerp

Re: [PATCH 2/3] powerpc/xmon: Disable and enable tracing command

2017-08-02 Thread Breno Leitao
On Wed, Aug 02, 2017 at 06:51:24PM +0530, Naveen N. Rao wrote: > On 2017/08/01 11:21AM, Breno Leitao wrote: > > Hi Naveen, > > > > On Tue, Aug 01, 2017 at 12:10:24PM +0530, Naveen N. Rao wrote: > > > On 2017/07/31 02:22PM, Breno Leitao wrote: > > > > I

kernel BUG at mm/usercopy.c:72!

2017-05-15 Thread Breno Leitao
Hello, Kernel 4.12-rc1 is showing a bug when I try it on a POWER8 virtual machine. Justing SSHing into the machine causes this issue. [23.138124] usercopy: kernel memory overwrite attempt detected to d3d80030 (mm_struct) (560 bytes) [23.138195] [ cut here

Re: kernel BUG at mm/usercopy.c:72!

2017-05-16 Thread Breno Leitao
On Tue, May 16, 2017 at 09:02:29PM +1000, Michael Ellerman wrote: > Breno Leitao <lei...@debian.org> writes: > > > Hello, > > > > Kernel 4.12-rc1 is showing a bug when I try it on a POWER8 virtual > > machine. Justing SSHing into the machine causes this iss

[PATCH] powerpc/kernel: Avoid redundancies on giveup_all

2017-06-22 Thread Breno Leitao
giveup_all() in average just 3%, but since giveup_all() is called very frequently, around 8x per CPU per second on an idle machine, this change might show some noticeable improvement. Signed-off-by: Breno Leitao <lei...@debian.org> Signed-off-by: Gustavo Romero <grom...@linux.vnet.ibm.com&g

Re: [PATCH] powerpc/kernel: Avoid redundancies on giveup_all

2017-06-23 Thread Breno Leitao
Hi Cyril, On Fri, Jun 23, 2017 at 04:03:12PM +1000, Cyril Bur wrote: > On Thu, 2017-06-22 at 17:27 -0300, Breno Leitao wrote: > > Currently giveup_all() calls __giveup_fpu(), __giveup_altivec(), and > > __giveup_vsx(). But __giveup_vsx() also calls __giveup_fpu() and > > __g

Re: [PATCH] powerpc/mm: Fix virt_addr_valid() etc. on 64-bit hash

2017-05-18 Thread Breno Leitao
; another solution, this commit does the minimal fix to make virt_addr_valid() > work, by explicitly checking that the address is in the linear mapping region. > > Fixes: bdbc29c19b26 ("powerpc: Work around gcc miscompilation of __pa() on > 64-bit") > Signed-off-by: Michael Ellerman <m...@ellerman.id.au> Tested-by: Breno Leitao <breno.lei...@gmail.com>

[PATCH] powerpc/kernel: improve FP and vector registers restoration

2017-06-02 Thread Breno Leitao
itches restored FP and vector registers without need, causing a performance degradation. Signed-off-by: Breno Leitao <lei...@debian.org> Signed-off-by: Gustavo Romero <gusbrom...@gmail.com> --- arch/powerpc/kernel/process.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/a

[PATCH] powerpc/kernel: Initialize load_tm on task creation

2017-06-05 Thread Breno Leitao
aim and recheckpoint in the scheduling process). CC: Anton Blanchard <an...@samba.org> Fixes: 5d176f751ee3c6eededd984ad409bff201f436a7 Signed-off-by: Breno Leitao <lei...@debian.org> --- arch/powerpc/kernel/process.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/kernel/p

Re: [PATCH] powerpc/kernel: improve FP and vector registers restoration

2017-06-04 Thread Breno Leitao
On Sun, Jun 04, 2017 at 11:38:14AM +1000, Anton Blanchard wrote: > On Sat, 3 Jun 2017 19:42:14 -0300 > Breno Leitao <lei...@debian.org> wrote: > > > Hi Anton, > > > > On Sat, Jun 03, 2017 at 08:04:11AM +1000, Anton Blanchard wrote: > > > Hi Breno, > &

Re: [PATCH] powerpc/kernel: improve FP and vector registers restoration

2017-06-03 Thread Breno Leitao
Hi Anton, On Sat, Jun 03, 2017 at 08:04:11AM +1000, Anton Blanchard wrote: > Hi Breno, > > > Currently tsk->thread->load_vec and load_fp are not initialized > > during a task creation, which set garbage to these variables > > (non-zero value). > > Nice catch! It seems like we should zero

[PATCH] powerpc/kernel: improve FP and vector registers restoration

2017-06-02 Thread Breno Leitao
itches restored FP and vector registers without need, causing a performance degradation. Signed-off-by: Breno Leitao <breno.lei...@gmail.com> Signed-off-by: Gustavo Romero <gusbrom...@gmail.com> --- arch/powerpc/kernel/process.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/a

Debian 9 "Stretch" released

2017-06-19 Thread Breno Leitao
Forwarded Message Subject: Debian 9 "Stretch" released Resent-Date: Sun, 18 Jun 2017 06:26:39 + (UTC) Resent-From: debian-annou...@lists.debian.org Date: Sat, 17 Jun 2017 20:22:36 -1000 From: Ana Guerrero Lopez To: debian-annou...@lists.debian.org

[PATCH] powerpc/xmon: check before calling xive functions

2017-10-17 Thread Breno Leitao
x68 lr: c00997b8: opal_return+0x0/0x50 This patch simply checks if XIVE is enabled before calling XIVE functions. Suggested-by: Guilherme G. Piccoli <gpicc...@linux.vnet.ibm.com> Signed-off-by: Breno Leitao <lei...@debian.org> --- arch/powerpc/xmon/xmon.c | 6 ++ 1

Re: [PATCH 1/4] powerpc/tm: Add commandline option to disable hardware transactional memory

2017-10-23 Thread Breno Leitao
On Sat, Oct 21, 2017 at 11:58:47AM +1100, Michael Neuling wrote: > On Fri, 2017-10-20 at 09:45 -0200, Breno Leitao wrote: > > Mikey, Cyril, > > > > On Thu, Oct 12, 2017 at 09:17:16PM +1100, Michael Ellerman wrote: > > > From: Cyril Bur <cyril...@gmail.com> >

Re: [PATCH v9 44/51] selftest/vm: powerpc implementation for generic abstraction

2017-11-10 Thread Breno Leitao
Hi Ram, On Thu, Nov 09, 2017 at 03:37:46PM -0800, Ram Pai wrote: > On Thu, Nov 09, 2017 at 04:47:15PM -0200, Breno Leitao wrote: > > On Mon, Nov 06, 2017 at 12:57:36AM -0800, Ram Pai wrote: > > > @@ -206,12 +209,14 @@ void signal_handler(int signum, siginfo_t *si, void

[PATCH] scripts: Add ppc64le support for checkstack.pl

2017-11-28 Thread Breno Leitao
t function, and this is the value checkstack.pl will find the stack size for each function. This patch also simplifies the entire Powerpc section, since just two type of instructions are used, 'stdu' for 64 bits and 'stwu' for 32 bits platform. Signed-off-by: Breno Leitao <lei...@debian.org> --- scripts/ch

Re: [PATCH v9 44/51] selftest/vm: powerpc implementation for generic abstraction

2017-11-09 Thread Breno Leitao
Hi Ram, On Mon, Nov 06, 2017 at 12:57:36AM -0800, Ram Pai wrote: > @@ -206,12 +209,14 @@ void signal_handler(int signum, siginfo_t *si, void > *vucontext) > > trapno = uctxt->uc_mcontext.gregs[REG_TRAPNO]; > ip = uctxt->uc_mcontext.gregs[REG_IP_IDX]; > - fpregset =

[PATCH] powerpc/tm: Set ckpt_regs.msr before using it.

2017-10-24 Thread Breno Leitao
From: Breno Leitao <breno.lei...@debian.org> On commit commit f48e91e87e67 ("powerpc/tm: Fix FP and VMX register corruption"), we check ckpt_regs.msr to see if a feature (as VEC, VSX and FP) is disabled (thus the hot registers might be bogus during the reclaim), and then copy the

[PATCH] powerpc/tm: Make the tm code more readable

2017-10-24 Thread Breno Leitao
to change some comments that still reference old fields that were changed in commit 000ec280e3dd ("powerpc: tm: Rename transct_(*) to ck(\1)_state"). Signed-off-by: Breno Leitao <lei...@debian.org> Signed-off-by: Gustavo Romero <gusbrom...@gmail.com> --- arch/powerpc/kernel/pr

[PATCH v2 2/4] powerpc/tm: Fix HTM documentation

2018-06-18 Thread Breno Leitao
re checkpointed regs during treclaim/trecheckpoint"), where tm_recheckpoint can recheckpoint what is in ck{fp,vr}_state blindly. Signed-off-by: Breno Leitao --- arch/powerpc/kernel/tm.S| 10 +- arch/powerpc/kernel/traps.c | 15 +-- 2 files changed, 14 insertions(+), 1

[PATCH v2 3/4] powerpc/tm: Adjust tm_reclaim_thread() parameters

2018-06-18 Thread Breno Leitao
live registers") Just remove it and adjust the callers. Signed-off-by: Cyril Bur Signed-off-by: Breno Leitao --- arch/powerpc/kernel/process.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index 9e

[PATCH v2 4/4] powerpc/tm: Do not recheckpoint non-tm task

2018-06-18 Thread Breno Leitao
e TM user. This does not cause a lot of damage because tm_recheckpoint() will abort the call since it realize that the current task does not have msr[TM] bit set. Signed-off-by: Breno Leitao --- arch/powerpc/kernel/process.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/power

[PATCH] powerpc/pci: Remove legacy debug code

2018-06-18 Thread Breno Leitao
ply remove the debug block, since it does not seem to sense now. Fixes: 59f47eff03a08c ("powerpc/pci: Use of_irq_parse_and_map_pci() helper") Signed-off-by: Breno Leitao --- arch/powerpc/kernel/pci-common.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/powerpc/kernel

[PATCH v2 1/4] powerpc/tm: Remove msr_tm_active()

2018-06-18 Thread Breno Leitao
not require any TM facility. This patchset remove every instance of msr_tm_active() and replaced it by MSR_TM_ACTIVE(). Signed-off-by: Breno Leitao --- arch/powerpc/kernel/process.c | 34 +- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/arch

Re: [RFC,00/12] Deal with TM on kernel entry and exit

2018-06-13 Thread Breno Leitao
Hi Cyril, On 02/19/2018 09:22 PM, Cyril Bur wrote: > This is very much a proof of concept and if it isn't clear from the > commit names, still a work in progress. > I believe I have something that works - all the powerpc selftests > pass. I would like to get some eyes on it to a) see if I've

[PATCH 1/3] powerpc/tm: Remove msr_tm_active()

2018-06-15 Thread Breno Leitao
not require any TM facility. This patchset remove every instance of msr_tm_active() and replaced it by MSR_TM_ACTIVE(); Signed-off-by: Breno Leitao --- arch/powerpc/kernel/process.c | 18 ++ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/arch/powerpc/kernel

[PATCH 3/3] powerpc/tm: Remove struct thread_info param from tm_reclaim_thread()

2018-06-15 Thread Breno Leitao
sters") Just remove it and adjust the callers. Signed-off-by: Cyril Bur Signed-off-by: Breno Leitao --- arch/powerpc/kernel/process.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index 6b73d74793c2..06

[PATCH 2/3] powerpc/tm: Fix HTM documentation

2018-06-15 Thread Breno Leitao
ys save/restore checkpointed regs during treclaim/trecheckpoint"), where tm_recheckpoint can recheckpoint what is in ck{fp,vr}_state blindly. Signed-off-by: Breno Leitao --- arch/powerpc/kernel/tm.S| 10 +- arch/powerpc/kernel/traps.c | 15 +-- 2 files changed, 14 inserti

Re: [PATCH] selftests/powerpc: Fix strncpy usage

2018-06-25 Thread Breno Leitao
hi Segher, On 06/22/2018 10:10 PM, Segher Boessenkool wrote: >> - strncpy(prog, argv[0], strlen(argv[0])); >> + if (strlen(argv[0]) >= LEN_MAX){ >> + fprintf(stderr, "Very big executable name: %s\n", argv[0]); >> + return 1; >> + } >> + >> +

[PATCH v2] selftests/powerpc: Fix strncpy usage

2018-06-25 Thread Breno Leitao
'prog' according to the argv[0] length, avoiding LEN_MAX restriction. CC: Segher Boessenkool CC: Anshuman Khandual Signed-off-by: Breno Leitao --- tools/testing/selftests/powerpc/dscr/dscr_inherit_exec_test.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tools

Re: [PATCH] selftests/powerpc: Fix strncpy usage

2018-06-22 Thread Breno Leitao
Hi Segher, On 06/21/2018 08:18 PM, Segher Boessenkool wrote: > On Wed, Jun 20, 2018 at 07:51:11PM -0300, Breno Leitao wrote: >> -strncpy(prog, argv[0], strlen(argv[0])); >> +strncpy(prog, argv[0], sizeof(prog) - 1); > > strncpy(prog, argv[0], sizeof prog); &g

[PATCH] powerpc: Wire up io_pgetevents

2018-06-20 Thread Breno Leitao
: Christoph Hellwig Signed-off-by: Breno Leitao --- arch/powerpc/include/asm/systbl.h | 1 + arch/powerpc/include/asm/unistd.h | 2 +- arch/powerpc/include/uapi/asm/unistd.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/systbl.h b/arch

[PATCH] selftests/powerpc: Fix strncpy usage

2018-06-20 Thread Breno Leitao
the string copy to sizeof(prog) less 1 (space for \0). CC: Anshuman Khandual Signed-off-by: Breno Leitao --- tools/testing/selftests/powerpc/dscr/dscr_inherit_exec_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/powerpc/dscr

Re: [PATCH v2] selftests/powerpc: Fix strncpy usage

2018-06-26 Thread Breno Leitao
On 06/26/2018 02:24 AM, Michael Ellerman wrote: > Breno Leitao writes: > >> There is a buffer overflow in dscr_inherit_test.c test. In main(), >> strncpy()'s >> third argument is the length of the source, not the size of the destination >> buffer, which makes

[PATCH v3 1/2] selftests/powerpc: Fix strncpy usage

2018-06-26 Thread Breno Leitao
' to the argv[0] memory region, removing the static allocation and the LEN_MAX size restriction. CC: Michael Ellerman CC: Segher Boessenkool CC: Anshuman Khandual Signed-off-by: Breno Leitao --- tools/testing/selftests/powerpc/dscr/dscr_inherit_exec_test.c | 4 ++-- 1 file changed, 2 insertions

[PATCH v3 2/2] selftests/powerpc: Fix typos

2018-06-26 Thread Breno Leitao
Fix two typos in the file header. Replacing the word 'priviledged' by 'privileged' and 'exuecuted' by 'executed'. Signed-off-by: Breno Leitao Signed-off-by: Gustavo Romero --- tools/testing/selftests/powerpc/dscr/dscr_inherit_exec_test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions

Re: [PATCH 1/4] powerpc/tm: Add commandline option to disable hardware transactional memory

2017-10-20 Thread Breno Leitao
Mikey, Cyril, On Thu, Oct 12, 2017 at 09:17:16PM +1100, Michael Ellerman wrote: > From: Cyril Bur > > Currently the kernel relies on firmware to inform it whether or not the > CPU supports HTM and as long as the kernel was built with > CONFIG_PPC_TRANSACTIONAL_MEM=y then it

Re: [PATCH] powerpc/tm: fix live state of vs0/32 in tm_reclaim

2017-10-26 Thread Breno Leitao
and in that case the VSX unavailable exception does > > > not > > > happen in the middle of the transactional block. > > > > > > Finally, that commit also fixes the MSR used to check if FP and VEC bits > > > are enabled once we are in tm_reclaim_thre

[PATCH v2] selftests/powerpc: Avoid remaining process/threads

2018-08-03 Thread Breno Leitao
ler in the harness process, which will kill the child process group once a SIGINT is caught. Signed-off-by: Breno Leitao Signed-off-by: Gustavo Romero --- tools/testing/selftests/powerpc/harness.c | 23 --- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/tools/testing/selfte

[PATCH] powerpc: Wire up file system mount new syscalls

2018-07-27 Thread Breno Leitao
/ CC: David Howells Signed-off-by: Breno Leitao --- arch/powerpc/include/asm/systbl.h | 6 ++ arch/powerpc/include/asm/unistd.h | 2 +- arch/powerpc/include/uapi/asm/unistd.h | 6 ++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/systbl.h b

[PATCH] powerpc/selftests: Avoid backgroud process/threads

2018-07-31 Thread Breno Leitao
two threads being executed in background, one of the thread ('pong') consumes 100% of the CPU and the other one ('ping') dumps output message, from time to time, in the STDOUT, which is annoying. This patch simply gets the child process to be SIGTERMed when the parent dies. Signed-off-by: Breno Lei

[PATCH] powerpc/selftests: Wait all threads to join

2018-07-31 Thread Breno Leitao
created is equal to thread_num. Signed-off-by: Breno Leitao --- tools/testing/selftests/powerpc/tm/tm-tmspr.c | 27 +-- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/tools/testing/selftests/powerpc/tm/tm-tmspr.c b/tools/testing/selftests/powerpc/tm/tm

[PATCH] powerpc/tm: Print 64-bits MSR

2018-08-06 Thread Breno Leitao
On a kernel TM Bad thing program exception, the MSR is not being properly displayed, since it dumps a 32-bits value. MSR is a 64 bits register for all platforms that have HTM enabled. This patch dumps the MSR value as 64-bits instead of 32 bits. Signed-off-by: Breno Leitao --- arch/powerpc

Re: [PATCH v2] powerpc/tm: Print 64-bits MSR

2018-08-07 Thread Breno Leitao
Hi, On 08/07/2018 02:15 PM, Christophe LEROY wrote: > Le 07/08/2018 à 15:35, Breno Leitao a écrit : >> On a kernel TM Bad thing program exception, the Machine State Register >> (MSR) is not being properly displayed. The exception code dumps a 32-bits >> value but MSR is a 64

Re: [PATCH v2] powerpc/tm: Print 64-bits MSR

2018-08-08 Thread Breno Leitao
Hi Leroy, On 08/07/2018 03:57 PM, LEROY Christophe wrote: > Breno Leitao a écrit : >> On 08/07/2018 02:15 PM, Christophe LEROY wrote: >>> Le 07/08/2018 à 15:35, Breno Leitao a écrit : >>> I think it would be better to change 'reason' to 'unsigned long' instead of &g

Re: [PATCH v2 4/4] powerpc/tm: Do not recheckpoint non-tm task

2018-08-16 Thread Breno Leitao
Hey Mikey, Thanks for the review. On 08/15/2018 08:50 PM, Michael Neuling wrote: > On Mon, 2018-06-18 at 19:59 -0300, Breno Leitao wrote: >> If __switch_to() tries to context switch from task A to task B, and task A >> had task->thread->regs->msr[TM] enabled, then __

[PATCH v3] powerpc/tm: Remove msr_tm_active()

2018-08-16 Thread Breno Leitao
the dualism and simplifying the code. This patchset remove every instance of msr_tm_active() and replaced it by MSR_TM_ACTIVE(). Signed-off-by: Breno Leitao --- arch/powerpc/include/asm/reg.h | 7 ++- arch/powerpc/kernel/process.c | 21 + 2 files changed, 15 insertions(+), 13

Re: [PATCH v2 1/4] powerpc/tm: Remove msr_tm_active()

2018-08-17 Thread Breno Leitao
Hi Michael, On 08/16/2018 09:49 PM, Michael Ellerman wrote: > Michael Neuling writes: > >> On Mon, 2018-06-18 at 19:59 -0300, Breno Leitao wrote: >>> Currently msr_tm_active() is a wrapper around MSR_TM_ACTIVE() if >>> CONFIG_PPC_TRANSACTIONAL_MEM is

[PATCH v3] selftests/powerpc: Kill child processes on SIGINT

2018-08-07 Thread Breno Leitao
ler to SIGINT in the harness process. This handler will interrupt (EINTR) the parent process waitpid() call, letting the code to follow through the normal flow, which will kill all the processes in the child process group. This patch also fixes a typo. Signed-off-by: Breno Leitao Signed-off-by: Gust

Re: [PATCH v2] selftests/powerpc: Avoid remaining process/threads

2018-08-06 Thread Breno Leitao
Hello Michael, On 08/06/2018 08:06 AM, Michael Ellerman wrote: > Breno Leitao writes: > >> diff --git a/tools/testing/selftests/powerpc/harness.c >> b/tools/testing/selftests/powerpc/harness.c >> index 66d31de60b9a..06c51e8d8ccb 100644 >> --- a/tools/testi

[PATCH v2] powerpc/tm: Print 64-bits MSR

2018-08-07 Thread Breno Leitao
. In order to do so, the 'reason' variable could not be used, since it trimmed MSR to 32-bits (int). Signed-off-by: Breno Leitao --- 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/traps.c index

[PATCH v2] powerpc/xive: Avoid unitialized variable

2018-08-23 Thread Breno Leitao
From: Breno Leitao Function xive_native_get_ipi() might uses chip_id without it being initialized. This gives the following error on 'smatch' tool: error: uninitialized symbol 'chip_id' The suggestion is using xc->chip_id instead of consulting the OF for chip id, which is safe si

[PATCH] powerpc/iommu: avoid derefence before pointer check

2018-08-21 Thread Breno Leitao
The tbl pointer is being derefenced by IOMMU_PAGE_SIZE prior the check if it is not NULL. Just moving the dereference code to after the check, where there will be guarantee that 'tbl' will not be NULL. CC: Alistair Popple Signed-off-by: Breno Leitao --- arch/powerpc/kernel/iommu.c | 2 +- 1

[PATCH] powerpc/xive: Initialize symbol before usage

2018-08-21 Thread Breno Leitao
Function xive_native_get_ipi() might uses chip_id without it being initialized. This gives the following error on 'smatch' tool: error: uninitialized symbol 'chip_id' This patch simply sets chip_id initial value to 0. CC: Benjamin Herrenschmidt Signed-off-by: Breno Leitao --- arch

[PATCH] selftests/powerpc: Do not fail on TM_CAUSE_RESCHED

2018-08-21 Thread Breno Leitao
these two failures and avoid the whole test to return failure. CC: Gustavo Romero Signed-off-by: Breno Leitao --- tools/testing/selftests/powerpc/tm/tm-unavailable.c | 10 +++--- tools/testing/selftests/powerpc/tm/tm.h | 9 + 2 files changed, 16 insertions(+), 3

[PATCH] powerpc/kernel: Fix potential spectre v1 in syscall

2018-08-21 Thread Breno Leitao
where the 'nargs' value would be set to XX. struct rtas_args ra; ra.nargs = htobe32(XX); syscall(__NR_rtas, ); Signed-off-by: Breno Leitao --- arch/powerpc/kernel/rtas.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/rtas.c b

[PATCH 5/9] powerpc/xmon: Define static functions

2018-10-22 Thread Breno Leitao
of a straightforward dereference. Signed-off-by: Breno Leitao --- arch/powerpc/xmon/xmon.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index 4264aedc7775..5c7187923a72 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch

[PATCH 1/9] powerpc/64s: Include cpu header

2018-10-22 Thread Breno Leitao
'cpu_show_spec_store_bypass' was not declared. Should it be static? This patch simply includes the proper header (linux/cpu.h) to match function definition and declaration. Signed-off-by: Breno Leitao --- arch/powerpc/kernel/security.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc

[PATCH 7/9] powerpc/scom: Return NULL instead of 0

2018-10-22 Thread Breno Leitao
/powerpc/sysdev/scom.c:86:24: warning: Using plain integer as NULL pointer This patch simply replaces zero by NULL. Signed-off-by: Breno Leitao --- arch/powerpc/sysdev/scom.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/sysdev/scom.c b/arch/powerpc/sysdev

[PATCH 2/9] powerpc/eeh: Declare pci_ers_result_name() as static

2018-10-22 Thread Breno Leitao
the function a static. Signed-off-by: Breno Leitao --- arch/powerpc/kernel/eeh_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/eeh_driver.c b/arch/powerpc/kernel/eeh_driver.c index 67619b4b3f96..c325dedfee73 100644 --- a/arch/powerpc/kernel/eeh_driver.c

[PATCH 4/9] powerpc/xive: Define xive_do_source_eoi as static

2018-10-22 Thread Breno Leitao
. Signed-off-by: Breno Leitao --- arch/powerpc/sysdev/xive/common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/sysdev/xive/common.c b/arch/powerpc/sysdev/xive/common.c index 959a2a62f233..6a6178357529 100644 --- a/arch/powerpc/sysdev/xive/common.c +++ b/arch

[PATCH 3/9] powerpc/mm: Remove extern from function definition

2018-10-22 Thread Breno Leitao
: function 'huge_ptep_set_access_flags' with external linkage has definition This patch removes the keyword from the definition part, while keeps it in the declaration part. Signed-off-by: Breno Leitao --- arch/powerpc/mm/pgtable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch

[PATCH 6/9] powerpc/lib: Declare static methods

2018-10-22 Thread Breno Leitao
/powerpc/lib/feature-fixups.c:171:6: warning: symbol 'do_stf_exit_barrier_fixups' was not declared. Should it be static? This patch declares both functions as static, as they are only called by do_stf_barrier_fixups(), which is in the same source code file. Signed-off-by: Breno Leitao --- arch

[PATCH 8/9] powerpc/perf: Declare static identifier a such

2018-10-22 Thread Breno Leitao
definition to these symbols, thus, restricting their usage only in the imc-pmu.c file. Signed-off-by: Breno Leitao --- arch/powerpc/perf/imc-pmu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc/perf/imc-pmu.c index 1fafc32b12a0

[PATCH 9/9] powerpc/pkey: Define functions as static

2018-10-22 Thread Breno Leitao
the warning, basically turning all global variables that are not declared as extern at asm/pkeys.h into static. It also includes asm/mmu_context.h header, which contains the definition of arch_vma_access_permitted. Signed-off-by: Breno Leitao --- arch/powerpc/mm/pkeys.c | 15 --- 1 file

[PATCH] selftests/powerpc: Fix ptrace tm failure

2018-10-22 Thread Breno Leitao
ll be used as base, and r0 is not allowed to be used, avoiding this issue. Other than that, removing flt_2 register from the input operands, since it is not used by the inline assembly code at all. Cc: sta...@vger.kernel.org Signed-off-by: Breno Leitao --- tools/testing/selftests/powerpc/ptrace

Re: [PATCH 2/2] selftests/powerpc: Skip test instead of failing

2018-10-24 Thread Breno Leitao
Hi Tyrel, On 10/23/2018 05:41 PM, Tyrel Datwyler wrote: >> --- a/tools/testing/selftests/powerpc/ptrace/core-pkey.c >> +++ b/tools/testing/selftests/powerpc/ptrace/core-pkey.c >> @@ -352,17 +352,11 @@ static int write_core_pattern(const char *core_pattern) >> FILE *f; >> >> f =

Re: [PATCH 3/9] powerpc/mm: Remove extern from function definition

2018-10-24 Thread Breno Leitao
hi Christophe, On 10/23/2018 12:38 PM, LEROY Christophe wrote: > Breno Leitao a écrit : >> >> This patch removes the keyword from the definition part, while keeps >> it in >> the declaration part. > > I think checkpatch also says that extern should be

[PATCH 1/2] selftests/powerpc: Allocate base registers

2018-10-23 Thread Breno Leitao
by the tests. Signed-off-by: Breno Leitao --- tools/testing/selftests/powerpc/ptrace/ptrace-gpr.c| 2 +- tools/testing/selftests/powerpc/ptrace/ptrace-tm-gpr.c | 4 ++-- tools/testing/selftests/powerpc/ptrace/ptrace-tm-spd-tar.c | 2 +- tools/testing/selftests/powerpc/ptrace/ptrace-tm-spd-vsx.c

[PATCH 2/2] selftests/powerpc: Skip test instead of failing

2018-10-23 Thread Breno Leitao
this undesired failure. CC: Thiago Jung Bauermann Signed-off-by: Breno Leitao --- tools/testing/selftests/powerpc/ptrace/core-pkey.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/tools/testing/selftests/powerpc/ptrace/core-pkey.c b/tools/testing/selftests/powerpc/ptrace

[PATCH v2 1/3] selftests/powerpc: Allocate base registers

2018-10-31 Thread Breno Leitao
. Signed-off-by: Breno Leitao Reviewed-by: Segher Boessenkool --- tools/testing/selftests/powerpc/ptrace/ptrace-gpr.c| 2 +- tools/testing/selftests/powerpc/ptrace/ptrace-tm-gpr.c | 4 ++-- tools/testing/selftests/powerpc/ptrace/ptrace-tm-spd-tar.c | 2 +- tools/testing/selftests/powerpc

Re: [PATCH 3/9] powerpc/mm: Remove extern from function definition

2018-10-31 Thread Breno Leitao
Hi Christophe, On 10/24/18 12:12 PM, LEROY Christophe wrote: > Breno Leitao a écrit : > >> hi Christophe, >> >> On 10/23/2018 12:38 PM, LEROY Christophe wrote: >>> Breno Leitao a écrit : >>>> >>>> This patch

[PATCH v2 3/3] selftests/powerpc: Skip test instead of failing

2018-10-31 Thread Breno Leitao
this undesired failure. CC: Tyrel Datwyler CC: Thiago Jung Bauermann Signed-off-by: Breno Leitao --- tools/testing/selftests/powerpc/ptrace/core-pkey.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tools/testing/selftests/powerpc/ptrace/core-pkey.c b/tools/testing/selftests

[PATCH v2] powerpc/mm: Remove extern from function definition

2018-10-31 Thread Breno Leitao
: function 'huge_ptep_set_access_flags' with external linkage has definition This patch removes the keyword from the definition part. It also removes the extern keyword from the declaration part, since checkpatch --strict complains about it. Suggested-by: Christophe Leroy Signed-off-by: Breno Leitao

[PATCH v2 2/3] selftests/powerpc: Create a new SKIP_IF macro

2018-10-31 Thread Breno Leitao
This patch creates a new macro that skips a test and prints a message to stderr. This is useful to give an idea why the tests is being skipped, other than just skipping the test blindly. Signed-off-by: Breno Leitao --- tools/testing/selftests/powerpc/include/utils.h | 10 ++ 1 file

Re: [PATCH] selftests/powerpc: Fix compilation issue due to asm label

2018-10-31 Thread Breno Leitao
ild again. I also tested the rfi_flush_test selftest as other tests (ptrace/ and tm/) and everything seems to be normal again. Thank you! >> Reported-by: Breno Leitao >> Signed-off-by: Naveen N. Rao Tested-by: Breno Leitao

[PATCH] powerpc/mm: remove unused function prototype

2018-11-01 Thread Breno Leitao
Commit f384796c40dc ("powerpc/mm: Add support for handling > 512TB address in SLB miss") removed function slb_miss_bad_addr(struct pt_regs *regs), but kept its declaration in the prototype file. This patch simply removes the function definition. Signed-off-by: Breno Leitao ---

Re: [RFC PATCH v2 00/14] New TM Model

2018-11-06 Thread Breno Leitao
hi Florian, On 11/06/2018 04:32 PM, Florian Weimer wrote: > * Breno Leitao: > >> This patchset for the hardware transactional memory (TM) subsystem >> aims to avoid spending a lot of time on TM suspended mode in kernel >> space. It basically changes where

Re: [PATCH] powerpc: Mark variable `cpumsr` as unused

2018-11-08 Thread Breno Leitao
Hi Mathieu, Christophe Thanks for spotting and fixing this bug. On 11/08/2018 05:25 AM, Mathieu Malaterre wrote: > On Thu, Nov 8, 2018 at 7:09 AM Christophe Leroy > wrote: >> >> >> >> On 11/07/2018 08:26 PM, Mathieu Malaterre wrote: >>> Add gcc attribute unused for `cpumsr` variable. >>> >>>

Re: [PATCH] powerpc: Add KVM guest defconfig

2018-11-08 Thread Breno Leitao
hi Satheesh, On 11/08/2018 03:08 AM, sathn...@linux.vnet.ibm.com wrote: > --- /dev/null > +++ b/arch/powerpc/configs/guest.config > @@ -0,0 +1,14 @@ > +CONFIG_VIRTIO_BLK=y > +CONFIG_VIRTIO_BLK_SCSI=y > +CONFIG_SCSI_VIRTIO=y > +CONFIG_VIRTIO_NET=y > +CONFIG_NET_FAILOVER=y >

[RFC PATCH v2 00/14] New TM Model

2018-11-06 Thread Breno Leitao
() is only called by TM_KERNEL_ENTRY and tm_recheckpoint is only called by restore_tm_state(). All the rest causes a warning. Regards, Breno [1] Documentation/powerpc/transactional_memory.txt [2] commit 4bb3c7a0208fc13ca70598efd109901a7cd45ae7 [3] https://github.com/leitao/htm_torture/ Breno

  1   2   >