Re: [PATCH 2/5] powerpc64/bpf: jit support for unconditional byte swap

2024-05-22 Thread Hari Bathini
good to me. Also, tested the changes with test_bpf module and selftests. For the series.. Reviewed-by: Hari Bathini #ifdef __BIG_ENDIAN__ if (BPF_SRC(code) == BPF_FROM_BE) goto emit_clear; #else /* !__BIG_ENDIAN__

[PATCH] powerpc/fadump: update documentation about bootargs_append

2024-05-10 Thread Hari Bathini
Update ABI documentation about the introduction of the new sysfs entry bootargs_append. This sysfs entry will be used to setup the additional parameters to be passed to dump capture kernel. Signed-off-by: Hari Bathini --- * This patch is a follow-up of below patch series, to update

[PATCH] powerpc/85xx: fix compile error without CONFIG_CRASH_DUMP

2024-05-10 Thread Hari Bathini
and CRASH_DUMP dependency") Reported-by: Christian Zigotzky Closes: https://lore.kernel.org/all/fa247ae4-5825-4dbe-a737-d93b7ab4d...@xenosoft.de/ Suggested-by: Michael Ellerman Signed-off-by: Hari Bathini --- arch/powerpc/platforms/85xx/smp.c | 9 ++--- 1 file changed, 6 insert

[PATCH v2 3/3] powerpc/fadump: pass additional parameters when fadump is active

2024-05-09 Thread Hari Bathini
Append the additional parameters passed/set in the dedicated parameter area (RTAS_FADUMP_PARAM_AREA) to bootargs in fadump capture kernel. Signed-off-by: Hari Bathini --- arch/powerpc/include/asm/fadump.h | 2 ++ arch/powerpc/kernel/fadump.c | 35 +++ arch

[PATCH v2 2/3] powerpc/fadump: setup additional parameters for dump capture kernel

2024-05-09 Thread Hari Bathini
parameter area to be passed to the capture kernel. This area type is defined as RTAS_FADUMP_PARAM_AREA. Sysfs attribute '/sys/kernel/fadump/bootargs_append' is exported to the userspace to specify the additional parameters to be passed to the capture kernel Signed-off-by: Hari Bathini --- arch

[PATCH v2 1/3] powerpc/pseries/fadump: add support for multiple boot memory regions

2024-05-09 Thread Hari Bathini
added to the fadump_ops structure to get the maximum boot memory regions supported by the platform. Signed-off-by: Sourabh Jain Signed-off-by: Hari Bathini --- arch/powerpc/include/asm/fadump-internal.h | 2 +- arch/powerpc/kernel/fadump.c | 27 +- arch/powerpc/platforms

[PATCH v2 0/3] powerpc/fadump: pass additional args to dump capture kernel

2024-05-09 Thread Hari Bathini
up. * Reserving the parameter area only when needed. [1] https://lore.kernel.org/linuxppc-dev/20231205201835.388030-1-hbath...@linux.ibm.com/ Hari Bathini (3): powerpc/pseries/fadump: add support for multiple boot memory regions powerpc/fadump: setup additional parameters for dump capture

[PATCH v4 1/2] powerpc64/bpf: fix tail calls for PCREL addressing

2024-05-02 Thread Hari Bathini
esing") Cc: sta...@vger.kernel.org Signed-off-by: Hari Bathini --- * Changes in v4: - Fix out of range errors by switching to kernelbase instead of PC for relative addressing. * Changes in v3: - New patch to fix tailcall issues with PCREL addressing. arch/powerpc/net/b

[PATCH v4 2/2] powerpc/bpf: enable kfunc call

2024-05-02 Thread Hari Bathini
-bit pointers, as an address offset can be more than 32-bit long on PPC64. Signed-off-by: Hari Bathini --- * Changes in v4: - Use either kernelbase or PC for relative addressing. Also, fallback to PPC_LI64(), if both are out of range. - Update r2 with kernel TOC for elfv1 too as elfv1 also

[PATCH 1/2] radix/kfence: map __kfence_pool at page granularity

2024-04-24 Thread Hari Bathini
: # cat /proc/meminfo MemTotal: 101201920 kB With patch: # cat /proc/meminfo MemTotal: 104483904 kB All kfence_test.c testcases passed with this patch. [1] https://lore.kernel.org/all/20201103175841.3495947-2-el...@google.com/ Signed-off-by: Hari Bathini --- arch/powerpc

[PATCH 2/2] radix/kfence: support late __kfence_pool allocation

2024-04-24 Thread Hari Bathini
all memory at PMD level and split the mapping for PMD pages that overlap with __kfence_pool to page level granularity if and when __kfence_pool is allocated after system startup. Signed-off-by: Hari Bathini --- arch/powerpc/include/asm/book3s/64/radix.h | 2 + arch/powerpc/include/asm/kfence.h

[PATCH v3 1/2] powerpc64/bpf: fix tail calls for PCREL addressing

2024-04-02 Thread Hari Bathini
PCREL addresing") Cc: sta...@vger.kernel.org Signed-off-by: Hari Bathini --- * Changes in v3: - New patch to fix tailcall issues with PCREL addressing. arch/powerpc/net/bpf_jit_comp64.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/powerpc/net/bpf_jit_comp64.c b/arch/p

[PATCH v3 2/2] powerpc/bpf: enable kfunc call

2024-04-02 Thread Hari Bathini
g on PPC64, override bpf_jit_supports_far_kfunc_call() to enable 64-bit pointers. Signed-off-by: Hari Bathini --- * Changes in v3: - Retained optimized instruction sequence when function address is a core kernel address as suggested by Naveen. - Used unoptimized instruction sequence

Re: [PATCH v8 1/3] powerpc: make fadump resilient with memory add/remove events

