[PATCH v9 5/7] powerpc/memcpy: Add memcpy_mcsafe for pmem

2019-08-12 Thread Santosh Sivaraj
largely borrows from the copyuser_power7 logic and does not add the VMX optimizations, largely to keep the patch simple. If needed those optimizations can be folded in. Signed-off-by: Balbir Singh [ar...@linux.ibm.com: Added symbol export] Co-developed-by: Santosh Sivaraj Signed-off-by: Santosh

[PATCH v9 6/7] powerpc/mce: Handle UE event for memcpy_mcsafe

2019-08-12 Thread Santosh Sivaraj
If we take a UE on one of the instructions with a fixup entry, set nip to continue execution at the fixup entry. Stop processing the event further or print it. Co-developed-by: Reza Arbab Signed-off-by: Reza Arbab Cc: Mahesh Salgaonkar Signed-off-by: Santosh Sivaraj --- arch/powerpc/include

[PATCH v9 7/7] powerpc: add machine check safe copy_to_user

2019-08-12 Thread Santosh Sivaraj
Use memcpy_mcsafe() implementation to define copy_to_user_mcsafe() Signed-off-by: Santosh Sivaraj --- arch/powerpc/Kconfig | 1 + arch/powerpc/include/asm/uaccess.h | 14 ++ 2 files changed, 15 insertions(+) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig

Re: [PATCH v9 2/7] powerpc/mce: Fix MCE handling for huge pages

2019-08-12 Thread Santosh Sivaraj
Sasha Levin writes: > Hi, > > [This is an automated email] > > This commit has been processed because it contains a "Fixes:" tag, > fixing commit: ba41e1e1ccb9 powerpc/mce: Hookup derror (load/store) UE errors. > > The bot has tested the following trees: v5.2.8, v4.19.66. > > v5.2.8: Build OK! >

[PATCH 0/3] Add bad pmem bad blocks to bad range

2019-08-14 Thread Santosh Sivaraj
This series, which should be based on top of the still un-merged "powerpc: implement machine check safe memcpy" series, adds support to add the bad blocks which generated an MCE to the NVDIMM bad blocks. The next access of the same memory will be blocked by the NVDIMM layer itself

[PATCH 1/3] powerpc/mce: Add MCE notification chain

2019-08-14 Thread Santosh Sivaraj
This is needed to report bad blocks for persistent memory. Signed-off-by: Santosh Sivaraj --- arch/powerpc/include/asm/mce.h | 3 +++ arch/powerpc/kernel/mce.c | 15 +++ 2 files changed, 18 insertions(+) diff --git a/arch/powerpc/include/asm/mce.h b/arch/powerpc/include/asm

[PATCH 2/3] of_pmem: Add memory ranges which took a mce to bad range

2019-08-14 Thread Santosh Sivaraj
Subscribe to the MCE notification and add the physical address which generated a memory error to nvdimm bad range. Signed-off-by: Santosh Sivaraj --- drivers/nvdimm/of_pmem.c | 122 +-- 1 file changed, 103 insertions(+), 19 deletions(-) diff --git a/drivers

[PATCH 3/3] papr/scm: Add bad memory ranges to nvdimm bad ranges

2019-08-14 Thread Santosh Sivaraj
Subscribe to the MCE notification and add the physical address which generated a memory error to nvdimm bad range. Signed-off-by: Santosh Sivaraj --- arch/powerpc/platforms/pseries/papr_scm.c | 65 +++ 1 file changed, 65 insertions(+) diff --git a/arch/powerpc/platforms

Re: [PATCH v9 4/7] extable: Add function to search only kernel exception table

2019-08-14 Thread Santosh Sivaraj
Balbir Singh writes: > On 12/8/19 7:22 pm, Santosh Sivaraj wrote: >> Certain architecture specific operating modes (e.g., in powerpc machine >> check handler that is unable to access vmalloc memory), the >> search_exception_tables cannot be called because it also searches th

Re: [PATCH v9 7/7] powerpc: add machine check safe copy_to_user

2019-08-14 Thread Santosh Sivaraj
Hi Balbir, Balbir Singh writes: > On 12/8/19 7:22 pm, Santosh Sivaraj wrote: >> Use memcpy_mcsafe() implementation to define copy_to_user_mcsafe() >> >> Signed-off-by: Santosh Sivaraj >> --- >> arch/powerpc/Kconfig | 1 + >>

Re: [PATCH v9 6/7] powerpc/mce: Handle UE event for memcpy_mcsafe

2019-08-14 Thread Santosh Sivaraj
Hi Balbir, Balbir Singh writes: > On 12/8/19 7:22 pm, Santosh Sivaraj wrote: >> If we take a UE on one of the instructions with a fixup entry, set nip >> to continue execution at the fixup entry. Stop processing the event >> further or print it. >> >> Co-develo

[PATCH v10 0/7] powerpc: implement machine check safe memcpy

2019-08-14 Thread Santosh Sivaraj
et r13 workaround as the last patch -- Balbir Singh (3): powerpc/mce: Fix MCE handling for huge pages powerpc/memcpy: Add memcpy_mcsafe for pmem powerpc/mce: Handle UE event for memcpy_mcsafe Reza Arbab (1): powerpc/mce: Make machine_check_ue_event() static Santosh Sivaraj (3): power

[PATCH v10 1/7] powerpc/mce: Schedule work from irq_work

2019-08-14 Thread Santosh Sivaraj
schedule_work() cannot be called from MCE exception context as MCE can interrupt even in interrupt disabled context. fixes: 733e4a4c ("powerpc/mce: hookup memory_failure for UE errors") Suggested-by: Mahesh Salgaonkar Signed-off-by: Santosh Sivaraj Reviewed-by: Mahesh Salgaonkar

