Re: [EXTERNAL] Re: Try jailhouse on Orange Pi Zero

2018-04-13 Thread Qiu Shui
On Thursday, April 12, 2018 at 8:19:50 PM UTC+8, Qiu Shui wrote:
> On Monday, April 9, 2018 at 8:26:56 PM UTC+8, Qiu Shui wrote:
> > On Monday, April 9, 2018 at 5:40:48 PM UTC+8, Qiu Shui wrote:
> > > On Monday, April 9, 2018 at 2:19:13 PM UTC+8, J. Kiszka wrote:
> > > > On 2018-04-09 02:42, Qiu Shui wrote:
> > > > > On Sunday, April 8, 2018 at 2:18:28 PM UTC+8, Qiu Shui wrote:
> > > > >> On Sunday, April 8, 2018 at 11:29:01 AM UTC+8, Qiu Shui wrote:
> > > > >>> On Monday, April 2, 2018 at 4:33:40 PM UTC+8, Qiu Shui wrote:
> > > >  On Monday, April 2, 2018 at 3:05:08 PM UTC+8, Nikhil Devshatwar 
> > > >  wrote:
> > > > > On Monday 02 April 2018 11:16 AM, Qiu Shui wrote:
> > > > >> On Monday, April 2, 2018 at 11:12:12 AM UTC+8, Qiu Shui wrote:
> > > > >>> On Thursday, March 29, 2018 at 1:09:46 PM UTC+8, Jan Kiszka 
> > > > >>> wrote:
> > > >  On 2018-03-29 06:36, Qiu Shui wrote:
> > > > > I build the armbian with these two patches to the kernel:
> > > > > [1]
> > > > > http://git.kiszka.org/?p=linux.git;a=commit;h=f057e9bb4ba2fca0b435d36893eb41ddd57b4208
> > > > > [2]
> > > > > http://git.kiszka.org/?p=linux.git;a=commit;h=1c926e27072d4cca76a756058554485067ce472b
> > > > >
> > > > > But when I build jailhouse with the armbian kernel source 
> > > > > files(version: Linux orangepizero 4.16.0-rc6-sunxi #2 SMP Wed 
> > > > > Mar 28 15:33:44 CST 2018 armv7l GNU/Linux), I got these 
> > > > > warnings:
> > > > > WARNING: "__stack_chk_fail" 
> > > > > [/home/liu/project/kiszka/jailhouse-0.8/driver/jailhouse.ko] 
> > > > > undefined!
> > > > > WARNING: "__hyp_stub_vectors" 
> > > > > [/home/liu/project/kiszka/jailhouse-0.8/driver/jailhouse.ko] 
> > > > > undefined!
> > > > > WARNING: "__stack_chk_guard" 
> > > > > [/home/liu/project/kiszka/jailhouse-0.8/driver/jailhouse.ko] 
> > > > > undefined!
> > > > >
> > > > > I have tried some google solutions but still not solved.
> > > > >
> > > > > Are there any suggestions?
> > > > 
> > > >  Regarding __hyp_stub_vectors: you also need
> > > >  http://git.kiszka.org/?p=linux.git;a=commitdiff;h=2a681cb2213e3ea0f142fae7345fb80208a88a53
> > > > 
> > > >  The other two issue seem to be related to some build 
> > > >  inconsistency: Your
> > > >  kernel was built without CONFIG_CC_STACKPROTECTOR, but when 
> > > >  you build
> > > >  the Jailhouse module, this feature is considered to be enabled.
> > > > 
> > > >  Jan
> > > > >>>
> > > > >>> Thank you very much!
> > > > >>> After two days trying, I've finally built the kernel and 
> > > > >>> jailhouse module successfully.
> > > > >>> (I am using armbian building scripts and modified the 
> > > > >>> linux-sunxi-dev.config with "# CONFIG_THUMB2_KERNEL is not set")
> > > > >>>
> > > > >>> Now I can enable jailhouse and create cell:
> > > > >>> # jailhouse enable configs/orangepi0.cell
> > > > >>> # jailhouse cell create configs/orangepi0-gic-demo.cell
> > > > >>> # jailhouse cell list
> > > > >>> ID  NameState   Assigned CPUs   
> > > > >>> Failed CPUs
> > > > >>> 0   Orange-Pi0  running 0,2-3
> > > > >>> 1   orangepi0-gic-demo  shut down   1
> > > > >>>
> > > > >>> But when I load the gic-demo.bin, it failed:
> > > > >>> # jailhouse cell load orangepi0-gic-demo 
> > > > >>> inmates/demos/arm/gic-demo.bin
> > > > >>> Unhandled data read at 0x1f0(4)
> > > > >>> FATAL: unhandled trap (exception class 0x24)
> > > > >>> pc=0xc08cc6c0 cpsr=0x2013 hsr=0x93830007
> > > > >>> r0=0x0190 r1=0x0002 r2=0xa035 r3=0xcf807000
> > > > >>> r4=0xcda54e10 r5=0xc1103d00 r6=0x00300402 r7=0xcd8d7480
> > > > >>> r8=0x0002300c r9=0x0285 r10=0x r11=0xcda47df4
> > > > >>> r12=0x0030 r13=0xcda47dd0 r14=0xc08c9ab8
> > > > >>> Parking CPU 3 (Cell: "Orange-Pi0")
> > > > >>> Cell "orangepi0-gic-demo" can be loaded
> > > > >>>
> > > > >>> Any suggestions would be greatly appreciated :)
> > > > >>>
> > > > >>> Is there any demo can be used to make sure my jailhouse 
> > > > >>> environments are ready?
> > > > >>>
> > > > >>> Thanks!
> > > > >>
> > > > >> I solved this problem by trying some different memory 
> > > > >> configurations.
> > > > >> The following does work:
> > > > >> mem=448M vmalloc=256M
> > > > >> /* Orangepi0.c */
> > > > >>  .hypervisor_memory = {
> > > > >>  .phys_start = 0x5f80,
> > > > >>  .size = 0x80,
> > > > >>  },
> > > > >> ...
> > > > >>  /* RAM */ {
> > > > >>  

Re: [EXTERNAL] Re: Try jailhouse on Orange Pi Zero

2018-04-12 Thread Qiu Shui
On Monday, April 9, 2018 at 8:26:56 PM UTC+8, Qiu Shui wrote:
> On Monday, April 9, 2018 at 5:40:48 PM UTC+8, Qiu Shui wrote:
> > On Monday, April 9, 2018 at 2:19:13 PM UTC+8, J. Kiszka wrote:
> > > On 2018-04-09 02:42, Qiu Shui wrote:
> > > > On Sunday, April 8, 2018 at 2:18:28 PM UTC+8, Qiu Shui wrote:
> > > >> On Sunday, April 8, 2018 at 11:29:01 AM UTC+8, Qiu Shui wrote:
> > > >>> On Monday, April 2, 2018 at 4:33:40 PM UTC+8, Qiu Shui wrote:
> > >  On Monday, April 2, 2018 at 3:05:08 PM UTC+8, Nikhil Devshatwar 
> > >  wrote:
> > > > On Monday 02 April 2018 11:16 AM, Qiu Shui wrote:
> > > >> On Monday, April 2, 2018 at 11:12:12 AM UTC+8, Qiu Shui wrote:
> > > >>> On Thursday, March 29, 2018 at 1:09:46 PM UTC+8, Jan Kiszka wrote:
> > >  On 2018-03-29 06:36, Qiu Shui wrote:
> > > > I build the armbian with these two patches to the kernel:
> > > > [1]
> > > > http://git.kiszka.org/?p=linux.git;a=commit;h=f057e9bb4ba2fca0b435d36893eb41ddd57b4208
> > > > [2]
> > > > http://git.kiszka.org/?p=linux.git;a=commit;h=1c926e27072d4cca76a756058554485067ce472b
> > > >
> > > > But when I build jailhouse with the armbian kernel source 
> > > > files(version: Linux orangepizero 4.16.0-rc6-sunxi #2 SMP Wed 
> > > > Mar 28 15:33:44 CST 2018 armv7l GNU/Linux), I got these 
> > > > warnings:
> > > > WARNING: "__stack_chk_fail" 
> > > > [/home/liu/project/kiszka/jailhouse-0.8/driver/jailhouse.ko] 
> > > > undefined!
> > > > WARNING: "__hyp_stub_vectors" 
> > > > [/home/liu/project/kiszka/jailhouse-0.8/driver/jailhouse.ko] 
> > > > undefined!
> > > > WARNING: "__stack_chk_guard" 
> > > > [/home/liu/project/kiszka/jailhouse-0.8/driver/jailhouse.ko] 
> > > > undefined!
> > > >
> > > > I have tried some google solutions but still not solved.
> > > >
> > > > Are there any suggestions?
> > > 
> > >  Regarding __hyp_stub_vectors: you also need
> > >  http://git.kiszka.org/?p=linux.git;a=commitdiff;h=2a681cb2213e3ea0f142fae7345fb80208a88a53
> > > 
> > >  The other two issue seem to be related to some build 
> > >  inconsistency: Your
> > >  kernel was built without CONFIG_CC_STACKPROTECTOR, but when you 
> > >  build
> > >  the Jailhouse module, this feature is considered to be enabled.
> > > 
> > >  Jan
> > > >>>
> > > >>> Thank you very much!
> > > >>> After two days trying, I've finally built the kernel and 
> > > >>> jailhouse module successfully.
> > > >>> (I am using armbian building scripts and modified the 
> > > >>> linux-sunxi-dev.config with "# CONFIG_THUMB2_KERNEL is not set")
> > > >>>
> > > >>> Now I can enable jailhouse and create cell:
> > > >>> # jailhouse enable configs/orangepi0.cell
> > > >>> # jailhouse cell create configs/orangepi0-gic-demo.cell
> > > >>> # jailhouse cell list
> > > >>> ID  NameState   Assigned CPUs 
> > > >>>   Failed CPUs
> > > >>> 0   Orange-Pi0  running 0,2-3
> > > >>> 1   orangepi0-gic-demo  shut down   1
> > > >>>
> > > >>> But when I load the gic-demo.bin, it failed:
> > > >>> # jailhouse cell load orangepi0-gic-demo 
> > > >>> inmates/demos/arm/gic-demo.bin
> > > >>> Unhandled data read at 0x1f0(4)
> > > >>> FATAL: unhandled trap (exception class 0x24)
> > > >>> pc=0xc08cc6c0 cpsr=0x2013 hsr=0x93830007
> > > >>> r0=0x0190 r1=0x0002 r2=0xa035 r3=0xcf807000
> > > >>> r4=0xcda54e10 r5=0xc1103d00 r6=0x00300402 r7=0xcd8d7480
> > > >>> r8=0x0002300c r9=0x0285 r10=0x r11=0xcda47df4
> > > >>> r12=0x0030 r13=0xcda47dd0 r14=0xc08c9ab8
> > > >>> Parking CPU 3 (Cell: "Orange-Pi0")
> > > >>> Cell "orangepi0-gic-demo" can be loaded
> > > >>>
> > > >>> Any suggestions would be greatly appreciated :)
> > > >>>
> > > >>> Is there any demo can be used to make sure my jailhouse 
> > > >>> environments are ready?
> > > >>>
> > > >>> Thanks!
> > > >>
> > > >> I solved this problem by trying some different memory 
> > > >> configurations.
> > > >> The following does work:
> > > >> mem=448M vmalloc=256M
> > > >> /* Orangepi0.c */
> > > >>.hypervisor_memory = {
> > > >>.phys_start = 0x5f80,
> > > >>.size = 0x80,
> > > >>},
> > > >> ...
> > > >>/* RAM */ {
> > > >>.phys_start = 0x4000,
> > > >>.virt_start = 0x4000,
> > > >>.size =0x1f70,
> > > >>.flags = JAILHOUSE_MEM_READ | 
> > > >> JAILHOUSE_MEM_WRITE |
> > > >>   

Re: [EXTERNAL] Re: Try jailhouse on Orange Pi Zero

2018-04-09 Thread Qiu Shui
On Monday, April 9, 2018 at 5:40:48 PM UTC+8, Qiu Shui wrote:
> On Monday, April 9, 2018 at 2:19:13 PM UTC+8, J. Kiszka wrote:
> > On 2018-04-09 02:42, Qiu Shui wrote:
> > > On Sunday, April 8, 2018 at 2:18:28 PM UTC+8, Qiu Shui wrote:
> > >> On Sunday, April 8, 2018 at 11:29:01 AM UTC+8, Qiu Shui wrote:
> > >>> On Monday, April 2, 2018 at 4:33:40 PM UTC+8, Qiu Shui wrote:
> >  On Monday, April 2, 2018 at 3:05:08 PM UTC+8, Nikhil Devshatwar wrote:
> > > On Monday 02 April 2018 11:16 AM, Qiu Shui wrote:
> > >> On Monday, April 2, 2018 at 11:12:12 AM UTC+8, Qiu Shui wrote:
> > >>> On Thursday, March 29, 2018 at 1:09:46 PM UTC+8, Jan Kiszka wrote:
> >  On 2018-03-29 06:36, Qiu Shui wrote:
> > > I build the armbian with these two patches to the kernel:
> > > [1]
> > > http://git.kiszka.org/?p=linux.git;a=commit;h=f057e9bb4ba2fca0b435d36893eb41ddd57b4208
> > > [2]
> > > http://git.kiszka.org/?p=linux.git;a=commit;h=1c926e27072d4cca76a756058554485067ce472b
> > >
> > > But when I build jailhouse with the armbian kernel source 
> > > files(version: Linux orangepizero 4.16.0-rc6-sunxi #2 SMP Wed Mar 
> > > 28 15:33:44 CST 2018 armv7l GNU/Linux), I got these warnings:
> > > WARNING: "__stack_chk_fail" 
> > > [/home/liu/project/kiszka/jailhouse-0.8/driver/jailhouse.ko] 
> > > undefined!
> > > WARNING: "__hyp_stub_vectors" 
> > > [/home/liu/project/kiszka/jailhouse-0.8/driver/jailhouse.ko] 
> > > undefined!
> > > WARNING: "__stack_chk_guard" 
> > > [/home/liu/project/kiszka/jailhouse-0.8/driver/jailhouse.ko] 
> > > undefined!
> > >
> > > I have tried some google solutions but still not solved.
> > >
> > > Are there any suggestions?
> > 
> >  Regarding __hyp_stub_vectors: you also need
> >  http://git.kiszka.org/?p=linux.git;a=commitdiff;h=2a681cb2213e3ea0f142fae7345fb80208a88a53
> > 
> >  The other two issue seem to be related to some build 
> >  inconsistency: Your
> >  kernel was built without CONFIG_CC_STACKPROTECTOR, but when you 
> >  build
> >  the Jailhouse module, this feature is considered to be enabled.
> > 
> >  Jan
> > >>>
> > >>> Thank you very much!
> > >>> After two days trying, I've finally built the kernel and jailhouse 
> > >>> module successfully.
> > >>> (I am using armbian building scripts and modified the 
> > >>> linux-sunxi-dev.config with "# CONFIG_THUMB2_KERNEL is not set")
> > >>>
> > >>> Now I can enable jailhouse and create cell:
> > >>> # jailhouse enable configs/orangepi0.cell
> > >>> # jailhouse cell create configs/orangepi0-gic-demo.cell
> > >>> # jailhouse cell list
> > >>> ID  NameState   Assigned CPUs   
> > >>> Failed CPUs
> > >>> 0   Orange-Pi0  running 0,2-3
> > >>> 1   orangepi0-gic-demo  shut down   1
> > >>>
> > >>> But when I load the gic-demo.bin, it failed:
> > >>> # jailhouse cell load orangepi0-gic-demo 
> > >>> inmates/demos/arm/gic-demo.bin
> > >>> Unhandled data read at 0x1f0(4)
> > >>> FATAL: unhandled trap (exception class 0x24)
> > >>> pc=0xc08cc6c0 cpsr=0x2013 hsr=0x93830007
> > >>> r0=0x0190 r1=0x0002 r2=0xa035 r3=0xcf807000
> > >>> r4=0xcda54e10 r5=0xc1103d00 r6=0x00300402 r7=0xcd8d7480
> > >>> r8=0x0002300c r9=0x0285 r10=0x r11=0xcda47df4
> > >>> r12=0x0030 r13=0xcda47dd0 r14=0xc08c9ab8
> > >>> Parking CPU 3 (Cell: "Orange-Pi0")
> > >>> Cell "orangepi0-gic-demo" can be loaded
> > >>>
> > >>> Any suggestions would be greatly appreciated :)
> > >>>
> > >>> Is there any demo can be used to make sure my jailhouse 
> > >>> environments are ready?
> > >>>
> > >>> Thanks!
> > >>
> > >> I solved this problem by trying some different memory configurations.
> > >> The following does work:
> > >> mem=448M vmalloc=256M
> > >> /* Orangepi0.c */
> > >>  .hypervisor_memory = {
> > >>  .phys_start = 0x5f80,
> > >>  .size = 0x80,
> > >>  },
> > >> ...
> > >>  /* RAM */ {
> > >>  .phys_start = 0x4000,
> > >>  .virt_start = 0x4000,
> > >>  .size =0x1f70,
> > >>  .flags = JAILHOUSE_MEM_READ | 
> > >> JAILHOUSE_MEM_WRITE |
> > >>  JAILHOUSE_MEM_EXECUTE,
> > >>  },
> > >>  /* IVSHMEM shared memory region */ {
> > >>  .phys_start = 0x5f70,
> > >>  .virt_start = 0x5f70,
> > >>   

Re: [EXTERNAL] Re: Try jailhouse on Orange Pi Zero

2018-04-09 Thread Qiu Shui
On Monday, April 9, 2018 at 2:19:13 PM UTC+8, J. Kiszka wrote:
> On 2018-04-09 02:42, Qiu Shui wrote:
> > On Sunday, April 8, 2018 at 2:18:28 PM UTC+8, Qiu Shui wrote:
> >> On Sunday, April 8, 2018 at 11:29:01 AM UTC+8, Qiu Shui wrote:
> >>> On Monday, April 2, 2018 at 4:33:40 PM UTC+8, Qiu Shui wrote:
>  On Monday, April 2, 2018 at 3:05:08 PM UTC+8, Nikhil Devshatwar wrote:
> > On Monday 02 April 2018 11:16 AM, Qiu Shui wrote:
> >> On Monday, April 2, 2018 at 11:12:12 AM UTC+8, Qiu Shui wrote:
> >>> On Thursday, March 29, 2018 at 1:09:46 PM UTC+8, Jan Kiszka wrote:
>  On 2018-03-29 06:36, Qiu Shui wrote:
> > I build the armbian with these two patches to the kernel:
> > [1]
> > http://git.kiszka.org/?p=linux.git;a=commit;h=f057e9bb4ba2fca0b435d36893eb41ddd57b4208
> > [2]
> > http://git.kiszka.org/?p=linux.git;a=commit;h=1c926e27072d4cca76a756058554485067ce472b
> >
> > But when I build jailhouse with the armbian kernel source 
> > files(version: Linux orangepizero 4.16.0-rc6-sunxi #2 SMP Wed Mar 
> > 28 15:33:44 CST 2018 armv7l GNU/Linux), I got these warnings:
> > WARNING: "__stack_chk_fail" 
> > [/home/liu/project/kiszka/jailhouse-0.8/driver/jailhouse.ko] 
> > undefined!
> > WARNING: "__hyp_stub_vectors" 
> > [/home/liu/project/kiszka/jailhouse-0.8/driver/jailhouse.ko] 
> > undefined!
> > WARNING: "__stack_chk_guard" 
> > [/home/liu/project/kiszka/jailhouse-0.8/driver/jailhouse.ko] 
> > undefined!
> >
> > I have tried some google solutions but still not solved.
> >
> > Are there any suggestions?
> 
>  Regarding __hyp_stub_vectors: you also need
>  http://git.kiszka.org/?p=linux.git;a=commitdiff;h=2a681cb2213e3ea0f142fae7345fb80208a88a53
> 
>  The other two issue seem to be related to some build inconsistency: 
>  Your
>  kernel was built without CONFIG_CC_STACKPROTECTOR, but when you build
>  the Jailhouse module, this feature is considered to be enabled.
> 
>  Jan
> >>>
> >>> Thank you very much!
> >>> After two days trying, I've finally built the kernel and jailhouse 
> >>> module successfully.
> >>> (I am using armbian building scripts and modified the 
> >>> linux-sunxi-dev.config with "# CONFIG_THUMB2_KERNEL is not set")
> >>>
> >>> Now I can enable jailhouse and create cell:
> >>> # jailhouse enable configs/orangepi0.cell
> >>> # jailhouse cell create configs/orangepi0-gic-demo.cell
> >>> # jailhouse cell list
> >>> ID  NameState   Assigned CPUs 
> >>>   Failed CPUs
> >>> 0   Orange-Pi0  running 0,2-3
> >>> 1   orangepi0-gic-demo  shut down   1
> >>>
> >>> But when I load the gic-demo.bin, it failed:
> >>> # jailhouse cell load orangepi0-gic-demo 
> >>> inmates/demos/arm/gic-demo.bin
> >>> Unhandled data read at 0x1f0(4)
> >>> FATAL: unhandled trap (exception class 0x24)
> >>> pc=0xc08cc6c0 cpsr=0x2013 hsr=0x93830007
> >>> r0=0x0190 r1=0x0002 r2=0xa035 r3=0xcf807000
> >>> r4=0xcda54e10 r5=0xc1103d00 r6=0x00300402 r7=0xcd8d7480
> >>> r8=0x0002300c r9=0x0285 r10=0x r11=0xcda47df4
> >>> r12=0x0030 r13=0xcda47dd0 r14=0xc08c9ab8
> >>> Parking CPU 3 (Cell: "Orange-Pi0")
> >>> Cell "orangepi0-gic-demo" can be loaded
> >>>
> >>> Any suggestions would be greatly appreciated :)
> >>>
> >>> Is there any demo can be used to make sure my jailhouse environments 
> >>> are ready?
> >>>
> >>> Thanks!
> >>
> >> I solved this problem by trying some different memory configurations.
> >> The following does work:
> >> mem=448M vmalloc=256M
> >> /* Orangepi0.c */
> >>.hypervisor_memory = {
> >>.phys_start = 0x5f80,
> >>.size = 0x80,
> >>},
> >> ...
> >>/* RAM */ {
> >>.phys_start = 0x4000,
> >>.virt_start = 0x4000,
> >>.size =0x1f70,
> >>.flags = JAILHOUSE_MEM_READ | 
> >> JAILHOUSE_MEM_WRITE |
> >>JAILHOUSE_MEM_EXECUTE,
> >>},
> >>/* IVSHMEM shared memory region */ {
> >>.phys_start = 0x5f70,
> >>.virt_start = 0x5f70,
> >>.size = 0x10,
> >>.flags = JAILHOUSE_MEM_READ | 
> >> JAILHOUSE_MEM_WRITE,
> >>},
> >> 
> >>
> >> But if I use the following configuration. When I 