2024-03-11 Thread Hari Bathini
Cc: Aditya Gupta Cc: Aneesh Kumar K.V Cc: Hari Bathini Cc: Mahesh Salgaonkar Cc: Michael Ellerman Cc: Naveen N Rao --- arch/powerpc/include/asm/fadump-internal.h | 31 +- arch/powerpc/kernel/fadump.c | 339 +++ arch/powerpc/platforms/powernv/opal

Re: [PATCH v17 6/6] powerpc/crash: add crash memory hotplug support

2024-03-02 Thread Hari Bathini
e patchset looks good. I tried out the changes too. Acked-by: Hari Bathini Signed-off-by: Sourabh Jain Cc: Akhil Raj Cc: Andrew Morton Cc: Aneesh Kumar K.V Cc: Baoquan He Cc: Borislav Petkov (AMD) Cc: Boris Ostrovsky Cc: Christophe Leroy Cc: Dave Hansen Cc: Dave Young Cc: David Hilde

Re: [PATCH v17 5/6] powerpc/crash: add crash CPU hotplug support

2024-03-02 Thread Hari Bathini
under the CRASH_HOTPLUG config, and it is enabled by default. Looks good. Acked-by: Hari Bathini Signed-off-by: Sourabh Jain Cc: Akhil Raj Cc: Andrew Morton Cc: Aneesh Kumar K.V Cc: Baoquan He Cc: Borislav Petkov (AMD) Cc: Boris Ostrovsky Cc: Christophe Leroy Cc: Dave Hansen Cc: Dave Yo

Re: [PATCH v17 4/6] PowerPC/kexec: make the update_cpus_node() function public

2024-03-02 Thread Hari Bathini
nts for both kexec_load and kexec_file_load syscalls. No functional changes are intended. Looks good to me. Acked-by: Hari Bathini Signed-off-by: Sourabh Jain Cc: Akhil Raj Cc: Andrew Morton Cc: Aneesh Kumar K.V Cc: Baoquan He Cc: Borislav Petkov (AMD) Cc: Boris Ostrovsky Cc: Christophe Le

Re: [PATCH v17 3/6] powerpc/kexec: move *_memory_ranges functions to ranges.c

2024-03-02 Thread Hari Bathini
ded. Acked-by: Hari Bathini Signed-off-by: Sourabh Jain Cc: Akhil Raj Cc: Andrew Morton Cc: Aneesh Kumar K.V Cc: Baoquan He Cc: Borislav Petkov (AMD) Cc: Boris Ostrovsky Cc: Christophe Leroy Cc: Dave Hansen Cc: Dave Young Cc: David Hildenbrand Cc: Greg Kroah-Hartman Cc: Hari Bathini

Re: [PATCH v17 1/6] crash: forward memory_notify arg to arch crash hotplug handler

2024-03-02 Thread Hari Bathini
handler. Acked-by: Hari Bathini Signed-off-by: Sourabh Jain Acked-by: Baoquan He Cc: Akhil Raj Cc: Andrew Morton Cc: Aneesh Kumar K.V Cc: Borislav Petkov (AMD) Cc: Boris Ostrovsky Cc: Christophe Leroy Cc: Dave Hansen Cc: Dave Young Cc: David Hildenbrand Cc: Greg Kroah-Hartman Cc: Hari

Re: [PATCH v17 2/6] crash: add a new kexec flag for hotplug support

2024-03-02 Thread Hari Bathini
of struct kimage for both kexec_load and kexec_file_load system calls. This simplifies kernel checks to identify hotplug support for the currently loaded kdump image by just examining the value of @hotplug_support. Couple of minor nits. See comments below. Otherwise, looks good to me. Acked-by: Ha

[PATCH linux-next v2 2/3] powerpc/kexec: split CONFIG_KEXEC_FILE and CONFIG_CRASH_DUMP

2024-02-26 Thread Hari Bathini
CONFIG_KEXEC_FILE does not have to select CONFIG_CRASH_DUMP. Move some code under CONFIG_CRASH_DUMP to support CONFIG_KEXEC_FILE and !CONFIG_CRASH_DUMP case. Signed-off-by: Hari Bathini --- * No changes in v2. arch/powerpc/kexec/elf_64.c | 4 +- arch/powerpc/kexec/file_load_64.c | 269

[PATCH linux-next v2 3/3] powerpc/kdump: Split KEXEC_CORE and CRASH_DUMP dependency

2024-02-26 Thread Hari Bathini
on CONFIG_CRASH_DUMP to avoid unmet dependencies for FA_DUMP with !CONFIG_KEXEC_CORE configuration option. Signed-off-by: Hari Bathini --- Changes in v2: * Fixed a compile error for POWERNV build reported by Sourabh. arch/powerpc/Kconfig | 9 +-- arch/powerpc/include/asm/kexec.h

[PATCH linux-next v2 0/3] powerpc/kexec: split CONFIG_CRASH_DUMP out from CONFIG_KEXEC_CORE

2024-02-26 Thread Hari Bathini
-bec9-ec67e9899...@linux.ibm.com/ Changes in v2: * Fixed a compile error for POWERNV build reported by Sourabh. Hari Bathini (3): kexec/kdump: make struct crash_mem available without CONFIG_CRASH_DUMP powerpc/kexec: split CONFIG_KEXEC_FILE and CONFIG_CRASH_DUMP powerpc/kdump: Split KEXEC_CORE

[PATCH linux-next v2 1/3] kexec/kdump: make struct crash_mem available without CONFIG_CRASH_DUMP

2024-02-26 Thread Hari Bathini
memory ranges and exclude memory ranges needed to find the right memory regions to load kexec kernel. So, make the definition of crash_mem structure available for !CONFIG_CRASH_DUMP case too. Signed-off-by: Hari Bathini --- * No changes in v2. include/linux/crash_core.h | 12 ++-- 1 file

Re: [PATCH linux-next 3/3] powerpc/kdump: Split KEXEC_CORE and CRASH_DUMP dependency

