I'm having some trouble understanding the acceptable values usable in a call to l4sigma0_map_iomem. It looks like the way for me to request a map from an available physical address block to a virtual memory address that can be used by the program. Perhaps I am lacking a more fundamental understanding of the ARM memory model.
But what addresses should be allowed? My Verstaile Express board has 1GB RAM starting at physical address 0x60000000 but I can't use this address. I immediately get an error. I also tried starting at 0x80000000. (The L4 Bootloader seems to be using memory at 0x60000000 for its own purposes anyway.)
Error: Cannot map physical memory: (-2147451404) No fpage received
If I try to get size 0x04000000 from address 0x08000000 it works fine. I am going off the memory map of the CoreTile A9x4.
http://infocenter.arm.com/help/topic/com.arm.doc.dui0448e/CIAGFCHA.html#BBAF...
The CoreTile A9x4 uses the Versatile Express Motherboard uATX's Legacy memory map.
http://infocenter.arm.com/help/topic/com.arm.doc.dui0447e/ch04s02s01.html#CH...
Thanks,
On Thu Sep 29, 2011 at 15:34:38 -0700, Wesley Miaw wrote:
I'm having some trouble understanding the acceptable values usable in a call to l4sigma0_map_iomem. It looks like the way for me to request a map from an available physical address block to a virtual memory address that can be used by the program. Perhaps I am lacking a more fundamental understanding of the ARM memory model.
But what addresses should be allowed? My Verstaile Express board has 1GB RAM starting at physical address 0x60000000 but I can't use this address. I immediately get an error. I also tried starting at 0x80000000. (The L4 Bootloader seems to be using memory at 0x60000000 for its own purposes anyway.)
Error: Cannot map physical memory: (-2147451404) No fpage received
If I try to get size 0x04000000 from address 0x08000000 it works fine. I am going off the memory map of the CoreTile A9x4.
l4sigma0_map_iomem is used to map IO-mem, i.e. non-RAM. For RAM (0x60000000-0x9fffffff) use l4sigma0_map_anypage()/l4sigma0_map_mem().
Adam
On Thu Sep 29, 2011 at 15:34:38 -0700, Wesley Miaw wrote:
I'm having some trouble understanding the acceptable values usable in a call to l4sigma0_map_iomem....
But what addresses should be allowed? My Verstaile Express board has 1GB RAM starting at physical address 0x60000000 but I can't use this address.
l4sigma0_map_iomem is used to map IO-mem, i.e. non-RAM. For RAM (0x60000000-0x9fffffff) use l4sigma0_map_anypage()/l4sigma0_map_mem().
I tried requesting physical memory 0x60000000 of size 0x40000000 mapped onto virtual 0x60000000 using l4sigma0_map_mem() and am still getting the error. I also tried a few other smaller sizes like 0x80000000 size 0x20000000 and 0x64000000 size 0x1c000000. But they are all failing as well.
I thought based on the RAM printout maybe I had to request a portion that was in restricted to one of the "contiguous blocks" printed out. I think owner '0' equals Sigma0 and owner '4' equals Root, so Sigma0 should be able to give me 0x64000000 size 0x1c000000.
Here's some log output:
SIGMA0: Hello! KIP @ 60002000 allocated 4KB for maintenance structures SIGMA0: Dump of all resource maps RAM:------------------------ [0:60000000;60000fff] [0:60066000;6008ffff] [0:60097000;60097fff] [0:6009f000;6013ffff] [4:60140000;60176fff] [0:60177000;60177fff] [4:60178000;6018efff] [0:6018f000;6100efff] [4:6100f000;6100ffff] [0:61010000;6209afff] [4:6209b000;6247dfff] [0:6247e000;9effffff] IOMEM:---------------------- [0:0;5fffffff] [0:a0000000;ffffffff] MOE: Hello world MOE: found 1027436 KByte free memory MOE: found RAM from 60000000 to 9f000000 MOE: allocated 1008 KByte for the page array @0x6018f000 MOE: virtual user address space [0-bfffffff] prog | l4sigma0_map_mem(64000000, 64000000, 1c000000) prog | l4sigma0_map_mem: size 1c000000; phys 64000000; virt 64000000 prog | [init] Error: Cannot map physical memory: (-2147451396) No fpage received.
Thanks, Wes
Hi,
did I miss this one?
On Tue Oct 04, 2011 at 00:37:47 -0000, Wesley@wesman.net wrote:
On Thu Sep 29, 2011 at 15:34:38 -0700, Wesley Miaw wrote:
I'm having some trouble understanding the acceptable values usable in a call to l4sigma0_map_iomem....
But what addresses should be allowed? My Verstaile Express board has 1GB RAM starting at physical address 0x60000000 but I can't use this address.
l4sigma0_map_iomem is used to map IO-mem, i.e. non-RAM. For RAM (0x60000000-0x9fffffff) use l4sigma0_map_anypage()/l4sigma0_map_mem().
I tried requesting physical memory 0x60000000 of size 0x40000000 mapped onto virtual 0x60000000 using l4sigma0_map_mem() and am still getting the error. I also tried a few other smaller sizes like 0x80000000 size 0x20000000 and 0x64000000 size 0x1c000000. But they are all failing as well.
I thought based on the RAM printout maybe I had to request a portion that was in restricted to one of the "contiguous blocks" printed out. I think owner '0' equals Sigma0 and owner '4' equals Root, so Sigma0 should be able to give me 0x64000000 size 0x1c000000.
Here's some log output:
SIGMA0: Hello! KIP @ 60002000 allocated 4KB for maintenance structures SIGMA0: Dump of all resource maps RAM:------------------------ [0:60000000;60000fff] [0:60066000;6008ffff] [0:60097000;60097fff] [0:6009f000;6013ffff] [4:60140000;60176fff] [0:60177000;60177fff] [4:60178000;6018efff] [0:6018f000;6100efff] [4:6100f000;6100ffff] [0:61010000;6209afff] [4:6209b000;6247dfff] [0:6247e000;9effffff] IOMEM:---------------------- [0:0;5fffffff] [0:a0000000;ffffffff] MOE: Hello world MOE: found 1027436 KByte free memory MOE: found RAM from 60000000 to 9f000000 MOE: allocated 1008 KByte for the page array @0x6018f000 MOE: virtual user address space [0-bfffffff] prog | l4sigma0_map_mem(64000000, 64000000, 1c000000) prog | l4sigma0_map_mem: size 1c000000; phys 64000000; virt 64000000 prog | [init] Error: Cannot map physical memory: (-2147451396) No fpage received.
Try mapping smaller chunks and/or try l4sigma0_map_anypage().
Adam
Hi Adam,
Yeah, but I figured it out so everything's good. Thanks. :)
I found that if I want to allocate this memory, I need to keep it in the "iomem" area even though it is actually RAM. Once I did that, I could allocate half the actual RAM to Fiasco/L4, and keep the other half in reserve for the the "normal world" Linux kernel.
Unfortunately at this point I'm stuck on a TrustZone issue--whenever I try to switch the PC to the normal world instruction, located in the reserved half of RAM, the device halts/hangs. It is happening even with the example Versatile Express TrustZone code available off the ARM web site, so I don't think it's something specifically at issue with L4/Fiasco. I think I need to partition/initialize the TrustZone Controller somehow but I don't know how. If you have any insight that'd be great but otherwise I'm still searching for details elsewhere.
Thanks, -- Wesley Miaw wesley@wesman.net
On Oct 16, 2011, at 4:56 PM, Adam Lackorzynski wrote:
Hi,
did I miss this one?
On Tue Oct 04, 2011 at 00:37:47 -0000, Wesley@wesman.net wrote:
On Thu Sep 29, 2011 at 15:34:38 -0700, Wesley Miaw wrote:
I'm having some trouble understanding the acceptable values usable in a call to l4sigma0_map_iomem....
But what addresses should be allowed? My Verstaile Express board has 1GB RAM starting at physical address 0x60000000 but I can't use this address.
l4sigma0_map_iomem is used to map IO-mem, i.e. non-RAM. For RAM (0x60000000-0x9fffffff) use l4sigma0_map_anypage()/l4sigma0_map_mem().
I tried requesting physical memory 0x60000000 of size 0x40000000 mapped onto virtual 0x60000000 using l4sigma0_map_mem() and am still getting the error. I also tried a few other smaller sizes like 0x80000000 size 0x20000000 and 0x64000000 size 0x1c000000. But they are all failing as well.
I thought based on the RAM printout maybe I had to request a portion that was in restricted to one of the "contiguous blocks" printed out. I think owner '0' equals Sigma0 and owner '4' equals Root, so Sigma0 should be able to give me 0x64000000 size 0x1c000000.
Here's some log output:
SIGMA0: Hello! KIP @ 60002000 allocated 4KB for maintenance structures SIGMA0: Dump of all resource maps RAM:------------------------ [0:60000000;60000fff] [0:60066000;6008ffff] [0:60097000;60097fff] [0:6009f000;6013ffff] [4:60140000;60176fff] [0:60177000;60177fff] [4:60178000;6018efff] [0:6018f000;6100efff] [4:6100f000;6100ffff] [0:61010000;6209afff] [4:6209b000;6247dfff] [0:6247e000;9effffff] IOMEM:---------------------- [0:0;5fffffff] [0:a0000000;ffffffff] MOE: Hello world MOE: found 1027436 KByte free memory MOE: found RAM from 60000000 to 9f000000 MOE: allocated 1008 KByte for the page array @0x6018f000 MOE: virtual user address space [0-bfffffff] prog | l4sigma0_map_mem(64000000, 64000000, 1c000000) prog | l4sigma0_map_mem: size 1c000000; phys 64000000; virt 64000000 prog | [init] Error: Cannot map physical memory: (-2147451396) No fpage received.
Try mapping smaller chunks and/or try l4sigma0_map_anypage().
Adam
Adam adam@os.inf.tu-dresden.de Lackorzynski http://os.inf.tu-dresden.de/~adam/
l4-hackers mailing list l4-hackers@os.inf.tu-dresden.de http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers
On Tue, 2011-10-04 at 00:37 +0000, Wesley@wesman.net wrote:
On Thu Sep 29, 2011 at 15:34:38 -0700, Wesley Miaw wrote:
I'm having some trouble understanding the acceptable values usable in a call to l4sigma0_map_iomem....
But what addresses should be allowed? My Verstaile Express board has 1GB RAM starting at physical address 0x60000000 but I can't use this address.
l4sigma0_map_iomem is used to map IO-mem, i.e. non-RAM. For RAM (0x60000000-0x9fffffff) use l4sigma0_map_anypage()/l4sigma0_map_mem().
I tried requesting physical memory 0x60000000 of size 0x40000000 mapped onto virtual 0x60000000 using l4sigma0_map_mem() and am still getting the error. I also tried a few other smaller sizes like 0x80000000 size 0x20000000 and 0x64000000 size 0x1c000000. But they are all failing as well.
I thought based on the RAM printout maybe I had to request a portion that was in restricted to one of the "contiguous blocks" printed out. I think owner '0' equals Sigma0 and owner '4' equals Root, so Sigma0 should be able to give me 0x64000000 size 0x1c000000.
Here's some log output:
SIGMA0: Hello! KIP @ 60002000 allocated 4KB for maintenance structures SIGMA0: Dump of all resource maps RAM:------------------------ [0:60000000;60000fff] [0:60066000;6008ffff] [0:60097000;60097fff] [0:6009f000;6013ffff] [4:60140000;60176fff] [0:60177000;60177fff] [4:60178000;6018efff] [0:6018f000;6100efff] [4:6100f000;6100ffff] [0:61010000;6209afff] [4:6209b000;6247dfff] [0:6247e000;9effffff] IOMEM:---------------------- [0:0;5fffffff] [0:a0000000;ffffffff] MOE: Hello world MOE: found 1027436 KByte free memory MOE: found RAM from 60000000 to 9f000000 MOE: allocated 1008 KByte for the page array @0x6018f000 MOE: virtual user address space [0-bfffffff] prog | l4sigma0_map_mem(64000000, 64000000, 1c000000) prog | l4sigma0_map_mem: size 1c000000; phys 64000000; virt 64000000 prog | [init] Error: Cannot map physical memory: (-2147451396) No fpage received.
After Moe has started it has allocated all memory (RAM) from sigma0 and you cannot get any RAM from sigma0 any more. The dump is done at sigma0 startup and represents the initial memory regions. IOMEM is different and is MMIO of potential devices, the dump shows a0000000;ffffffff this memory is not allocated by Moe and can be requested from sigma0 via l4sigma0_map_iomem. Note, this is not RAM! And the requester needs to know what it is doing, you can easily crash the system when accessing MMIO memory the wrong way.
l4-hackers@os.inf.tu-dresden.de