Re: [EXTERNAL] Re: Try jailhouse on Orange Pi Zero

2018-04-09 Thread Jan Kiszka
On 2018-04-09 02:42, Qiu Shui wrote:
> On Sunday, April 8, 2018 at 2:18:28 PM UTC+8, Qiu Shui wrote:
>> On Sunday, April 8, 2018 at 11:29:01 AM UTC+8, Qiu Shui wrote:
>>> On Monday, April 2, 2018 at 4:33:40 PM UTC+8, Qiu Shui wrote:
 On Monday, April 2, 2018 at 3:05:08 PM UTC+8, Nikhil Devshatwar wrote:
> On Monday 02 April 2018 11:16 AM, Qiu Shui wrote:
>> On Monday, April 2, 2018 at 11:12:12 AM UTC+8, Qiu Shui wrote:
>>> On Thursday, March 29, 2018 at 1:09:46 PM UTC+8, Jan Kiszka wrote:
 On 2018-03-29 06:36, Qiu Shui wrote:
> I build the armbian with these two patches to the kernel:
> [1]
> http://git.kiszka.org/?p=linux.git;a=commit;h=f057e9bb4ba2fca0b435d36893eb41ddd57b4208
> [2]
> http://git.kiszka.org/?p=linux.git;a=commit;h=1c926e27072d4cca76a756058554485067ce472b
>
> But when I build jailhouse with the armbian kernel source 
> files(version: Linux orangepizero 4.16.0-rc6-sunxi #2 SMP Wed Mar 28 
> 15:33:44 CST 2018 armv7l GNU/Linux), I got these warnings:
> WARNING: "__stack_chk_fail" 
> [/home/liu/project/kiszka/jailhouse-0.8/driver/jailhouse.ko] 
> undefined!
> WARNING: "__hyp_stub_vectors" 
> [/home/liu/project/kiszka/jailhouse-0.8/driver/jailhouse.ko] 
> undefined!
> WARNING: "__stack_chk_guard" 
> [/home/liu/project/kiszka/jailhouse-0.8/driver/jailhouse.ko] 
> undefined!
>
> I have tried some google solutions but still not solved.
>
> Are there any suggestions?

 Regarding __hyp_stub_vectors: you also need
 http://git.kiszka.org/?p=linux.git;a=commitdiff;h=2a681cb2213e3ea0f142fae7345fb80208a88a53

 The other two issue seem to be related to some build inconsistency: 
 Your
 kernel was built without CONFIG_CC_STACKPROTECTOR, but when you build
 the Jailhouse module, this feature is considered to be enabled.

 Jan
