arm linux page initialization
Oscar Salvador
osalvador.vilardaga at gmail.com
Thu Oct 13 04:09:08 PDT 2016
Hi all, I have a question regarding page initialization on arm32 without
LPAE support enabled.
I was trying to find the right pte of a kernel linear address (f.i
0xc05518bc)
by walking the page tables starting with the pgd taken from TTBR1.
I was using the functions:
pgd_offset_k
pud_offset
pmd_offset
pte_offset_kernel
Since pte_offset_kernel should lead me to virtual address of the Linux
PTE version, I thougt I should be able to check the L_PTE_* bits.
But actually I realized that the pte given from pte_offset_kernel
didn't have such flags.
By looking at the code from arch/arm/mm/mmu.c, I could see that, actually
(talking about a system with 1GB ram), during map_lowmem function,
memory (virtual) from 0xC0000000 to 0xef800000 is being put in sections
of 1MB and marked as a "PMD_TYPE_SECT | PMD_SECT_AP_WRITE",
then it does a flush_pmd_entry.
So that means that the first level table for these addresses are pointing
directly
to a Section, instead to point to a second level tables, right?
If that's true, I guess this memory don't have PTE's
(at least I didn't see that at boot time).
Given that, without pte's available for this range of memory,
we shoudln't be able to check for L_PTE_* flags here.
Then, why do we have all these L_PTE_* flags?
Are not they being used to check for instance if the kernel code is
writeable or not (I think you can configure that).
I hope I could explain my question in a clear way.
Thank you very much
More information about the linux-arm
mailing list