[okl4-developer] How to get rid of IRQ conflicts between two OK linux cells ?
Geoffrey Lee
glee at ok-labs.com
Sat Dec 6 00:14:50 EST 2008
On Fri, Dec 05, 2008 at 12:40:51PM +0100, Hugues Balp wrote:
>>
>>> The compilation is ok but elfweaver crashes because of an *out of
>>> memory* error
>>> detected by the memory allocator when trying to allocate the memory
>>> for the second
>>> ok_linux cell....
>> Hugues -
>>
>> Maybe you have run out of physical memory. The amount of memory
>> available to OK Linux is configured statically at build time via the
>> heap = argument in the OK Linux Sconscript. If you run out of physical
>> memory to back the heap then elfweaver will refuse to output the image.
>>
>>
>> The amount of physical memory is specified in the machine
>> description file in platform/<platform>/tools/machines.py.
>>
>> -gl
>>
> Thanks Geoffrey,
Hugues - specifying the add_device is equivalent to granting
access, you cannot grant access to two OK Linux instances
at the same time.
-gl
>
> now I can build the image.elf containing two ok linux cells after the
> following redefinitions of the versatile physical and rom memories
> in file okl4_3.0/platform/versatile/tools/machines.py
>
> #memory['physical'] = [Region(0x04100000L, 0x07900000L)]
> memory['physical'] = [Region(0x04100000L, 0x08900000L)]
> #memory['rom'] = [Region(0x07900000L, 0x08000000L)]
> memory['rom'] = [Region(0x08900000L, 0x09000000L)]
>
> The generated elfweaver merge specification file and memory usage reports
> are joined to this mail.
>
> The problem now is to configure correctly the IRQ and devices
> and to boot correctly both ok linux kernels.
>
> When trying to boot the image an IRQ conflict is raised for the
> serial device... as shown below:
>
> OKL4 - (provider: Open Kernel Labs) built on Dec 4 2008 12:12:26 using
> gcc version 3.4.4.
> PANIC in void ki_assign_irq(space_t*, ki_assign_irq_t*),
> pistachio/src/init_script.cc, line 648:
> ===> ASSIGN IRQ: irq=0xc
> --- KD# panic ---
> >
>
> In case I deactivate the use of the serial device in cell "ok_linux2",
> another IRQ conflict
> is raised for the timer device etc... until I comment all the devices in
> file okl4_3.0/cells/linux2/SConscript
> ( this last file results from a copy paste from file
> okl4_3.0/cells/linux/SConscript ) as follows:
>
> #rootserver_env.add_use_device(None, ["serial_dev"])
> #rootserver_env.add_use_device(None, ["timer_dev"])
> ##if rootserver_env.machine.__name__ in ["versatile", "versatile_uboot"]:
> # rootserver_env.add_use_device(None, ["eth_dev"])
> # rootserver_env.add_use_device(None, ["versatilesys_dev"])
> # rootserver_env.add_use_device(None, ["clcd_dev"])
> # rootserver_env.add_use_device(None, ["kmi0_dev"])
> # rootserver_env.add_use_device(None, ["kmi1_dev"])
>
> Once all devices are removed for the cell "ok_linux2", then no more IRQ
> conflicts is raised
> but the ok linux root cell doesn't boot even if the devices are well
> declared for this cell..
> After a system_reset in qemu at address 0x041000000L only one line is
> printed on the console
> and nothing else appends....
>
> OKL4 - (provider: Open Kernel Labs) built on Dec 4 2008 12:12:26 using
> gcc version 3.4.4.
> ...no boot...
>
> The question for me now is to understand how I can get rid of the IRQ
> conflicts between the two ok linux cells ?
> What are the main principles I should follow to get further ?
> You said that some folks have already resolved this kind of problem with
> L4 but outside okl4...
> Do you have some more informations on how they have handle the IRQ
> conflicts ?
> Is there a mean to map one IRQ on two different cells with some kind of
> multiplexing ?
>
> Best regards,
>
> Hugues Balp.
>
>
>
> <?xml version="1.0" ?>
> <!DOCTYPE image
> SYSTEM 'weaver-2.0.dtd'>
> <image>
> <machine>
> <cpu name="arm926ejs"/>
> <word_size size="0x20"/>
> <virtual_memory name="virtual">
> <region base="0x80000000" size="0x50000000"/>
> </virtual_memory>
> <physical_memory name="rom">
> <region base="0x8900000" rights="all" size="0x700000"/>
> </physical_memory>
> <physical_memory name="physical">
> <region base="0x4100000" rights="all" size="0x4800000"/>
> </physical_memory>
> <phys_device name="timer_dev">
> <physical_memory name="timer_mem0">
> <region base="0x101e3000" cache_policy="uncached" rights="all" size="0x1000"/>
> </physical_memory>
> <interrupt name="int_timer0" number="5"/>
> </phys_device>
> <phys_device name="serial_dev">
> <physical_memory name="serial_mem0">
> <region base="0x101f1000" cache_policy="uncached" rights="all" size="0x1000"/>
> </physical_memory>
> <interrupt name="int_serial0" number="12"/>
> </phys_device>
> <phys_device name="eth_dev">
> <physical_memory name="eth_mem0">
> <region base="0x10010000" cache_policy="uncached" rights="all" size="0x10000"/>
> </physical_memory>
> <interrupt name="int_eth0" number="25"/>
> </phys_device>
> <phys_device name="versatilesys_dev">
> <physical_memory name="versatilesys_mem0">
> <region base="0x10000000" cache_policy="uncached" rights="all" size="0x1000"/>
> </physical_memory>
> </phys_device>
> <phys_device name="kmi0_dev">
> <physical_memory name="kmi0_mem0">
> <region base="0x10006000" cache_policy="uncached" rights="all" size="0x1000"/>
> </physical_memory>
> <interrupt name="int_kmi00" number="35"/>
> </phys_device>
> <phys_device name="kmi1_dev">
> <physical_memory name="kmi1_mem0">
> <region base="0x10007000" cache_policy="uncached" rights="all" size="0x1000"/>
> </physical_memory>
> <interrupt name="int_kmi10" number="36"/>
> </phys_device>
> <phys_device name="clcd_dev">
> <physical_memory name="clcd_mem0">
> <region base="0x10120000" cache_policy="uncached" rights="all" size="0x1000"/>
> </physical_memory>
> <interrupt name="int_clcd0" number="16"/>
> </phys_device>
> <phys_device name="test_dev">
> <interrupt name="int_test0" number="6"/>
> <interrupt name="int_test1" number="7"/>
> </phys_device>
> <page_size size="0x1000"/>
> <page_size size="0x10000"/>
> <page_size size="0x100000"/>
> </machine>
> <physical_pool direct="true" name="rom">
> <memory src="rom"/>
> </physical_pool>
> <virtual_pool name="virtual">
> <memory src="virtual"/>
> </virtual_pool>
> <physical_pool direct="true" name="physical">
> <memory src="physical"/>
> </physical_pool>
> <kernel file="/home/hugues/tools/okl4/okl4_3.0/build/pistachio/bin/l4kernel" physpool="physical" virtpool="virtual"/>
> <linux clists="256" file="/home/hugues/tools/okl4/okl4_3.0/build/oklinux/wombat/vmlinux" kernel_heap="0x400000" mutexes="256" name="oklinux" spaces="128">
> <use_device name="serial_dev"/>
> <use_device name="timer_dev"/>
> <use_device name="eth_dev"/>
> <use_device name="versatilesys_dev"/>
> <use_device name="clcd_dev"/>
> <use_device name="kmi0_dev"/>
> <use_device name="kmi1_dev"/>
> <environment>
> <entry cap="heap/physical" key="heap_physical"/>
> <entry cap="/oklinux2/main" key="OK_LINUX_CELL_CAP"/>
> </environment>
> <memsection align="0x200000" attach="rwx" cache_policy="strong" mem_type="virtual" name="dma_heap_segment" size="0x200000"/>
> <memsection attach="rwx" mem_type="virtual" name="vmalloc" size="0x200000"/>
> <stack size="0x2000"/>
> <heap attach="rwx" size="0x1400000"/>
> <commandline>
> <arg value="vmlinux igms_name=ramdisk root=/dev/igms0 console=ttyAMA0,115200"/>
> </commandline>
> <memsection align="0x100000" file="/home/hugues/tools/okl4/okl4_3.0/build/linux/ext2ramdisk" name="rootfs"/>
> </linux>
> <linux clists="256" file="/home/hugues/tools/okl4/okl4_3.0/build/oklinux2/wombat/vmlinux" kernel_heap="0x400000" mutexes="256" name="oklinux2" spaces="128">
> <environment>
> <entry cap="heap/physical" key="heap_physical"/>
> <entry cap="/oklinux/main" key="ROOT_CELL_CAP"/>
> <entry key="OK_LINUX_CELL_CAP" value="1"/>
> </environment>
> <memsection align="0x200000" attach="rwx" cache_policy="strong" mem_type="virtual" name="dma_heap_segment" size="0x200000"/>
> <memsection attach="rwx" mem_type="virtual" name="vmalloc" size="0x200000"/>
> <stack size="0x2000"/>
> <heap attach="rwx" size="0x1400000"/>
> <commandline>
> <arg value="vmlinux igms_name=ramdisk root=/dev/igms0 console=ttyS0,115200"/>
> </commandline>
> <memsection align="0x100000" file="/home/hugues/tools/okl4/okl4_3.0/build/linux2/ext2ramdisk" name="rootfs"/>
> </linux>
> </image>
>
> Memory in Use at end of initialization
> =======================================
>
> Memory claimed by ELF image:
> 11 Segments giving 16086KB
>
> SAS1:
> 12 additional sections giving 41079KB
>
> Cell 1:
> Heap: 4096KB
>
> Cell 2:
> Heap: 4096KB
>
> Total Memory claimed for use: 65357KB
>
> Physical memory remaining: 8371KB of 73728KB
>
> Statistics for program kernel:
>
> Sections (with debug and empty sections dropped):
>
> kernel.text 85028 Bytes
> kernel.rodata 33075 Bytes
> kernel.init 6824 Bytes
> kernel.roinit 4 Bytes
> kernel.elfweaver_info 104 Bytes
> kernel.data 5600 Bytes
> kernel.got 4 Bytes
> kernel.got.plt 12 Bytes
> kernel.bss 11560 Bytes
> kernel.kspace 16384 Bytes
> kernel.traps 4096 Bytes
> kernel.utcb_page 4096 Bytes
> initscript 4096 Bytes
>
> Total static size by sections (unrounded) is 166.88 KB
>
> Size by rounded segments (3 total) is 188.00 KB (47 pages)
>
> Statistics for program vmlinux:
>
> Sections (with debug and empty sections dropped):
>
> vmlinux.text 1724416 Bytes
> vmlinux.data 102400 Bytes
> 5734400 Bytes
> 2891 Bytes
> vmlinux.text 1724416 Bytes
> vmlinux.data 102400 Bytes
> 5734400 Bytes
> 3391 Bytes
>
> Total static size by sections (unrounded) is 14774.13 KB
>
> Size by rounded segments (8 total) is 15904.00 KB (3976 pages)
>
> Statistics for program vmlinux:
>
> Sections (with debug and empty sections dropped):
>
> vmlinux.text 1724416 Bytes
> vmlinux.data 102400 Bytes
> 5734400 Bytes
> 2891 Bytes
> vmlinux.text 1724416 Bytes
> vmlinux.data 102400 Bytes
> 5734400 Bytes
> 3391 Bytes
>
> Total static size by sections (unrounded) is 14774.13 KB
>
> Size by rounded segments (8 total) is 15904.00 KB (3976 pages)
>
>
>
> ID usage
> =========
>
> Type spaceid 256 available, 256 allocated to spaces, 2 used
> Type clistid 512 available, 512 allocated to spaces, 2 used
> Type mutexid 512 available, 512 allocated to spaces, 0 used
> Type thread_handles 4092 available, 4092 allocated to spaces, 2 used
> Type capabilities0 1024 available, 1024 allocated to spaces, 1 used
> Type capabilities256 1024 available, 1024 allocated to spaces, 1 used
>
>
> Heap Usage
> ===========
>
> Cell 1:
> Heap is Heap0 - size 4096KB with 71KB used
>
> Cell 2:
> Heap is Heap1 - size 4096KB with 62KB used
>
>
>
> Quick summary of environment:
>
> In kernel:
> Space called kspace
> Id Ranges:
> Pools:
> vm0 on kspc
> Programs:
> kernel with 15 sections
>
> In Cell oklinux2:
> Space called oklinux2
> Id Ranges:
> 4092 for threads
> 128 for spaces
> 256 for clists
> 256 for mutexes
> Pools:
> vm1 on vm_pool0
> Programs:
> vmlinux with 20 sections
>
> In Cell oklinux:
> Space called oklinux
> Id Ranges:
> 4092 for threads
> 128 for spaces
> 256 for clists
> 256 for mutexes
> Pools:
> vm2 on vm_pool1
> Programs:
> vmlinux with 20 sections
>
> _______________________________________________
> Developer mailing list
> Developer at okl4.org
> https://lists.okl4.org/mailman/listinfo/developer
--
More information about the Developer
mailing list