>>>
>>> Thank you very much!
>>> After two days trying, I've finally built the kernel and jailhouse 
>>> module successfully.
>>> (I am using armbian building scripts and modified the 
>>> linux-sunxi-dev.config with "# CONFIG_THUMB2_KERNEL is not set")
>>>
>>> Now I can enable jailhouse and create cell:
>>> # jailhouse enable configs/orangepi0.cell
>>> # jailhouse cell create configs/orangepi0-gic-demo.cell
>>> # jailhouse cell list
>>> ID  NameState   Assigned CPUs   
>>> Failed CPUs
>>> 0   Orange-Pi0  running 0,2-3
>>> 1   orangepi0-gic-demo  shut down   1
>>>
>>> But when I load the gic-demo.bin, it failed:
>>> # jailhouse cell load orangepi0-gic-demo inmates/demos/arm/gic-demo.bin
>>> Unhandled data read at 0x1f0(4)
>>> FATAL: unhandled trap (exception class 0x24)
>>> pc=0xc08cc6c0 cpsr=0x2013 hsr=0x93830007
>>> r0=0x0190 r1=0x0002 r2=0xa035 r3=0xcf807000
>>> r4=0xcda54e10 r5=0xc1103d00 r6=0x00300402 r7=0xcd8d7480
>>> r8=0x0002300c r9=0x0285 r10=0x r11=0xcda47df4
>>> r12=0x0030 r13=0xcda47dd0 r14=0xc08c9ab8
>>> Parking CPU 3 (Cell: "Orange-Pi0")
>>> Cell "orangepi0-gic-demo" can be loaded
>>>
>>> Any suggestions would be greatly appreciated :)
>>>
>>> Is there any demo can be used to make sure my jailhouse environments 
>>> are ready?
>>>
>>> Thanks!
>>
>> I solved this problem by trying some different memory configurations.
>> The following does work:
>> mem=448M vmalloc=256M
>> /* Orangepi0.c */
>>  .hypervisor_memory = {
>>  .phys_start = 0x5f80,
>>  .size = 0x80,
>>  },
>> ...
>>  /* RAM */ {
>>  .phys_start = 0x4000,
>>  .virt_start = 0x4000,
>>  .size =0x1f70,
>>  .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
>>  JAILHOUSE_MEM_EXECUTE,
>>  },
>>  /* IVSHMEM shared memory region */ {
>>  .phys_start = 0x5f70,
>>  .virt_start = 0x5f70,
>>  .size = 0x10,
>>  .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE,
>>  },
>> 
>>
>> But if I use the following configuration. When I enable jailhouse, it 
>> says "JAILHOUSE_ENABLE: Invalid argument".
>> /* orangepi0.c */
>>  .hypervisor_memory = {
>>  .phys_start = 0x5c00,
>>  .size = 0x400,
>>  },
>> ..
>>  /* RAM */ {
>>  .phys_start = 0x4000,
>>  .virt_start = 0x4000,
>>

Re: [EXTERNAL] Re: Try jailhouse on Orange Pi Zero

2018-04-08 Thread Qiu Shui
On Sunday, April 8, 2018 at 2:18:28 PM UTC+8, Qiu Shui wrote:
> On Sunday, April 8, 2018 at 11:29:01 AM UTC+8, Qiu Shui wrote:
> > On Monday, April 2, 2018 at 4:33:40 PM UTC+8, Qiu Shui wrote:
> > > On Monday, April 2, 2018 at 3:05:08 PM UTC+8, Nikhil Devshatwar wrote:
> > > > On Monday 02 April 2018 11:16 AM, Qiu Shui wrote:
> > > > > On Monday, April 2, 2018 at 11:12:12 AM UTC+8, Qiu Shui wrote:
> > > > >> On Thursday, March 29, 2018 at 1:09:46 PM UTC+8, Jan Kiszka wrote:
> > > > >>> On 2018-03-29 06:36, Qiu Shui wrote:
> > > >  I build the armbian with these two patches to the kernel:
> > > >  [1]
> > > >  http://git.kiszka.org/?p=linux.git;a=commit;h=f057e9bb4ba2fca0b435d36893eb41ddd57b4208
> > > >  [2]
> > > >  http://git.kiszka.org/?p=linux.git;a=commit;h=1c926e27072d4cca76a756058554485067ce472b
> > > > 
> > > >  But when I build jailhouse with the armbian kernel source 
> > > >  files(version: Linux orangepizero 4.16.0-rc6-sunxi #2 SMP Wed Mar 
> > > >  28 15:33:44 CST 2018 armv7l GNU/Linux), I got these warnings:
> > > >  WARNING: "__stack_chk_fail" 
> > > >  [/home/liu/project/kiszka/jailhouse-0.8/driver/jailhouse.ko] 
> > > >  undefined!
> > > >  WARNING: "__hyp_stub_vectors" 
> > > >  [/home/liu/project/kiszka/jailhouse-0.8/driver/jailhouse.ko] 
> > > >  undefined!
> > > >  WARNING: "__stack_chk_guard" 
> > > >  [/home/liu/project/kiszka/jailhouse-0.8/driver/jailhouse.ko] 
> > > >  undefined!
> > > > 
> > > >  I have tried some google solutions but still not solved.
> > > > 
> > > >  Are there any suggestions?
> > > > >>>
> > > > >>> Regarding __hyp_stub_vectors: you also need
> > > > >>> http://git.kiszka.org/?p=linux.git;a=commitdiff;h=2a681cb2213e3ea0f142fae7345fb80208a88a53
> > > > >>>
> > > > >>> The other two issue seem to be related to some build inconsistency: 
> > > > >>> Your
> > > > >>> kernel was built without CONFIG_CC_STACKPROTECTOR, but when you 
> > > > >>> build
> > > > >>> the Jailhouse module, this feature is considered to be enabled.
> > > > >>>
> > > > >>> Jan
> > > > >>
> > > > >> Thank you very much!
> > > > >> After two days trying, I've finally built the kernel and jailhouse 
> > > > >> module successfully.
> > > > >> (I am using armbian building scripts and modified the 
> > > > >> linux-sunxi-dev.config with "# CONFIG_THUMB2_KERNEL is not set")
> > > > >>
> > > > >> Now I can enable jailhouse and create cell:
> > > > >> # jailhouse enable configs/orangepi0.cell
> > > > >> # jailhouse cell create configs/orangepi0-gic-demo.cell
> > > > >> # jailhouse cell list
> > > > >> ID  NameState   Assigned CPUs
> > > > >>Failed CPUs
> > > > >> 0   Orange-Pi0  running 0,2-3
> > > > >> 1   orangepi0-gic-demo  shut down   1
> > > > >>
> > > > >> But when I load the gic-demo.bin, it failed:
> > > > >> # jailhouse cell load orangepi0-gic-demo 
> > > > >> inmates/demos/arm/gic-demo.bin
> > > > >> Unhandled data read at 0x1f0(4)
> > > > >> FATAL: unhandled trap (exception class 0x24)
> > > > >> pc=0xc08cc6c0 cpsr=0x2013 hsr=0x93830007
> > > > >> r0=0x0190 r1=0x0002 r2=0xa035 r3=0xcf807000
> > > > >> r4=0xcda54e10 r5=0xc1103d00 r6=0x00300402 r7=0xcd8d7480
> > > > >> r8=0x0002300c r9=0x0285 r10=0x r11=0xcda47df4
> > > > >> r12=0x0030 r13=0xcda47dd0 r14=0xc08c9ab8
> > > > >> Parking CPU 3 (Cell: "Orange-Pi0")
> > > > >> Cell "orangepi0-gic-demo" can be loaded
> > > > >>
> > > > >> Any suggestions would be greatly appreciated :)
> > > > >>
> > > > >> Is there any demo can be used to make sure my jailhouse environments 
> > > > >> are ready?
> > > > >>
> > > > >> Thanks!
> > > > > 
> > > > > I solved this problem by trying some different memory configurations.
> > > > > The following does work:
> > > > > mem=448M vmalloc=256M
> > > > > /* Orangepi0.c */
> > > > >   .hypervisor_memory = {
> > > > >   .phys_start = 0x5f80,
> > > > >   .size = 0x80,
> > > > >   },
> > > > > ...
> > > > >   /* RAM */ {
> > > > >   .phys_start = 0x4000,
> > > > >   .virt_start = 0x4000,
> > > > >   .size =0x1f70,
> > > > >   .flags = JAILHOUSE_MEM_READ | 
> > > > > JAILHOUSE_MEM_WRITE |
> > > > >   JAILHOUSE_MEM_EXECUTE,
> > > > >   },
> > > > >   /* IVSHMEM shared memory region */ {
> > > > >   .phys_start = 0x5f70,
> > > > >   .virt_start = 0x5f70,
> > > > >   .size = 0x10,
> > > > >   .flags = JAILHOUSE_MEM_READ | 
> > > > > JAILHOUSE_MEM_WRITE,
> > > > >   },
> > > > > 
> > > > > 
> > > > > But if I use the following configuration. When I enable jailhouse, it 

