[PATCH v2] powerpc/crash: save cpu register data in crash_smp_send_stop()

2022-06-30 Thread Hari Bathini
to smp_send_stop() in case the function gets called without kdump configured. Signed-off-by: Hari Bathini --- Changes in v2: * For INTERRUPT_SYSTEM_RESET case, stopped sending IPIs again to secondary CPUs via crash_kexec_prepare_cpus(). * Added comments where appropriate. arch/powerpc/include/asm

Re: [PATCH] powerpc/crash: save cpu register data in crash_smp_send_stop()

2022-06-30 Thread Hari Bathini
Please ignore this thread. Will resend with v2 tag.. On 30/06/22 11:00 am, Hari Bathini wrote: During kdump, two set of NMI IPIs are sent to secondary CPUs, if 'crash_kexec_post_notifiers' option is set. The first set of NMI IPIs to stop the CPUs and the other set to collect register data

[PATCH] powerpc/crash: save cpu register data in crash_smp_send_stop()

2022-06-29 Thread Hari Bathini
to smp_send_stop() in case the function gets called without kdump configured. Signed-off-by: Hari Bathini --- arch/powerpc/include/asm/kexec.h | 1 + arch/powerpc/kernel/smp.c| 29 arch/powerpc/kexec/crash.c | 77 +++- 3 files changed, 57 insertions

Re: [PATCH v2 5/5] bpf ppc32: Add instructions for atomic_[cmp]xchg

2022-06-13 Thread Hari Bathini
On 14/06/22 12:41 am, Hari Bathini wrote: On 11/06/22 11:04 pm, Christophe Leroy wrote: Le 10/06/2022 à 17:55, Hari Bathini a écrit : This adds two atomic opcodes BPF_XCHG and BPF_CMPXCHG on ppc32, both of which include the BPF_FETCH flag.  The kernel's atomic_cmpxchg operation

Re: [PATCH v2 5/5] bpf ppc32: Add instructions for atomic_[cmp]xchg

2022-06-13 Thread Hari Bathini
On 11/06/22 11:04 pm, Christophe Leroy wrote: Le 10/06/2022 à 17:55, Hari Bathini a écrit : This adds two atomic opcodes BPF_XCHG and BPF_CMPXCHG on ppc32, both of which include the BPF_FETCH flag. The kernel's atomic_cmpxchg operation fundamentally has 3 operands, but we only have two

Re: [PATCH v2 4/5] bpf ppc32: add support for BPF_ATOMIC bitwise operations

2022-06-13 Thread Hari Bathini
On 11/06/22 10:44 pm, Christophe Leroy wrote: Le 10/06/2022 à 17:55, Hari Bathini a écrit : Adding instructions for ppc32 for atomic_and atomic_or atomic_xor atomic_fetch_add atomic_fetch_and atomic_fetch_or atomic_fetch_xor Signed-off-by: Hari Bathini --- Changes in v2: * Used

[PATCH v2 5/5] bpf ppc32: Add instructions for atomic_[cmp]xchg

2022-06-10 Thread Hari Bathini
-coded to be BPF_REG_R0. Also, kernel's atomic_cmpxchg returns the previous value at dst_reg + off. JIT the same for BPF too with return value put in BPF_REG_0. BPF_REG_R0 = atomic_cmpxchg(dst_reg + off, BPF_REG_R0, src_reg); Signed-off-by: Hari Bathini --- Changes in v2: * Moved variable

[PATCH v2 4/5] bpf ppc32: add support for BPF_ATOMIC bitwise operations

2022-06-10 Thread Hari Bathini
Adding instructions for ppc32 for atomic_and atomic_or atomic_xor atomic_fetch_add atomic_fetch_and atomic_fetch_or atomic_fetch_xor Signed-off-by: Hari Bathini --- Changes in v2: * Used an additional register (BPF_REG_AX) - to avoid clobbering src_reg. - to keep the lwarx reservation

[PATCH v2 3/5] bpf ppc64: Add instructions for atomic_[cmp]xchg

2022-06-10 Thread Hari Bathini
-coded to be BPF_REG_R0. Also, kernel's atomic_cmpxchg returns the previous value at dst_reg + off. JIT the same for BPF too with return value put in BPF_REG_0. BPF_REG_R0 = atomic_cmpxchg(dst_reg + off, BPF_REG_R0, src_reg); Signed-off-by: Hari Bathini --- Changes in v2: * Moved variable

[PATCH v2 2/5] bpf ppc64: add support for atomic fetch operations

2022-06-10 Thread Hari Bathini
Adding instructions for ppc64 for atomic[64]_fetch_add atomic[64]_fetch_and atomic[64]_fetch_or atomic[64]_fetch_xor Signed-off-by: Hari Bathini --- * No changes in v2. arch/powerpc/net/bpf_jit_comp64.c | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/arch

[PATCH v2 1/5] bpf ppc64: add support for BPF_ATOMIC bitwise operations

2022-06-10 Thread Hari Bathini
Adding instructions for ppc64 for atomic[64]_and atomic[64]_or atomic[64]_xor Signed-off-by: Hari Bathini --- * No changes in v2. arch/powerpc/net/bpf_jit_comp64.c | 57 --- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/arch/powerpc/net

[PATCH v2 0/5] Atomics support for eBPF on powerpc

2022-06-10 Thread Hari Bathini
ep the lwarx reservation as intended. - to avoid the odd switch/goto construct. * For ppc32, zero'ed out the higher 32-bit explicitly when required. Hari Bathini (5): bpf ppc64: add support for BPF_ATOMIC bitwise operations bpf ppc64: add support for atomic fetch operations bpf ppc64: Add

