[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [RFC v01 2/3] arm: omap: translate iommu mapping to 4K pages



Hi Stefano,

On Thu, Jan 23, 2014 at 4:52 PM, Stefano Stabellini
<stefano.stabellini@xxxxxxxxxxxxx> wrote:
> On Wed, 22 Jan 2014, Andrii Tseglytskyi wrote:
>> Patch introduces the following algorithm:
>> - enumerates all first level translation entries
>> - for each section creates 256 pages, each page is 4096 bytes
>> - for each supersection creates 4096 pages, each page is 4096 bytes
>> - flush cache to synchronize Cortex M15 and IOMMU
>>
>> This algorithm make possible to use 4K mapping only.
>>
>> Change-Id: Ie2cf45f23e0c170e9ba9d58f8dbb917348fdbd33
>> Signed-off-by: Andrii Tseglytskyi <andrii.tseglytskyi@xxxxxxxxxxxxxxx>
>
> I take that the first patch doesn't actually work without this one?
> In that case it might make sense to just merge them into one.
>

No, each patch from the series works standalone. This patch rewrites
structure of the pagetable. I did this to increase granularity of
memory allocations. I'm pretty sure that we won't have continuous
blocks of 1Mb and 16 Mb
of memory, when several guest domains will be active. With 4K
granularity chances for successful translation are much more higher.

>>               /* "section" 1Mb */
>>               } else if (iopgd_is_section(iopgd)) {
>> -                     da = i << IOSECTION_SHIFT;
>> -                     mmu->pagetable[i] = mmu_translate_pgentry(dom, iopgd, 
>> da, IOSECTION_MASK);
>> +                     if (likely(translate_sections_to_pages)) {
>> +                             mmu->pagetable[i] = mmu_iopte_alloc(mmu, dom, 
>> iopgd, i);
>> +                     } else {
>> +                             da = i << IOSECTION_SHIFT;
>> +                             mmu->pagetable[i] = mmu_translate_pgentry(dom, 
>> iopgd, da, IOSECTION_MASK);
>> +                     }
>>
>>               /* "table" */
>>               } else if (iopgd_is_table(iopgd)) {
>
> Since the 16MB and 1MB sections might not actually be contigous in
> machine address space, this patch replaces the guest allocated sections
> with pte tables pointing to the original IPAs. Is that right?

Yes, you are right.

Thank you for review,

regards,
Andrii

-- 

Andrii Tseglytskyi | Embedded Dev
GlobalLogic
www.globallogic.com

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.