All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Berger <stefanb@linux.ibm.com>
To: "linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>
Cc: ritesh.list@gmail.com, masriniv@in.ibm.com
Subject: kexec failing with KVM on Power8 baremetal host
Date: Tue, 4 Feb 2025 14:05:37 -0500	[thread overview]
Message-ID: <c683fcdc-38e7-4bed-8bfe-dcf6f122da6a@linux.ibm.com> (raw)

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;
  }




             reply	other threads:[~2025-02-04 19:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-04 19:05 Stefan Berger [this message]
2025-02-05  6:27 ` kexec failing with KVM on Power8 baremetal host Madhavan Srinivasan
2025-02-05 21:55   ` Stefan Berger
2025-04-07 19:36 ` Ritesh Harjani
2025-04-09 16:13   ` Stefan Berger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c683fcdc-38e7-4bed-8bfe-dcf6f122da6a@linux.ibm.com \
    --to=stefanb@linux.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=masriniv@in.ibm.com \
    --cc=ritesh.list@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.