[PATCH v10 2/7] powerpc/mce: Fix MCE handling for huge pages

2019-08-14 Thread Santosh Sivaraj
: ba41e1e1ccb9 ("powerpc/mce: Hookup derror (load/store) UE errors") Signed-off-by: Balbir Singh [ar...@linux.ibm.com: Fixup pseries_do_memory_failure()] Signed-off-by: Reza Arbab Co-developed-by: Santosh Sivaraj Signed-off-by: Santosh Sivaraj Tested-by: Mahesh Salgaonkar Cc: sta...@vger.

[PATCH v10 3/7] powerpc/mce: Make machine_check_ue_event() static

2019-08-14 Thread Santosh Sivaraj
From: Reza Arbab The function doesn't get used outside this file, so make it static. Signed-off-by: Reza Arbab Signed-off-by: Santosh Sivaraj Reviewed-by: Nicholas Piggin --- arch/powerpc/kernel/mce.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/po

[PATCH v10 4/7] extable: Add function to search only kernel exception table

2019-08-14 Thread Santosh Sivaraj
Gleixner Cc: Ingo Molnar Cc: Nicholas Piggin Signed-off-by: Santosh Sivaraj Reviewed-by: Nicholas Piggin --- include/linux/extable.h | 2 ++ kernel/extable.c| 11 +-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/include/linux/extable.h b/include/linux/extable.h

[PATCH v10 5/7] powerpc/memcpy: Add memcpy_mcsafe for pmem

2019-08-14 Thread Santosh Sivaraj
largely borrows from the copyuser_power7 logic and does not add the VMX optimizations, largely to keep the patch simple. If needed those optimizations can be folded in. Signed-off-by: Balbir Singh [ar...@linux.ibm.com: Added symbol export] Co-developed-by: Santosh Sivaraj Signed-off-by: Santosh

[PATCH v10 6/7] powerpc/mce: Handle UE event for memcpy_mcsafe

2019-08-14 Thread Santosh Sivaraj
From: Balbir Singh If we take a UE on one of the instructions with a fixup entry, set nip to continue execution at the fixup entry. Stop processing the event further or print it. Co-developed-by: Reza Arbab Signed-off-by: Reza Arbab Signed-off-by: Balbir Singh Signed-off-by: Santosh Sivaraj

[PATCH v10 7/7] powerpc: add machine check safe copy_to_user

2019-08-14 Thread Santosh Sivaraj
Use memcpy_mcsafe() implementation to define copy_to_user_mcsafe() Signed-off-by: Santosh Sivaraj --- arch/powerpc/Kconfig | 1 + arch/powerpc/include/asm/uaccess.h | 14 ++ 2 files changed, 15 insertions(+) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig

Re: [PATCH 3/3] papr/scm: Add bad memory ranges to nvdimm bad ranges

2019-08-15 Thread Santosh Sivaraj
"Oliver O'Halloran" writes: > On Wed, Aug 14, 2019 at 6:25 PM Santosh Sivaraj wrote: >> >> Subscribe to the MCE notification and add the physical address which >> generated a memory error to nvdimm bad range. >> >> Signed-off-by: Santosh Si

[PATCH 1/6] asm-generic/tlb: Track freeing of page-table directories in struct mmu_gather

2020-02-19 Thread Santosh Sivaraj
in struct mmu_gather so that the architecture code can operate accordingly if it's the intermediate levels being invalidated. Signed-off-by: Peter Zijlstra Signed-off-by: Will Deacon Cc: # 4.19 Signed-off-by: Santosh Sivaraj [santosh: prerequisite for tlbflush backports] --- include/asm-ge

[PATCH 0/6] Memory corruption may occur due to incorrent tlb flush

2020-02-19 Thread Santosh Sivaraj
The TLB flush optimisation (a46cc7a90f: powerpc/mm/radix: Improve TLB/PWC flushes) may result in random memory corruption. Any concurrent page-table walk could end up with a Use-after-Free. Even on UP this might give issues, since mmu_gather is preemptible these days. An interrupt or preempted task

[PATCH 2/6] asm-generic/tlb: Track which levels of the page tables have been cleared

2020-02-19 Thread Santosh Sivaraj
granule required for invalidation. Signed-off-by: Will Deacon Cc: # 4.19 Signed-off-by: Santosh Sivaraj [santosh: prerequisite for upcoming tlbflush backports] --- include/asm-generic/tlb.h | 58 +-- mm/memory.c | 4 ++- 2 files changed, 53

[PATCH 3/6] asm-generic/tlb, arch: Invert CONFIG_HAVE_RCU_TABLE_INVALIDATE

2020-02-19 Thread Santosh Sivaraj
change in behavior intended. Signed-off-by: Peter Zijlstra (Intel) Cc: # 4.19 Signed-off-by: Santosh Sivaraj [santosh: prerequisite for upcoming tlbflush backports] --- arch/Kconfig | 2 +- arch/powerpc/Kconfig | 1 + arch/sparc/Kconfig | 1 + arch/x86/Kconfig | 1 - mm/memory.c

[PATCH 4/6] powerpc/mmu_gather: enable RCU_TABLE_FREE even for !SMP case

2020-02-19 Thread Santosh Sivaraj
th our platforms that run on Power9 force SMP on in Kconfig, so the !SMP case is unlikely to be a problem for anyone in practice, unless they've hacked their kernel to build it !SMP." Link: http://lkml.kernel.org/r/20200116064531.483522-2-aneesh.ku...@linux.ibm.com Signed-off-by: Aneesh

[PATCH 5/6] mm/mmu_gather: invalidate TLB correctly on batch allocation failure and flush

