* [PATCH] riscv: Prevent early kernel panic in instrumented apply_early_boot_alternatives
@ 2025-06-24 11:30 ` Changbin Du
0 siblings, 0 replies; 12+ messages in thread
From: Changbin Du @ 2025-06-24 11:30 UTC (permalink / raw)
To: Paul Walmsley, Palmer Dabbelt, Albert Ou
Cc: Alexandre Ghiti, linux-riscv, linux-kernel, Changbin Du
Under FTRACE=y, DYNAMIC_FTRACE=n, and RISCV_ALTERNATIVE_EARLY=n, the kernel
panics upon returning from _mcount() in the early boot path. This occurs
during _start_kernel() -> setup_vm() -> apply_early_boot_alternatives().
The CC_FLAGS_FTRACE is only removed from alternative.c when
CONFIG_RISCV_ALTERNATIVE_EARLY=y. Therefore, no function calls should be
made to alternative.c during early boot in this configuration.
Fixes: a35707c3d850 ("riscv: add memory-type errata for T-Head")
Signed-off-by: Changbin Du <changbin.du@huawei.com>
---
arch/riscv/include/asm/alternative.h | 6 ++++++
arch/riscv/kernel/alternative.c | 4 ++--
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/arch/riscv/include/asm/alternative.h b/arch/riscv/include/asm/alternative.h
index 3c2b59b25017..c670b0cc55f4 100644
--- a/arch/riscv/include/asm/alternative.h
+++ b/arch/riscv/include/asm/alternative.h
@@ -31,7 +31,13 @@
#define ALT_ALT_PTR(a) __ALT_PTR(a, alt_offset)
void __init apply_boot_alternatives(void);
+
+# ifdef CONFIG_RISCV_ALTERNATIVE_EARLY
void __init apply_early_boot_alternatives(void);
+# else
+static inline void apply_early_boot_alternatives(void) { }
+# endif
+
void apply_module_alternatives(void *start, size_t length);
void riscv_alternative_fix_offsets(void *alt_ptr, unsigned int len,
diff --git a/arch/riscv/kernel/alternative.c b/arch/riscv/kernel/alternative.c
index 7eb3cb1215c6..5406c3301627 100644
--- a/arch/riscv/kernel/alternative.c
+++ b/arch/riscv/kernel/alternative.c
@@ -205,6 +205,7 @@ void __init apply_boot_alternatives(void)
apply_vdso_alternatives();
}
+#ifdef CONFIG_RISCV_ALTERNATIVE_EARLY
/*
* apply_early_boot_alternatives() is called from setup_vm() with MMU-off.
*
@@ -219,12 +220,11 @@ void __init apply_boot_alternatives(void)
*/
void __init apply_early_boot_alternatives(void)
{
-#ifdef CONFIG_RISCV_ALTERNATIVE_EARLY
_apply_alternatives((struct alt_entry *)__alt_start,
(struct alt_entry *)__alt_end,
RISCV_ALTERNATIVES_EARLY_BOOT);
-#endif
}
+#endif
#ifdef CONFIG_MODULES
void apply_module_alternatives(void *start, size_t length)
--
2.43.0
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH] riscv: Prevent early kernel panic in instrumented apply_early_boot_alternatives
@ 2025-06-24 11:30 ` Changbin Du
0 siblings, 0 replies; 12+ messages in thread
From: Changbin Du @ 2025-06-24 11:30 UTC (permalink / raw)
To: Paul Walmsley, Palmer Dabbelt, Albert Ou
Cc: Alexandre Ghiti, linux-riscv, linux-kernel, Changbin Du
Under FTRACE=y, DYNAMIC_FTRACE=n, and RISCV_ALTERNATIVE_EARLY=n, the kernel
panics upon returning from _mcount() in the early boot path. This occurs
during _start_kernel() -> setup_vm() -> apply_early_boot_alternatives().
The CC_FLAGS_FTRACE is only removed from alternative.c when
CONFIG_RISCV_ALTERNATIVE_EARLY=y. Therefore, no function calls should be
made to alternative.c during early boot in this configuration.
Fixes: a35707c3d850 ("riscv: add memory-type errata for T-Head")
Signed-off-by: Changbin Du <changbin.du@huawei.com>
---
arch/riscv/include/asm/alternative.h | 6 ++++++
arch/riscv/kernel/alternative.c | 4 ++--
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/arch/riscv/include/asm/alternative.h b/arch/riscv/include/asm/alternative.h
index 3c2b59b25017..c670b0cc55f4 100644
--- a/arch/riscv/include/asm/alternative.h
+++ b/arch/riscv/include/asm/alternative.h
@@ -31,7 +31,13 @@
#define ALT_ALT_PTR(a) __ALT_PTR(a, alt_offset)
void __init apply_boot_alternatives(void);
+
+# ifdef CONFIG_RISCV_ALTERNATIVE_EARLY
void __init apply_early_boot_alternatives(void);
+# else
+static inline void apply_early_boot_alternatives(void) { }
+# endif
+
void apply_module_alternatives(void *start, size_t length);
void riscv_alternative_fix_offsets(void *alt_ptr, unsigned int len,
diff --git a/arch/riscv/kernel/alternative.c b/arch/riscv/kernel/alternative.c
index 7eb3cb1215c6..5406c3301627 100644
--- a/arch/riscv/kernel/alternative.c
+++ b/arch/riscv/kernel/alternative.c
@@ -205,6 +205,7 @@ void __init apply_boot_alternatives(void)
apply_vdso_alternatives();
}
+#ifdef CONFIG_RISCV_ALTERNATIVE_EARLY
/*
* apply_early_boot_alternatives() is called from setup_vm() with MMU-off.
*
@@ -219,12 +220,11 @@ void __init apply_boot_alternatives(void)
*/
void __init apply_early_boot_alternatives(void)
{
-#ifdef CONFIG_RISCV_ALTERNATIVE_EARLY
_apply_alternatives((struct alt_entry *)__alt_start,
(struct alt_entry *)__alt_end,
RISCV_ALTERNATIVES_EARLY_BOOT);
-#endif
}
+#endif
#ifdef CONFIG_MODULES
void apply_module_alternatives(void *start, size_t length)
--
2.43.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH] riscv: Prevent early kernel panic in instrumented apply_early_boot_alternatives
2025-06-24 11:30 ` Changbin Du
@ 2025-06-24 12:54 ` Alexandre Ghiti
-1 siblings, 0 replies; 12+ messages in thread
From: Alexandre Ghiti @ 2025-06-24 12:54 UTC (permalink / raw)
To: Changbin Du, Paul Walmsley, Palmer Dabbelt, Albert Ou
Cc: linux-riscv, linux-kernel
Hi Changbin,
On 6/24/25 13:30, Changbin Du wrote:
> Under FTRACE=y, DYNAMIC_FTRACE=n, and RISCV_ALTERNATIVE_EARLY=n, the kernel
Your above config works fine for me, I guess you meant FUNCTION_TRACER
&& !DYNAMIC_FTRACE (which fails).
We were just talking with Andy about this configuration (FUNCTION_TRACER
&& !DYNAMIC_FTRACE): do we really want to support static ftrace? Andy
should send a patch soon to remove this possibility as IMO we don't want
to support it. Let's wait for this patch and the discussion that will
follow before merging your fix. I'll keep it in my list for 6.16 just in
case someone comes up with a good argument to keep it.
Thanks,
Alex
> panics upon returning from _mcount() in the early boot path. This occurs
> during _start_kernel() -> setup_vm() -> apply_early_boot_alternatives().
>
> The CC_FLAGS_FTRACE is only removed from alternative.c when
> CONFIG_RISCV_ALTERNATIVE_EARLY=y. Therefore, no function calls should be
> made to alternative.c during early boot in this configuration.
>
> Fixes: a35707c3d850 ("riscv: add memory-type errata for T-Head")
> Signed-off-by: Changbin Du <changbin.du@huawei.com>
> ---
> arch/riscv/include/asm/alternative.h | 6 ++++++
> arch/riscv/kernel/alternative.c | 4 ++--
> 2 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/arch/riscv/include/asm/alternative.h b/arch/riscv/include/asm/alternative.h
> index 3c2b59b25017..c670b0cc55f4 100644
> --- a/arch/riscv/include/asm/alternative.h
> +++ b/arch/riscv/include/asm/alternative.h
> @@ -31,7 +31,13 @@
> #define ALT_ALT_PTR(a) __ALT_PTR(a, alt_offset)
>
> void __init apply_boot_alternatives(void);
> +
> +# ifdef CONFIG_RISCV_ALTERNATIVE_EARLY
> void __init apply_early_boot_alternatives(void);
> +# else
> +static inline void apply_early_boot_alternatives(void) { }
> +# endif
> +
> void apply_module_alternatives(void *start, size_t length);
>
> void riscv_alternative_fix_offsets(void *alt_ptr, unsigned int len,
> diff --git a/arch/riscv/kernel/alternative.c b/arch/riscv/kernel/alternative.c
> index 7eb3cb1215c6..5406c3301627 100644
> --- a/arch/riscv/kernel/alternative.c
> +++ b/arch/riscv/kernel/alternative.c
> @@ -205,6 +205,7 @@ void __init apply_boot_alternatives(void)
> apply_vdso_alternatives();
> }
>
> +#ifdef CONFIG_RISCV_ALTERNATIVE_EARLY
> /*
> * apply_early_boot_alternatives() is called from setup_vm() with MMU-off.
> *
> @@ -219,12 +220,11 @@ void __init apply_boot_alternatives(void)
> */
> void __init apply_early_boot_alternatives(void)
> {
> -#ifdef CONFIG_RISCV_ALTERNATIVE_EARLY
> _apply_alternatives((struct alt_entry *)__alt_start,
> (struct alt_entry *)__alt_end,
> RISCV_ALTERNATIVES_EARLY_BOOT);
> -#endif
> }
> +#endif
>
> #ifdef CONFIG_MODULES
> void apply_module_alternatives(void *start, size_t length)
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] riscv: Prevent early kernel panic in instrumented apply_early_boot_alternatives
@ 2025-06-24 12:54 ` Alexandre Ghiti
0 siblings, 0 replies; 12+ messages in thread
From: Alexandre Ghiti @ 2025-06-24 12:54 UTC (permalink / raw)
To: Changbin Du, Paul Walmsley, Palmer Dabbelt, Albert Ou
Cc: linux-riscv, linux-kernel
Hi Changbin,
On 6/24/25 13:30, Changbin Du wrote:
> Under FTRACE=y, DYNAMIC_FTRACE=n, and RISCV_ALTERNATIVE_EARLY=n, the kernel
Your above config works fine for me, I guess you meant FUNCTION_TRACER
&& !DYNAMIC_FTRACE (which fails).
We were just talking with Andy about this configuration (FUNCTION_TRACER
&& !DYNAMIC_FTRACE): do we really want to support static ftrace? Andy
should send a patch soon to remove this possibility as IMO we don't want
to support it. Let's wait for this patch and the discussion that will
follow before merging your fix. I'll keep it in my list for 6.16 just in
case someone comes up with a good argument to keep it.
Thanks,
Alex
> panics upon returning from _mcount() in the early boot path. This occurs
> during _start_kernel() -> setup_vm() -> apply_early_boot_alternatives().
>
> The CC_FLAGS_FTRACE is only removed from alternative.c when
> CONFIG_RISCV_ALTERNATIVE_EARLY=y. Therefore, no function calls should be
> made to alternative.c during early boot in this configuration.
>
> Fixes: a35707c3d850 ("riscv: add memory-type errata for T-Head")
> Signed-off-by: Changbin Du <changbin.du@huawei.com>
> ---
> arch/riscv/include/asm/alternative.h | 6 ++++++
> arch/riscv/kernel/alternative.c | 4 ++--
> 2 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/arch/riscv/include/asm/alternative.h b/arch/riscv/include/asm/alternative.h
> index 3c2b59b25017..c670b0cc55f4 100644
> --- a/arch/riscv/include/asm/alternative.h
> +++ b/arch/riscv/include/asm/alternative.h
> @@ -31,7 +31,13 @@
> #define ALT_ALT_PTR(a) __ALT_PTR(a, alt_offset)
>
> void __init apply_boot_alternatives(void);
> +
> +# ifdef CONFIG_RISCV_ALTERNATIVE_EARLY
> void __init apply_early_boot_alternatives(void);
> +# else
> +static inline void apply_early_boot_alternatives(void) { }
> +# endif
> +
> void apply_module_alternatives(void *start, size_t length);
>
> void riscv_alternative_fix_offsets(void *alt_ptr, unsigned int len,
> diff --git a/arch/riscv/kernel/alternative.c b/arch/riscv/kernel/alternative.c
> index 7eb3cb1215c6..5406c3301627 100644
> --- a/arch/riscv/kernel/alternative.c
> +++ b/arch/riscv/kernel/alternative.c
> @@ -205,6 +205,7 @@ void __init apply_boot_alternatives(void)
> apply_vdso_alternatives();
> }
>
> +#ifdef CONFIG_RISCV_ALTERNATIVE_EARLY
> /*
> * apply_early_boot_alternatives() is called from setup_vm() with MMU-off.
> *
> @@ -219,12 +220,11 @@ void __init apply_boot_alternatives(void)
> */
> void __init apply_early_boot_alternatives(void)
> {
> -#ifdef CONFIG_RISCV_ALTERNATIVE_EARLY
> _apply_alternatives((struct alt_entry *)__alt_start,
> (struct alt_entry *)__alt_end,
> RISCV_ALTERNATIVES_EARLY_BOOT);
> -#endif
> }
> +#endif
>
> #ifdef CONFIG_MODULES
> void apply_module_alternatives(void *start, size_t length)
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] riscv: Prevent early kernel panic in instrumented apply_early_boot_alternatives
2025-06-24 12:54 ` Alexandre Ghiti
@ 2025-06-25 3:10 ` duchangbin
-1 siblings, 0 replies; 12+ messages in thread
From: duchangbin @ 2025-06-25 3:10 UTC (permalink / raw)
To: Alexandre Ghiti
Cc: duchangbin, Paul Walmsley, Palmer Dabbelt, Albert Ou,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
On Tue, Jun 24, 2025 at 02:54:32PM +0200, Alexandre Ghiti wrote:
> Hi Changbin,
>
> On 6/24/25 13:30, Changbin Du wrote:
> > Under FTRACE=y, DYNAMIC_FTRACE=n, and RISCV_ALTERNATIVE_EARLY=n, the kernel
>
>
> Your above config works fine for me, I guess you meant FUNCTION_TRACER &&
> !DYNAMIC_FTRACE (which fails).
>
Yes, it's FUNCTION_TRACER.
> We were just talking with Andy about this configuration (FUNCTION_TRACER &&
> !DYNAMIC_FTRACE): do we really want to support static ftrace? Andy should
> send a patch soon to remove this possibility as IMO we don't want to support
> it. Let's wait for this patch and the discussion that will follow before
> merging your fix. I'll keep it in my list for 6.16 just in case someone
> comes up with a good argument to keep it.
>
No problem. I'm unable to enable DYNAMIC_FTRACE because GCC_SUPPORTS_DYNAMIC_FTRACE=n
and CC_HAS_MIN_FUNCTION_ALIGNMENT=n are set. It seems that my GCC version (13.3.0)
does not support the option -fmin-function-alignment=8.
By the way, this change also eliminates an empty function call.
> Thanks,
>
> Alex
>
>
> > panics upon returning from _mcount() in the early boot path. This occurs
> > during _start_kernel() -> setup_vm() -> apply_early_boot_alternatives().
> >
> > The CC_FLAGS_FTRACE is only removed from alternative.c when
> > CONFIG_RISCV_ALTERNATIVE_EARLY=y. Therefore, no function calls should be
> > made to alternative.c during early boot in this configuration.
> >
> > Fixes: a35707c3d850 ("riscv: add memory-type errata for T-Head")
> > Signed-off-by: Changbin Du <changbin.du@huawei.com>
> > ---
> > arch/riscv/include/asm/alternative.h | 6 ++++++
> > arch/riscv/kernel/alternative.c | 4 ++--
> > 2 files changed, 8 insertions(+), 2 deletions(-)
> >
> > diff --git a/arch/riscv/include/asm/alternative.h b/arch/riscv/include/asm/alternative.h
> > index 3c2b59b25017..c670b0cc55f4 100644
> > --- a/arch/riscv/include/asm/alternative.h
> > +++ b/arch/riscv/include/asm/alternative.h
> > @@ -31,7 +31,13 @@
> > #define ALT_ALT_PTR(a) __ALT_PTR(a, alt_offset)
> > void __init apply_boot_alternatives(void);
> > +
> > +# ifdef CONFIG_RISCV_ALTERNATIVE_EARLY
> > void __init apply_early_boot_alternatives(void);
> > +# else
> > +static inline void apply_early_boot_alternatives(void) { }
> > +# endif
> > +
> > void apply_module_alternatives(void *start, size_t length);
> > void riscv_alternative_fix_offsets(void *alt_ptr, unsigned int len,
> > diff --git a/arch/riscv/kernel/alternative.c b/arch/riscv/kernel/alternative.c
> > index 7eb3cb1215c6..5406c3301627 100644
> > --- a/arch/riscv/kernel/alternative.c
> > +++ b/arch/riscv/kernel/alternative.c
> > @@ -205,6 +205,7 @@ void __init apply_boot_alternatives(void)
> > apply_vdso_alternatives();
> > }
> > +#ifdef CONFIG_RISCV_ALTERNATIVE_EARLY
> > /*
> > * apply_early_boot_alternatives() is called from setup_vm() with MMU-off.
> > *
> > @@ -219,12 +220,11 @@ void __init apply_boot_alternatives(void)
> > */
> > void __init apply_early_boot_alternatives(void)
> > {
> > -#ifdef CONFIG_RISCV_ALTERNATIVE_EARLY
> > _apply_alternatives((struct alt_entry *)__alt_start,
> > (struct alt_entry *)__alt_end,
> > RISCV_ALTERNATIVES_EARLY_BOOT);
> > -#endif
> > }
> > +#endif
> > #ifdef CONFIG_MODULES
> > void apply_module_alternatives(void *start, size_t length)
--
Cheers,
Changbin Du
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] riscv: Prevent early kernel panic in instrumented apply_early_boot_alternatives
@ 2025-06-25 3:10 ` duchangbin
0 siblings, 0 replies; 12+ messages in thread
From: duchangbin @ 2025-06-25 3:10 UTC (permalink / raw)
To: Alexandre Ghiti
Cc: duchangbin, Paul Walmsley, Palmer Dabbelt, Albert Ou,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
On Tue, Jun 24, 2025 at 02:54:32PM +0200, Alexandre Ghiti wrote:
> Hi Changbin,
>
> On 6/24/25 13:30, Changbin Du wrote:
> > Under FTRACE=y, DYNAMIC_FTRACE=n, and RISCV_ALTERNATIVE_EARLY=n, the kernel
>
>
> Your above config works fine for me, I guess you meant FUNCTION_TRACER &&
> !DYNAMIC_FTRACE (which fails).
>
Yes, it's FUNCTION_TRACER.
> We were just talking with Andy about this configuration (FUNCTION_TRACER &&
> !DYNAMIC_FTRACE): do we really want to support static ftrace? Andy should
> send a patch soon to remove this possibility as IMO we don't want to support
> it. Let's wait for this patch and the discussion that will follow before
> merging your fix. I'll keep it in my list for 6.16 just in case someone
> comes up with a good argument to keep it.
>
No problem. I'm unable to enable DYNAMIC_FTRACE because GCC_SUPPORTS_DYNAMIC_FTRACE=n
and CC_HAS_MIN_FUNCTION_ALIGNMENT=n are set. It seems that my GCC version (13.3.0)
does not support the option -fmin-function-alignment=8.
By the way, this change also eliminates an empty function call.
> Thanks,
>
> Alex
>
>
> > panics upon returning from _mcount() in the early boot path. This occurs
> > during _start_kernel() -> setup_vm() -> apply_early_boot_alternatives().
> >
> > The CC_FLAGS_FTRACE is only removed from alternative.c when
> > CONFIG_RISCV_ALTERNATIVE_EARLY=y. Therefore, no function calls should be
> > made to alternative.c during early boot in this configuration.
> >
> > Fixes: a35707c3d850 ("riscv: add memory-type errata for T-Head")
> > Signed-off-by: Changbin Du <changbin.du@huawei.com>
> > ---
> > arch/riscv/include/asm/alternative.h | 6 ++++++
> > arch/riscv/kernel/alternative.c | 4 ++--
> > 2 files changed, 8 insertions(+), 2 deletions(-)
> >
> > diff --git a/arch/riscv/include/asm/alternative.h b/arch/riscv/include/asm/alternative.h
> > index 3c2b59b25017..c670b0cc55f4 100644
> > --- a/arch/riscv/include/asm/alternative.h
> > +++ b/arch/riscv/include/asm/alternative.h
> > @@ -31,7 +31,13 @@
> > #define ALT_ALT_PTR(a) __ALT_PTR(a, alt_offset)
> > void __init apply_boot_alternatives(void);
> > +
> > +# ifdef CONFIG_RISCV_ALTERNATIVE_EARLY
> > void __init apply_early_boot_alternatives(void);
> > +# else
> > +static inline void apply_early_boot_alternatives(void) { }
> > +# endif
> > +
> > void apply_module_alternatives(void *start, size_t length);
> > void riscv_alternative_fix_offsets(void *alt_ptr, unsigned int len,
> > diff --git a/arch/riscv/kernel/alternative.c b/arch/riscv/kernel/alternative.c
> > index 7eb3cb1215c6..5406c3301627 100644
> > --- a/arch/riscv/kernel/alternative.c
> > +++ b/arch/riscv/kernel/alternative.c
> > @@ -205,6 +205,7 @@ void __init apply_boot_alternatives(void)
> > apply_vdso_alternatives();
> > }
> > +#ifdef CONFIG_RISCV_ALTERNATIVE_EARLY
> > /*
> > * apply_early_boot_alternatives() is called from setup_vm() with MMU-off.
> > *
> > @@ -219,12 +220,11 @@ void __init apply_boot_alternatives(void)
> > */
> > void __init apply_early_boot_alternatives(void)
> > {
> > -#ifdef CONFIG_RISCV_ALTERNATIVE_EARLY
> > _apply_alternatives((struct alt_entry *)__alt_start,
> > (struct alt_entry *)__alt_end,
> > RISCV_ALTERNATIVES_EARLY_BOOT);
> > -#endif
> > }
> > +#endif
> > #ifdef CONFIG_MODULES
> > void apply_module_alternatives(void *start, size_t length)
--
Cheers,
Changbin Du
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] riscv: Prevent early kernel panic in instrumented apply_early_boot_alternatives
2025-06-25 3:10 ` duchangbin
@ 2025-10-09 2:01 ` Paul Walmsley
-1 siblings, 0 replies; 12+ messages in thread
From: Paul Walmsley @ 2025-10-09 2:01 UTC (permalink / raw)
To: duchangbin, Alexandre Ghiti, andybnac
Cc: Paul Walmsley, Palmer Dabbelt, Albert Ou,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Hi Alex, duchangbin, Andy,
On Wed, 25 Jun 2025, duchangbin wrote:
> On Tue, Jun 24, 2025 at 02:54:32PM +0200, Alexandre Ghiti wrote:
> > Hi Changbin,
> >
> > On 6/24/25 13:30, Changbin Du wrote:
> > > Under FTRACE=y, DYNAMIC_FTRACE=n, and RISCV_ALTERNATIVE_EARLY=n, the kernel
> >
> >
> > Your above config works fine for me, I guess you meant FUNCTION_TRACER &&
> > !DYNAMIC_FTRACE (which fails).
> >
> Yes, it's FUNCTION_TRACER.
>
> > We were just talking with Andy about this configuration (FUNCTION_TRACER &&
> > !DYNAMIC_FTRACE): do we really want to support static ftrace? Andy should
> > send a patch soon to remove this possibility as IMO we don't want to support
> > it. Let's wait for this patch and the discussion that will follow before
> > merging your fix. I'll keep it in my list for 6.16 just in case someone
> > comes up with a good argument to keep it.
> >
> No problem. I'm unable to enable DYNAMIC_FTRACE because GCC_SUPPORTS_DYNAMIC_FTRACE=n
> and CC_HAS_MIN_FUNCTION_ALIGNMENT=n are set. It seems that my GCC version (13.3.0)
> does not support the option -fmin-function-alignment=8.
>
> By the way, this change also eliminates an empty function call.
Working on cleaning out Patchwork. Was there any further conclusion
reached on this patch, or more broadly, static ftrace ?
- Paul
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] riscv: Prevent early kernel panic in instrumented apply_early_boot_alternatives
@ 2025-10-09 2:01 ` Paul Walmsley
0 siblings, 0 replies; 12+ messages in thread
From: Paul Walmsley @ 2025-10-09 2:01 UTC (permalink / raw)
To: duchangbin, Alexandre Ghiti, andybnac
Cc: Paul Walmsley, Palmer Dabbelt, Albert Ou,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Hi Alex, duchangbin, Andy,
On Wed, 25 Jun 2025, duchangbin wrote:
> On Tue, Jun 24, 2025 at 02:54:32PM +0200, Alexandre Ghiti wrote:
> > Hi Changbin,
> >
> > On 6/24/25 13:30, Changbin Du wrote:
> > > Under FTRACE=y, DYNAMIC_FTRACE=n, and RISCV_ALTERNATIVE_EARLY=n, the kernel
> >
> >
> > Your above config works fine for me, I guess you meant FUNCTION_TRACER &&
> > !DYNAMIC_FTRACE (which fails).
> >
> Yes, it's FUNCTION_TRACER.
>
> > We were just talking with Andy about this configuration (FUNCTION_TRACER &&
> > !DYNAMIC_FTRACE): do we really want to support static ftrace? Andy should
> > send a patch soon to remove this possibility as IMO we don't want to support
> > it. Let's wait for this patch and the discussion that will follow before
> > merging your fix. I'll keep it in my list for 6.16 just in case someone
> > comes up with a good argument to keep it.
> >
> No problem. I'm unable to enable DYNAMIC_FTRACE because GCC_SUPPORTS_DYNAMIC_FTRACE=n
> and CC_HAS_MIN_FUNCTION_ALIGNMENT=n are set. It seems that my GCC version (13.3.0)
> does not support the option -fmin-function-alignment=8.
>
> By the way, this change also eliminates an empty function call.
Working on cleaning out Patchwork. Was there any further conclusion
reached on this patch, or more broadly, static ftrace ?
- Paul
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] riscv: Prevent early kernel panic in instrumented apply_early_boot_alternatives
2025-10-09 2:01 ` Paul Walmsley
@ 2025-10-09 6:31 ` Vivian Wang
-1 siblings, 0 replies; 12+ messages in thread
From: Vivian Wang @ 2025-10-09 6:31 UTC (permalink / raw)
To: Paul Walmsley
Cc: Paul Walmsley, Palmer Dabbelt, Albert Ou,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
duchangbin, Alexandre Ghiti, andybnac
On 10/9/25 10:01, Paul Walmsley wrote:
> Hi Alex, duchangbin, Andy,
>
> On Wed, 25 Jun 2025, duchangbin wrote:
>
> [...]
>
> Working on cleaning out Patchwork. Was there any further conclusion
> reached on this patch, or more broadly, static ftrace ?
Static ftrace for riscv is no longer supported in 6.17. config RISCV is now:
select DYNAMIC_FTRACE if FUNCTION_TRACER
Since commit 5874ca4c6280 ("riscv: Stop supporting static ftrace"). This
patch should be obsolete.
Vivian "dramforever" Wang
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] riscv: Prevent early kernel panic in instrumented apply_early_boot_alternatives
@ 2025-10-09 6:31 ` Vivian Wang
0 siblings, 0 replies; 12+ messages in thread
From: Vivian Wang @ 2025-10-09 6:31 UTC (permalink / raw)
To: Paul Walmsley
Cc: Paul Walmsley, Palmer Dabbelt, Albert Ou,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
duchangbin, Alexandre Ghiti, andybnac
On 10/9/25 10:01, Paul Walmsley wrote:
> Hi Alex, duchangbin, Andy,
>
> On Wed, 25 Jun 2025, duchangbin wrote:
>
> [...]
>
> Working on cleaning out Patchwork. Was there any further conclusion
> reached on this patch, or more broadly, static ftrace ?
Static ftrace for riscv is no longer supported in 6.17. config RISCV is now:
select DYNAMIC_FTRACE if FUNCTION_TRACER
Since commit 5874ca4c6280 ("riscv: Stop supporting static ftrace"). This
patch should be obsolete.
Vivian "dramforever" Wang
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] riscv: Prevent early kernel panic in instrumented apply_early_boot_alternatives
2025-10-09 6:31 ` Vivian Wang
@ 2025-10-09 23:33 ` Paul Walmsley
-1 siblings, 0 replies; 12+ messages in thread
From: Paul Walmsley @ 2025-10-09 23:33 UTC (permalink / raw)
To: Vivian Wang
Cc: Paul Walmsley, Paul Walmsley, Palmer Dabbelt, Albert Ou,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
duchangbin, Alexandre Ghiti, andybnac
[-- Attachment #1: Type: text/plain, Size: 560 bytes --]
Hi Vivian,
On Thu, 9 Oct 2025, Vivian Wang wrote:
> On 10/9/25 10:01, Paul Walmsley wrote:
> > On Wed, 25 Jun 2025, duchangbin wrote:
> >
> > [...]
> >
> > Working on cleaning out Patchwork. Was there any further conclusion
> > reached on this patch, or more broadly, static ftrace ?
>
> Static ftrace for riscv is no longer supported in 6.17. config RISCV is now:
>
> select DYNAMIC_FTRACE if FUNCTION_TRACER
>
> Since commit 5874ca4c6280 ("riscv: Stop supporting static ftrace"). This
> patch should be obsolete.
Thanks for the followup.
- Paul
[-- Attachment #2: Type: text/plain, Size: 161 bytes --]
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] riscv: Prevent early kernel panic in instrumented apply_early_boot_alternatives
@ 2025-10-09 23:33 ` Paul Walmsley
0 siblings, 0 replies; 12+ messages in thread
From: Paul Walmsley @ 2025-10-09 23:33 UTC (permalink / raw)
To: Vivian Wang
Cc: Paul Walmsley, Paul Walmsley, Palmer Dabbelt, Albert Ou,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
duchangbin, Alexandre Ghiti, andybnac
[-- Attachment #1: Type: text/plain, Size: 560 bytes --]
Hi Vivian,
On Thu, 9 Oct 2025, Vivian Wang wrote:
> On 10/9/25 10:01, Paul Walmsley wrote:
> > On Wed, 25 Jun 2025, duchangbin wrote:
> >
> > [...]
> >
> > Working on cleaning out Patchwork. Was there any further conclusion
> > reached on this patch, or more broadly, static ftrace ?
>
> Static ftrace for riscv is no longer supported in 6.17. config RISCV is now:
>
> select DYNAMIC_FTRACE if FUNCTION_TRACER
>
> Since commit 5874ca4c6280 ("riscv: Stop supporting static ftrace"). This
> patch should be obsolete.
Thanks for the followup.
- Paul
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2025-10-09 23:33 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-24 11:30 [PATCH] riscv: Prevent early kernel panic in instrumented apply_early_boot_alternatives Changbin Du
2025-06-24 11:30 ` Changbin Du
2025-06-24 12:54 ` Alexandre Ghiti
2025-06-24 12:54 ` Alexandre Ghiti
2025-06-25 3:10 ` duchangbin
2025-06-25 3:10 ` duchangbin
2025-10-09 2:01 ` Paul Walmsley
2025-10-09 2:01 ` Paul Walmsley
2025-10-09 6:31 ` Vivian Wang
2025-10-09 6:31 ` Vivian Wang
2025-10-09 23:33 ` Paul Walmsley
2025-10-09 23:33 ` Paul Walmsley
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.