lkml.org 
[lkml]   [2010]   [Sep]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 2/2] Rewrite jump_label.c to use binary search
    On Wed, Sep 22, 2010 at 11:07:43AM -0400, Mathieu Desnoyers wrote:
    > * Mathieu Desnoyers (mathieu.desnoyers@polymtl.ca) wrote:
    > > * Andi Kleen (andi@firstfloor.org) wrote:
    > > >
    > > > >
    > > > >>> + for (; entry < stop && entry->key == key; entry++)
    > > > >>> + if (kernel_text_address(entry->code))
    > > > >>
    > > > >> This does not work for modules I'm afraid, only for the core kernel. You
    > > > >> should test for __module_text_address() somewhere.
    > > > >
    > > > > I thought it was shared now, but ok.
    > > >
    > > > Double checked. This is ok because kernel_text_address()
    > > > already checks for modules. You were probably thinking
    > > > of __kernel_text_address()
    > >
    > > Ah right,
    > >
    > > Although we have another problem:
    > >
    > > __module_text_address() includes module init text, which defeats the
    > > purpose of the check put in there by Jason.
    > >
    > > So the check works for the core kernel, but not for modules.
    >
    > So, we have this issue, but I also have a question for Jason: what
    > happens if someone puts static jump in a function declared in the __init
    > section of the core kernel/module ? Can we enable them at early boot ?
    >
    > Thanks,
    >
    > Mathieu
    >

    Hi Mathieu,

    Yes, we should be able to enable these. Look at the definition for
    core_kernel_text():

    int core_kernel_text(unsigned long addr)
    {
    if (addr >= (unsigned long)_stext &&
    addr <= (unsigned long)_etext)
    return 1;

    if (system_state == SYSTEM_BOOTING &&
    init_kernel_text(addr))
    return 1;
    return 0;
    }

    If the system is in the SYSTEM_BOOTING state we allow the text to be
    updated. same for modules, the check will allow module __init text
    modifications. At very early init there could be some issue
    text_poke_smp() working on x86, I'm not sure. In any case, we could
    always fall back to text_poke_early(), if needed. So I don't see any
    fundamental issues with this case.

    thanks,

    -Jason


    \
     
     \ /
      Last update: 2010-09-22 17:47    [W:0.025 / U:0.352 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site