2020-02-19 Thread Santosh Sivaraj
owerpc/mm/radix: Improve TLB/PWC flushes") Signed-off-by: Peter Zijlstra (Intel) Cc: # 4.19 Signed-off-by: Santosh Sivaraj [santosh: backported to 4.19 stable] --- arch/Kconfig| 3 --- arch/powerpc/Kconfig| 1 - arch/powerpc/include/asm/tlb.h | 11 +++

[PATCH 6/6] asm-generic/tlb: avoid potential double flush

2020-02-19 Thread Santosh Sivaraj
-by: Aneesh Kumar K.V Reported-by: "Aneesh Kumar K.V" Cc: # 4.19 Signed-off-by: Santosh Sivaraj [santosh: backported to 4.19 stable] --- include/asm-generic/tlb.h | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/asm-generic/tlb.h b/include/asm-g

[PATCH 0/6] Memory corruption may occur due to incorrent tlb flush

2020-02-20 Thread Santosh Sivaraj
The TLB flush optimisation (a46cc7a90f: powerpc/mm/radix: Improve TLB/PWC flushes) may result in random memory corruption. Any concurrent page-table walk could end up with a Use-after-Free. Even on UP this might give issues, since mmu_gather is preemptible these days. An interrupt or preempted task

[PATCH 1/6] asm-generic/tlb: Track freeing of page-table directories in struct mmu_gather

2020-02-20 Thread Santosh Sivaraj
in struct mmu_gather so that the architecture code can operate accordingly if it's the intermediate levels being invalidated. 22a61c3c4f1379 in upstream Signed-off-by: Peter Zijlstra Signed-off-by: Will Deacon Cc: # 4.19 Signed-off-by: Santosh Sivaraj [santosh: prerequisite for tlb

[PATCH 2/6] asm-generic/tlb: Track which levels of the page tables have been cleared

2020-02-20 Thread Santosh Sivaraj
granule required for invalidation. a6d60245d6d9 in upstream Signed-off-by: Will Deacon Cc: # 4.19 Signed-off-by: Santosh Sivaraj [santosh: prerequisite for upcoming tlbflush backports] --- include/asm-generic/tlb.h | 58 +-- mm/memory.c | 4

[PATCH 3/6] asm-generic/tlb, arch: Invert CONFIG_HAVE_RCU_TABLE_INVALIDATE

2020-02-20 Thread Santosh Sivaraj
change in behavior intended. 96bc9567cbe1 in upstream. Signed-off-by: Peter Zijlstra (Intel) Cc: # 4.19 Signed-off-by: Santosh Sivaraj [santosh: prerequisite for upcoming tlbflush backports] --- arch/Kconfig | 2 +- arch/powerpc/Kconfig | 1 + arch/sparc/Kconfig | 1 + arch/x86

[PATCH 4/6] powerpc/mmu_gather: enable RCU_TABLE_FREE even for !SMP case

2020-02-20 Thread Santosh Sivaraj
x.ibm.com Signed-off-by: Aneesh Kumar K.V Cc: # 4.19 Signed-off-by: Santosh Sivaraj [santosh: backported for 4.19 stable] --- arch/powerpc/Kconfig | 2 +- arch/powerpc/include/asm/book3s/32/pgalloc.h | 8 arch/powerpc/include/asm/book3s/64/pgalloc.h | 2 -- arc

[PATCH 6/6] asm-generic/tlb: avoid potential double flush

2020-02-20 Thread Santosh Sivaraj
a (Intel) Signed-off-by: Aneesh Kumar K.V Reported-by: "Aneesh Kumar K.V" Cc: # 4.19 Signed-off-by: Santosh Sivaraj [santosh: backported to 4.19 stable] --- include/asm-generic/tlb.h | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/asm-generic/tl

[PATCH 5/6] mm/mmu_gather: invalidate TLB correctly on batch allocation failure and flush

2020-02-20 Thread Santosh Sivaraj
.com Fixes: a46cc7a90fd8 ("powerpc/mm/radix: Improve TLB/PWC flushes") Signed-off-by: Peter Zijlstra (Intel) Cc: # 4.19 Signed-off-by: Santosh Sivaraj [santosh: backported to 4.19 stable] --- arch/Kconfig| 3 --- arch/powerpc/Kconfig| 1 - arch/powerpc/inc

Re: [PATCH v10 2/7] powerpc/mce: Fix MCE handling for huge pages

2019-08-19 Thread Santosh Sivaraj
bm.com: Fixup pseries_do_memory_failure()] >> Signed-off-by: Reza Arbab >> Co-developed-by: Santosh Sivaraj >> Signed-off-by: Santosh Sivaraj >> Tested-by: Mahesh Salgaonkar >> Cc: sta...@vger.kernel.org # v4.15+ >> --- >> arch/powerpc/include/asm/m

[PATCH 0/3] Add bad pmem bad blocks to bad range

2019-08-19 Thread Santosh Sivaraj
This series, which should be based on top of the still un-merged "powerpc: implement machine check safe memcpy" series, adds support to add the bad blocks which generated an MCE to the NVDIMM bad blocks. The next access of the same memory will be blocked by the NVDIMM layer itself. -

[PATCH 1/3] powerpc/mce: Add MCE notification chain

2019-08-19 Thread Santosh Sivaraj
This is needed to report bad blocks for persistent memory. Signed-off-by: Santosh Sivaraj --- arch/powerpc/include/asm/mce.h | 3 +++ arch/powerpc/kernel/mce.c | 15 +++ 2 files changed, 18 insertions(+) diff --git a/arch/powerpc/include/asm/mce.h b/arch/powerpc/include/asm

[PATCH 3/3] papr/scm: Add bad memory ranges to nvdimm bad ranges