2024-02-25 Thread Hari Bathini
On 23/02/24 1:05 pm, Sourabh Jain wrote: Hello Hari, Hi Sourabh, Build failure detected. Thanks for trying out the patches. On 13/02/24 17:01, Hari Bathini wrote: Remove CONFIG_CRASH_DUMP dependency on CONFIG_KEXEC. CONFIG_KEXEC_CORE was used at places where CONFIG_CRASH_DUMP

Re: [PATCH v2 00/14] Split crash out from kexec and clean up related config items

2024-02-22 Thread Hari Bathini
On 23/02/24 2:59 am, Andrew Morton wrote: On Thu, 22 Feb 2024 10:47:29 +0530 Hari Bathini wrote: On 22/02/24 2:27 am, Andrew Morton wrote: On Wed, 21 Feb 2024 11:15:00 +0530 Hari Bathini wrote: On 04/02/24 8:56 am, Baoquan He wrote: Hope Hari and Pingfan can help have a look, see

Re: [powerpc] Dump capture failure with recent linux-next

2024-02-21 Thread Hari Bathini
Hi Sachin, On 22/02/24 10:55 am, Sachin Sant wrote: Kdump fails to save vmcore with recent linux-next builds on IBM Power server with following messages Starting Kdump Vmcore Save Service... [ 17.349599] kdump[367]: Kdump is using the default log level(3). [ 17.407407] kdump[391]:

Re: [PATCH v2 00/14] Split crash out from kexec and clean up related config items

2024-02-21 Thread Hari Bathini
On 22/02/24 2:27 am, Andrew Morton wrote: On Wed, 21 Feb 2024 11:15:00 +0530 Hari Bathini wrote: On 04/02/24 8:56 am, Baoquan He wrote: Hope Hari and Pingfan can help have a look, see if it's doable. Now, I make it either have both kexec and crash enabled, or disable both of them

Re: [PATCH v2 00/14] Split crash out from kexec and clean up related config items

2024-02-20 Thread Hari Bathini
Hi Baoquan, On 04/02/24 8:56 am, Baoquan He wrote: Hope Hari and Pingfan can help have a look, see if it's doable. Now, I make it either have both kexec and crash enabled, or disable both of them altogether. Sure. I will take a closer look... Thanks a lot. Please feel free to post patches to

Re: [PATCH v2 1/2] powerpc/bpf: ensure module addresses are supported

2024-02-15 Thread Hari Bathini
On 13/02/24 1:23 pm, Christophe Leroy wrote: Le 01/02/2024 à 18:12, Hari Bathini a écrit : Currently, bpf jit code on powerpc assumes all the bpf functions and helpers to be kernel text. This is false for kfunc case, as function addresses are mostly module addresses in that case. Ensure

Re: [PATCH v2 2/2] powerpc/bpf: enable kfunc call

2024-02-15 Thread Hari Bathini
On 13/02/24 1:24 pm, Christophe Leroy wrote: Le 01/02/2024 à 18:12, Hari Bathini a écrit : With module addresses supported, override bpf_jit_supports_kfunc_call() to enable kfunc support. Module address offsets can be more than 32-bit long, so override bpf_jit_supports_far_kfunc_call

[PATCH linux-next 3/3] powerpc/kdump: Split KEXEC_CORE and CRASH_DUMP dependency

2024-02-13 Thread Hari Bathini
on CONFIG_CRASH_DUMP to avoid unmet dependencies for FA_DUMP with !CONFIG_KEXEC_CORE configuration option. Signed-off-by: Hari Bathini --- arch/powerpc/Kconfig | 9 +-- arch/powerpc/include/asm/kexec.h | 98 +++--- arch/powerpc/kernel/prom.c | 2

[PATCH linux-next 2/3] powerpc/kexec: split CONFIG_KEXEC_FILE and CONFIG_CRASH_DUMP

2024-02-13 Thread Hari Bathini
CONFIG_KEXEC_FILE does not have to select CONFIG_CRASH_DUMP. Move some code under CONFIG_CRASH_DUMP to support CONFIG_KEXEC_FILE and !CONFIG_CRASH_DUMP case. Signed-off-by: Hari Bathini --- arch/powerpc/kexec/elf_64.c | 4 +- arch/powerpc/kexec/file_load_64.c | 269

[PATCH linux-next 1/3] kexec/kdump: make struct crash_mem available without CONFIG_CRASH_DUMP

2024-02-13 Thread Hari Bathini
memory ranges and exclude memory ranges needed to find the right memory regions to load kexec kernel. So, make the definition of crash_mem structure available for !CONFIG_CRASH_DUMP case too. Signed-off-by: Hari Bathini --- include/linux/crash_core.h | 12 ++-- 1 file changed, 6 insertions

[PATCH linux-next 0/3] powerpc/kexec: split CONFIG_CRASH_DUMP out from CONFIG_KEXEC_CORE

2024-02-13 Thread Hari Bathini
-bec9-ec67e9899...@linux.ibm.com/ Hari Bathini (3): kexec/kdump: make struct crash_mem available without CONFIG_CRASH_DUMP powerpc/kexec: split CONFIG_KEXEC_FILE and CONFIG_CRASH_DUMP powerpc/kdump: Split KEXEC_CORE and CRASH_DUMP dependency arch/powerpc/Kconfig | 9 +- arch

Re: [PATCH v2 00/14] Split crash out from kexec and clean up related config items

2024-02-01 Thread Hari Bathini
Hi Baoquan, On 19/01/24 8:22 pm, Baoquan He wrote: Motivation: = Previously, LKP reported a building error. When investigating, it can't be resolved reasonablly with the present messy kdump config items. https://lore.kernel.org/oe-kbuild-all/202312182200.ka7mzifq-...@intel.com/

[PATCH v2 2/2] powerpc/bpf: enable kfunc call

2024-02-01 Thread Hari Bathini
With module addresses supported, override bpf_jit_supports_kfunc_call() to enable kfunc support. Module address offsets can be more than 32-bit long, so override bpf_jit_supports_far_kfunc_call() to enable 64-bit pointers. Signed-off-by: Hari Bathini --- * No changes since v1. arch/powerpc

