lkml.org 
[lkml]   [2015]   [Jul]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 3/6] iommu: add ARM short descriptor page table allocator.
On Fri, Jul 31, 2015 at 08:55:37AM +0100, Yong Wu wrote:
> About the AP bits, I may have to add a new quirk for it...
>
> Current I add AP in pte like this:
> #define ARM_SHORT_PTE_RD_WR (3 << 4)
> #define ARM_SHORT_PTE_RDONLY BIT(9)
>
> pteprot |= ARM_SHORT_PTE_RD_WR;
>
>
> If(!(prot & IOMMU_WRITE) && (prot & IOMMU_READ))
>
>
> pteprot |= ARM_SHORT_PTE_RDONLY;
>
> The problem is that the BIT(9) in the level1 and level2 pagetable of our
> HW has been used for PA[32] that is for the dram size over 4G.

Aha, now *thats* a case of page-table abuse!

> so I had to add a quirk to disable bit9 while RDONLY case.
> (If BIT9 isn't disabled, the HW treat it as the PA[32] case then it will
> translation fault..)
>
> like: IO_PGTABLE_QUIRK_SHORT_MTK ?

Given that you don't have XN either, maybe IO_PGTABLE_QUIRK_NO_PERMS?
When set, IOMMU_READ/WRITE/EXEC are ignored and the mapping will never
generate a permission fault.

Will


\
 
 \ /
  Last update: 2015-07-31 14:01    [W:0.143 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site