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, >>>> >>>> Ch

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 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

[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

[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

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

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] 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

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 p

[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

[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 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 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 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 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/powerpc

[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 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 0/7] powerpc: implement machine check safe memcpy

2019-08-20 Thread Santosh Sivaraj
mcpy_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/powerpc/Kconfig

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

[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

[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 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 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. -

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

2019-08-19 Thread Santosh Sivaraj
m: 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/mce.h

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 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

[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 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 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 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/powerpc

[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 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 Salgaon

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

2019-08-14 Thread Santosh Sivaraj
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): powerpc/mce: Schedule work fro

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

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 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

[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

[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 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 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

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 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

[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 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 4/7] extable: Add function to search only kernel exception table

2019-08-12 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 v9 3/7] powerpc/mce: Make machine_check_ue_event() static

2019-08-12 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/powerpc

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

2019-08-12 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 v9 1/7] powerpc/mce: Schedule work from irq_work

2019-08-12 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 Cc: sta...@vger.kernel.org # v4.15+

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

2019-08-12 Thread Santosh Sivaraj
owerpc/mce: Fix MCE handling for huge pages powerpc/memcpy: Add memcpy_mcsafe for pmem Reza Arbab (1): powerpc/mce: Make machine_check_ue_event() static Santosh Sivaraj (4): powerpc/mce: Schedule work from irq_work extable: Add function to search only kernel exception table powerpc/mce:

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

2019-08-10 Thread Santosh Sivaraj
Michael Ellerman writes: > Santosh Sivaraj writes: >> 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

Re: [PATCH v8 3/7] powerpc/mce: Fix MCE handling for huge pages

2019-08-10 Thread Santosh Sivaraj
Mahesh Jagannath Salgaonkar writes: > On 8/7/19 8:26 PM, Santosh Sivaraj wrote: >> From: Balbir Singh >> >> The current code would fail on huge pages addresses, since the shift would >> be incorrect. Use the correct page shift value returned by >> __find_linux_

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

2019-08-07 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 v8 6/7] powerpc/mce: Handle UE event for memcpy_mcsafe

2019-08-07 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 v8 5/7] powerpc/memcpy: Add memcpy_mcsafe for pmem

2019-08-07 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 v8 4/7] extable: Add function to search only kernel exception table

2019-08-07 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 v8 3/7] powerpc/mce: Fix MCE handling for huge pages

2019-08-07 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 --- arch/powerpc/include/asm/mce.h |

[PATCH v8 2/7] powerpc/mce: Make machine_check_ue_event() static

2019-08-07 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/powerpc

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

2019-08-07 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") Signed-off-by: Santosh Sivaraj --- arch/powerpc/kernel/mce.c | 8 +--- 1 file changed, 5 insert

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

2019-08-07 Thread Santosh Sivaraj
pmem Reza Arbab (1): powerpc/mce: Make machine_check_ue_event() static Santosh Sivaraj (4): powerpc/mce: Schedule work from irq_work extable: Add function to search only kernel exception table powerpc/mce: Handle UE event for memcpy_mcsafe powerpc: add machine check safe copy_to_user ar

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

2019-08-05 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 v7 6/7] powerpc/mce: Handle UE event for memcpy_mcsafe

2019-08-05 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. Based-on-patch-by: Reza Arbab Cc: Reza Arbab Cc: Mahesh Salgaonkar Signed-off-by: Santosh Sivaraj --- arch/powerpc/include/asm/mce.h

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

2019-08-05 Thread Santosh Sivaraj
] Signed-off-by: Santosh Sivaraj --- arch/powerpc/include/asm/string.h | 2 + arch/powerpc/lib/Makefile | 2 +- arch/powerpc/lib/memcpy_mcsafe_64.S | 239 3 files changed, 242 insertions(+), 1 deletion(-) create mode 100644 arch/powerpc/lib/memcpy_mcsafe_64

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

2019-08-05 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 v7 3/7] powerpc/mce: Fix MCE handling for huge pages

2019-08-05 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 [santosh: return physical address instead of pfn; change commit log] Signed-off-by: Santosh Sivaraj --- ar

[PATCH v7 2/7] powerpc/mce: Make machine_check_ue_event() static

2019-08-05 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/powerpc

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

2019-08-05 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") Signed-off-by: Santosh Sivaraj --- arch/powerpc/kernel/mce.c | 8 +--- 1 file changed, 5 insert

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

2019-08-05 Thread Santosh Sivaraj
set RI bit explicitly [mahesh] * Re-ordered series to get r13 workaround as the last patch -- Balbir Singh (2): powerpc/mce: Fix MCE handling for huge pages powerpc/memcpy: Add memcpy_mcsafe for pmem Reza Arbab (1): powerpc/mce: Make machine_check_ue_event() static Santosh Sivaraj (4): p

[PATCH] powerpc/mce: Schedule work from irq_work

2019-08-01 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") Signed-off-by: Santosh Sivaraj --- arch/powerpc/kernel/mce.c | 8 +--- 1 file changed, 5 insert

[PATCH] powerpc/kvm: Fall through switch case explicitly