2019-08-19 Thread Santosh Sivaraj
Subscribe to the MCE notification and add the physical address which generated a memory error to nvdimm bad range. Signed-off-by: Santosh Sivaraj --- arch/powerpc/platforms/pseries/papr_scm.c | 86 ++- 1 file changed, 85 insertions(+), 1 deletion(-) diff --git a/arch

[PATCH 2/3] of_pmem: Add memory ranges which took a mce to bad range

2019-08-19 Thread Santosh Sivaraj
Subscribe to the MCE notification and add the physical address which generated a memory error to nvdimm bad range. Signed-off-by: Santosh Sivaraj --- drivers/nvdimm/of_pmem.c | 151 +-- 1 file changed, 131 insertions(+), 20 deletions(-) diff --git a/drivers

Re: [PATCH 0/3] Add bad pmem bad blocks to bad range

2019-08-19 Thread Santosh Sivaraj
Santosh Sivaraj writes: > This series, which should be based on top of the still un-merged > "powerpc: implement machine check safe memcpy" series, adds support > to add the bad blocks which generated an MCE to the NVDIMM bad blocks. > The next access of the same memory

[PATCH v11 0/7] powerpc: implement machine check safe memcpy

2019-08-20 Thread Santosh Sivaraj
powerpc/memcpy: Add memcpy_mcsafe for pmem Reza Arbab (1): powerpc/mce: Make machine_check_ue_event() static Santosh Sivaraj (3): powerpc/mce: Schedule work from irq_work extable: Add function to search only kernel exception table powerpc: add machine check safe copy_to_user arch

[PATCH v11 1/7] powerpc/mce: Schedule work from irq_work

2019-08-20 Thread Santosh Sivaraj
schedule_work() cannot be called from MCE exception context as MCE can interrupt even in interrupt disabled context. fixes: 733e4a4c ("powerpc/mce: hookup memory_failure for UE errors") Reviewed-by: Mahesh Salgaonkar Reviewed-by: Nicholas Piggin Acked-by: Balbir Singh Signed-off-b

[PATCH v11 2/7] powerpc/mce: Fix MCE handling for huge pages

2019-08-20 Thread Santosh Sivaraj
: ba41e1e1ccb9 ("powerpc/mce: Hookup derror (load/store) UE errors") Signed-off-by: Balbir Singh [ar...@linux.ibm.com: Fixup pseries_do_memory_failure()] Signed-off-by: Reza Arbab Tested-by: Mahesh Salgaonkar Signed-off-by: Santosh Sivaraj Cc: sta...@vger.kernel.org # v4.15+ --- arch/powe

[PATCH v11 3/7] powerpc/mce: Make machine_check_ue_event() static

2019-08-20 Thread Santosh Sivaraj
From: Reza Arbab The function doesn't get used outside this file, so make it static. Signed-off-by: Reza Arbab Signed-off-by: Santosh Sivaraj Reviewed-by: Nicholas Piggin --- arch/powerpc/kernel/mce.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/po

[PATCH v11 4/7] extable: Add function to search only kernel exception table

2019-08-20 Thread Santosh Sivaraj
Gleixner Cc: Ingo Molnar Cc: Nicholas Piggin Signed-off-by: Santosh Sivaraj Reviewed-by: Nicholas Piggin --- include/linux/extable.h | 2 ++ kernel/extable.c| 11 +-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/include/linux/extable.h b/include/linux/extable.h

[PATCH v11 5/7] powerpc/mce: Handle UE event for memcpy_mcsafe

2019-08-20 Thread Santosh Sivaraj
Reviewed-by: Nicholas Piggin Signed-off-by: Santosh Sivaraj --- arch/powerpc/include/asm/mce.h | 4 +++- arch/powerpc/kernel/mce.c | 16 arch/powerpc/kernel/mce_power.c | 15 +-- 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/arch/powerpc

[PATCH v11 6/7] powerpc/memcpy: Add memcpy_mcsafe for pmem

2019-08-20 Thread Santosh Sivaraj
largely borrows from the copyuser_power7 logic and does not add the VMX optimizations, largely to keep the patch simple. If needed those optimizations can be folded in. Signed-off-by: Balbir Singh [ar...@linux.ibm.com: Added symbol export] Co-developed-by: Santosh Sivaraj Signed-off-by: Santosh

[PATCH v11 7/7] powerpc: add machine check safe copy_to_user

2019-08-20 Thread Santosh Sivaraj
Use memcpy_mcsafe() implementation to define copy_to_user_mcsafe() Signed-off-by: Santosh Sivaraj --- arch/powerpc/Kconfig | 1 + arch/powerpc/include/asm/uaccess.h | 14 ++ 2 files changed, 15 insertions(+) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig

[PATCH] powerpc/vdso64: inline __get_datapage()

2019-08-21 Thread Santosh Sivaraj
clock-gettime-realtime-coarse: syscall: 515 nsec/call373 nsec/call clock-gettime-realtime-coarse:libc: 23 nsec/call 22 nsec/call clock-gettime-realtime-coarse:vdso: 14 nsec/call 13 nsec/call Based on the patch by Christophe Leroy for vdso32. Signed-off-by: Santosh Sivaraj

Re: [PATCH] powerpc/vdso64: inline __get_datapage()

2019-08-21 Thread Santosh Sivaraj
Christophe Leroy writes: > Le 21/08/2019 à 11:29, Santosh Sivaraj a écrit : >> __get_datapage() is only a few instructions to retrieve the >> address of the page where the kernel stores data to the VDSO. >> >> By inlining this function into its users, a bl/blr pair

Re: [PATCH] powerpc/vdso64: inline __get_datapage()

