Hi,

Blow is my setup details:

>>I have the below RAM:

    memory@48000000 {
        device_type = "memory";
        /* first 128MB is reserved for secure area. */
        reg = <0x0 0x48000000 0x0 0x78000000>;
    };

    memory@600000000 {
        device_type = "memory";
        reg = <0x6 0x00000000 0x0 0x80000000>;
    };

>>I have the below configuration for Linux in DTS to reserve the memory for 
Jailhouse,

    reserved-memory {
        #address-cells = <2>;
        #size-cells = <2>;
        ranges;

        jailhouse: jailhouse@58000000 {
            reg = <0x0 0x58000000 0x0 0x1000000>;
            no-map;
            status = "okay";
        };

        jh_inmate@59000000 {
            status = "okay";
            no-map;
            reg = <0x00 0x59000000 0x00 0x20000000>;
        };
    };

>>In the root cell configuration I have the RAM regions as below:

    .mem_regions = {
        /* RAM */ {
            .phys_start = 0x48000000,
            .virt_start = 0x48000000,
            .size = 0x10000000,
            .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
                JAILHOUSE_MEM_EXECUTE,
        },
        /* Leave hole for hypervisor */
        /* RAM */ {
            .phys_start = 0x79000000,
            .virt_start = 0x79000000,
            .size = 0x47000000,
            .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
                JAILHOUSE_MEM_EXECUTE,
        },
        /* RAM */ {
            .phys_start = 0x600000000,
            .virt_start = 0x600000000,
            .size = 0x80000000,
            .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
                JAILHOUSE_MEM_EXECUTE,
        },
....
}

>>And for the Linux inmate I have the memory regions as,

    .mem_regions = {
        /* RAM */ {
            .phys_start = 0x59000000,
            .virt_start = CONFIG_INMATE_BASE,
            .size = 0x20000000,
            .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
                JAILHOUSE_MEM_EXECUTE | JAILHOUSE_MEM_DMA |
                JAILHOUSE_MEM_LOADABLE,
        },
........
}

When I try and load the Linux image I am getting unhandled reads at the DDR 
location (0x59000000):

root@hihope-rzg2m:~# jailhouse cell linux renesas-r8a774a1-linux-demo.cell 
Image.gz -d inmate-r8a774a1-hihope.dtb -c "clk_ignore_unused rootwait rw"
Cell "renesas-r8a774a1-linux-demo" can be loaded
Unhandled data write at 0x59000000(1)

FATAL: unhandled trap (exception class 0x24)
Cell state before exception:
 pc: ffff8000104762f0   lr: ffff800008b10e64 spsr: 20000005     EL1
 sp: ffff8000118ebd40  elr: ffff8000104762f0  esr: 24 1 0000046
 x0: ffff800011640000   x1: 00000000016278c0   x2: 0000000000003440
 x3: 0000ffffffffffff   x4: 0000000000000000   x5: ffff8000116434c0
 x6: ffff800011640000   x7: d518c00058007c40   x8: 9100001f58007c40
 x9: d5181040d2a00600  x10: d5033fdfd51b423f  x11: d10403ff14000cb0
x12: a9010fe2a90007e0  x13: a9031fe6a90217e4  x14: a9052feaa90427e8
x15: 0000000000000000  x16: 0000000000000000  x17: 0000000000000000
x18: 0000000000000000  x19: ffff800011640000  x20: 00000000000034c0
x21: 0000ffffd57f1b28  x22: ffff800011109000  x23: 0000000000000000
x24: 00ffffd57f1b4800  x25: ffff8000118ebda8  x26: 0000000000000000
x27: ffff800011640000  x28: 00ffffd57f1b2800  x29: ffff8000118ebd40

