[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] Basic bare metal ARM domain interface



On Tue, May 31, 2016 at 10:53:06AM +0100, Julien Grall wrote:
> 
> 
> On 30/05/16 21:21, Ivan Pavić2 wrote:
> >Hello,
> 
> Hello Ivan,
> 
> Sorry for the late answer.
> 
> >>>I used FreeRTOS code for console output. It is based on Mini OS code. 
> >>>There are two problems as I've >determined
> >>>with debugging. First is that vsnprintf blocks for some reason in print 
> >>>function so i commented it out. After the
> >
> >>snprintf blocks...
> >
> >>>hypercall function blocked as well. I modified hypercall function so it 
> >>>looks like this:
> >>>(void)HYPERVISOR_console_io(CONSOLEIO_write, 3, "yes");
> >
> >>As the call failed I decided to make hypervisor call directly in boot 
> >>procedure, so I put this assembler code just >before
> >>branch to main:
> >
> >>        mov r12, #18 ; console io code
> >>        mov r0, #0 ; write operation(first parameter)
> >>        mov r1, #5 ; length of message (second parameter)
> >>       ldr r2, =msg ; message address (third parameter)
> >>        .long 0xe140ea71 ; hvc instruction
> >>        b main ; branch to main
> 
> For your information, hypervisor calls have to be done with data
> cache enabled. Otherwise you not may get garbage (or nothing at all)
> on the console.
> 
> >
> >>msg is defined as:
> >
> >>msg:
> >>    .asciz "hello"
> >
> >>I get deadbeef in registers, apperently something happened (xenctx output):
> >>PC:       4000c5bc
> >>CPSR:     600001f3
> >>USR:               SP:00000000 LR:00000000
> >>SVC: SPSR:00000000 SP:4011c200 LR:400080a8
> >>FIQ: SPSR:00000000 SP:40124200 LR:00000000
> >>IRQ: SPSR:00000000 SP:40120200 LR:00000000
> >>ABT: SPSR:00000000 SP:40128200 LR:00000000
> >>UND: SPSR:00000000 SP:4012c200 LR:00000000
> >
> >  >r0_usr: 00000000        r1_usr: deadbeef        r2_usr: deadbeef
> >  >r3_usr: 00000000        r4_usr: 00000000        r5_usr: 00000000
> >  >r6_usr: 00000000        r7_usr: 00000000        r8_usr: 00000000
> >  >r9_usr: 00000064       r10_usr: 00000064       r11_usr: 00000000
> >>r12_usr: deadbeef
> >
> >
> >>According to arch-arm.h r0 is return value of call. It is 0, operation 
> >>successful???? Still I don't get output on
> >>console...
> >
> >>Thank you in advance,
> >
> >>Regards,
> >
> >>Ivan Pavic
> >
> >I still didn't solve why I don't see no output on emergency console, I think 
> >I should because if deadbeef in registers it
> >do_console_io should have been called.
> 
> The emergency console and any Xen debug facilities (hvc 0xffxx) only
> works when the hypervisor has been built with debug enabled.
> 
> By default, release version are built with debug disabled. You will
> have to pass debug=y on the build command line to enable debug.
> 
> >However new problem emerged i tried to add iomem
> >parameter in configuration file to get access over gpio but domain won't 
> >start because operation is not permitted.
> >Should I somehow release disable that memory space for dom0, perhaps in dts 
> >for dom0?
> >
> >Snippet from dom.cfg file:
> >
> >iomem = ["0x13400000,1@0x41400000"]
> >
> >0x13400000 is base address of GPIO that I want to use.
> 
> iomem expects a physical page number (see the documentation in
> docs/man/xl.cfg.pod.5). So it should be:
> 
> iomem = ["0x13400,1@0x41400"]
> 
> >
> >I get this error: (snippet from xl -vvv create -c dom.cfg)
> >
> >libxl: debug: libxl_create.c:1213:domcreate_launch_dm: dom4 iomem 
> >13400000-13400000
> >libxl: error: libxl_create.c:1220:domcreate_launch_dm: failed give dom4 
> >access to iomem range 13400000-13400000: Operation not permitted
> >libxl: debug: libxl.c:1719:devices_destroy_cb: forked pid 3835 for destroy 
> >of domain 4
> >
> >Thank you in advance,
> 
> Regards,
> 
> -- 
> Julien Grall

Hello Julien,

thank you very much, I succeded with debug console and pin toggle (iomem).
It's actually good that you answered late, because it made me look through xen
traps.c and console.c code, so I recompiled xen few times. The main problem with
was compiler, I think. I've always got data abort with hypervisor calls and 
similiar. Now I'm using gcc-linaro-arm-none-eabi-4.9 for both xen and 
application. I'll try to document this as much as possible and I'll put code 
on github. (github.com/dumpram). Next thing I will do, is to measure gpio 
latency in dom0 and guest domain with different schedulers. Final step would 
be to create starting point for porting some RTOS. Thank you once again for the 
patience, with my beginner questions, but I'm afraid that there will be more...

Regards,

Ivan Pavic
 




_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.