Re: [PATCH] powerpc/crash: save cpu register data in crash_smp_send_stop()

2022-05-24 Thread Hari Bathini
Hi Nick, Thanks for the review.. On 10/05/22 2:31 pm, Nicholas Piggin wrote: Excerpts from Hari Bathini's message of May 7, 2022 2:39 am: Capture register data for secondary CPUs in crash_smp_send_stop() instead of doing it much later in crash_kexec_prepare_cpus() function with another set of

[PATCH 5/5] bpf ppc32: Add instructions for atomic_[cmp]xchg

2022-05-12 Thread Hari Bathini
-coded to be BPF_REG_R0. Also, kernel's atomic_cmpxchg returns the previous value at dst_reg + off. JIT the same for BPF too with return value put in BPF_REG_0. BPF_REG_R0 = atomic_cmpxchg(dst_reg + off, BPF_REG_R0, src_reg); Signed-off-by: Hari Bathini --- arch/powerpc/net/bpf_jit_comp32.c | 17

[PATCH 4/5] bpf ppc32: add support for BPF_ATOMIC bitwise operations

2022-05-12 Thread Hari Bathini
Adding instructions for ppc32 for atomic_and atomic_or atomic_xor atomic_fetch_add atomic_fetch_and atomic_fetch_or atomic_fetch_xor Signed-off-by: Hari Bathini --- arch/powerpc/net/bpf_jit_comp32.c | 45 +-- 1 file changed, 31 insertions(+), 14 deletions(-) diff

[PATCH 3/5] bpf ppc64: Add instructions for atomic_[cmp]xchg

2022-05-12 Thread Hari Bathini
-coded to be BPF_REG_R0. Also, kernel's atomic_cmpxchg returns the previous value at dst_reg + off. JIT the same for BPF too with return value put in BPF_REG_0. BPF_REG_R0 = atomic_cmpxchg(dst_reg + off, BPF_REG_R0, src_reg); Signed-off-by: Hari Bathini --- arch/powerpc/net/bpf_jit_comp64.c | 28

[PATCH 2/5] bpf ppc64: add support for atomic fetch operations

2022-05-12 Thread Hari Bathini
Adding instructions for ppc64 for atomic[64]_fetch_add atomic[64]_fetch_and atomic[64]_fetch_or atomic[64]_fetch_xor Signed-off-by: Hari Bathini --- arch/powerpc/net/bpf_jit_comp64.c | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/net

[PATCH 1/5] bpf ppc64: add support for BPF_ATOMIC bitwise operations

2022-05-12 Thread Hari Bathini
Adding instructions for ppc64 for atomic[64]_and atomic[64]_or atomic[64]_xor Signed-off-by: Hari Bathini --- arch/powerpc/net/bpf_jit_comp64.c | 57 --- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/arch/powerpc/net/bpf_jit_comp64.c b/arch

[PATCH 0/5] Atomics support for eBPF on powerpc

2022-05-12 Thread Hari Bathini
omic bitwise operations on ppc32. patch #5 adds support for xchg and cmpxchg atomic operations on ppc32. Hari Bathini (5): bpf ppc64: add support for BPF_ATOMIC bitwise operations bpf ppc64: add support for atomic fetch operations bpf ppc64: Add instructions for atomic_[cmp]xchg bpf ppc32:

[PATCH] powerpc/crash: save cpu register data in crash_smp_send_stop()

2022-05-06 Thread Hari Bathini
-off-by: Hari Bathini --- arch/powerpc/kernel/smp.c | 40 -- arch/powerpc/kexec/crash.c | 58 ++ 2 files changed, 40 insertions(+), 58 deletions(-) diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c index de0f6f09a5dd

Re: [PATCH 08/30] powerpc/setup: Refactor/untangle panic notifiers

2022-05-05 Thread Hari Bathini
be observed, but after the planned panic refactor we should expect more panic reliability with this patch. Cc: Benjamin Herrenschmidt Cc: Hari Bathini Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Paul Mackerras Signed-off-by: Guilherme G. Piccoli The change looks good. I have tested

[PATCH 3/3] powerpc/fadump: print start of preserved area

2022-04-06 Thread Hari Bathini
Print preserved area start address in fadump_region_show() function. Signed-off-by: Hari Bathini --- arch/powerpc/platforms/powernv/opal-fadump.c | 6 +++--- arch/powerpc/platforms/pseries/rtas-fadump.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/powerpc

[PATCH 2/3] powerpc/fadump: align destination address to pagesize

2022-04-06 Thread Hari Bathini
to fail forcing tools like makedumpfile to fall back to regular read. Avoid mmap read failure by ensuring that the destination address is always page aligned. Signed-off-by: Hari Bathini --- arch/powerpc/kernel/fadump.c | 5 + arch/powerpc/platforms/pseries/rtas-fadump.c | 6

[PATCH 1/3] powerpc/fadump: fix PT_LOAD segment for boot memory area

2022-04-06 Thread Hari Bathini
ements") Signed-off-by: Hari Bathini --- arch/powerpc/kernel/fadump.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c index 65562c4a0a69..dc2350b288cf 100644 --- a/arch/powerpc/kernel/fadump.c +++ b/arch/pow

[PATCH 0/3] powerpc/fadump: fadump fixes and improvements

2022-04-06 Thread Hari Bathini
that is printed for fadump. Hari Bathini (3): powerpc/fadump: fix PT_LOAD segment for boot memory area powerpc/fadump: align destination address to pagesize powerpc/fadump: print start of preserved area arch/powerpc/kernel/fadump.c | 13 +++-- arch/powerpc/platforms