Parking CPU 0 (Cell: "Renesas HopeRun HiHope RZ/G2M")
[  970.239415] Unable to handle kernel NULL pointer dereference at virtual 
address 0000000000000000
[  970.248241] Mem abort info:
[  970.251073]   ESR = 0x86000006
[  970.254150]   EC = 0x21: IABT (current EL), IL = 32 bits
[  970.259482]   SET = 0, FnV = 0
[  970.262555]   EA = 0, S1PTW = 0
[  970.265704] user pgtable: 4k pages, 48-bit VAs, pgdp=0000000604241000
[  970.272163] [0000000000000000] pgd=0000000602b44003, 
p4d=0000000602b44003, pud=0000000602b5b003, pmd=0000000000000000
[  970.282807] Internal error: Oops: 86000006 [#1] PREEMPT SMP
[  970.288386] Modules linked in: jailhouse(O)
[  970.292586] CPU: 0 PID: 396 Comm: python3 Tainted: G           O     
 5.10.31+ #36
[  970.300161] Hardware name: HopeRun HiHope RZ/G2M with sub board (DT)
[  970.306521] pstate: 20000005 (nzCv daif -PAN -UAO -TCO BTYPE=--)
[  970.312539] pc : 0x0
[  970.314737] lr : jailhouse_cmd_cell_load+0x2d4/0x3f8 [jailhouse]
[  970.320748] sp : ffff8000118ebd40
[  970.324067] x29: ffff8000118ebd40 x28: 00ffffd57f1b2800
[  970.329388] x27: ffff800011640000 x26: 0000000000000000
[  970.334707] x25: ffff8000118ebda8 x24: 00ffffd57f1b4800
[  970.340026] x23: 0000000000000000 x22: ffff800011109000
[  970.345345] x21: 0000ffffd57f1b28 x20: 00000000000034c0
[  970.350665] x19: ffff800011640000 x18: 0000000000000000
[  970.355984] x17: 0000000000000000 x16: 0000000000000000
[  970.361303] x15: 0000000000000000 x14: a9052feaa90427e8
[  970.366623] x13: a9031fe6a90217e4 x12: a9010fe2a90007e0
[  970.371942] x11: d10403ff14000cb0 x10: d5033fdfd51b423f
[  970.377262] x9 : d5181040d2a00600 x8 : 9100001f58007c40
[  970.382580] x7 : d518c00058007c40 x6 : ffff800011640000
[  970.387900] x5 : ffff8000116434c0 x4 : 0000000000000000
[  970.393220] x3 : 0000ffffffffffff x2 : 0000000000003440
[  970.398540] x1 : 00000000016278c0 x0 : ffff800011640000
[  970.403860] Call trace:
[  970.406313]  0x0
[  970.408161]  jailhouse_ioctl+0xd8/0x100 [jailhouse]
[  970.413053]  __arm64_sys_ioctl+0xac/0xf0
[  970.416985]  el0_svc_common.constprop.3+0x68/0x170
[  970.421782]  do_el0_svc+0x24/0x90
[  970.425105]  el0_svc+0x14/0x20
[  970.428165]  el0_sync_handler+0x90/0xb8
[  970.432008]  el0_sync+0x158/0x180
[  970.435335] Code: bad PC value
[  970.438406] ---[ end trace 23ec5ec9e67e1b67 ]---
[  970.443029] Kernel panic - not syncing: Oops: Fatal exception
[  970.448780] SMP: stopping secondary CPUs
[  970.452722] Kernel Offset: disabled
[  970.456217] CPU features: 0x0040022,21002004
[  970.460493] Memory Limit: none
[  970.463557] ---[ end Kernel panic - not syncing: Oops: Fatal exception 
]---

* Looking at some of the linux inmate  configs there are two regions of RAM 
specified is this a strict requirement?
* For the inmate RAM should the virt_start = CONFIG_INMATE_BASE?

Cheers,
Prabhakar

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jailhouse-dev/94bae287-eaf2-4ae2-bcdd-fc87342256e5n%40googlegroups.com.

Reply via email to