[Barrelfish-users] (no subject)

Andrew Baumann Andrew.Baumann at microsoft.com
Wed Apr 3 06:25:48 CEST 2013


This is a known problem, and a side-effect of the way memory is allocated when loading ELF images.

As you know, globalmsg is part of the data section. In Barrelfish, another domain (typically spawnd) loads the ELF image for a program, allocating memory and constructing its initial page tables. When the new domain starts running, it has page table mappings for its ELF image, but not the metadata or caps backing them which are required by the pmap lookup code. This is why the first lookup fails. The second lookup succeeds because the thread's stack is allocated dynamically within the context of the new domain, so the metadata is tracked correctly.

There is nothing (easy) you can do to fix this - it's just something we haven't implemented because nothing really needed it yet, but it has occurred to me that much of this would be cleaner if we did most of the ELF loading in the context of the new domain rather than its parent.

Perhaps we can help you find a workaround ... what are you trying to achieve at the high level?


From: zhanqing Zhan(Qing) [mailto:zhanqing.zhan at huawei.com]
Sent: Tuesday, 2 April 2013 20:19
To: barrelfish-users at lists.inf.ethz.ch
Subject: [Barrelfish-users] (no subject)

hi, everyone
   I have a problem about global string point and local string point in memory map.
My machine is x86_64 debian and the test code looks like:

char globalmsg[] = "hello, world";

void func()
   struct pmap *pmap = get_current_pmap();
   /* this lookup function can't find global string memory capref  */
   pmap->f.lookup(pmap, globalmsg, ..cap.. );

   char localmsg[] = "hello, world";
   /* this lookup function can find local string memory capref, it works */
   pmap->f.lookup(pmap, localmsg, ..cap..);

  How do I make the pmap lookup function get capref with globalmsg ?

the localmsg Vaddress is 0x511f20, is belong to stack segment;
the globalmsg Vaddress is 0x4b9008;
and we can see globalmsg in text segment and localmsg in text segment,

  [ 1] .text             PROGBITS         0000000000400120  00000120
       0000000000090922  0000000000000000  AX       0     0     16
  [ 9] .data             PROGBITS         00000000004b9000  000b9000
       000000000000d608  0000000000000000  WA       0     0     32

  So I think there are maybe two problem:
1, the data segment not do map;
2, the global string point Vaddress should add segment address;

the fs register is 0x17, the IDT context is:
ldt[0] 0x2cc40
ldt[1] 0x4b9020
ldt[2] 0x804f0020

  I add those idt address to globalmsg then do pmap lookup function, all the same not work.
Thanks for your any suggestion!

Best regards!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.inf.ethz.ch/pipermail/barrelfish-users/attachments/20130403/1fc42d08/attachment.html 

More information about the Barrelfish-users mailing list