lkml.org 
[lkml]   [2015]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC PATCH] iommu: add ARM short descriptor page table allocator.
From
Date
On Tue, 2015-05-12 at 11:15 +0200, Matthias Brugger wrote:
> 2015-04-28 9:41 GMT+02:00 Yong Wu <yong.wu@mediatek.com>:
> > This patch is for ARM Short Descriptor Format.It has 2-levels
> > pagetable and the allocator supports 4K/64K/1M/16M.
> >
> > Signed-off-by: Yong Wu <yong.wu@mediatek.com>
[snip]
> > +static phys_addr_t arm_short_iova_to_phys(struct io_pgtable_ops *ops,
> > + unsigned long iova)
> > +{
> > + struct arm_short_io_pgtable *data = io_pgtable_short_ops_to_data(ops);
> > + arm_short_iopte *pte, *pgd = data->pgd;
> > + phys_addr_t pa = 0;
> > +
> > + pgd += ARM_SHORT_PGD_IDX(iova);
> > +
> > + if (ARM_SHORT_F_PGD_TYPE_IS_PAGE(*pgd)) {
> > + pte = arm_short_get_pte_in_pgd(*pgd, iova);
> > +
> > + if (ARM_SHORT_F_PTE_TYPE_GET(*pte)
> > + == ARM_SHORT_F_PTE_TYPE_LARGE) {
> > + pa = (*pte) & ARM_SHORT_F_PTE_PA_LARGE_MSK;
> > + pa |= iova & (~ARM_SHORT_F_PTE_PA_LARGE_MSK);
> > + } else if (ARM_SHORT_F_PTE_TYPE_GET(*pte)
> > + == ARM_SHORT_F_PTE_TYPE_SMALL) {
>
> Would make it easier to read:
> u8 pte_type;
>
> [...]
>
> pte_type = ARM_SHORT_F_PTE_TYPE_GET(*pte)
> if (pte_type == ARM_SHORT_F_PTE_TYPE_LARGE) {
> [...]
> } else if (pte_type == ARM_SHORT_F_PTE_TYPE_SMALL) {
> [...]
Hi Matthias,
Thanks for your review.I will fix this in next version.




\
 
 \ /
  Last update: 2015-05-13 05:01    [W:0.078 / U:0.324 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site