[PATCH v2 1/2] powerpc/bpf: ensure module addresses are supported

2024-02-01 Thread Hari Bathini
with no kfunc call to optimize instruction sequence in that case. Add a check to error out if this assumption ever changes in the future. Signed-off-by: Hari Bathini --- Changes in v2: * Using bpf_prog_has_kfunc_call() to decide whether to use optimized instruction sequence or not as suggested

Re: [PATCH v15 5/5] powerpc: add crash memory hotplug support

2024-01-23 Thread Hari Bathini
by: Sourabh Jain Cc: Akhil Raj Cc: Andrew Morton Cc: Aneesh Kumar K.V Cc: Baoquan He Cc: Borislav Petkov (AMD) Cc: Boris Ostrovsky Cc: Christophe Leroy Cc: Dave Hansen Cc: Dave Young Cc: David Hildenbrand Cc: Greg Kroah-Hartman Cc: Hari Bathini Cc: Laurent Dufour Cc: Mahesh Salgaon

Re: [PATCH v15 4/5] powerpc: add crash CPU hotplug support

2024-01-23 Thread Hari Bathini
under the CRASH_HOTPLUG config, and it is enabled by default. Signed-off-by: Sourabh Jain Cc: Akhil Raj Cc: Andrew Morton Cc: Aneesh Kumar K.V Cc: Baoquan He Cc: Borislav Petkov (AMD) Cc: Boris Ostrovsky Cc: Christophe Leroy Cc: Dave Hansen Cc: Dave Young Cc: David Hildenbrand Cc: Greg Kroah

Re: [PATCH v7 1/3] powerpc: make fadump resilient with memory add/remove events

2024-01-23 Thread Hari Bathini
not have the changes introduced here then kernel fail to collect the dump and prints relevant error message on the console. Signed-off-by: Sourabh Jain Cc: Aditya Gupta Cc: Aneesh Kumar K.V Cc: Hari Bathini Cc: Mahesh Salgaonkar Cc: Michael Ellerman Cc: Naveen N Rao --- arch/powerpc/include/a

Re: [PATCHv9 2/2] powerpc/setup: Loosen the mapping between cpu logical id and its seq in dt

2024-01-08 Thread Hari Bathini
On 09/01/24 9:57 am, Hari Bathini wrote: Hi Michael, Sorry, Michael. I am just about getting back to work and I spoke too soon. You already seem to have posted a set with the approach you had in mind: https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=388350 Thanks Hari I

Re: [PATCHv9 2/2] powerpc/setup: Loosen the mapping between cpu logical id and its seq in dt

2024-01-08 Thread Hari Bathini
Hi Michael, I am fine with either approach. I was trying to address your concerns in my way. Looking for your inputs here on how to go about this now.. On 29/11/23 7:00 am, Pingfan Liu wrote: Hi Hari, On Mon, Nov 27, 2023 at 12:30 PM Hari Bathini wrote: Hi Pingfan, Michael, On 17/10/23 4

[PATCH 2/2] powerpc/bpf: enable kfunc call

2023-12-20 Thread Hari Bathini
With module addresses supported, override bpf_jit_supports_kfunc_call() to enable kfunc support. Module address offsets can be more than 32-bit long, so override bpf_jit_supports_far_kfunc_call() to enable 64-bit pointers. Signed-off-by: Hari Bathini --- arch/powerpc/net/bpf_jit_comp.c | 10

[PATCH 1/2] powerpc/bpf: ensure module addresses are supported

2023-12-20 Thread Hari Bathini
2: Setup kernel TOC in r2 on entry") that paved the way for the commits mentioned above is reverted. Signed-off-by: Hari Bathini --- arch/powerpc/net/bpf_jit.h| 2 +- arch/powerpc/net/bpf_jit_comp32.c | 8 +-- arch/powerpc/net/bpf_jit_comp64.c | 90 +-- 3 files

Re: [PATCH v14 5/6] powerpc: add crash CPU hotplug support

2023-12-19 Thread Hari Bathini
av Petkov (AMD) Cc: Boris Ostrovsky Cc: Christophe Leroy Cc: Dave Hansen Cc: Dave Young Cc: David Hildenbrand Cc: Eric DeVolder Cc: Greg Kroah-Hartman Cc: Hari Bathini Cc: Laurent Dufour Cc: Mahesh Salgaonkar Cc: Michael Ellerman Cc: Mimi Zohar Cc: Naveen N Rao Cc: Oscar Salvador Cc: Tho

Re: [RFC PATCH 2/3] powerpc/fadump: pass additional parameters to dump capture kernel

2023-12-17 Thread Hari Bathini
Hi Sourabh, On 15/12/23 2:12 pm, Sourabh Jain wrote: Hello Hari, On 06/12/23 01:48, Hari Bathini wrote: For fadump case, passing additional parameters to dump capture kernel helps in minimizing the memory footprint for it and also provides the flexibility to disable components/modules, like

[RFC PATCH 3/3] powerpc/fadump: pass additional parameters when fadump is active

2023-12-05 Thread Hari Bathini
Append the additional parameters passed/set in the dedicated parameter area (RTAS_FADUMP_PARAM_AREA) to bootargs in fadump capture kernel. Signed-off-by: Hari Bathini --- arch/powerpc/include/asm/fadump.h | 2 ++ arch/powerpc/kernel/fadump.c | 34 +++ arch

[RFC PATCH 2/3] powerpc/fadump: pass additional parameters to dump capture kernel

2023-12-05 Thread Hari Bathini
parameter area to be passed to the capture kernel. This area type is defined as RTAS_FADUMP_PARAM_AREA. Sysfs attribute '/sys/kernel/fadump/bootargs_append' is exported to the userspace to specify the additional parameters to be passed to the capture kernel Signed-off-by: Hari Bathini --- arch

