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

2023-12-03 Thread Sourabh Jain
Extend the arch crash hotplug handler, as introduced by the patch title ("powerpc: add crash CPU hotplug support"), to also support memory add/remove events. Elfcorehdr describes the memory of the crash kernel to capture the kernel; hence, it needs to be updated if memory resources change due to

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

2023-12-03 Thread Sourabh Jain
Due to CPU/Memory hotplug or online/offline events the elfcorehdr (which describes the CPUs and memory of the crashed kernel) and FDT (Flattened Device Tree) of kdump image becomes outdated. Consequently, attempting dump collection with an outdated elfcorehdr or FDT can lead to failed or

[PATCH v13 4/6] powerpc/kexec: turn some static helper functions public

2023-12-03 Thread Sourabh Jain
Move the functions update_cpus_node and get_crash_memory_ranges from kexec/file_load_64.c to kexec/core_64.c to make these functions usable by other kexec components. get_crash_memory_ranges uses functions defined in ranges.c, so take ranges.c out of CONFIG_KEXEC_FILE. Later in the series, these

[PATCH v13 3/6] crash: add a new kexec flag for FDT update

2023-12-03 Thread Sourabh Jain
The commit a72bbec70da2 ("crash: hotplug support for kexec_load()") introduced a new kexec flag, `KEXEC_UPDATE_ELFCOREHDR`. Kexec tool uses this flag to indicate kernel that it is safe to modify the elfcorehdr of kdump image loaded using kexec_load system call. Similarly, add a new kexec flag,

[PATCH v13 2/6] crash: make CPU and Memory hotplug support reporting flexible

2023-12-03 Thread Sourabh Jain
Architectures' specific functions `arch_crash_hotplug_cpu_support()` and `arch_crash_hotplug_memory_support()` advertise the kernel's capability to update the kdump image on CPU and Memory hotplug events to userspace via the sysfs interface. These architecture-specific functions need to access

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

2023-12-03 Thread Sourabh Jain
In the event of memory hotplug or online/offline events, the crash memory hotplug notifier `crash_memhp_notifier()` receives a `memory_notify` object but doesn't forward that object to the generic and architecture-specific crash hotplug handler. The `memory_notify` object contains the starting

[PATCH v13 0/6] powerpc/crash: Kernel handling of CPU and memory hotplug

2023-12-03 Thread Sourabh Jain
Commit 247262756121 ("crash: add generic infrastructure for crash hotplug support") added a generic infrastructure that allows architectures to selectively update the kdump image component during CPU or memory add/remove events within the kernel itself. This patch series adds crash hotplug

[PATCH v3] powerpc/mm: Fix null-pointer dereference in pgtable_cache_add

2023-12-03 Thread Kunwu Chan
kasprintf() returns a pointer to dynamically allocated memory which can be NULL upon failure. Ensure the allocation was successful by checking the pointer validity. Suggested-by: Christophe Leroy Suggested-by: Michael Ellerman Signed-off-by: Kunwu Chan --- v2: Use "panic" instead of "return"

[PATCH 2/2] powerpc/locking: enable HAVE_CMPXCHG_LOCAL in kconfig

2023-12-03 Thread Luming Yu
enable arch feature HAVE_CMPXCHG_LOCAL for ppc by default Signed-off-by: Luming Yu --- arch/powerpc/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 6f105ee4f3cf..c10229c0243c 100644 --- a/arch/powerpc/Kconfig +++

Re: [PATCH v2] powerpc/mm: Fix null-pointer dereference in pgtable_cache_add

2023-12-03 Thread Kunwu Chan
Sure,i'll follow your suggestion in v3 patch: 1. set new to NULL 2. add a 'if' judgment before 'kmem_cache_create' Thanks, Kunwu On 2023/12/1 18:17, Michael Ellerman wrote: avoid two calls to panic

[PATCH 1/2] powerpc/locking: implement this_cpu_cmpxchg local API

2023-12-03 Thread Luming Yu
ppc appears to have already supported cmpxchg-local atomic semantics that is defined by the kernel convention of the feature. Add this_cpu_cmpxchg ppc local for the performance benefit of arch sepcific implementation than asm-generic c verison of the locking API. Signed-off-by: Luming Yu ---