2019-07-28 Thread Santosh Sivaraj
Implicit fallthrough warning was enabled globally which broke the build. Make it explicit with a `fall through` comment. Signed-off-by: Santosh Sivaraj --- arch/powerpc/kvm/book3s_32_mmu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/kvm/book3s_32_mmu.c b/arch/powerpc/kvm

[v6 6/6] powerpc: add machine check safe copy_to_user

2019-07-28 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

[v6 5/6] powerpc/mce: Handle UE event for memcpy_mcsafe

2019-07-28 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. Based-on-patch-by: Reza Arbab Cc: Reza Arbab Cc: Mahesh Salgaonkar Signed-off-by: Santosh Sivaraj --- arch/powerpc/include/asm/mce.h

[v6 4/6] powerpc/memcpy: Add memcpy_mcsafe for pmem

2019-07-28 Thread Santosh Sivaraj
] Signed-off-by: Santosh Sivaraj --- arch/powerpc/include/asm/string.h | 2 + arch/powerpc/lib/Makefile | 2 +- arch/powerpc/lib/memcpy_mcsafe_64.S | 239 3 files changed, 242 insertions(+), 1 deletion(-) create mode 100644 arch/powerpc/lib/memcpy_mcsafe_64

[v6 3/6] extable: Add function to search only kernel exception table

2019-07-28 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

[v6 2/6] powerpc/mce: Fix MCE handling for huge pages

2019-07-28 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 [santosh: return physical address instead of pfn; change commit log] Signed-off-by: Santosh Sivaraj --- ar

[v6 1/6] powerpc/mce: Make machine_check_ue_event() static

2019-07-28 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/powerpc

[v6 0/6] powerpc: implement machine check safe memcpy

2019-07-28 Thread Santosh Sivaraj
to get r13 workaround as the last patch -- Balbir Singh (2): powerpc/mce: Fix MCE handling for huge pages powerpc/memcpy: Add memcpy_mcsafe for pmem Reza Arbab (1): powerpc/mce: Make machine_check_ue_event() static Santosh Sivaraj (3): extable: Add function to search only kernel exception table

[v5 5/6] powerpc/mce: Handle UE event for memcpy_mcsafe

2019-07-09 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. Based-on-patch-by: Reza Arbab Cc: Reza Arbab Cc: Mahesh Salgaonkar Signed-off-by: Santosh Sivaraj --- arch/powerpc/include/asm/mce.h

[v5 6/6] powerpc: add machine check safe copy_to_user

2019-07-09 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

[v5 4/6] extable: Add function to search only kernel exception table

2019-07-09 Thread Santosh Sivaraj
In real mode, the search_exception tables cannot be called because it also searches the module exception tables if entry is not found in the kernel exception tables. Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Nicholas Piggin Signed-off-by: Santosh Sivaraj --- include/linux/extable.h | 2

[v5 3/6] powerpc/memcpy: Add memcpy_mcsafe for pmem

2019-07-09 Thread Santosh Sivaraj
] Signed-off-by: Santosh Sivaraj --- arch/powerpc/include/asm/string.h | 2 + arch/powerpc/lib/Makefile | 2 +- arch/powerpc/lib/memcpy_mcsafe_64.S | 239 3 files changed, 242 insertions(+), 1 deletion(-) create mode 100644 arch/powerpc/lib/memcpy_mcsafe_64

[v5 2/6] powerpc/mce: Fix MCE handling for huge pages

2019-07-09 Thread Santosh Sivaraj
("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 Signed-off-by: Santosh Sivaraj --- arch/powerpc/include/asm/mce.h | 3 ++- arch/powerpc/kernel/mce_power.c

[v5 1/6] powerpc/mce: Make machine_check_ue_event() static

2019-07-09 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/powerpc

[v5 0/6] powerpc: implement machine check safe memcpy

2019-07-09 Thread Santosh Sivaraj
erged] v2: * Don't set RI bit explicitly [mahesh] * Re-ordered series to get r13 workaround as the last patch --- Balbir Singh (2): powerpc/mce: Fix MCE handling for huge pages powerpc/memcpy: Add memcpy_mcsafe for pmem Reza Arbab (1): powerpc/mce: Make machine_check_ue_event() static Santosh

[v4 6/6] powerpc/64s: save r13 in MCE handler (simulator workaroud)

2019-07-06 Thread Santosh Sivaraj
From: Reza Arbab Testing my memcpy_mcsafe() work in progress with an injected UE, I get an error like this immediately after the function returns: BUG: Unable to handle kernel data access at 0x7fff84dec8f8 Faulting instruction address: 0xc008009c00b0 Oops: Kernel access of bad area, sig: 11

[v4 5/6] powerpc: add machine check safe copy_to_user

2019-07-06 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

[v4 4/6] powerpc/mce: Handle UE event for memcpy_mcsafe

2019-07-06 Thread Santosh Sivaraj
If we take a UE on one of the instructions with a fixup entry, set nip to continue exucution at the fixup entry. Stop processing the event further or print it. Based-on-patch-by: Reza Arbab Cc: Reza Arbab Cc: Mahesh Salgaonkar Signed-off-by: Santosh Sivaraj --- arch/powerpc/include/asm/mce.h