[RFC PATCH 1/3] powerpc/pseries/fadump: add support for multiple boot memory regions

2023-12-05 Thread Hari Bathini
callback has been added to the fadump_ops structure to get the maximum boot memory regions supported by the platform. Signed-off-by: Sourabh Jain Signed-off-by: Hari Bathini --- arch/powerpc/include/asm/fadump-internal.h | 2 +- arch/powerpc/kernel/fadump.c | 27 +- arch

[RFC PATCH 0/3] powerpc/fadump: pass additional args to dump capture kernel

2023-12-05 Thread Hari Bathini
to specify the additional parameters to be passed to the capture kernel. The last patch appends the parameters to bootargs during capture kernel boot. Hari Bathini (2): powerpc/fadump: pass additional parameters to dump capture kernel powerpc/fadump: pass additional parameters when fadump is active

Re: [PATCHv9 2/2] powerpc/setup: Loosen the mapping between cpu logical id and its seq in dt

2023-11-26 Thread Hari Bathini
Hi Pingfan, Michael, On 17/10/23 4:03 pm, Hari Bathini wrote: On 17/10/23 7:58 am, Pingfan Liu wrote: *** Idea *** For kexec -p, the boot cpu can be not the cpu0, this causes the problem of allocating memory for paca_ptrs[]. However, in theory, there is no requirement to assign cpu's logical

Re: [PATCH v5 1/3] powerpc: make fadump resilient with memory add/remove events

2023-11-16 Thread Hari Bathini
On 17/11/23 11:01 am, Aneesh Kumar K V wrote: On 11/17/23 10:03 AM, Sourabh Jain wrote: Hi Aneesh, Thanks for reviewing the patch. On 15/11/23 10:14, Aneesh Kumar K.V wrote: Sourabh Jain  writes: diff --git a/arch/powerpc/include/asm/fadump-internal.h

Re: [PATCH v7 1/5] powerpc/code-patching: introduce patch_instructions()

2023-10-30 Thread Hari Bathini
Hi Aneesh, On 30/10/23 6:32 pm, Aneesh Kumar K.V wrote: Hari Bathini writes: patch_instruction() entails setting up pte, patching the instruction, clearing the pte and flushing the tlb. If multiple instructions need to be patched, every instruction would have to go through the above drill

Re: [PATCH v6 5/5] powerpc/bpf: use bpf_jit_binary_pack_[alloc|finalize|free]

2023-10-20 Thread Hari Bathini
On 19/10/23 11:41 am, Michael Ellerman wrote: Hari Bathini writes: Use bpf_jit_binary_pack_alloc in powerpc jit. The jit engine first writes the program to the rw buffer. When the jit is done, the program is copied to the final location with bpf_jit_binary_pack_finalize. With multiple

[PATCH v7 1/5] powerpc/code-patching: introduce patch_instructions()

2023-10-20 Thread Hari Bathini
() always as BPF expects poking_init() to be setup even when STRICT_KERNEL_RWX is off. Signed-off-by: Hari Bathini Acked-by: Song Liu --- Changes in v7: * Fixed crash observed with !STRICT_RWX. arch/powerpc/include/asm/code-patching.h | 1 + arch/powerpc/lib/code-patching.c | 141

[PATCH v7 5/5] powerpc/bpf: use bpf_jit_binary_pack_[alloc|finalize|free]

2023-10-20 Thread Hari Bathini
bpf_jit_binary_pack_finalize() yet. Implement custom bpf_jit_free() like in commit 1d5f82d9dd47 ("bpf, x86: fix freeing of not-finalized bpf_prog_pack") to call bpf_jit_binary_pack_finalize(), if necessary. As bpf_flush_icache() is not needed anymore, remove it. Signed-off-by: Hari Bath

[PATCH v7 3/5] powerpc/bpf: implement bpf_arch_text_invalidate for bpf_prog_pack

2023-10-20 Thread Hari Bathini
Implement bpf_arch_text_invalidate and use it to fill unused part of the bpf_prog_pack with trap instructions when a BPF program is freed. Signed-off-by: Hari Bathini Acked-by: Song Liu --- * No changes in v7. arch/powerpc/net/bpf_jit_comp.c | 15 +++ 1 file changed, 15

[PATCH v7 4/5] powerpc/bpf: rename powerpc64_jit_data to powerpc_jit_data

2023-10-20 Thread Hari Bathini
powerpc64_jit_data is a misnomer as it is meant for both ppc32 and ppc64. Rename it to powerpc_jit_data. Signed-off-by: Hari Bathini Acked-by: Song Liu --- * No changes in v7. arch/powerpc/net/bpf_jit_comp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch

[PATCH v7 2/5] powerpc/bpf: implement bpf_arch_text_copy

2023-10-20 Thread Hari Bathini
bpf_arch_text_copy is used to dump JITed binary to RX page, allowing multiple BPF programs to share the same page. Use the newly introduced patch_instructions() to implement it. Signed-off-by: Hari Bathini Acked-by: Song Liu --- * No changes in v7. arch/powerpc/net/bpf_jit_comp.c | 20

[PATCH v7 0/5] powerpc/bpf: use BPF prog pack allocator

2023-10-20 Thread Hari Bathini
. Changes in v2: * Introduced patch_instructions() to help with patching bpf programs. Hari Bathini (5): powerpc/code-patching: introduce patch_instructions() powerpc/bpf: implement bpf_arch_text_copy powerpc/bpf: implement bpf_arch_text_invalidate for bpf_prog_pack powerpc/bpf: rename po

Re: [PATCHv9 2/2] powerpc/setup: Loosen the mapping between cpu logical id and its seq in dt

2023-10-20 Thread Hari Bathini
On 18/10/23 1:51 pm, Pingfan Liu wrote: On Tue, Oct 17, 2023 at 6:39 PM Hari Bathini wrote: On 17/10/23 7:58 am, Pingfan Liu wrote: *** Idea *** For kexec -p, the boot cpu can be not the cpu0, this causes the problem of allocating memory for paca_ptrs[]. However, in theory