Re: [EXTERNAL] Re: Try jailhouse on Orange Pi Zero

2018-04-08 Thread Qiu Shui
On Sunday, April 8, 2018 at 11:29:01 AM UTC+8, Qiu Shui wrote:
> On Monday, April 2, 2018 at 4:33:40 PM UTC+8, Qiu Shui wrote:
> > On Monday, April 2, 2018 at 3:05:08 PM UTC+8, Nikhil Devshatwar wrote:
> > > On Monday 02 April 2018 11:16 AM, Qiu Shui wrote:
> > > > On Monday, April 2, 2018 at 11:12:12 AM UTC+8, Qiu Shui wrote:
> > > >> On Thursday, March 29, 2018 at 1:09:46 PM UTC+8, Jan Kiszka wrote:
> > > >>> On 2018-03-29 06:36, Qiu Shui wrote:
> > >  I build the armbian with these two patches to the kernel:
> > >  [1]
> > >  http://git.kiszka.org/?p=linux.git;a=commit;h=f057e9bb4ba2fca0b435d36893eb41ddd57b4208
> > >  [2]
> > >  http://git.kiszka.org/?p=linux.git;a=commit;h=1c926e27072d4cca76a756058554485067ce472b
> > > 
> > >  But when I build jailhouse with the armbian kernel source 
> > >  files(version: Linux orangepizero 4.16.0-rc6-sunxi #2 SMP Wed Mar 28 
> > >  15:33:44 CST 2018 armv7l GNU/Linux), I got these warnings:
> > >  WARNING: "__stack_chk_fail" 
> > >  [/home/liu/project/kiszka/jailhouse-0.8/driver/jailhouse.ko] 
> > >  undefined!
> > >  WARNING: "__hyp_stub_vectors" 
> > >  [/home/liu/project/kiszka/jailhouse-0.8/driver/jailhouse.ko] 
> > >  undefined!
> > >  WARNING: "__stack_chk_guard" 
> > >  [/home/liu/project/kiszka/jailhouse-0.8/driver/jailhouse.ko] 
> > >  undefined!
> > > 
> > >  I have tried some google solutions but still not solved.
> > > 
> > >  Are there any suggestions?
> > > >>>
> > > >>> Regarding __hyp_stub_vectors: you also need
> > > >>> http://git.kiszka.org/?p=linux.git;a=commitdiff;h=2a681cb2213e3ea0f142fae7345fb80208a88a53
> > > >>>
> > > >>> The other two issue seem to be related to some build inconsistency: 
> > > >>> Your
> > > >>> kernel was built without CONFIG_CC_STACKPROTECTOR, but when you build
> > > >>> the Jailhouse module, this feature is considered to be enabled.
> > > >>>
> > > >>> Jan
> > > >>
> > > >> Thank you very much!
> > > >> After two days trying, I've finally built the kernel and jailhouse 
> > > >> module successfully.
> > > >> (I am using armbian building scripts and modified the 
> > > >> linux-sunxi-dev.config with "# CONFIG_THUMB2_KERNEL is not set")
> > > >>
> > > >> Now I can enable jailhouse and create cell:
> > > >> # jailhouse enable configs/orangepi0.cell
> > > >> # jailhouse cell create configs/orangepi0-gic-demo.cell
> > > >> # jailhouse cell list
> > > >> ID  NameState   Assigned CPUs  
> > > >>  Failed CPUs
> > > >> 0   Orange-Pi0  running 0,2-3
> > > >> 1   orangepi0-gic-demo  shut down   1
> > > >>
> > > >> But when I load the gic-demo.bin, it failed:
> > > >> # jailhouse cell load orangepi0-gic-demo inmates/demos/arm/gic-demo.bin
> > > >> Unhandled data read at 0x1f0(4)
> > > >> FATAL: unhandled trap (exception class 0x24)
> > > >> pc=0xc08cc6c0 cpsr=0x2013 hsr=0x93830007
> > > >> r0=0x0190 r1=0x0002 r2=0xa035 r3=0xcf807000
> > > >> r4=0xcda54e10 r5=0xc1103d00 r6=0x00300402 r7=0xcd8d7480
> > > >> r8=0x0002300c r9=0x0285 r10=0x r11=0xcda47df4
> > > >> r12=0x0030 r13=0xcda47dd0 r14=0xc08c9ab8
> > > >> Parking CPU 3 (Cell: "Orange-Pi0")
> > > >> Cell "orangepi0-gic-demo" can be loaded
> > > >>
> > > >> Any suggestions would be greatly appreciated :)
> > > >>
> > > >> Is there any demo can be used to make sure my jailhouse environments 
> > > >> are ready?
> > > >>
> > > >> Thanks!
> > > > 
> > > > I solved this problem by trying some different memory configurations.
> > > > The following does work:
> > > > mem=448M vmalloc=256M
> > > > /* Orangepi0.c */
> > > > .hypervisor_memory = {
> > > > .phys_start = 0x5f80,
> > > > .size = 0x80,
> > > > },
> > > > ...
> > > > /* RAM */ {
> > > > .phys_start = 0x4000,
> > > > .virt_start = 0x4000,
> > > > .size =0x1f70,
> > > > .flags = JAILHOUSE_MEM_READ | 
> > > > JAILHOUSE_MEM_WRITE |
> > > > JAILHOUSE_MEM_EXECUTE,
> > > > },
> > > > /* IVSHMEM shared memory region */ {
> > > > .phys_start = 0x5f70,
> > > > .virt_start = 0x5f70,
> > > > .size = 0x10,
> > > > .flags = JAILHOUSE_MEM_READ | 
> > > > JAILHOUSE_MEM_WRITE,
> > > > },
> > > > 
> > > > 
> > > > But if I use the following configuration. When I enable jailhouse, it 
> > > > says "JAILHOUSE_ENABLE: Invalid argument".
> > > > /* orangepi0.c */
> > > > .hypervisor_memory = {
> > > > .phys_start = 0x5c00,
> > > > .size = 0x400,
> > > >   

Re: [EXTERNAL] Re: Try jailhouse on Orange Pi Zero

2018-04-02 Thread Qiu Shui
On Monday, April 2, 2018 at 3:05:08 PM UTC+8, Nikhil Devshatwar wrote:
> On Monday 02 April 2018 11:16 AM, Qiu Shui wrote:
> > On Monday, April 2, 2018 at 11:12:12 AM UTC+8, Qiu Shui wrote:
> >> On Thursday, March 29, 2018 at 1:09:46 PM UTC+8, Jan Kiszka wrote:
> >>> On 2018-03-29 06:36, Qiu Shui wrote:
>  I build the armbian with these two patches to the kernel:
>  [1]
>  http://git.kiszka.org/?p=linux.git;a=commit;h=f057e9bb4ba2fca0b435d36893eb41ddd57b4208
>  [2]
>  http://git.kiszka.org/?p=linux.git;a=commit;h=1c926e27072d4cca76a756058554485067ce472b
> 
>  But when I build jailhouse with the armbian kernel source files(version: 
>  Linux orangepizero 4.16.0-rc6-sunxi #2 SMP Wed Mar 28 15:33:44 CST 2018 
>  armv7l GNU/Linux), I got these warnings:
>  WARNING: "__stack_chk_fail" 
>  [/home/liu/project/kiszka/jailhouse-0.8/driver/jailhouse.ko] undefined!
>  WARNING: "__hyp_stub_vectors" 
>  [/home/liu/project/kiszka/jailhouse-0.8/driver/jailhouse.ko] undefined!
>  WARNING: "__stack_chk_guard" 
>  [/home/liu/project/kiszka/jailhouse-0.8/driver/jailhouse.ko] undefined!
> 
>  I have tried some google solutions but still not solved.
> 
>  Are there any suggestions?
> >>>
> >>> Regarding __hyp_stub_vectors: you also need
> >>> http://git.kiszka.org/?p=linux.git;a=commitdiff;h=2a681cb2213e3ea0f142fae7345fb80208a88a53
> >>>
> >>> The other two issue seem to be related to some build inconsistency: Your
> >>> kernel was built without CONFIG_CC_STACKPROTECTOR, but when you build
> >>> the Jailhouse module, this feature is considered to be enabled.
> >>>
> >>> Jan
> >>
> >> Thank you very much!
> >> After two days trying, I've finally built the kernel and jailhouse module 
> >> successfully.
> >> (I am using armbian building scripts and modified the 
> >> linux-sunxi-dev.config with "# CONFIG_THUMB2_KERNEL is not set")
> >>
> >> Now I can enable jailhouse and create cell:
> >> # jailhouse enable configs/orangepi0.cell
> >> # jailhouse cell create configs/orangepi0-gic-demo.cell
> >> # jailhouse cell list
> >> ID  NameState   Assigned CPUs   
> >> Failed CPUs
> >> 0   Orange-Pi0  running 0,2-3
> >> 1   orangepi0-gic-demo  shut down   1
> >>
> >> But when I load the gic-demo.bin, it failed:
> >> # jailhouse cell load orangepi0-gic-demo inmates/demos/arm/gic-demo.bin
> >> Unhandled data read at 0x1f0(4)
> >> FATAL: unhandled trap (exception class 0x24)
> >> pc=0xc08cc6c0 cpsr=0x2013 hsr=0x93830007
> >> r0=0x0190 r1=0x0002 r2=0xa035 r3=0xcf807000
> >> r4=0xcda54e10 r5=0xc1103d00 r6=0x00300402 r7=0xcd8d7480
> >> r8=0x0002300c r9=0x0285 r10=0x r11=0xcda47df4
> >> r12=0x0030 r13=0xcda47dd0 r14=0xc08c9ab8
> >> Parking CPU 3 (Cell: "Orange-Pi0")
> >> Cell "orangepi0-gic-demo" can be loaded
> >>
> >> Any suggestions would be greatly appreciated :)
> >>
> >> Is there any demo can be used to make sure my jailhouse environments are 
> >> ready?
> >>
> >> Thanks!
> > 
> > I solved this problem by trying some different memory configurations.
> > The following does work:
> > mem=448M vmalloc=256M
> > /* Orangepi0.c */
> > .hypervisor_memory = {
> > .phys_start = 0x5f80,
> > .size = 0x80,
> > },
> > ...
> > /* RAM */ {
> > .phys_start = 0x4000,
> > .virt_start = 0x4000,
> > .size =0x1f70,
> > .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
> > JAILHOUSE_MEM_EXECUTE,
> > },
> > /* IVSHMEM shared memory region */ {
> > .phys_start = 0x5f70,
> > .virt_start = 0x5f70,
> > .size = 0x10,
> > .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE,
> > },
> > 
> > 
> > But if I use the following configuration. When I enable jailhouse, it says 
> > "JAILHOUSE_ENABLE: Invalid argument".
> > /* orangepi0.c */
> > .hypervisor_memory = {
> > .phys_start = 0x5c00,
> > .size = 0x400,
> > },
> > ..
> > /* RAM */ {
> > .phys_start = 0x4000,
> > .virt_start = 0x4000,
> > .size =0x1bf0,
> > .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
> > JAILHOUSE_MEM_EXECUTE,
> > },
> > /* IVSHMEM shared memory region */ {
> > .phys_start = 0x5bf0,
> > .virt_start = 0x5bf0,
> > .size = 0x10,
> > .flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE,
> > },
> > 
> > cat 

