lkml.org 
[lkml]   [2018]   [Sep]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [patch 02/10] x86/mm/cpa: Rework static_protections()
    From
    Date
    On 09/07/2018 08:01 AM, Thomas Gleixner wrote:
    > +static inline pgprot_t static_protections(pgprot_t prot, unsigned long address,
    > + unsigned long pfn)
    > +{
    > + pgprotval_t forbidden;
    > +
    > + /* Operate on the virtual address */
    > + forbidden = protect_kernel_text(address);
    > + forbidden |= protect_kernel_text_ro(address);
    > +
    > + /* Check the PFN directly */
    > + forbidden |= protect_pci_bios(pfn);
    > + forbidden |= protect_rodata(pfn);
    >
    > - return prot;
    > + return __pgprot(pgprot_val(prot) & ~forbidden);
    > }

    Wow, that's quite an improvement, especially separating the vaddr vs.
    paddr checks.

    \
     
     \ /
      Last update: 2018-09-07 18:23    [W:2.331 / U:0.292 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site