[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1492781365.w4t118903f.astroid@naverao1-tp.none>
Date: Fri, 21 Apr 2017 13:32:10 +0000
From: "Naveen N. Rao" <naveen.n.rao@...ux.vnet.ibm.com>
To: Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Christophe Leroy <christophe.leroy@....fr>,
Michael Ellerman <mpe@...erman.id.au>,
Scott Wood <oss@...error.net>,
Paul Mackerras <paulus@...ba.org>
Cc: linux-kernel@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org
Subject: Re: [PATCH v2 3/3] powerpc/mm: Implement CONFIG_DEBUG_RODATA on PPC32
Excerpts from Christophe Leroy's message of April 21, 2017 18:32:
> This patch implements CONFIG_DEBUG_RODATA on PPC32.
>
> As for CONFIG_DEBUG_PAGEALLOC, it deactivates BAT and LTLB mappings
> in order to allow page protection setup at the level of each page.
>
> As BAT/LTLB mappings are deactivated, their might be performance
> impact. For this reason, we keep it OFF by default.
>
> Signed-off-by: Christophe Leroy <christophe.leroy@....fr>
[snip]
> diff --git a/arch/powerpc/kernel/ftrace.c
> b/arch/powerpc/kernel/ftrace.c
> index 32509de6ce4c..06d2ac53f471 100644
> --- a/arch/powerpc/kernel/ftrace.c
> +++ b/arch/powerpc/kernel/ftrace.c
> @@ -46,6 +46,7 @@ static int
> ftrace_modify_code(unsigned long ip, unsigned int old, unsigned int new)
> {
> unsigned int replaced;
> + int err;
>
> /*
> * Note:
> @@ -67,10 +68,11 @@ ftrace_modify_code(unsigned long ip, unsigned int old, unsigned int new)
> }
>
> /* replace the text with the new text */
> - if (patch_instruction((unsigned int *)ip, new))
> - return -EPERM;
> + set_kernel_text_rw(ip);
> + err = patch_instruction((unsigned int *)ip, new);
> + set_kernel_text_ro(ip);
Is there a reason to not put those inside patch_instruction()?
- Naveen
Powered by blists - more mailing lists