Re: [EXTERNAL] Re: Try jailhouse on Orange Pi Zero

2018-04-02 Thread 'Nikhil Devshatwar' via Jailhouse

On Monday 02 April 2018 11:16 AM, Qiu Shui wrote:

On Monday, April 2, 2018 at 11:12:12 AM UTC+8, Qiu Shui wrote:

On Thursday, March 29, 2018 at 1:09:46 PM UTC+8, Jan Kiszka wrote:

On 2018-03-29 06:36, Qiu Shui wrote:

I build the armbian with these two patches to the kernel:
[1]
http://git.kiszka.org/?p=linux.git;a=commit;h=f057e9bb4ba2fca0b435d36893eb41ddd57b4208
[2]
http://git.kiszka.org/?p=linux.git;a=commit;h=1c926e27072d4cca76a756058554485067ce472b

But when I build jailhouse with the armbian kernel source files(version: Linux 
orangepizero 4.16.0-rc6-sunxi #2 SMP Wed Mar 28 15:33:44 CST 2018 armv7l 
GNU/Linux), I got these warnings:
WARNING: "__stack_chk_fail" 
[/home/liu/project/kiszka/jailhouse-0.8/driver/jailhouse.ko] undefined!
WARNING: "__hyp_stub_vectors" 
[/home/liu/project/kiszka/jailhouse-0.8/driver/jailhouse.ko] undefined!
WARNING: "__stack_chk_guard" 
[/home/liu/project/kiszka/jailhouse-0.8/driver/jailhouse.ko] undefined!

