lkml.org 
[lkml]   [2008]   [Feb]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH] [3/5] CPA: Make advised protection check truly advisory
    Date

    Only force RO in the advisory protection checks when all pages in the
    range are RO. Previously it would trigger when any page in the range
    was ro.

    I believe this will make try_preserve_large_page much safer to use.

    Signed-off-by: Andi Kleen <ak@suse.de>

    ---
    arch/x86/mm/pageattr.c | 8 ++++----
    1 file changed, 4 insertions(+), 4 deletions(-)

    Index: linux/arch/x86/mm/pageattr.c
    ===================================================================
    --- linux.orig/arch/x86/mm/pageattr.c
    +++ linux/arch/x86/mm/pageattr.c
    @@ -191,14 +191,14 @@ advised_static_prot(pgprot_t prot, unsig
    {
    #ifdef CONFIG_DEBUG_RODATA
    /* The .rodata section needs to be read-only */
    - if (within_range(start, end, (unsigned long)__start_rodata,
    - (unsigned long)__end_rodata))
    + if (within_range((unsigned long)__start_rodata,
    + (unsigned long)__end_rodata, start, end))
    pgprot_val(prot) &= ~_PAGE_RW;
    /*
    * Do the same for the x86-64 high kernel mapping
    */
    - if (within_range(start, end, virt_to_highmap(__start_rodata),
    - virt_to_highmap(__end_rodata)))
    + if (within_range(virt_to_highmap(__start_rodata),
    + virt_to_highmap(__end_rodata), start, end))
    pgprot_val(prot) &= ~_PAGE_RW;
    #endif
    return prot;

    \
     
     \ /
      Last update: 2008-02-08 14:31    [W:0.019 / U:31.332 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site