about consistent_init function

Chan Kim ckim at etri.re.kr
Thu May 22 08:51:03 EDT 2014


Dear all,


As I said, I'm trying to use consistent memory (from ARM) to our sparc board.
after I run the consistent_init, (which runs after the paging init, as one of the initcalls), the skeleton of the page table is setup.
At that time the pte values for the start of consistent memory (used for dma_alloc_writecombine) is all zero.(not allocated to any physical memory). I read the pte values for the buffer.
But during the frame buffer driver initialization, the code accesses the frame buffer area and causes page fault.
During the fault process, when I probe the page table for the buffer address(virtual address), it now has the pte value directing to some physical memory area. When did linux assign this PFN? 
I would be grateful if someone explain it to me.
(by the way I assigned consistent memory below 0xc00000 and blocked BUG_ON(base < VMALLOC_END); check)
Thanks,

Chan



보낸 사람 : "Chan Kim" <ckim at etri.re.kr>
보낸 날짜 : 2014-05-22 13:57:23 ( +09:00 )
받는 사람 : kernelnewbies at kernelnewbies.org <kernelnewbies at kernelnewbies.org>
참조 : 
제목 : about consistent_init function

Hello,

In http://lxr.free-electrons.com/source/arch/arm/mm/dma-mapping.c?v=3.3#L162, in line 208, 
Could anybody kindly explain why it increases the variable 'base' by PMD_SIZE?
Is the consistent memory chunck initialized by PMD_SIZE? 

It seems to me the consistent_init allocates only the skeleton of the page table (with final pte entries empty) for the consistent memory region.
Then when is the actual pte entries filled? In ARM how does this work?

I'm trying to allocate memory for dma (uncached region) for our sparc processor using dma_alloc_writecombine which is from arm.
Is this a correct approach? (dma_alloc_coherent seems to be for smaller size), I need almost 2MB buffer.

Any help or suggestion will be appreciated.
Thanks,
Chan
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


More information about the Kernelnewbies mailing list