I have tried some google solutions but still not solved.

Are there any suggestions?


Regarding __hyp_stub_vectors: you also need
http://git.kiszka.org/?p=linux.git;a=commitdiff;h=2a681cb2213e3ea0f142fae7345fb80208a88a53

The other two issue seem to be related to some build inconsistency: Your
kernel was built without CONFIG_CC_STACKPROTECTOR, but when you build
the Jailhouse module, this feature is considered to be enabled.

Jan


Thank you very much!
After two days trying, I've finally built the kernel and jailhouse module 
successfully.
(I am using armbian building scripts and modified the linux-sunxi-dev.config with "# 
CONFIG_THUMB2_KERNEL is not set")

Now I can enable jailhouse and create cell:
# jailhouse enable configs/orangepi0.cell
# jailhouse cell create configs/orangepi0-gic-demo.cell
# jailhouse cell list
ID  NameState   Assigned CPUs   Failed 
CPUs
0   Orange-Pi0  running 0,2-3
1   orangepi0-gic-demo  shut down   1

But when I load the gic-demo.bin, it failed:
# jailhouse cell load orangepi0-gic-demo inmates/demos/arm/gic-demo.bin
Unhandled data read at 0x1f0(4)
FATAL: unhandled trap (exception class 0x24)
pc=0xc08cc6c0 cpsr=0x2013 hsr=0x93830007
r0=0x0190 r1=0x0002 r2=0xa035 r3=0xcf807000
r4=0xcda54e10 r5=0xc1103d00 r6=0x00300402 r7=0xcd8d7480
r8=0x0002300c r9=0x0285 r10=0x r11=0xcda47df4
r12=0x0030 r13=0xcda47dd0 r14=0xc08c9ab8
Parking CPU 3 (Cell: "Orange-Pi0")
Cell "orangepi0-gic-demo" can be loaded

Any suggestions would be greatly appreciated :)