[PATCH] cxl: Fix null pointer dereference in cxl_get_fd

2023-12-03 Thread Kunwu Chan
kasprintf() returns a pointer to dynamically allocated memory which can be NULL upon failure. Fixes: bdecf76e319a ("cxl: Fix coredump generation when cxl_get_fd() is used") Signed-off-by: Kunwu Chan --- drivers/misc/cxl/api.c | 4 1 file changed, 4 insertions(+) diff --git

[powerpc:next-test] BUILD SUCCESS 27951e1d8274e9f9a2925b069e4492939a3f2099

2023-12-03 Thread kernel test robot
nsimosci_defconfig gcc arc randconfig-001-20231203 gcc arc randconfig-002-20231203 gcc arm allmodconfig gcc arm allnoconfig gcc arm allyesconfig gcc arm

[PATCH v2 02/35] lib/find: add test for atomic find_bit() ops

2023-12-03 Thread Yury Norov
Add basic functionality test for new API. Signed-off-by: Yury Norov --- lib/test_bitmap.c | 61 +++ 1 file changed, 61 insertions(+) diff --git a/lib/test_bitmap.c b/lib/test_bitmap.c index 65f22c2578b0..277e1ca9fd28 100644 --- a/lib/test_bitmap.c

[PATCH v2 01/35] lib/find: add atomic find_bit() primitives

2023-12-03 Thread Yury Norov
Add helpers around test_and_{set,clear}_bit() that allow to search for clear or set bits and flip them atomically. The target patterns may look like this: for (idx = 0; idx < nbits; idx++) if (test_and_clear_bit(idx, bitmap)) do_something(idx); Or

[PATCH v2 00/35] bitops: add atomic find_bit() operations

2023-12-03 Thread Yury Norov
Add helpers around test_and_{set,clear}_bit() that allow to search for clear or set bits and flip them atomically. The target patterns may look like this: for (idx = 0; idx < nbits; idx++) if (test_and_clear_bit(idx, bitmap)) do_something(idx); Or

[PATCH v2 18/35] powerpc: use atomic find_bit() API where appropriate

2023-12-03 Thread Yury Norov
Use find_and_{set,clear}_bit() where appropriate and simplify the logic. Signed-off-by: Yury Norov --- arch/powerpc/mm/book3s32/mmu_context.c | 10 ++--- arch/powerpc/platforms/pasemi/dma_lib.c| 45 +- arch/powerpc/platforms/powernv/pci-sriov.c | 12 ++ 3 files

Re: [PATCH] perf vendor events: Update datasource event name to fix duplicate events

2023-12-03 Thread Athira Rajeev
> On 29-Nov-2023, at 10:51 AM, Athira Rajeev > wrote: > > > >> On 27-Nov-2023, at 5:32 PM, Disha Goel wrote: >> >> On 23/11/23 9:31 pm, Athira Rajeev wrote: >> >>> Running "perf list" on powerpc fails with segfault >>> as below: >>> >>> ./perf list >>> Segmentation fault (core

Re: [PATCH 05/26] vfio: KVM: Pass get/put helpers from KVM to VFIO, don't do circular lookup

2023-12-03 Thread Jason Gunthorpe
On Fri, Dec 01, 2023 at 04:51:55PM -0800, Sean Christopherson wrote: > There's one more wrinkle: this patch is buggy in that it doesn't ensure the > liveliness > of KVM-the-module, i.e. nothing prevents userspace from unloading kvm.ko > while VFIO > still holds a reference to a kvm structure,

Re: [PATCH RFC 06/12] mm/gup: Drop folio_fast_pin_allowed() in hugepd processing

2023-12-03 Thread Christophe Leroy
Le 30/11/2023 à 22:30, Peter Xu a écrit : > On Fri, Nov 24, 2023 at 11:07:51AM -0500, Peter Xu wrote: >> On Fri, Nov 24, 2023 at 09:06:01AM +, Ryan Roberts wrote: >>> I don't have any micro-benchmarks for GUP though, if that's your question. >>> Is >>> there an easy-to-use test I can run to