lkml.org 
[lkml]   [2014]   [Apr]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 3.11 046/182] arm64: Make DMA coherent and strongly ordered mappings not executable
    Date
    3.11.10.9 -stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Catalin Marinas <catalin.marinas@arm.com>

    commit de2db7432917a82b62d55bb59635586eeca6d1bd upstream.

    pgprot_{dmacoherent,writecombine,noncached} don't need to generate
    executable mappings with side-effects like __sync_icache_dcache() being
    called when the mapping is in user space.

    Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
    Reported-by: Bharat Bhushan <Bharat.Bhushan@freescale.com>
    Tested-by: Laura Abbott <lauraa@codeaurora.org>
    Tested-by: Bharat Bhushan <Bharat.Bhushan@freescale.com>
    Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
    ---
    arch/arm64/include/asm/pgtable.h | 6 +++---
    1 file changed, 3 insertions(+), 3 deletions(-)

    diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h
    index bb969e9..5dee621 100644
    --- a/arch/arm64/include/asm/pgtable.h
    +++ b/arch/arm64/include/asm/pgtable.h
    @@ -253,11 +253,11 @@ static inline int has_transparent_hugepage(void)
    * Mark the prot value as uncacheable and unbufferable.
    */
    #define pgprot_noncached(prot) \
    - __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_DEVICE_nGnRnE))
    + __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_DEVICE_nGnRnE) | PTE_PXN | PTE_UXN)
    #define pgprot_writecombine(prot) \
    - __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_NORMAL_NC))
    + __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_NORMAL_NC) | PTE_PXN | PTE_UXN)
    #define pgprot_dmacoherent(prot) \
    - __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_NORMAL_NC))
    + __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_NORMAL_NC) | PTE_PXN | PTE_UXN)
    #define __HAVE_PHYS_MEM_ACCESS_PROT
    struct file;
    extern pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
    --
    1.9.1


    \
     
     \ /
      Last update: 2014-04-24 14:21    [W:4.067 / U:0.324 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site