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__
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
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
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
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
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
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
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
-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
:
# 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
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
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
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
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
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
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
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
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
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
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
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
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
-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
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
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
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
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]:
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
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
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
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
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
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
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
-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
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/
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
() 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
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
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
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
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
.
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
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
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
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
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
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
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
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
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
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
, 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
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
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
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
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
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
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
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
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
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
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
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
, 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
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
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
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
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
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
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
://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
#
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
, 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
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
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
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
-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
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
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 -
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
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 - 100 of 792 matches
Mail list logo