linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* kexec failing with KVM on Power8 baremetal host
@ 2025-02-04 19:05 Stefan Berger
  2025-02-05  6:27 ` Madhavan Srinivasan
  2025-04-07 19:36 ` Ritesh Harjani
  0 siblings, 2 replies; 5+ messages in thread
From: Stefan Berger @ 2025-02-04 19:05 UTC (permalink / raw)
  To: linuxppc-dev@lists.ozlabs.org; +Cc: ritesh.list, masriniv

I bisected Linux between 6.13.0 and 6.12.0 due to failing kexec on a 
Power8 baremetal host on 6.13.0:

8fec58f503b296af87ffca3898965e3054f2b616 is the first bad commit
commit 8fec58f503b296af87ffca3898965e3054f2b616
Author: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
Date:   Fri Oct 18 22:59:50 2024 +0530

     book3s64/hash: Add kfence functionality

     Now that linear map functionality of debug_pagealloc is made generic,
     enable kfence to use this generic infrastructure.

     1. Define kfence related linear map variables.
        - u8 *linear_map_kf_hash_slots;
        - unsigned long linear_map_kf_hash_count;
        - DEFINE_RAW_SPINLOCK(linear_map_kf_hash_lock);
     2. The linear map size allocated in RMA region is quite small
        (KFENCE_POOL_SIZE >> PAGE_SHIFT) which is 512 bytes by default.
     3. kfence pool memory is reserved using memblock_phys_alloc() which has
        can come from anywhere.
        (default 255 objects => ((1+255) * 2) << PAGE_SHIFT = 32MB)
     4. The hash slot information for kfence memory gets added in linear map
        in hash_linear_map_add_slot() (which also adds for debug_pagealloc).

     Reported-by: Pavithra Prakash <pavrampu@linux.vnet.ibm.com>
     Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
     Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
     Link: 
https://patch.msgid.link/5c2b61941b344077a2b8654dab46efa0322af3af.1729271995.git.ritesh.list@gmail.com

  arch/powerpc/include/asm/kfence.h     |   5 ---
  arch/powerpc/mm/book3s64/hash_utils.c | 162 
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------
  2 files changed, 149 insertions(+), 18 deletions(-)


Reverting part of this patch by applying the following changes to 6.13.0 
resolves the issue:


diff --git a/arch/powerpc/include/asm/kfence.h 
b/arch/powerpc/include/asm/kfence.h
index 1f7cab58ab2c..e7981719313c 100644
--- a/arch/powerpc/include/asm/kfence.h
+++ b/arch/powerpc/include/asm/kfence.h
@@ -10,6 +10,7 @@

  #include <linux/mm.h>
  #include <asm/pgtable.h>
+#include <asm/mmu.h>

  #ifdef CONFIG_PPC64_ELF_ABI_V1
  #define ARCH_FUNC_PREFIX "."
@@ -25,6 +26,10 @@ static inline void disable_kfence(void)

  static inline bool arch_kfence_init_pool(void)
  {
+#ifdef CONFIG_PPC64
+       if (!radix_enabled())
+               return false;
+#endif
         return !kfence_disabled;
  }




^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-04-09 16:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-04 19:05 kexec failing with KVM on Power8 baremetal host Stefan Berger
2025-02-05  6:27 ` Madhavan Srinivasan
2025-02-05 21:55   ` Stefan Berger
2025-04-07 19:36 ` Ritesh Harjani
2025-04-09 16:13   ` Stefan Berger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).