Is there any demo can be used to make sure my jailhouse environments are ready?

Thanks!


I solved this problem by trying some different memory configurations.
The following does work:
mem=448M vmalloc=256M
/* Orangepi0.c */
.hypervisor_memory = {
.phys_start = 0x5f80,
.size = 0x80,
},
...
/* RAM */ {
.phys_start = 0x4000,
.virt_start = 0x4000,
.size =0x1f70,
.flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
JAILHOUSE_MEM_EXECUTE,
},
/* IVSHMEM shared memory region */ {
.phys_start = 0x5f70,
.virt_start = 0x5f70,
.size = 0x10,
.flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE,
},


But if I use the following configuration. When I enable jailhouse, it says 
"JAILHOUSE_ENABLE: Invalid argument".
/* orangepi0.c */
.hypervisor_memory = {
.phys_start = 0x5c00,
.size = 0x400,
},
..
/* RAM */ {
.phys_start = 0x4000,
.virt_start = 0x4000,
.size =0x1bf0,
.flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
JAILHOUSE_MEM_EXECUTE,
},
/* IVSHMEM shared memory region */ {
.phys_start = 0x5bf0,
.virt_start = 0x5bf0,
.size = 0x10,
.flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE,
},

cat /proc/iomem
01c02000-01c02fff : dma-controller@1c02000
01c0f000-01c0 : mmc@1c0f000
01c1-01c10fff : mmc@1c1
01c19000-01c193ff : usb@1c19000
   01c19000-01c193ff : usb@1c19000
01c19400-01c1942b : phy_ctrl
01c1a000-01c1a0ff : usb@1c1a000
01c1a400-01c1a4ff : usb@1c1a400
01c1a800-01c1a803 : pmu0
01c1b000-01c1b0ff : usb@1c1b000
01c1b400-01c1b4ff : usb@1c1b400
01c1b800-01c1b803 : pmu1
01c1c000-01c1c0ff : usb@1c1c000
01c1c400-01c1c4ff : usb@1c1c400
01c1c800-01c1c803 : pmu2

Re: Try jailhouse on Orange Pi Zero

2018-04-01 Thread Qiu Shui
On Monday, April 2, 2018 at 11:12:12 AM UTC+8, Qiu Shui wrote:
> On Thursday, March 29, 2018 at 1:09:46 PM UTC+8, Jan Kiszka wrote:
> > On 2018-03-29 06:36, Qiu Shui wrote:
> > > I build the armbian with these two patches to the kernel:
> > > [1] 
> > > http://git.kiszka.org/?p=linux.git;a=commit;h=f057e9bb4ba2fca0b435d36893eb41ddd57b4208
> > > [2] 
> > > http://git.kiszka.org/?p=linux.git;a=commit;h=1c926e27072d4cca76a756058554485067ce472b
> > > 
> > > But when I build jailhouse with the armbian kernel source files(version: 
> > > Linux orangepizero 4.16.0-rc6-sunxi #2 SMP Wed Mar 28 15:33:44 CST 2018 
> > > armv7l GNU/Linux), I got these warnings:
> > > WARNING: "__stack_chk_fail" 
> > > [/home/liu/project/kiszka/jailhouse-0.8/driver/jailhouse.ko] undefined!
> > > WARNING: "__hyp_stub_vectors" 
> > > [/home/liu/project/kiszka/jailhouse-0.8/driver/jailhouse.ko] undefined!
> > > WARNING: "__stack_chk_guard" 
> > > [/home/liu/project/kiszka/jailhouse-0.8/driver/jailhouse.ko] undefined!  
> > > 
> > > I have tried some google solutions but still not solved. 
> > > 
> > > Are there any suggestions?
> > 
> > Regarding __hyp_stub_vectors: you also need
> > http://git.kiszka.org/?p=linux.git;a=commitdiff;h=2a681cb2213e3ea0f142fae7345fb80208a88a53
> > 
> > The other two issue seem to be related to some build inconsistency: Your
> > kernel was built without CONFIG_CC_STACKPROTECTOR, but when you build
> > the Jailhouse module, this feature is considered to be enabled.
> > 
> > Jan
> 
> Thank you very much!
> After two days trying, I've finally built the kernel and jailhouse module 
> successfully.
> (I am using armbian building scripts and modified the linux-sunxi-dev.config 
> with "# CONFIG_THUMB2_KERNEL is not set")
> 
> Now I can enable jailhouse and create cell:
> # jailhouse enable configs/orangepi0.cell
> # jailhouse cell create configs/orangepi0-gic-demo.cell
> # jailhouse cell list
> ID  NameState   Assigned CPUs   
> Failed CPUs 
> 0   Orange-Pi0  running 0,2-3 
>   
> 1   orangepi0-gic-demo  shut down   1  
> 
> But when I load the gic-demo.bin, it failed:
> # jailhouse cell load orangepi0-gic-demo inmates/demos/arm/gic-demo.bin
> Unhandled data read at 0x1f0(4)
> FATAL: unhandled trap (exception class 0x24)  
>   
> pc=0xc08cc6c0 cpsr=0x2013 hsr=0x93830007  
>   
> r0=0x0190 r1=0x0002 r2=0xa035 r3=0xcf807000   
>   
> r4=0xcda54e10 r5=0xc1103d00 r6=0x00300402 r7=0xcd8d7480   
>   
> r8=0x0002300c r9=0x0285 r10=0x r11=0xcda47df4 
>   
> r12=0x0030 r13=0xcda47dd0 r14=0xc08c9ab8  
>   
> Parking CPU 3 (Cell: "Orange-Pi0")
>   
> Cell "orangepi0-gic-demo" can be loaded
> 
> Any suggestions would be greatly appreciated :)
> 
> Is there any demo can be used to make sure my jailhouse environments are 
> ready?
> 
> Thanks!

