lkml.org 
[lkml]   [2020]   [Jul]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v4 5/7] arch/x86: kprobes: Use text_alloc() in alloc_insn_page()
    Date
    Use text_alloc() as part of the arch specific implementation for
    alloc_insn_page().

    Cc: Andi Kleen <ak@linux.intel.com>
    Cc: Masami Hiramatsu <mhiramat@kernel.org>
    Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>Im
    ---
    arch/x86/kernel/kprobes/core.c | 8 +-------
    1 file changed, 1 insertion(+), 7 deletions(-)

    diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c
    index ada39ddbc922..0f20a3e52a06 100644
    --- a/arch/x86/kernel/kprobes/core.c
    +++ b/arch/x86/kernel/kprobes/core.c
    @@ -423,7 +423,7 @@ void *alloc_insn_page(void)
    {
    void *page;

    - page = module_alloc(PAGE_SIZE);
    + page = text_alloc(PAGE_SIZE);
    if (!page)
    return NULL;

    @@ -443,12 +443,6 @@ void *alloc_insn_page(void)
    return page;
    }

    -/* Recover page to RW mode before releasing it */
    -void free_insn_page(void *page)
    -{
    - module_memfree(page);
    -}
    -
    static int arch_copy_kprobe(struct kprobe *p)
    {
    struct insn insn;
    --
    2.25.1
    \
     
     \ /
      Last update: 2020-07-17 05:06    [W:2.570 / U:0.108 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site