Re: [PATCH 5/5] ftrace, x86: do not depend on system state forkernel text info

From: Ingo Molnar
Date: Fri Feb 20 2009 - 12:37:27 EST



* Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:

> From: Steven Rostedt <srostedt@xxxxxxxxxx>
>
> Andrew Morton pointed out that using SYSTEM_STATE is a bad idea
> since there is no guarantee to what its state will actually be.
>
> Instead, I moved the check into the set_kernel_text_* functions
> themselves, and use a local variable to determine when it is
> OK to change the kernel text RW permissions.
>
> Reported-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> Signed-off-by: Steven Rostedt <srostedt@xxxxxxxxxx>
> ---
> arch/x86/kernel/ftrace.c | 8 --------
> arch/x86/mm/init_32.c | 10 ++++++++++
> arch/x86/mm/init_64.c | 10 ++++++++++
> 3 files changed, 20 insertions(+), 8 deletions(-)
>
> diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
> index c9ba2f9..025d783 100644
> --- a/arch/x86/kernel/ftrace.c
> +++ b/arch/x86/kernel/ftrace.c
> @@ -28,20 +28,12 @@
>
> int ftrace_arch_modify_prepare(void)
> {
> - /* at boot up, we are still writable */
> - if (system_state != SYSTEM_RUNNING)
> - return 0;
> -

Since i suspect you'll rebase anyway, i'd suggest to squash this
patch into patch #2, with credit to Andrew added.

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/