From: PUCCETTI Armand <armand.puccetti@cea.fr>
To: xen-devel@lists.xensource.com
Subject: idle_pg_tables??
Date: Fri, 01 Sep 2006 18:10:48 +0200 [thread overview]
Message-ID: <44F85B88.4060704@cea.fr> (raw)
In the paging mechanism of XEN what is the role of the variable
'idle_pg_table*' variables ??
For a 4-levels paging system these variables are defined in x86_64.S and
partially initialised.
Here is the code, copied from x86_64.S:
__________________________________________________
...
/* Initial PML4 -- level-4 page table. */
.org 0x2000
ENTRY(idle_pg_table)
ENTRY(idle_pg_table_4)
.quad idle_pg_table_l3 - __PAGE_OFFSET + 7 # PML4[0]
.fill 261,8,0
.quad idle_pg_table_l3 - __PAGE_OFFSET + 7 # PML4[262]
/* Initial PDP -- level-3 page table. */
.org 0x3000
ENTRY(idle_pg_table_l3)
.quad idle_pg_table_l2 - __PAGE_OFFSET + 7
/* Initial PDE -- level-2 page table. Maps first 64MB physical memory. */
.org 0x4000
ENTRY(idle_pg_table_l2)
.macro identmap from=0, count=32
.if \count-1
identmap "(\from+0)","(\count/2)"
identmap "(\from+(0x200000*(\count/2)))","(\count/2)"
.else
.quad 0x00000000000001e3 + \from
.endif
.endm
identmap
.org 0x4000 + PAGE_SIZE
.code64
.section ".bss.stack_aligned","w"
ENTRY(cpu0_stack)
.fill STACK_SIZE,1,0
______________________________________________________
trying to understand that:
- idle_pg_table_l4 is the same as idle_pg_table and contains 263 enties,
all zeroed but two (identical) ones. These
two pointers point somewhere close to idle_pg_table_l3. Why are there
two identical pointers and why shift them by __PAGE_OFFSET +7?
- idle_pg_table_l3 is located between 0x3000 and 0x4000 , with only the
first slot initialised. The later points to
level 2 table with some offset.
- idle_pg_table_l2 has terrible code with a recursive macro, who expands
into 63 quad constants. It is unclear
to me why this complicated macro?? I would have put a table of constants
pretty simply... Every entry in that l2 table points to a
fixed address, at intervals of 4K (a page).l2 tables are located between
0x01E3 to 0x03E001E3 in groups. Every group
is apparently a set of 4 page tables and each table has a size of 128K.
Groups are separated by approx 256MB.
Why are these spacings and groups?
- idle_pg_table_l1 is not an entry and so l1 tables are not allocated. Why?
thanks for help!
Armand
next reply other threads:[~2006-09-01 16:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-01 16:10 PUCCETTI Armand [this message]
2006-09-01 16:50 ` idle_pg_tables?? Petersson, Mats
2006-09-01 17:07 ` idle_pg_tables?? Ryan Harper
2006-09-05 10:50 ` idle_pg_tables?? PUCCETTI Armand
2006-09-05 14:03 ` idle_pg_tables?? Petersson, Mats
-- strict thread matches above, loose matches on Subject: below --
2006-08-30 16:38 idle_pg_tables? PUCCETTI Armand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=44F85B88.4060704@cea.fr \
--to=armand.puccetti@cea.fr \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.