[PATCH] powerpc/fadump: save CPU reg data in vmcore when PHYP terminates LPAR

2022-04-04 Thread Hari Bathini
LPAR. Also, rename the crash info member variable from online_mask to cpu_mask as it doesn't necessarily have to be online CPU mask always. Signed-off-by: Hari Bathini --- arch/powerpc/include/asm/fadump-internal.h | 2 +- arch/powerpc/kernel/fadump.c | 7 ++- arch/powerpc

Re: powerpc: Set crashkernel offset to mid of RMA region

2022-02-01 Thread Hari Bathini
On 28/01/22 3:34 pm, Sourabh Jain wrote: On large config LPARs (having 192 and more cores), Linux fails to boot due to insufficient memory in the first memblock. It is due to the memory reservation for the crash kernel which starts at 128MB offset of the first memblock. This memory

[RESEND PATCH v2] powerpc/fadump: register for fadump as early as possible

2022-02-01 Thread Hari Bathini
roc/vmcore at all due to incomplete configuration in the userspace at the time of crash. Commit 0823c68b054b ("powerpc/fadump: re-register firmware-assisted dump if already registered") ensures this change does not break userspace. Signed-off-by: Hari Bathini --- * Resending the patch a

Re: [PATCH v3 1/2] mm/cma: provide option to opt out from exposing pages on activation failure

2022-01-23 Thread Hari Bathini
Hi Andrew, Could you please pick these patches via -mm tree. On 17/01/22 1:22 pm, Hari Bathini wrote: Commit 072355c1cf2d ("mm/cma: expose all pages to the buddy if activation of an area fails") started exposing all pages to buddy allocator on CMA activation failure. But there

Re: [PATCH v2 1/2] mm/cma: provide option to opt out from exposing pages on activation failure