Re: [PATCHv9 2/2] powerpc/setup: Loosen the mapping between cpu logical id and its seq in dt

2023-10-17 Thread Hari Bathini
Xiong Cc: Baoquan He Cc: Ming Lei Cc: Sourabh Jain Cc: Hari Bathini Cc: ke...@lists.infradead.org To: linuxppc-dev@lists.ozlabs.org Thanks for working on this, Pingfan. Looks good to me. Acked-by: Hari Bathini --- arch/powerpc/kernel/prom.c | 25 + arch/powerpc/kernel/setup

Re: [PATCHv9 1/2] powerpc/setup : Enable boot_cpu_hwid for PPC32

2023-10-17 Thread Hari Bathini
this variable on PPC32 so later it can also be used to carry that information for PPC32 in the coming patch. Signed-off-by: Pingfan Liu Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Christophe Leroy Cc: Mahesh Salgaonkar Cc: Wen Xiong Cc: Baoquan He Cc: Ming Lei Cc: Sourabh Jain Cc: Hari Bathini Cc

Re: [PATCH v6 0/5] powerpc/bpf: use BPF prog pack allocator

2023-10-17 Thread Hari Bathini
On 16/10/23 5:37 pm, Daniel Borkmann wrote: On 10/12/23 10:03 PM, Hari Bathini wrote: Most BPF programs are small, but they consume a page each. For systems with busy traffic and many BPF programs, this may also add significant pressure on instruction TLB. High iTLB pressure usually slows

Re: [PATCH v5 1/5] powerpc/code-patching: introduce patch_instructions()

2023-10-12 Thread Hari Bathini
Thanks for the review, Christophe. On 10/10/23 11:16 pm, Christophe Leroy wrote: Le 28/09/2023 à 21:48, Hari Bathini a écrit : patch_instruction() entails setting up pte, patching the instruction, clearing the pte and flushing the tlb. If multiple instructions need to be patched, every

[PATCH v6 5/5] powerpc/bpf: use bpf_jit_binary_pack_[alloc|finalize|free]

2023-10-12 Thread Hari Bathini
bpf_jit_binary_pack_finalize() yet. Implement custom bpf_jit_free() like in commit 1d5f82d9dd47 ("bpf, x86: fix freeing of not-finalized bpf_prog_pack") to call bpf_jit_binary_pack_finalize(), if necessary. As bpf_flush_icache() is not needed anymore, remove it. Signed-off-by: Hari Bath

[PATCH v6 4/5] powerpc/bpf: rename powerpc64_jit_data to powerpc_jit_data

2023-10-12 Thread Hari Bathini
powerpc64_jit_data is a misnomer as it is meant for both ppc32 and ppc64. Rename it to powerpc_jit_data. Signed-off-by: Hari Bathini Acked-by: Song Liu --- arch/powerpc/net/bpf_jit_comp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/net/bpf_jit_comp.c b

[PATCH v6 3/5] powerpc/bpf: implement bpf_arch_text_invalidate for bpf_prog_pack

2023-10-12 Thread Hari Bathini
Implement bpf_arch_text_invalidate and use it to fill unused part of the bpf_prog_pack with trap instructions when a BPF program is freed. Signed-off-by: Hari Bathini Acked-by: Song Liu --- arch/powerpc/net/bpf_jit_comp.c | 15 +++ 1 file changed, 15 insertions(+) diff --git

[PATCH v6 2/5] powerpc/bpf: implement bpf_arch_text_copy

2023-10-12 Thread Hari Bathini
bpf_arch_text_copy is used to dump JITed binary to RX page, allowing multiple BPF programs to share the same page. Use the newly introduced patch_instructions() to implement it. Signed-off-by: Hari Bathini Acked-by: Song Liu --- arch/powerpc/net/bpf_jit_comp.c | 20 +++- 1 file

[PATCH v6 1/5] powerpc/code-patching: introduce patch_instructions()

2023-10-12 Thread Hari Bathini
, clears the pte and flushes the tlb only once per page range of instructions to be patched. This duplicates most of the code patching logic, instead of merging with it, to avoid performance degradation observed for single instruction patching on ppc32 with the code path merged. Signed-off-by: Hari

[PATCH v6 0/5] powerpc/bpf: use BPF prog pack allocator

2023-10-12 Thread Hari Bathini
lp with patching bpf programs. Hari Bathini (5): powerpc/code-patching: introduce patch_instructions() powerpc/bpf: implement bpf_arch_text_copy powerpc/bpf: implement bpf_arch_text_invalidate for bpf_prog_pack powerpc/bpf: rename powerpc64_jit_data to powerpc_jit_data

Re: [PATCHv8 3/5] powerpc/setup: Handle the case when boot_cpuid greater than nr_cpus

2023-10-11 Thread Hari Bathini
On 11/10/23 8:35 am, Pingfan Liu wrote: On Tue, Oct 10, 2023 at 01:56:13PM +0530, Hari Bathini wrote: On 09/10/23 5:00 pm, Pingfan Liu wrote: If the boot_cpuid is smaller than nr_cpus, it requires extra effort to ensure the boot_cpu is in cpu_present_mask. This can be achieved

Re: [PATCHv8 2/5] powerpc/setup: Loosen the mapping between cpu logical id and its seq in dt

2023-10-10 Thread Hari Bathini
On 09/10/23 5:00 pm, Pingfan Liu wrote: *** Idea *** For kexec -p, the boot cpu can be not the cpu0, this causes the problem of allocating memory for paca_ptrs[]. However, in theory, there is no requirement to assign cpu's logical id as its present sequence in the device tree. But there is

Re: [PATCHv8 3/5] powerpc/setup: Handle the case when boot_cpuid greater than nr_cpus