2019-08-22 Thread Santosh Sivaraj
Christophe Leroy writes: > Le 21/08/2019 à 14:15, Segher Boessenkool a écrit : >> On Wed, Aug 21, 2019 at 01:50:52PM +0200, Christophe Leroy wrote: >>> Do you have any idea on how to avoid that bcl/mflr stuff ? >> >> Do a load from some fixed address? Maybe an absolute address, even? >> lwz r3,

Re: [PATCH] powerpc/mm: tell if a bad page fault on data is read or write.

2019-08-25 Thread Santosh Sivaraj
Christophe Leroy writes: > DSISR has a bit to tell if the fault is due to a read or a write. > > Display it. > > Signed-off-by: Christophe Leroy Reviewed-by: Santosh Sivaraj > --- > arch/powerpc/mm/fault.c | 6 -- > 1 file changed, 4 insertions(+), 2 deletions(

Re: [PATCH v2 4/8] powerpc/vdso32: inline __get_datapage()

2019-08-25 Thread Santosh Sivaraj
Hi Christophe, Christophe Leroy writes: > __get_datapage() is only a few instructions to retrieve the > address of the page where the kernel stores data to the VDSO. > > By inlining this function into its users, a bl/blr pair and > a mflr/mtlr pair is avoided, plus a few reg moves. > > The impro

[PATCH 2/2] seltests/powerpc: Add a selftest for memcpy_mcsafe

2019-09-03 Thread Santosh Sivaraj
Appropriate self tests for memcpy_mcsafe Suggested-by: Michael Ellerman Signed-off-by: Santosh Sivaraj --- tools/testing/selftests/powerpc/copyloops/.gitignore | 1 + tools/testing/selftests/powerpc/copyloops/Makefile | 7 ++- tools/testing/selftests/powerpc/copyloops/asm

[PATCH 1/2] powerpc/memcpy: Fix stack corruption for smaller sizes

2019-09-03 Thread Santosh Sivaraj
For sizes lesser than 128 bytes, the code branches out early without saving the stack frame, which when restored later drops frame of the caller. Tested-by: Aneesh Kumar K.V Signed-off-by: Santosh Sivaraj --- arch/powerpc/lib/memcpy_mcsafe_64.S | 2 +- 1 file changed, 1 insertion(+), 1

Re: [PATCH 1/2] libnvdimm/altmap: Track namespace boundaries in altmap

2019-09-10 Thread Santosh Sivaraj
t > Signed-off-by: Aneesh Kumar K.V > --- > arch/powerpc/mm/init_64.c | 17 ++++- > drivers/nvdimm/pfn_devs.c | 2 ++ > include/linux/memremap.h | 1 + > 3 files changed, 19 insertions(+), 1 deletion(-) Tested-by: Santosh Sivaraj > > diff --git a/arch/powe

Re: [PATCH v2 4/8] powerpc/vdso32: inline __get_datapage()

2019-09-13 Thread Santosh Sivaraj
Christophe Leroy writes: > Hi Santosh, > > Le 26/08/2019 à 07:44, Santosh Sivaraj a écrit : >> Hi Christophe, >> >> Christophe Leroy writes: >> >>> __get_datapage() is only a few instructions to retrieve the >>> address of the page where the

Re: [PATCH v2 4/8] powerpc/vdso32: inline __get_datapage()

2019-09-13 Thread Santosh Sivaraj
Christophe Leroy writes: > Le 13/09/2019 à 15:31, Santosh Sivaraj a écrit : >> Christophe Leroy writes: >> >>> Hi Santosh, >>> >>> Le 26/08/2019 à 07:44, Santosh Sivaraj a écrit : >>>> Hi Christophe, >>>> >>>> Chris

[RESEND PATCH] kernel/watchdog: Fix watchdog_allowed_mask not used warning

2020-11-03 Thread Santosh Sivaraj
Define watchdog_allowed_mask only when SOFTLOCKUP_DETECTOR is enabled. Signed-off-by: Santosh Sivaraj --- Original patch is here: https://lore.kernel.org/lkml/20190807014417.9418-1-sant...@fossix.org/ A similar patch was also sent by Balamuruhan and reviewed by Petr. https://lkml.org/lkml/2020

[PATCH v2] kernel/watchdog: Fix watchdog_allowed_mask not used warning

2020-11-05 Thread Santosh Sivaraj
Define watchdog_allowed_mask only when SOFTLOCKUP_DETECTOR is enabled. Fixes: 7feeb9cd4f5b ("watchdog/sysctl: Clean up sysctl variable name space") Cc: Thomas Gleixner Cc: Andrew Morton Reviewed-by: Petr Mladek Signed-off-by: Santosh Sivaraj --- v2: Added Petr's reviewed-by f

Re: [PATCH] powerpc/mce: save ignore_event flag unconditionally for UE

2021-04-20 Thread Santosh Sivaraj
Hi Ganesh, Ganesh Goudar writes: > When we hit an UE while using machine check safe copy routines, > ignore_event flag is set and the event is ignored by mce handler, > And the flag is also saved for defered handling and printing of > mce event information, But as of now saving of this flag is

Re: [PATCH] powerpc/mce: save ignore_event flag unconditionally for UE

2021-04-20 Thread Santosh Sivaraj
mce->u.ue_error.physical_address = phys_addr; > - mce->u.ue_error.ignore_event = mce_err->ignore_event; > machine_check_ue_event(mce); > } > } Small nit: Setting ignore event can happen before the ph

Re: [PATCH] powerpc/mce: save ignore_event flag unconditionally for UE

2021-04-20 Thread Santosh Sivaraj
Ganesh writes: > On 4/20/21 12:54 PM, Santosh Sivaraj wrote: > >> Hi Ganesh, >> >> Ganesh Goudar writes: >> >>> When we hit an UE while using machine check safe copy routines, >>> ignore_event flag is set and the event is ignored by mce han

