bool
        default y if PPC64
 
+config LIVEPATCH_64
+       def_bool PPC64
+       depends on LIVEPATCH
+
 config MMU
        bool
        default y
        select HAVE_KPROBES_ON_FTRACE
        select HAVE_KRETPROBES
        select HAVE_LD_DEAD_CODE_DATA_ELIMINATION
-       select HAVE_LIVEPATCH                   if HAVE_DYNAMIC_FTRACE_WITH_REGS && PPC64
+       select HAVE_LIVEPATCH                   if HAVE_DYNAMIC_FTRACE_WITH_REGS
        select HAVE_MOD_ARCH_SPECIFIC
        select HAVE_NMI                         if PERF_EVENTS || (PPC64 && PPC_BOOK3S)
        select HAVE_OPTPROBES
 
 static inline unsigned long klp_get_ftrace_location(unsigned long faddr)
 {
        /*
-        * Live patch works only with -mprofile-kernel on PPC. In this case,
-        * the ftrace location is always within the first 16 bytes.
+        * Live patch works on PPC32 and only with -mprofile-kernel on PPC64. In
+        * both cases, the ftrace location is always within the first 16 bytes.
         */
        return ftrace_location_range(faddr, faddr + 16);
 }
+#endif /* CONFIG_LIVEPATCH */
 
+#ifdef CONFIG_LIVEPATCH_64
 static inline void klp_init_thread_info(struct task_struct *p)
 {
        /* + 1 to account for STACK_END_MAGIC */
 }
 #else
 static inline void klp_init_thread_info(struct task_struct *p) { }
-#endif /* CONFIG_LIVEPATCH */
+#endif
 
 #endif /* _ASM_POWERPC_LIVEPATCH_H */
 
        unsigned int    cpu;
 #endif
        unsigned long   local_flags;            /* private flags for thread */
-#ifdef CONFIG_LIVEPATCH
+#ifdef CONFIG_LIVEPATCH_64
        unsigned long *livepatch_sp;
 #endif
 #if defined(CONFIG_VIRT_CPU_ACCOUNTING_NATIVE) && defined(CONFIG_PPC32)
 
        OFFSET(TASK_CPU, task_struct, thread_info.cpu);
 #endif
 
-#ifdef CONFIG_LIVEPATCH
+#ifdef CONFIG_LIVEPATCH_64
        OFFSET(TI_livepatch_sp, thread_info, livepatch_sp);
 #endif