2022-01-17 Thread Hari Bathini
On 13/01/22 2:00 pm, David Hildenbrand wrote: +{ + if (!cma) + return; Do we really need that check for NULL? Probably not. + + cma->reserve_pages_on_error = true; +} + /** * cma_init_reserved_mem() - create custom contiguous area from reserved memory

[PATCH v3 2/2] powerpc/fadump: opt out from freeing pages on cma activation failure

2022-01-16 Thread Hari Bathini
osing pages to buddy allocator on CMA activation failure for fadump reserved memory. Signed-off-by: Hari Bathini Acked-by: David Hildenbrand --- Changes in v3: * Added Acked-by tag from David. arch/powerpc/kernel/fadump.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/powerpc/ke

[PATCH v3 1/2] mm/cma: provide option to opt out from exposing pages on activation failure

2022-01-16 Thread Hari Bathini
ion to opt out from exposing pages to buddy for such cases. Signed-off-by: Hari Bathini Reviewed-by: David Hildenbrand --- Changes in v3: * Dropped NULL check in cma_reserve_pages_on_error(). * Dropped explicit initialization of cma->reserve_pages_on_error to 'false' in cma_init_reserved_m

[PATCH v3 0/2] powerpc/fadump: handle CMA activation failure appropriately

2022-01-16 Thread Hari Bathini
ee_pages_on_error with cma->reserve_pages_on_error & cma_dont_free_pages_on_error() with cma_reserve_pages_on_error() to avoid confusion and make the expectation on failure clearer. Hari Bathini (2): mm/cma: provide option to opt out from exposing pages on activation failure powerpc/fadump:

[PATCH v2 2/2] powerpc/fadump: opt out from freeing pages on cma activation failure

2022-01-12 Thread Hari Bathini
osing pages to buddy allocator on CMA activation failure for fadump reserved memory. Signed-off-by: Hari Bathini --- arch/powerpc/kernel/fadump.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c index b7ceb041743c..82058b52e34a 10064

[PATCH v2 1/2] mm/cma: provide option to opt out from exposing pages on activation failure

2022-01-12 Thread Hari Bathini
ion to opt out from exposing pages to buddy for such cases. Signed-off-by: Hari Bathini --- Changes in v2: * Changed cma->free_pages_on_error to cma->reserve_pages_on_error and cma_dont_free_pages_on_error() to cma_reserve_pages_on_error() to avoid cofusion. include/linux/cma.h |

[PATCH v2 0/2] powerpc/fadump: handle CMA activation failure appropriately

2022-01-12 Thread Hari Bathini
dy allocator, on CMA activation failure. Changes in v2: * Replaced cma->free_pages_on_error with cma->reserve_pages_on_error & cma_dont_free_pages_on_error() with cma_reserve_pages_on_error() to avoid confusion and make the expectation on failure clearer. Hari Bathini (2): mm/cma:

Re: [PATCH 1/2] mm/cma: provide option to opt out from exposing pages on activation failure

2022-01-12 Thread Hari Bathini
On 11/01/22 8:06 pm, David Hildenbrand wrote: On 06.01.22 13:01, Hari Bathini wrote: To answer the question, fadump does not want the memory to be used for kernel pages, if CMA activation fails... Okay, so what you want is a reserved region, and if possible, let CMA use that memory

Re: [PATCH 1/2] mm/cma: provide option to opt out from exposing pages on activation failure

2022-01-06 Thread Hari Bathini
On 22/12/21 12:18 am, David Hildenbrand wrote: On 20.12.21 20:34, Hari Bathini wrote: Commit 072355c1cf2d ("mm/cma: expose all pages to the buddy if activation of an area fails") started exposing all pages to buddy allocator on CMA activation failure. But there can be CMA users

[PATCH 2/2] powerpc/fadump: opt out from freeing pages on cma activation failure

2021-12-20 Thread Hari Bathini
osing pages to buddy allocator on CMA activation failure for fadump reserved memory. Signed-off-by: Hari Bathini --- arch/powerpc/kernel/fadump.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c index b7ceb041743c..d1f7f79dfbd8 10064

[PATCH 1/2] mm/cma: provide option to opt out from exposing pages on activation failure

2021-12-20 Thread Hari Bathini
ion to opt out from exposing pages to buddy for such cases. Signed-off-by: Hari Bathini --- include/linux/cma.h | 2 ++ mm/cma.c| 15 +-- mm/cma.h| 1 + 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/include/linux/cma.h b/include/linux/c

[PATCH 0/2] powerpc/fadump: handle CMA activation failure appropriately

2021-12-20 Thread Hari Bathini
osing pages to buddy allocator, on CMA activation failure. Hari Bathini (2): mm/cma: provide option to opt out from exposing pages on activation failure powerpc/fadump: opt out from freeing pages on cma activation failure arch/powerpc/kernel/fadump.c | 6 ++ include/linux/cma.h

[PATCH v3 2/2] ppc64/fadump: fix inaccurate CPU state info in vmcore generated with panic

2021-12-07 Thread Hari Bathini
c_post_notifiers option. Also, as register data for all CPUs is captured by f/w, skip IPI callbacks here for fadump, to avoid any complications in finding the right backtraces. Signed-off-by: Hari Bathini --- arch/powerpc/kernel/fadump.c | 8 arch/powerpc/kernel/smp.c| 10 ++

[PATCH v3 1/2] powerpc: handle kdump appropriately with crash_kexec_post_notifiers option

2021-12-07 Thread Hari Bathini
in panic path"). Override this kdump friendly weak function to handle crash_kexec_post_notifiers option appropriately on powerpc. Signed-off-by: Hari Bathini [Fixed signature of crash_stop_this_cpu() - reported by l...@intel.com] Reported-by: kernel test robot ---

[PATCH v2 2/2] ppc64/fadump: fix inaccurate CPU state info in vmcore generated with panic

2021-11-25 Thread Hari Bathini
c_post_notifiers option. Also, as register data for all CPUs is captured by f/w, skip IPI callbacks here for fadump, to avoid any complications in finding the right backtraces. Signed-off-by: Hari Bathini --- Changes in v2: * Let panic(0 take crash friendly path when fadump is enabled using c

[PATCH v2 1/2] powerpc: handle kdump appropriately with crash_kexec_post_notifiers option

2021-11-25 Thread Hari Bathini
in panic path"). Override this kdump friendly weak function to handle crash_kexec_post_notifiers option appropriately on powerpc. Signed-off-by: Hari Bathini --- * New patch to handle the case where kdump is triggered after panic notifiers. arch/powerpc/kernel/smp.c | 26

Re: [PATCH] ppc64/fadump: fix inaccurate CPU state info in vmcore generated with panic

2021-11-16 Thread Hari Bathini
On 11/11/21 6:50 pm, Nicholas Piggin wrote: Excerpts from Hari Bathini's message of November 11, 2021 10:06 pm: On 11/11/21 11:44 am, Michael Ellerman wrote: Hari Bathini writes: In panic path, fadump is triggered via a panic notifier function. Before calling panic notifier functions

Re: [PATCH] ppc64/fadump: fix inaccurate CPU state info in vmcore generated with panic

2021-11-11 Thread Hari Bathini
On 11/11/21 11:44 am, Michael Ellerman wrote: Hari Bathini writes: In panic path, fadump is triggered via a panic notifier function. Before calling panic notifier functions, smp_send_stop() gets called, which stops all CPUs except the panic'ing CPU. Commit 8389b37dffdc ("po

[PATCH] ppc64/fadump: fix inaccurate CPU state info in vmcore generated with panic

2021-11-10 Thread Hari Bathini
38bbd4 ("powerpc: Offline CPU in stop_this_cpu()") reverted that change. To avoid vmcore from showing only one CPU as online in panic path, skip marking non panic'ing CPUs as offline while stopping them during fadump crash. Signed-off-by: Hari Bathini --- arch/powerpc/kernel/smp.c |

[PATCH] powerpc/bpf: fix write protecting JIT code

2021-10-24 Thread Hari Bathini
it by holding off write protection of JIT code until the extra pass, where branch target addresses fixup happens. Cc: sta...@vger.kernel.org Fixes: 62e3d4210ac9 ("powerpc/bpf: Write protect JIT code") Signed-off-by: Hari Bathini --- arch/powerpc/net/bpf_jit_comp.c | 2 +- 1 file changed, 1

Re: [PATCH] powerpc/kexec_file: Add of_node_put() before goto

2021-10-18 Thread Hari Bathini
-off-by: Wan Jiabing Thanks for fixing this! Acked-by: Hari Bathini --- arch/powerpc/kexec/file_load_64.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/kexec/file_load_64.c b/arch/powerpc/kexec/file_load_64.c index 5056e175ca2c..b4981b651d9a 100644 --- a/arch/powerpc/kexec

[RESEND PATCH v4 1/8] bpf powerpc: Remove unused SEEN_STACK

2021-10-12 Thread Hari Bathini
From: Ravi Bangoria SEEN_STACK is unused on PowerPC. Remove it. Also, have SEEN_TAILCALL use 0x4000. Signed-off-by: Ravi Bangoria Reviewed-by: Christophe Leroy --- * No changes in v4. arch/powerpc/net/bpf_jit.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git

[RESEND PATCH v4 0/8] bpf powerpc: Add BPF_PROBE_MEM support in powerpc JIT compiler

2021-10-12 Thread Hari Bathini
.@linux.vnet.ibm.com/ ("[v2,00/10] powerpc/bpf: Various fixes") Also, added Reviewed-by tag from Christophe for patches #3, #5, #6, #7 & #8. Hari Bathini (4): bpf powerpc: refactor JIT compiler code powerpc/ppc-opcode: introduce PPC_RAW_BRANCH() macro bpf ppc32: Add BPF_PROBE_MEM s

[RESEND PATCH v4 8/8] bpf ppc32: Access only if addr is kernel address

2021-10-12 Thread Hari Bathini
exception table. [Alexei suggested for x86] Suggested-by: Alexei Starovoitov Signed-off-by: Hari Bathini Reviewed-by: Christophe Leroy --- Changes in v4: * Adjusted the emit code to avoid using temporary reg. arch/powerpc/net/bpf_jit_comp32.c | 34 +++ 1 file

[RESEND PATCH v4 7/8] bpf ppc32: Add BPF_PROBE_MEM support for JIT

2021-10-12 Thread Hari Bathini
->| insn=0xfe14 | | fixup=0xffe8 | +--+ (Addresses shown here are chosen random, not real) Signed-off-by: Hari Bathini Reviewed-by: Christophe Leroy --- Changes in v4: * Dropped explicit fallthrough statement for empty switch cases. arch/powerpc/net

[RESEND PATCH v4 4/8] powerpc/ppc-opcode: introduce PPC_RAW_BRANCH() macro

2021-10-12 Thread Hari Bathini
Define and use PPC_RAW_BRANCH() macro instead of open coding it. This macro is used while adding BPF_PROBE_MEM support. Signed-off-by: Hari Bathini Reviewed-by: Christophe Leroy --- * No changes in v4. arch/powerpc/include/asm/ppc-opcode.h | 2 ++ arch/powerpc/net/bpf_jit.h| 2

[RESEND PATCH v4 6/8] bpf ppc64: Access only if addr is kernel address

2021-10-12 Thread Hari Bathini
-by: Hari Bathini Reviewed-by: Christophe Leroy --- Changes in v4: * Used IS_ENABLED() instead of #ifdef. * Dropped the else case that is not applicable for PPC64. arch/powerpc/net/bpf_jit_comp64.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/arch/powerpc/net

[RESEND PATCH v4 5/8] bpf ppc64: Add BPF_PROBE_MEM support for JIT

2021-10-12 Thread Hari Bathini
igned-off-by: Ravi Bangoria Signed-off-by: Hari Bathini Reviewed-by: Christophe Leroy --- Changes in v4: * Dropped explicit fallthrough statement for empty switch cases. arch/powerpc/net/bpf_jit.h| 8 +++- arch/powerpc/net/bpf_jit_comp.c | 66 ---

[RESEND PATCH v4 3/8] bpf powerpc: refactor JIT compiler code

2021-10-12 Thread Hari Bathini
Refactor powerpc LDX JITing code to simplify adding BPF_PROBE_MEM support. Signed-off-by: Hari Bathini Reviewed-by: Christophe Leroy --- Changes in v4: * Dropped the default case in the switch statement for bpf size. * Dropped explicit fallthrough statement for empty switch cases. arch

[RESEND PATCH v4 2/8] bpf powerpc: Remove extra_pass from bpf_jit_build_body()

2021-10-12 Thread Hari Bathini
From: Ravi Bangoria In case of extra_pass, usual JIT passes are always skipped. So, extra_pass is always false while calling bpf_jit_build_body() and can be removed. Signed-off-by: Ravi Bangoria --- * No changes in v4. arch/powerpc/net/bpf_jit.h| 2 +-

[PATCH v4 8/8] bpf ppc32: Access only if addr is kernel address

2021-09-29 Thread Hari Bathini
exception table. [Alexei suggested for x86] Suggested-by: Alexei Starovoitov Signed-off-by: Hari Bathini --- Changes in v4: * Adjusted the emit code to avoid using temporary reg. arch/powerpc/net/bpf_jit_comp32.c | 34 +++ 1 file changed, 34 insertions(+) diff

[PATCH v4 3/8] bpf powerpc: refactor JIT compiler code

2021-09-29 Thread Hari Bathini
Refactor powerpc LDX JITing code to simplify adding BPF_PROBE_MEM support. Signed-off-by: Hari Bathini --- Changes in v4: * Dropped the default case in the switch statement for bpf size. * Dropped explicit fallthrough statement for empty switch cases. arch/powerpc/net/bpf_jit_comp32.c | 33

[PATCH v4 7/8] bpf ppc32: Add BPF_PROBE_MEM support for JIT

2021-09-29 Thread Hari Bathini
->| insn=0xfe14 | | fixup=0xffe8 | +--+ (Addresses shown here are chosen random, not real) Signed-off-by: Hari Bathini --- Changes in v4: * Dropped explicit fallthrough statement for empty switch cases. arch/powerpc/net/bpf_jit.h| 4

[PATCH v4 6/8] bpf ppc64: Access only if addr is kernel address

2021-09-29 Thread Hari Bathini
-by: Hari Bathini --- Changes in v4: * Used IS_ENABLED() instead of #ifdef. * Dropped the else case that is not applicable for PPC64. arch/powerpc/net/bpf_jit_comp64.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/arch/powerpc/net/bpf_jit_comp64.c b/arch/powerpc

[PATCH v4 5/8] bpf ppc64: Add BPF_PROBE_MEM support for JIT

2021-09-29 Thread Hari Bathini
igned-off-by: Ravi Bangoria Signed-off-by: Hari Bathini --- Changes in v4: * Dropped explicit fallthrough statement for empty switch cases. arch/powerpc/net/bpf_jit.h| 8 +++- arch/powerpc/net/bpf_jit_comp.c | 70 --- arch/powerpc/net/bpf_jit_comp32.c |

[PATCH v4 4/8] powerpc/ppc-opcode: introduce PPC_RAW_BRANCH() macro

2021-09-29 Thread Hari Bathini
Define and use PPC_RAW_BRANCH() macro instead of open coding it. This macro is used while adding BPF_PROBE_MEM support. Signed-off-by: Hari Bathini Reviewed-by: Christophe Leroy --- * No changes in v4. arch/powerpc/include/asm/ppc-opcode.h | 2 ++ arch/powerpc/net/bpf_jit.h| 4

[PATCH v4 1/8] bpf powerpc: Remove unused SEEN_STACK

2021-09-29 Thread Hari Bathini
From: Ravi Bangoria SEEN_STACK is unused on PowerPC. Remove it. Also, have SEEN_TAILCALL use 0x4000. Signed-off-by: Ravi Bangoria Reviewed-by: Christophe Leroy --- * No changes in v4. arch/powerpc/net/bpf_jit.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git

[PATCH v4 0/8] bpf powerpc: Add BPF_PROBE_MEM support in powerpc JIT compiler

2021-09-29 Thread Hari Bathini
IT compilers respectively. Patch #6 & #8 handle bad userspace pointers for PPC64 & PPC32 cases respectively. Changes in v4: * Addressed all the review comments from Christophe. Hari Bathini (4): bpf powerpc: refactor JIT compiler code powerpc/ppc-opcode: introduce PPC_RAW_BRANCH() ma

[PATCH v4 2/8] bpf powerpc: Remove extra_pass from bpf_jit_build_body()

2021-09-29 Thread Hari Bathini
From: Ravi Bangoria In case of extra_pass, usual JIT passes are always skipped. So, extra_pass is always false while calling bpf_jit_build_body() and can be removed. Signed-off-by: Ravi Bangoria --- * No changes in v4. arch/powerpc/net/bpf_jit.h| 2 +-

[PATCH v3 8/8] bpf ppc32: Access only if addr is kernel address

2021-09-21 Thread Hari Bathini
exception table. [Alexei suggested for x86] Suggested-by: Alexei Starovoitov Signed-off-by: Hari Bathini --- Changes in v3: * Updated jump for PPC_BCC to always be the same while emitting a NOP instruction when needed. arch/powerpc/net/bpf_jit_comp32.c | 35 +++ 1

[PATCH v3 7/8] bpf ppc32: Add BPF_PROBE_MEM support for JIT

2021-09-21 Thread Hari Bathini
->| insn=0xfe14 | | fixup=0xffe8 | +--+ (Addresses shown here are chosen random, not real) Signed-off-by: Hari Bathini --- Changes in v3: * Changed how BPF_FIXUP_LEN is defined based on Chris' suggestion. arch/powerpc/net/bpf_jit.h| 4

[PATCH v3 6/8] bpf ppc64: Access only if addr is kernel address

2021-09-21 Thread Hari Bathini
-by: Hari Bathini --- Changes in v3: * Used is_kernel_addr() logic instead of using TASK_SIZE_MAX check all the time. * Addressed other comments from Christophe. arch/powerpc/net/bpf_jit_comp64.c | 29 + 1 file changed, 29 insertions(+) diff --git a/arch/powerpc/net

[PATCH v3 5/8] bpf ppc64: Add BPF_PROBE_MEM support for JIT

2021-09-21 Thread Hari Bathini
igned-off-by: Ravi Bangoria Signed-off-by: Hari Bathini --- Changes in v3: * Made all changes for bpf_add_extable_entry() in this patch instead of updating it again in patch #7. * Fixed a coding style issue. arch/powerpc/net/bpf_jit.h| 8 +++- arch/powerpc/net/bpf

[PATCH v3 4/8] powerpc/ppc-opcode: introduce PPC_RAW_BRANCH() macro

2021-09-21 Thread Hari Bathini
Define and use PPC_RAW_BRANCH() macro instead of open coding it. This macro is used while adding BPF_PROBE_MEM support. Signed-off-by: Hari Bathini Reviewed-by: Christophe Leroy --- Changes in v3: * Added Reviewed-by tag from Chris. arch/powerpc/include/asm/ppc-opcode.h | 2 ++ arch/powerpc

[PATCH v3 3/8] bpf powerpc: refactor JIT compiler code

2021-09-21 Thread Hari Bathini
Refactor powerpc LDX JITing code to simplify adding BPF_PROBE_MEM support. Signed-off-by: Hari Bathini --- Changes in v3: * Dropped ST(X) JITing coderefactoring and ensured the changes are minimal and relevant to BPF_PROBE_MEM support. * Added a default for size switch case to ensure compiler

[PATCH v3 2/8] bpf powerpc: Remove extra_pass from bpf_jit_build_body()

2021-09-21 Thread Hari Bathini
From: Ravi Bangoria In case of extra_pass, usual JIT passes are always skipped. So, extra_pass is always false while calling bpf_jit_build_body() and can be removed. Signed-off-by: Ravi Bangoria --- Changes in v3: * Updated the changelog wording a bit. arch/powerpc/net/bpf_jit.h| 2

[PATCH v3 1/8] bpf powerpc: Remove unused SEEN_STACK

2021-09-21 Thread Hari Bathini
From: Ravi Bangoria SEEN_STACK is unused on PowerPC. Remove it. Also, have SEEN_TAILCALL use 0x4000. Signed-off-by: Ravi Bangoria Reviewed-by: Christophe Leroy --- Changes in v3: * Added Reviewed-by tag from Chris. arch/powerpc/net/bpf_jit.h | 3 +-- 1 file changed, 1 insertion(+), 2

[PATCH v3 0/8] bpf powerpc: Add BPF_PROBE_MEM support in powerpc JIT compiler

2021-09-21 Thread Hari Bathini
IT compilers respectively. Patch #6 & #8 handle bad userspace pointers for PPC64 & PPC32 cases respectively. Changes in v3: * Addressed all the review comments from Christophe. Hari Bathini (4): bpf powerpc: refactor JIT compiler code powerpc/ppc-opcode: introduce PPC_RAW_BRANCH() ma

Re: [PATCH v2 3/8] bpf powerpc: refactor JIT compiler code

2021-09-20 Thread Hari Bathini
Hi Christophe, Thanks for reviewing the series. On 17/09/21 9:40 pm, Christophe Leroy wrote: Le 17/09/2021 à 17:30, Hari Bathini a écrit : Refactor powerpc JITing. This simplifies adding BPF_PROBE_MEM support. Could you describe a bit more what you are refactoring exactly ? I am trying

[PATCH v2 8/8] bpf ppc32: Add addr > TASK_SIZE_MAX explicit check

2021-09-17 Thread Hari Bathini
BPF exception table. [Alexei suggested for x86] Suggested-by: Alexei Starovoitov Signed-off-by: Hari Bathini --- Changes in v2: * New patch to handle bad userspace pointers on PPC32. arch/powerpc/net/bpf_jit_comp32.c | 39 +++ 1 file changed, 39 insertions(+) diff --

[PATCH v2 7/8] bpf ppc32: Add BPF_PROBE_MEM support for JIT

2021-09-17 Thread Hari Bathini
->| insn=0xfe14 | | fixup=0xffe8 | +--+ (Addresses shown here are chosen random, not real) Signed-off-by: Hari Bathini --- Changes in v2: * New patch to add BPF_PROBE_MEM support for PPC32. arch/powerpc/net/bpf_jit.h| 7 + arch/powerpc/net

[PATCH v2 3/8] bpf powerpc: refactor JIT compiler code

2021-09-17 Thread Hari Bathini
Refactor powerpc JITing. This simplifies adding BPF_PROBE_MEM support. Signed-off-by: Hari Bathini --- Changes in v2: * New patch to refactor a bit of JITing code. arch/powerpc/net/bpf_jit_comp32.c | 50 +++- arch/powerpc/net/bpf_jit_comp64.c | 76

[PATCH v2 6/8] bpf ppc64: Add addr > TASK_SIZE_MAX explicit check

2021-09-17 Thread Hari Bathini
off-by: Hari Bathini --- Changes in v2: * Refactored the code based on Christophe's comments. arch/powerpc/net/bpf_jit_comp64.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/arch/powerpc/net/bpf_jit_comp64.c b/arch/powerpc/net/bpf_jit_comp64.c index 2fc10995f

[PATCH v2 5/8] bpf ppc64: Add BPF_PROBE_MEM support for JIT

2021-09-17 Thread Hari Bathini
igned-off-by: Ravi Bangoria Signed-off-by: Hari Bathini --- Changes in v2: * Used JITing code after refactoring. * Replaced 'xor reg,reg,reg' with 'li reg,0' where appropriate. * Avoided unnecessary init during declaration. arch/powerpc/net/bpf_jit.h| 5 ++- arch/powerpc/net/bpf

[PATCH v2 4/8] powerpc/ppc-opcode: introduce PPC_RAW_BRANCH() macro

2021-09-17 Thread Hari Bathini
Define and use PPC_RAW_BRANCH() macro instead of open coding it. This macro is used while adding BPF_PROBE_MEM support. Signed-off-by: Hari Bathini --- Changes in v2: * New patch to introduce PPC_RAW_BRANCH() macro. arch/powerpc/include/asm/ppc-opcode.h | 2 ++ arch/powerpc/net/bpf_jit.h

[PATCH v2 2/8] bpf powerpc: Remove extra_pass from bpf_jit_build_body()

2021-09-17 Thread Hari Bathini
From: Ravi Bangoria In case of extra_pass, usual JIT passes are always skipped. So, extra_pass is always false while calling bpf_jit_build_body() and thus it can be removed. Signed-off-by: Ravi Bangoria --- Changes in v2: * Updated the changelog wording a bit. arch/powerpc/net/bpf_jit.h

[PATCH v2 1/8] bpf powerpc: Remove unused SEEN_STACK

2021-09-17 Thread Hari Bathini
From: Ravi Bangoria SEEN_STACK is unused on PowerPC. Remove it. Also, have SEEN_TAILCALL use 0x4000. Signed-off-by: Ravi Bangoria --- * No changes in v2. arch/powerpc/net/bpf_jit.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/powerpc/net/bpf_jit.h

[PATCH v2 0/8] bpf powerpc: Add BPF_PROBE_MEM support in powerpc JIT compiler

2021-09-17 Thread Hari Bathini
c: Add BPF_PROBE_MEM support for 64bit JIT") Hari Bathini (4): bpf powerpc: refactor JIT compiler code powerpc/ppc-opcode: introduce PPC_RAW_BRANCH() macro bpf ppc32: Add BPF_PROBE_MEM support for JIT bpf ppc32: Add addr > TASK_SIZE_MAX explicit check Ravi Bangoria (4): bpf pow

[PATCH V2] powerpc/fadump: register for fadump as early as possible

2021-07-28 Thread Hari Bathini
roc/vmcore at all due to incomplete configuration in the userspace at the time of crash. Commit 0823c68b054b ("powerpc/fadump: re-register firmware-assisted dump if already registered") ensures this change does not break userspace. Signed-off-by: Hari Bathini --- Changes in

[PATCH] powerpc/kexec: blacklist functions called in real mode for kprobe

2021-07-14 Thread Hari Bathini
As kprobe does not handle events happening in real mode, blacklist the functions that only get called in real mode or in kexec sequence with MMU turned off. Signed-off-by: Hari Bathini --- arch/powerpc/kernel/head_64.S|2 ++ arch/powerpc/kexec/core_64.c |6

[PATCH] powerpc/fadump: register for fadump as early as possible

2021-05-31 Thread Hari Bathini
fadump. Also, this change, in rare scenario, can lead to a case where the initrd is not dump capture capable, to offload the vmcore after a crash. But that does not make the case any worse than it already is. Signed-off-by: Hari Bathini --- arch/powerpc/kernel/fadump.c |6 -- 1 file changed, 4 ins

[PATCH] opal/fadump: fix fadump to work with a different endian capture kernel

2021-04-21 Thread Hari Bathini
. Fix it by having a well-defined endianess for struct opal_fadump_mem_struct. Signed-off-by: Hari Bathini --- arch/powerpc/platforms/powernv/opal-fadump.c | 94 ++ arch/powerpc/platforms/powernv/opal-fadump.h | 10 +-- 2 files changed, 57 insertions(+), 47 deletions

Re: [PATCH v4] powerpc/kexec_file: use current CPU info while setting up FDT

2021-04-19 Thread Hari Bathini
it for setting up the fdt in kexec_file_load case. Fixes: 6ecd0163d360 ("powerpc/kexec_file: Add appropriate regions for memory reserve map") Signed-off-by: Sourabh Jain Reviewed-by: Hari Bathini Cc: --- arch/powerpc/kexec/file_load_64.c | 98 +++ 1 file c

Re: [PATCH v3] powerpc/kexec_file: use current CPU info while setting up FDT

2021-04-18 Thread Hari Bathini
from of_root device node and use it for setting up the fdt in kexec_file_load case. Fixes: 6ecd0163d360 ("powerpc/kexec_file: Add appropriate regions for memory reserve map") Signed-off-by: Sourabh Jain Cc: Fow now, this should be a good stop-gap fix for /cpus node case. Reviewed-by

Re: [PATCH v2] powerpc/kexec_file: use current CPU info while setting up FDT

2021-04-16 Thread Hari Bathini
On 16/04/21 6:16 pm, Sourabh Jain wrote: kexec_file_load uses initial_boot_params in setting up the device-tree for the kernel to be loaded. Though initial_boot_params holds info about CPUs at the time of boot, it doesn't account for hot added CPUs. So, kexec'ing with kexec_file_load syscall

Re: [PATCH] powerpc/kdump: fix kdump kernel hangup issue with hot add CPUs

2021-04-16 Thread Hari Bathini
On 16/04/21 12:17 pm, Sourabh Jain wrote: With the kexec_file_load system call when system crashes on the hot add CPU the capture kernel hangs and failed to collect the vmcore. Kernel panic - not syncing: sysrq triggered crash CPU: 24 PID: 6065 Comm: echo Kdump: loaded Not tainted

Re: [PATCH v2] powerpc/kexec_file: Restore FDT size estimation for kdump kernel

2021-02-20 Thread Hari Bathini
s. Therefore change kexec_fdt_totalsize_ppc64() to calculate just the extra space needed by the kdump kernel, and change the function name so that it better reflects what the function is now doing. Thanks for fixing this, Thiago. Reviewed-by: Hari Bathini Signed-off-by: Thiago Jung Bauermann Reviewed-by: Lak

[PATCH] powerpc/kexec_file: fix FDT size estimation for kdump kernel

2021-02-04 Thread Hari Bathini
serve map") Cc: sta...@vger.kernel.org Signed-off-by: Hari Bathini --- arch/powerpc/include/asm/kexec.h |1 + arch/powerpc/kexec/elf_64.c |2 +- arch/powerpc/kexec/file_load_64.c | 34 ++ 3 files changed, 36 insertions(+), 1 deletion(-) d

Re: [RFC PATCH] powerpc/drmem: use global variable instead of fetching again

2020-08-17 Thread Hari Bathini
On 06/08/20 6:22 pm, Aneesh Kumar K.V wrote: use mem_addr_cells/mem_size_cells instead of fetching the values again from device tree. Looks good to me. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/drmem.c | 24 ++-- 1 file changed, 6 insertions(+), 18

Re: [PATCH] powerpc/book3s64/radix: Fix boot failure with large amount of guest memory

2020-08-17 Thread Hari Bathini
. Update the memblock limit after mmu_early_init_devtree() if the kernel is going to use radix translation. This forces some of the memblock allocations we do before mmu_early_init_devtree() to be within the RMA limit. Minor comments below. Nonetheless... Reviewed-by: Hari Bathini Fixes: 2bf

Re: [PATCH v2 2/4] powerpc/mem: Store the dt_root_size/addr cell values for later usage

2020-08-17 Thread Hari Bathini
On 06/08/20 9:53 pm, Aneesh Kumar K.V wrote: dt_root_addr_cells and dt_root_size_cells are __initdata variables. So make a copy of the same which can be used post init. This avoids doing the same thing at multiple places. So, thanks for the patch, Aneesh. Looks good to me. but nitpick

  1   2   3   4   5   6   7   >