2023-10-10 Thread Hari Bathini
On 09/10/23 5:00 pm, Pingfan Liu wrote: If the boot_cpuid is smaller than nr_cpus, it requires extra effort to ensure the boot_cpu is in cpu_present_mask. This can be achieved by reserving the last quota for the boot cpu. Note: the restriction on nr_cpus will be lifted with more effort in

Re: [PATCH v5 1/5] powerpc/code-patching: introduce patch_instructions()

2023-10-06 Thread Hari Bathini
Thanks for the review, Song. On 29/09/23 2:38 am, Song Liu wrote: On Thu, Sep 28, 2023 at 12:48 PM Hari Bathini wrote: patch_instruction() entails setting up pte, patching the instruction, clearing the pte and flushing the tlb. If multiple instructions need to be patched, every instruction

Re: [PATCH v5 1/5] powerpc/code-patching: introduce patch_instructions()

2023-10-06 Thread Hari Bathini
Hi Christophe, On 29/09/23 2:09 pm, Christophe Leroy wrote: Le 28/09/2023 à 21:48, Hari Bathini a écrit : patch_instruction() entails setting up pte, patching the instruction, clearing the pte and flushing the tlb. If multiple instructions need to be patched, every instruction would have

Re: [PATCH v4 4/5] powerpc/code-patching: introduce patch_instructions()

2023-09-28 Thread Hari Bathini
On 26/09/23 12:21 pm, Christophe Leroy wrote: Le 26/09/2023 à 00:50, Song Liu a écrit : On Fri, Sep 8, 2023 at 6:28 AM Hari Bathini wrote: patch_instruction() entails setting up pte, patching the instruction, clearing the pte and flushing the tlb. If multiple instructions need

[PATCH v5 5/5] powerpc/bpf: use bpf_jit_binary_pack_[alloc|finalize|free]

2023-09-28 Thread Hari Bathini
bpf_jit_binary_pack_finalize() yet. Implement custom bpf_jit_free() like in commit 1d5f82d9dd47 ("bpf, x86: fix freeing of not-finalized bpf_prog_pack") to call bpf_jit_binary_pack_finalize(), if necessary. As bpf_flush_icache() is not needed anymore, remove it. Signed-off-by: Hari Bathini

[PATCH v5 4/5] powerpc/bpf: rename powerpc64_jit_data to powerpc_jit_data

2023-09-28 Thread Hari Bathini
powerpc64_jit_data is a misnomer as it is meant for both ppc32 and ppc64. Rename it to powerpc_jit_data. Signed-off-by: Hari Bathini --- arch/powerpc/net/bpf_jit_comp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/net/bpf_jit_comp.c b/arch/powerpc/net

[PATCH v5 3/5] powerpc/bpf: implement bpf_arch_text_invalidate for bpf_prog_pack

2023-09-28 Thread Hari Bathini
Implement bpf_arch_text_invalidate and use it to fill unused part of the bpf_prog_pack with trap instructions when a BPF program is freed. Signed-off-by: Hari Bathini --- arch/powerpc/net/bpf_jit_comp.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/arch/powerpc/net

[PATCH v5 2/5] powerpc/bpf: implement bpf_arch_text_copy

2023-09-28 Thread Hari Bathini
bpf_arch_text_copy is used to dump JITed binary to RX page, allowing multiple BPF programs to share the same page. Use the newly introduced patch_instructions() to implement it. Signed-off-by: Hari Bathini --- arch/powerpc/net/bpf_jit_comp.c | 20 +++- 1 file changed, 19

[PATCH v5 1/5] powerpc/code-patching: introduce patch_instructions()

2023-09-28 Thread Hari Bathini
, clears the pte and flushes the tlb only once per page range of instructions to be patched. This adds a slight overhead to patch_instruction() call while improving the patching time for scenarios where more than one instruction needs to be patched. Signed-off-by: Hari Bathini --- arch/powerpc

[PATCH v5 0/5] powerpc/bpf: use BPF prog pack allocator

2023-09-28 Thread Hari Bathini
readability. Hari Bathini (5): powerpc/code-patching: introduce patch_instructions() powerpc/bpf: implement bpf_arch_text_copy powerpc/bpf: implement bpf_arch_text_invalidate for bpf_prog_pack powerpc/bpf: rename powerpc64_jit_data to powerpc_jit_data powerpc/bpf: use bpf_jit_binary

Re: [PATCH v4 0/5] powerpc/bpf: use BPF prog pack allocator

2023-09-25 Thread Hari Bathini
Ping! Comments, please.. On 08/09/23 6:57 pm, Hari Bathini wrote: Most BPF programs are small, but they consume a page each. For systems with busy traffic and many BPF programs, this may also add significant pressure on instruction TLB. High iTLB pressure usually slows down the whole system

Re: [PATCH] powerpc: add `cur_cpu_spec` symbol to vmcoreinfo