I solved this problem by trying some different memory configurations.
The following does work:
mem=448M vmalloc=256M
/* Orangepi0.c */
.hypervisor_memory = {
.phys_start = 0x5f80,
.size = 0x80,
},
...
/* RAM */ {
.phys_start = 0x4000,
.virt_start = 0x4000,
.size =0x1f70,
.flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
JAILHOUSE_MEM_EXECUTE,
},
/* IVSHMEM shared memory region */ {
.phys_start = 0x5f70,
.virt_start = 0x5f70,
.size = 0x10,
.flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE,
},


But if I use the following configuration. When I enable jailhouse, it says 
"JAILHOUSE_ENABLE: Invalid argument".
/* orangepi0.c */
.hypervisor_memory = {
.phys_start = 0x5c00,
.size = 0x400,
},
..
/* RAM */ {
.phys_start = 0x4000,
.virt_start = 0x4000,
.size =0x1bf0,
.flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE |
JAILHOUSE_MEM_EXECUTE,
},
/* IVSHMEM shared memory region */ {
.phys_start = 0x5bf0,
.virt_start = 0x5bf0,
.size = 0x10,
.flags = JAILHOUSE_MEM_READ | JAILHOUSE_MEM_WRITE,

Re: Try jailhouse on Orange Pi Zero

2018-04-01 Thread Qiu Shui
On Thursday, March 29, 2018 at 1:09:46 PM UTC+8, Jan Kiszka wrote:
> On 2018-03-29 06:36, Qiu Shui wrote:
> > I build the armbian with these two patches to the kernel:
> > [1] 
> > http://git.kiszka.org/?p=linux.git;a=commit;h=f057e9bb4ba2fca0b435d36893eb41ddd57b4208
> > [2] 
> > http://git.kiszka.org/?p=linux.git;a=commit;h=1c926e27072d4cca76a756058554485067ce472b
> > 
> > But when I build jailhouse with the armbian kernel source files(version: 
> > Linux orangepizero 4.16.0-rc6-sunxi #2 SMP Wed Mar 28 15:33:44 CST 2018 
> > armv7l GNU/Linux), I got these warnings:
> > WARNING: "__stack_chk_fail" 
> > [/home/liu/project/kiszka/jailhouse-0.8/driver/jailhouse.ko] undefined!
> > WARNING: "__hyp_stub_vectors" 
> > [/home/liu/project/kiszka/jailhouse-0.8/driver/jailhouse.ko] undefined!
> > WARNING: "__stack_chk_guard" 
> > [/home/liu/project/kiszka/jailhouse-0.8/driver/jailhouse.ko] undefined!  
> > 
> > I have tried some google solutions but still not solved. 
> > 
> > Are there any suggestions?
> 
> Regarding __hyp_stub_vectors: you also need
> http://git.kiszka.org/?p=linux.git;a=commitdiff;h=2a681cb2213e3ea0f142fae7345fb80208a88a53
> 
> The other two issue seem to be related to some build inconsistency: Your
> kernel was built without CONFIG_CC_STACKPROTECTOR, but when you build
> the Jailhouse module, this feature is considered to be enabled.
> 
> Jan

Thank you very much!
After two days trying, I've finally built the kernel and jailhouse module 
successfully.
(I am using armbian building scripts and modified the linux-sunxi-dev.config 
with "# CONFIG_THUMB2_KERNEL is not set")

Now I can enable jailhouse and create cell:
# jailhouse enable configs/orangepi0.cell
# jailhouse cell create configs/orangepi0-gic-demo.cell
# jailhouse cell list
ID  NameState   Assigned CPUs   Failed 
CPUs 
0   Orange-Pi0  running 0,2-3   

1   orangepi0-gic-demo  shut down   1  

But when I load the gic-demo.bin, it failed:
# jailhouse cell load orangepi0-gic-demo inmates/demos/arm/gic-demo.bin
Unhandled data read at 0x1f0(4)
FATAL: unhandled trap (exception class 0x24)
pc=0xc08cc6c0 cpsr=0x2013 hsr=0x93830007
r0=0x0190 r1=0x0002 r2=0xa035 r3=0xcf807000 
r4=0xcda54e10 r5=0xc1103d00 r6=0x00300402 r7=0xcd8d7480 
r8=0x0002300c r9=0x0285 r10=0x r11=0xcda47df4   
r12=0x0030 r13=0xcda47dd0 r14=0xc08c9ab8
Parking CPU 3 (Cell: "Orange-Pi0")  
Cell "orangepi0-gic-demo" can be loaded

Any suggestions would be greatly appreciated :)

Is there any demo can be used to make sure my jailhouse environments are ready?

Thanks!

-- 
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 jailhouse-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Try jailhouse on Orange Pi Zero

2018-03-28 Thread Jan Kiszka
On 2018-03-29 06:36, Qiu Shui wrote:
> I build the armbian with these two patches to the kernel:
> [1] 
> http://git.kiszka.org/?p=linux.git;a=commit;h=f057e9bb4ba2fca0b435d36893eb41ddd57b4208
> [2] 
> http://git.kiszka.org/?p=linux.git;a=commit;h=1c926e27072d4cca76a756058554485067ce472b
> 
> But when I build jailhouse with the armbian kernel source files(version: 
> Linux orangepizero 4.16.0-rc6-sunxi #2 SMP Wed Mar 28 15:33:44 CST 2018 
> armv7l GNU/Linux), I got these warnings:
> WARNING: "__stack_chk_fail" 
> [/home/liu/project/kiszka/jailhouse-0.8/driver/jailhouse.ko] undefined!
> WARNING: "__hyp_stub_vectors" 
> [/home/liu/project/kiszka/jailhouse-0.8/driver/jailhouse.ko] undefined!
> WARNING: "__stack_chk_guard" 
> [/home/liu/project/kiszka/jailhouse-0.8/driver/jailhouse.ko] undefined!  
> 
> I have tried some google solutions but still not solved. 
> 
> Are there any suggestions?

Regarding __hyp_stub_vectors: you also need
http://git.kiszka.org/?p=linux.git;a=commitdiff;h=2a681cb2213e3ea0f142fae7345fb80208a88a53

The other two issue seem to be related to some build inconsistency: Your
kernel was built without CONFIG_CC_STACKPROTECTOR, but when you build
the Jailhouse module, this feature is considered to be enabled.

Jan

-- 
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 jailhouse-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.