All of lore.kernel.org
 help / color / mirror / Atom feed
* idle_pg_tables?
@ 2006-08-30 16:38 PUCCETTI Armand
  0 siblings, 0 replies; 6+ messages in thread
From: PUCCETTI Armand @ 2006-08-30 16:38 UTC (permalink / raw)
  To: xen-devel

In the paging mechanism of XEN what is the role of the variable 
'idle_pg_table'??

For a 4-levels paging it is defined as external in asm-x86/page.h, like this

extern root_pgentry_t <http://lxr.xensource.com/lxr/ident?a=x86_64;i=root_pgentry_t> idle_pg_table <http://lxr.xensource.com/lxr/ident?a=x86_64;i=idle_pg_table>[ROOT_PAGETABLE_ENTRIES <http://lxr.xensource.com/lxr/ident?a=x86_64;i=ROOT_PAGETABLE_ENTRIES>];
extern l2_pgentry_t <http://lxr.xensource.com/lxr/ident?a=x86_64;i=l2_pgentry_t>   idle_pg_table_l2 <http://lxr.xensource.com/lxr/ident?a=x86_64;i=idle_pg_table_l2>[ROOT_PAGETABLE_ENTRIES <http://lxr.xensource.com/lxr/ident?a=x86_64;i=ROOT_PAGETABLE_ENTRIES>];


but where is it initialised?
and why is there only such as idle table for levels 4 and 2?
thanks

^ permalink raw reply	[flat|nested] 6+ messages in thread
* idle_pg_tables??
@ 2006-09-01 16:10 PUCCETTI Armand
  2006-09-01 16:50 ` idle_pg_tables?? Petersson, Mats
  0 siblings, 1 reply; 6+ messages in thread
From: PUCCETTI Armand @ 2006-09-01 16:10 UTC (permalink / raw)
  To: xen-devel

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-09-05 14:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-30 16:38 idle_pg_tables? PUCCETTI Armand
  -- strict thread matches above, loose matches on Subject: below --
2006-09-01 16:10 idle_pg_tables?? PUCCETTI Armand
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

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.