Re: [PATCH 1/2] powerpc: Free fdt on error in elf64_load()

2021-04-20 Thread Santosh Sivaraj
Hi Lakshmi, Lakshmi Ramasubramanian writes: > There are a few "goto out;" statements before the local variable "fdt" > is initialized through the call to of_kexec_alloc_and_setup_fdt() in > elf64_load(). This will result in an uninitialized "fdt" being passed > to kvfree() in this function if

Re: [PATCH 1/2] powerpc: Free fdt on error in elf64_load()

2021-04-21 Thread Santosh Sivaraj
Lakshmi Ramasubramanian writes: > On 4/20/21 10:35 PM, Santosh Sivaraj wrote: > Hi Santosh, > >> >>> There are a few "goto out;" statements before the local variable "fdt" >>> is initialized through the call to of_kexec_alloc_and_set

Re: [PATCH] powerpc/papr_scm: Add support for reporting dirty-shutdown-count

2021-05-26 Thread Santosh Sivaraj
Hi Vaibhav, Vaibhav Jain writes: > Persistent memory devices like NVDIMMs can loose cached writes in case > something prevents flush on power-fail. Such situations are termed as > dirty shutdown and are exposed to applications as > last-shutdown-state (LSS) flag and a dirty-shutdown-counter(DS

Re: [PATCH 11/15] powerpc: convert to setup_initial_init_mm()

2021-05-29 Thread Santosh Sivaraj
Kefeng Wang writes: > Use setup_initial_init_mm() helper to simplify code. > > Cc: Michael Ellerman > Cc: Benjamin Herrenschmidt > Cc: linuxppc-dev@lists.ozlabs.org > Signed-off-by: Kefeng Wang > --- > arch/powerpc/kernel/setup-common.c | 5 + > 1 file changed, 1 insertion(+), 4 deletions

Re: [PATCH v3 1/3] powerpc/mm: Enable radix GTSE only if supported.

2020-07-05 Thread Santosh Sivaraj
Hi Bharata, Bharata B Rao writes: > Make GTSE an MMU feature and enable it by default for radix. > However for guest, conditionally enable it if hypervisor supports > it via OV5 vector. Let prom_init ask for radix GTSE only if the > support exists. > > Having GTSE as an MMU feature will make i

[PATCH RESEND 1/2] powerpc/mce: Add MCE notification chain

2020-07-09 Thread Santosh Sivaraj
Introduce notification chain which lets know about uncorrected memory errors(UE). This would help prospective users in pmem or nvdimm subsystem to track bad blocks for better handling of persistent memory allocations. Signed-off-by: Santosh S Signed-off-by: Ganesh Goudar --- arch/powerpc/includ

[PATCH RESEND 2/2] papr/scm: Add bad memory ranges to nvdimm bad ranges

2020-07-09 Thread Santosh Sivaraj
Subscribe to the MCE notification and add the physical address which generated a memory error to nvdimm bad range. Reviewed-by: Mahesh Salgaonkar Signed-off-by: Santosh Sivaraj --- arch/powerpc/platforms/pseries/papr_scm.c | 98 ++- 1 file changed, 97 insertions(+), 1

Re: [PATCH RESEND 2/2] papr/scm: Add bad memory ranges to nvdimm bad ranges

2020-07-09 Thread Santosh Sivaraj
Christophe Leroy writes: > Le 09/07/2020 à 09:56, Santosh Sivaraj a écrit : >> Subscribe to the MCE notification and add the physical address which >> generated a memory error to nvdimm bad range. >> >> Reviewed-by: Mahesh Salgaonkar >> Signed-off-by: Santosh

Re: [PATCH RESEND 1/2] powerpc/mce: Add MCE notification chain

2020-07-09 Thread Santosh Sivaraj
Christophe Leroy writes: > Le 09/07/2020 à 09:56, Santosh Sivaraj a écrit : >> Introduce notification chain which lets know about uncorrected memory >> errors(UE). This would help prospective users in pmem or nvdimm subsystem >> to track bad blocks for better handling

[PATCH v2 1/2] powerpc/mce: Add MCE notification chain

2020-07-09 Thread Santosh Sivaraj
Introduce notification chain which lets us know about uncorrected memory errors(UE). This would help prospective users in pmem or nvdimm subsystem to track bad blocks for better handling of persistent memory allocations. Signed-off-by: Santosh Sivaraj Signed-off-by: Ganesh Goudar --- arch

[PATCH v2 2/2] papr/scm: Add bad memory ranges to nvdimm bad ranges

2020-07-09 Thread Santosh Sivaraj
Subscribe to the MCE notification and add the physical address which generated a memory error to nvdimm bad range. Reviewed-by: Mahesh Salgaonkar Signed-off-by: Santosh Sivaraj --- arch/powerpc/platforms/pseries/papr_scm.c | 96 ++- 1 file changed, 95 insertions(+), 1

[PATCH trivial] ppc64/mm: remove comment that is no longer valid

2020-07-21 Thread Santosh Sivaraj
hash_low_64.S was removed in [1] and since flush_hash_page is not called from any assembly routine. [1]: commit a43c0eb8364c0 ("powerpc/mm: Convert 4k insert from asm to C") Signed-off-by: Santosh Sivaraj --- arch/powerpc/mm/book3s64/hash_utils.c | 4 1 file changed, 4 deletion

[PATCH v4 0/6] Memory corruption may occur due to incorrent tlb flush

2020-05-20 Thread Santosh Sivaraj
The TLB flush optimisation (a46cc7a90f: powerpc/mm/radix: Improve TLB/PWC flushes) may result in random memory corruption. Any concurrent page-table walk could end up with a Use-after-Free. Even on UP this might give issues, since mmu_gather is preemptible these days. An interrupt or preempted task

[PATCH v4 1/6] asm-generic/tlb: Track freeing of page-table directories in struct mmu_gather

2020-05-20 Thread Santosh Sivaraj
higher up the tree. Add a new bit to the flags bitfield in struct mmu_gather so that the architecture code can operate accordingly if it's the intermediate levels being invalidated. Signed-off-by: Peter Zijlstra Signed-off-by: Will Deacon Cc: # 4.19 Signed-off-by: Santosh Sivaraj [sa

[PATCH v4 2/6] asm-generic/tlb: Track which levels of the page tables have been cleared

2020-05-20 Thread Santosh Sivaraj
that are cleared and provide a means to query the smallest granule required for invalidation. Signed-off-by: Will Deacon Cc: # 4.19 Signed-off-by: Santosh Sivaraj [santosh: prerequisite for upcoming tlbflush backports] --- include/asm-generic/tlb.h | 58 +-- mm

[PATCH v4 3/6] asm-generic/tlb, arch: Invert CONFIG_HAVE_RCU_TABLE_INVALIDATE

2020-05-20 Thread Santosh Sivaraj
require this. Make it an opt-out, instead of an opt-in. No change in behavior intended. Signed-off-by: Peter Zijlstra (Intel) Cc: # 4.19 Signed-off-by: Santosh Sivaraj [santosh: prerequisite for upcoming tlbflush backports] --- arch/Kconfig | 2 +- arch/powerpc/Kconfig | 1 + arch/sparc

[PATCH v4 4/6] powerpc/mmu_gather: enable RCU_TABLE_FREE even for !SMP case

2020-05-20 Thread Santosh Sivaraj
83522-2-aneesh.ku...@linux.ibm.com Signed-off-by: Aneesh Kumar K.V Cc: # 4.19 Signed-off-by: Santosh Sivaraj [santosh: backported for 4.19 stable] --- arch/powerpc/Kconfig | 2 +- arch/powerpc/include/asm/book3s/32/pgalloc.h | 8 arch/powerpc/include/asm/book3s/

[PATCH v4 5/6] mm/mmu_gather: invalidate TLB correctly on batch allocation failure and flush

2020-05-20 Thread Santosh Sivaraj
-aneesh.ku...@linux.ibm.com Fixes: a46cc7a90fd8 ("powerpc/mm/radix: Improve TLB/PWC flushes") Signed-off-by: Peter Zijlstra (Intel) Cc: # 4.19 Signed-off-by: Santosh Sivaraj [santosh: backported to 4.19 stable] --- arch/Kconfig| 3 --- arch/powerpc/Kconfig

[PATCH v4 6/6] asm-generic/tlb: avoid potential double flush

2020-05-20 Thread Santosh Sivaraj
ibm.com Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Aneesh Kumar K.V Reported-by: "Aneesh Kumar K.V" Cc: # 4.19 Signed-off-by: Santosh Sivaraj [santosh: backported to 4.19 stable] --- include/asm-generic/tlb.h | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --gi

[PATCH 1/2] powerpc/mmu_gather: enable RCU_TABLE_FREE even for !SMP case

2020-06-30 Thread Santosh Sivaraj
nlikely to be a problem for anyone in practice, unless they've hacked their kernel to build it !SMP." Link: http://lkml.kernel.org/r/20200116064531.483522-2-aneesh.ku...@linux.ibm.com Signed-off-by: Aneesh Kumar K.V Cc: # 4.19 Signed-off-by: Santosh Sivaraj

[PATCH 2/2] mm/mmu_gather: invalidate TLB correctly on batch allocation failure and flush

2020-06-30 Thread Santosh Sivaraj
-aneesh.ku...@linux.ibm.com Fixes: a46cc7a90fd8 ("powerpc/mm/radix: Improve TLB/PWC flushes") Signed-off-by: Peter Zijlstra (Intel) Cc: # 4.19 Signed-off-by: Santosh Sivaraj --- arch/Kconfig| 3 --- arch/powerpc/include/asm/tlb.h | 11 +++ arch/sparc/inclu

[PATCH] powerpc/time: Fix tracing in time.c

2017-06-19 Thread Santosh Sivaraj
: Naveen N. Rao Signed-off-by: Santosh Sivaraj --- arch/powerpc/kernel/Makefile | 2 -- arch/powerpc/kernel/time.c | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile index e132902..0845eeb 100644 --- a/arch/powerpc

[PATCH] powerpc/time: Fix tracing in time.c

2017-06-20 Thread Santosh Sivaraj
-by: Naveen N. Rao Signed-off-by: Santosh Sivaraj --- arch/powerpc/kernel/Makefile | 2 -- arch/powerpc/kernel/time.c | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile index e132902..0845eeb 100644 --- a/arch

[PATCH] powerpc/smp: Do not BUG_ON if invalid CPU during kick

2017-06-24 Thread Santosh Sivaraj
During secondary start, we do not need to BUG_ON if an invalid CPU number is passed. We alreay print an error if secondary cannot be started, so just return an error instead. Signed-off-by: Santosh Sivaraj --- arch/powerpc/kernel/smp.c| 3 ++- arch/powerpc/platforms/cell/smp.c

[PATCH 1/2] powerpc/smp: Do not BUG_ON if invalid CPU during kick

2017-06-27 Thread Santosh Sivaraj
During secondary start, we do not need to BUG_ON if an invalid CPU number is passed. We already print an error if secondary cannot be started, so just return an error instead. Signed-off-by: Santosh Sivaraj --- arch/powerpc/kernel/smp.c| 3 ++- arch/powerpc/platforms/cell/smp.c

[PATCH 2/2] powerpc/smp: Convert NR_CPUS to nr_cpu_ids

2017-06-27 Thread Santosh Sivaraj
nr_cpu_ids can be limited by nr_cpus boot parameter, whereas NR_CPUS is a compile time constant, which shouldn't be compared against during cpu kick. Signed-off-by: Santosh Sivaraj --- arch/powerpc/kernel/smp.c| 2 +- arch/powerpc/platforms/cell/smp.c| 2 +- arch/po

Re: [linux-next] SMT off triggers WARNING: CPU: 1 PID: 13 at arch/powerpc/kernel/watchdog.c:314 stop_wd_on_cpu+0x54/0xf0

2017-07-02 Thread Santosh Sivaraj
* Abdul Haleem wrote (on 2017-07-03 11:25:18 +0530): > Hi, > > Today's next-20170630 on powerpc shows warnings in dmesg when SMT is > disabled. Fix provided by Nick: https://lkml.org/lkml/2017/6/30/143 Thanks, Santosh > > Test: SMT off > kernel: 4.12.0-rc7-next-20170630 > Machine: Power 8 B

[PATCH] powerpc/smp: Get cpu only after validity check

2017-07-03 Thread Santosh Sivaraj
Check for validity of cpu before calling get_hard_smp_processor_id. Found with coverity. Signed-off-by: Santosh Sivaraj --- arch/powerpc/platforms/powernv/smp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/powernv/smp.c b/arch/powerpc/platforms

[PATCH] powerpc/vdso64: Add support for CLOCK_{REALTIME/MONOTONIC}_COARSE

2017-07-20 Thread Santosh Sivaraj
: syscall: 1347 nsec/call clock-gettime-monotonic-coarse:libc: 187 nsec/call clock-gettime-monotonic-coarse:vdso: 125 nsec/call Used https://github.com/nlynch-mentor/vdsotest.git for the benchmarks. CC: Benjamin Herrenschmidt Signed-off-by: Santosh Sivaraj --- arch/powerpc/include/asm

Re: [PATCH] powerpc/vdso64: Add support for CLOCK_{REALTIME/MONOTONIC}_COARSE

2017-07-20 Thread Santosh Sivaraj
* Michael Ellerman wrote (on 2017-07-20 23:18:26 +1000): > Santosh Sivaraj writes: > > > Current vDSO64 implementation does not have support for coarse > > clocks (CLOCK_MONOTONIC_COARSE, CLOCK_REALTIME_COARSE), for which it falls > > back to system call. Below is a ben

[PATCH v2] powerpc/vdso64: Add support for CLOCK_{REALTIME/MONOTONIC}_COARSE

2017-07-21 Thread Santosh Sivaraj
: syscall: 1347 nsec/call clock-gettime-monotonic-coarse:libc: 187 nsec/call clock-gettime-monotonic-coarse:vdso: 125 nsec/call Used https://github.com/nlynch-mentor/vdsotest.git for the benchmarks. CC: Benjamin Herrenschmidt Signed-off-by: Santosh Sivaraj --- V2 update: moved syscall

Re: [RFC][PATCH v2 0/7] printk/ia64/ppc64/parisc64: let's deprecate %pF/%pf printk specifiers

2017-09-21 Thread Santosh Sivaraj
dereferences a kernel pointer if it's within the kernel's .opd > section. > > - dereference_module_function_descriptor(module, addr) > dereference a module pointer if it's within the module's .opd > section. > > > *** A

Re: [RFC PATCH] powerpc/perf: Add compact mode pmu support for powernv

2017-10-05 Thread Santosh Sivaraj
* Madhavan Srinivasan wrote (on 2017-10-03 12:25:15 +): > Most of the power processor generation performance monitoring > unit (PMU) driver code is bundled in the kernel and one of those > is enabled/registered based on the oprofile_cpu_type check at > the boot. > > But things get little tr

Re: [PATCH] powerpc/perf: Fix for core/nest imc call trace on cpuhotplug

2017-10-05 Thread Santosh Sivaraj
value. > > > > Signed-off-by: Anju T Sudhakar Reviewed-by: Santosh Sivaraj > --- > arch/powerpc/perf/imc-pmu.c | 28 > 1 file changed, 28 insertions(

Re: [PATCH 2/2] powerpc/vdso64: Add support for CLOCK_{REALTIME/MONOTONIC}_COARSE

2017-10-08 Thread Santosh Sivaraj
* Naveen N. Rao wrote (on 2017-10-06 11:25:28 +): > On 2017/09/18 09:23AM, Santosh Sivaraj wrote: > > Current vDSO64 implementation does not have support for coarse clocks > > (CLOCK_MONOTONIC_COARSE, CLOCK_REALTIME_COARSE), for which it falls back > > to system

Re: [PATCH 2/2] powerpc/vdso64: Add support for CLOCK_{REALTIME/MONOTONIC}_COARSE

2017-10-08 Thread Santosh Sivaraj
* Naveen N. Rao wrote (on 2017-10-06 09:28:30 +): > On 2017/09/18 09:23AM, Santosh Sivaraj wrote: > > Current vDSO64 implementation does not have support for coarse clocks > > (CLOCK_MONOTONIC_COARSE, CLOCK_REALTIME_COARSE), for which it falls back > > to system

[PATCH v4] powerpc/vdso64: Add support for CLOCK_{REALTIME/MONOTONIC}_COARSE

2017-10-09 Thread Santosh Sivaraj
/call clock-gettime-monotonic-coarse:vdso: 11 nsec/call CC: Benjamin Herrenschmidt Signed-off-by: Santosh Sivaraj --- arch/powerpc/kernel/asm-offsets.c | 2 + arch/powerpc/kernel/vdso64/gettimeofday.S | 67 ++- 2 files changed, 58 insertions(+), 11

<    1   2   3   >