2023-09-15 Thread Hari Bathini
On 14/09/23 6:52 pm, Michael Ellerman wrote: Aditya Gupta writes: Presently, while reading a vmcore, makedumpfile uses `cur_cpu_spec.mmu_features` to decide whether the crashed system had RADIX MMU or not. Currently, makedumpfile fails to get the `cur_cpu_spec` symbol (unless a vmlinux is

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

2023-09-14 Thread Hari Bathini
On 14/09/23 11:48 am, Christophe Leroy wrote: Hi, Hi Christophe, Le 29/09/2021 à 13:18, Hari Bathini a écrit : With KUAP enabled, any kernel code which wants to access userspace needs to be surrounded by disable-enable KUAP. But that is not happening for BPF_PROBE_MEM load instruction

Re: [PATCH v2 2/3] vmcore: allow fadump to export vmcore even if is_kdump_kernel() is false

2023-09-12 Thread Hari Bathini
On 11/09/23 4:01 pm, Baoquan He wrote: On 09/11/23 at 05:13pm, Michael Ellerman wrote: Hari Bathini writes: Currently, is_kdump_kernel() returns true when elfcorehdr_addr is set. While elfcorehdr_addr is set for kexec based kernel dump mechanism, alternate dump capturing methods like

[PATCH v3 2/2] powerpc/fadump: make is_kdump_kernel() return false when fadump is active

2023-09-12 Thread Hari Bathini
and not desirable for fadump - eg. IO queues restriction in device drivers. So, define is_kdump_kernel() to return false when f/w assisted dump is active. Signed-off-by: Hari Bathini --- arch/powerpc/include/asm/kexec.h | 8 ++-- arch/powerpc/kernel/crash_dump.c | 12 2 files

[PATCH v3 1/2] vmcore: remove dependency with is_kdump_kernel() for exporting vmcore

2023-09-12 Thread Hari Bathini
://docs.kernel.org/powerpc/firmware-assisted-dump.html Suggested-by: Michael Ellerman Signed-off-by: Hari Bathini --- Changes in v3: * Decoupled is_vmcore_usable() & vmcore_unusable() from is_kdump_kernel() as suggested here: https://lore.kernel.org/linuxppc-dev/ZP7si3UMVpPfYV+w@MiWiFi-R3L-s

[PATCH v4 5/5] powerpc/bpf: use patch_instructions()

2023-09-08 Thread Hari Bathini
# With this patch (on a POWER9 lpar): # time modprobe test_bpf real0m5.013s user0m0.000s sys 0m4.216s # Signed-off-by: Hari Bathini --- arch/powerpc/net/bpf_jit_comp.c | 34 ++--- 1 file changed, 6 insertions(+), 28 deletions(-) diff --git a/arch

[PATCH v4 4/5] powerpc/code-patching: introduce patch_instructions()

2023-09-08 Thread Hari Bathini
, clears the pte and flushes the tlb only once per page range of instructions to be patched. This adds a slight overhead to patch_instruction() call while improving the patching time for scenarios where more than one instruction needs to be patched. Signed-off-by: Hari Bathini --- arch/powerpc

[PATCH v4 3/5] powerpc/bpf: use bpf_jit_binary_pack_[alloc|finalize|free]

2023-09-08 Thread Hari Bathini
t for both ppc32 and ppc64. Signed-off-by: Hari Bathini --- arch/powerpc/net/bpf_jit.h| 12 ++-- arch/powerpc/net/bpf_jit_comp.c | 110 ++ arch/powerpc/net/bpf_jit_comp32.c | 13 ++-- arch/powerpc/net/bpf_jit_comp64.c | 10 +-- 4 files changed, 98 inserti

[PATCH v4 2/5] powerpc/bpf: implement bpf_arch_text_invalidate for bpf_prog_pack

2023-09-08 Thread Hari Bathini
Implement bpf_arch_text_invalidate and use it to fill unused part of the bpf_prog_pack with trap instructions when a BPF program is freed. Signed-off-by: Hari Bathini --- arch/powerpc/net/bpf_jit_comp.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/arch/powerpc/net

[PATCH v4 1/5] powerpc/bpf: implement bpf_arch_text_copy

2023-09-08 Thread Hari Bathini
bpf_arch_text_copy is used to dump JITed binary to RX page, allowing multiple BPF programs to share the same page. Use patch_instruction() to implement it. Signed-off-by: Hari Bathini --- arch/powerpc/net/bpf_jit_comp.c | 41 - 1 file changed, 40 insertions(+), 1

[PATCH v4 0/5] powerpc/bpf: use BPF prog pack allocator

2023-09-08 Thread Hari Bathini
-1-hbath...@linux.ibm.com/ Hari Bathini (5): powerpc/bpf: implement bpf_arch_text_copy powerpc/bpf: implement bpf_arch_text_invalidate for bpf_prog_pack powerpc/bpf: use bpf_jit_binary_pack_[alloc|finalize|free] powerpc/code-patching: introduce patch_instructions() powerpc/bpf: use patch_inst

Re: [PATCH v2 1/3] powerpc/fadump: make is_fadump_active() visible for exporting vmcore

2023-09-07 Thread Hari Bathini
Thanks, Baoquan. On 07/09/23 11:12 am, Baoquan He wrote: On 09/06/23 at 12:06am, Hari Bathini wrote: Include asm/fadump.h in asm/kexec.h to make it visible while exporting vmcore. Also, update is_fadump_active() to return boolean instead of integer for better readability. The change

[PATCH v2 2/3] vmcore: allow fadump to export vmcore even if is_kdump_kernel() is false

2023-09-05 Thread Hari Bathini
ttps://docs.kernel.org/powerpc/firmware-assisted-dump.html Signed-off-by: Hari Bathini --- Changes in v2: * is_fadump_active() check added to is_vmcore_usable() as suggested by Baoquan. include/linux/crash_dump.h | 19 +-- 1 file changed, 17 insertions(+), 2 deletions(-) diff -

Re: [PATCH 1/2] vmcore: allow alternate dump capturing methods to export vmcore without is_kdump_kernel()

2023-09-05 Thread Hari Bathini
On 05/09/23 8:00 am, Baoquan He wrote: On 09/04/23 at 08:04pm, Hari Bathini wrote: Hi Baoquan, Thanks for the review... On 03/09/23 9:06 am, Baoquan He wrote: Hi Hari, On 09/02/23 at 12:34am, Hari Bathini wrote: Currently, is_kdump_kernel() returns true when elfcorehdr_addr is set

[PATCH v2 1/3] powerpc/fadump: make is_fadump_active() visible for exporting vmcore

2023-09-05 Thread Hari Bathini
Include asm/fadump.h in asm/kexec.h to make it visible while exporting vmcore. Also, update is_fadump_active() to return boolean instead of integer for better readability. The change will be used in the next patch to ensure vmcore is exported when fadump is active. Signed-off-by: Hari Bathini

  1   2   3   4   5   6   7   8   >