[v4 3/6] powerpc/memcpy: Add memcpy_mcsafe for pmem

2019-07-06 Thread Santosh Sivaraj
] Signed-off-by: Santosh Sivaraj --- arch/powerpc/include/asm/string.h | 2 + arch/powerpc/lib/Makefile | 2 +- arch/powerpc/lib/memcpy_mcsafe_64.S | 239 3 files changed, 242 insertions(+), 1 deletion(-) create mode 100644 arch/powerpc/lib/memcpy_mcsafe_64

[v4 2/6] powerpc/mce: Bug fixes for MCE handling in kernel space

2019-07-06 Thread Santosh Sivaraj
handle shift values returned. Fixes: 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 Signed-off-by: Santosh Sivaraj --- arch/powerpc/include/asm/mce.h

[v4 1/6] powerpc/mce: Make machine_check_ue_event() static

2019-07-06 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/powerpc

[v4 0/6] powerpc: implement machine check safe memcpy

2019-07-06 Thread Santosh Sivaraj
Bug fixes for MCE handling in kernel space powerpc/memcpy: Add memcpy_mcsafe for pmem Reza Arbab (2): powerpc/mce: Make machine_check_ue_event() static powerpc/64s: save r13 in MCE handler (simulator workaroud) Santosh Sivaraj (2): powerpc/mce: Handle UE event for memcpy_mcsafe powerpc: a

[v3 7/7] powerpc/64s: save r13 in MCE handler (simulator workaroud)

2019-07-05 Thread Santosh Sivaraj
From: Reza Arbab Testing my memcpy_mcsafe() work in progress with an injected UE, I get an error like this immediately after the function returns: BUG: Unable to handle kernel data access at 0x7fff84dec8f8 Faulting instruction address: 0xc008009c00b0 Oops: Kernel access of bad area, sig: 11

[v3 6/7] powerpc: add machine check safe copy_to_user

2019-07-05 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 | 12 2 files changed, 13 insertions(+) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig

[v3 5/7] powerpc/memcpy_mcsafe: return remaining bytes

2019-07-05 Thread Santosh Sivaraj
memcpy_mcsafe currently return -EFAULT on a machine check exception, change it to return the remaining bytes that needs to be copied, so that machine check safe copy_to_user can maintain the same behavior as copy_to_user. Signed-off-by: Santosh Sivaraj --- arch/powerpc/lib/memcpy_mcsafe_64.S

[v3 4/7] powerpc/mce: Handle UE event for memcpy_mcsafe

2019-07-05 Thread Santosh Sivaraj
If we take a UE on one of the instructions with a fixup entry, set nip to continue exucution at the fixup entry. Stop processing the event further or print it. Based-on-patch-by: Reza Arbab Cc: Reza Arbab Cc: Mahesh Salgaonkar Signed-off-by: Santosh Sivaraj --- arch/powerpc/include/asm/mce.h

[v3 3/7] powerpc/memcpy: Add memcpy_mcsafe for pmem

2019-07-05 Thread Santosh Sivaraj
the VMX optimizations, largely to keep the patch simple. If needed those optimizations can be folded in. Signed-off-by: Balbir Singh Acked-by: Nicholas Piggin [ar...@linux.ibm.com: Added symbol export] Signed-off-by: Santosh Sivaraj --- arch/powerpc/include/asm/string.h | 2 + arch/powerpc

[v3 2/7] powerpc/mce: Bug fixes for MCE handling in kernel space

2019-07-05 Thread Santosh Sivaraj
handle shift values returned. Fixes: 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 Signed-off-by: Santosh Sivaraj --- arch/powerpc/include/asm/mce.h

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

2019-07-05 Thread Santosh Sivaraj
/64s: save r13 in MCE handler (simulator workaroud) Santosh Sivaraj (3): powerpc/mce: Handle UE event for memcpy_mcsafe powerpc/memcpy_mcsafe: return remaining bytes powerpc: add machine check safe copy_to_user arch/powerpc/Kconfig | 1 + arch/powerpc/include/asm/mce.h

[v3 1/7] powerpc/mce: Make machine_check_ue_event() static

2019-07-05 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 --- arch/powerpc/kernel/mce.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/mce.c b/arch/powerpc/kernel

[v2 04/12] powerpc/mce: Move machine_check_ue_event() call

2019-07-02 Thread Santosh Sivaraj
From: Reza Arbab Move the call site of machine_check_ue_event() slightly later in the MCE codepath. No functional change intended--this is prep for a later patch to conditionally skip the call. Signed-off-by: Reza Arbab --- arch/powerpc/kernel/mce.c | 5 - 1 file changed, 4 insertions(+),

[v2 03/12] powerpc/mce: Add MCE notification chain

2019-07-02 Thread Santosh Sivaraj
From: Reza Arbab Signed-off-by: Reza Arbab --- arch/powerpc/include/asm/asm-prototypes.h | 1 + arch/powerpc/include/asm/mce.h| 4 arch/powerpc/kernel/exceptions-64s.S | 4 arch/powerpc/kernel/mce.c | 22 ++ 4 files changed, 31

  1   2   >