tz_vmm demo on imx53qsb

Joseph Lee leejose911 at ...9...
Mon Jan 11 00:19:58 CET 2016


Hi Stefan,

Thank you so much. I will check out some Android developer forums.

But for now, I tried it in a different way. Unlike your demo in this article
<https://github.com/skalk/genode/blob/i.MX53_tablet_demo/os/src/server/vmm/imx53/README>,
I wanted the display to be usable only by the normal world (Linux/Android
kernel). So I have downloaded the pre-built Linux/Android kernel uImage
binary for i.mx53QSB from Adeneo Embedded website (
http://www.adeneo-embedded.com/en/Products/Board-Support-Packages/Freescale-i.MX53-QSB)
and copy the binary to the 'bin' subdirectory of the Genode build
directory. I have also marked like I2C, GPIO and IPU as unsecure devices in
the csu.h file. However, I got a data abort error (see attached) at boot
time. Could you please tell me what is wrong?


Thanks and best regards,

On Fri, Jan 8, 2016 at 8:53 AM, Stefan Kalkowski <
stefan.kalkowski at ...1...> wrote:

> Hi,
>
> On 01/05/2016 11:34 PM, Joseph Lee wrote:
> > Hi Stefan,
> >
> > Thanks a lot for your explanation.
> >
> > when i reset the GPU to be unsecure in csu.h file, it displays the
> attached
> > output and gets stuck again. I assume a user prompt will appear in the
> end
> > to execute Linux commands. is that right? what does  "sh: can't access
> tty;
> > job control turned off" error mean?
>
> whether you will see a shell prompt on the serial line fully depends on
> the initramfs and the android services that are under your control. As I
> already said the original example you have adapted depends on the
> display driver etc. which doesn't seem to be incorporated into your run
> script.
>
> The message "sh: can't access tty; job control turned off" point to the
> fact that your initramfs starts a shell in the end (with other words the
> linux boot process finished) but it isn't writing to a proper tty,
> thereby it does not support e.g.: background processes or in general
> "job control". Probably it does not use the right serial tty in your
> initramfs. Does the /dev/ttymxc0 file exists within your initramfs, or
> is it created via udev or android configuration?
> What I can see from your output is, that you are still using the same
> kernel command line parameters like in the automated tz_vmm run-script
> version. In the old android demonstration scenario we used the following
> additional parameters: "androidboot.console=ttymxc0
> video=mxcdi1fb:RGB666,XGA gpu_memory=64M lpj=4997120". Although the
> video and lpj parameter probably must be different when using the
> Quickstart board instead of the tablet, the console parameter should be
> important for android.
>
> To be honest, I'm no expert for bootstrapping an Android system.
> Although, I brought that Android example on top of Genode/TrustZone to
> life, I'm not so much familiar with the internals of the Android
> configuration system. So if you are dealing with problems here, it might
> be valueable to look into Android porting howtos and Android system
> developer forums.
>
> Best regards
> Stefan
>
> >
> > Thanks,
> >
> > On Tue, Jan 5, 2016 at 8:47 AM, Stefan Kalkowski <
> > stefan.kalkowski at ...1...> wrote:
> >
> >> Hi Joseph,
> >>
> >> On 01/05/2016 01:49 AM, Joseph Lee wrote:
> >>> Hello everyone,
> >>>
> >>> I have built and run the current Genode version(15.11) with trustzone
> for
> >>> hw_imx53_qsb_tz platform but i used the initramfs (initrd.gz) for
> Android
> >>> image that are used in the demo for Sabre tablet (
> >>>
> >>
> https://github.com/skalk/genode/blob/i.MX53_tablet_demo/os/src/server/vmm/imx53/README
> >> ).
> >>
> >> That is right, one has to distinguish between Sabre Tablet and
> >> Quickstart Board on different levels including the Android images. There
> >> might be more surprises when porting the existent demo to the Quickstart
> >> board.
> >>
> >>> After some trials and errors, I have managed to get the following
> outputs
> >>> (see attached) on the serial console and it got stuck. is this the
> right
> >>> approach to run Android in the normal world of i.mx53 QSB?  What is
> >> missing
> >>> ? lvds display is connected to the board but nothing is displayed.
> >>
> >> When looking at the attached output I cannot see any initialization of
> >> drivers (e.g.: the framebuffer driver). It looks to me as if you are
> >> using the current 'tz_vmm' run-script that is used for automated testing
> >> only without any graphical setup. Is that right?
> >> As an alternative, you might use the run script from the tablet demo as
> >> a starting point:
> >>
> >>
> >>
> >>
> https://raw.githubusercontent.com/skalk/genode/i.MX53_tablet_demo/os/run/vmm.run
> >>
> >> But again, you must brace yourself for surprises, because the run-script
> >> is pretty much outdated and was created for a very specific setup on top
> >> of the SABRE tablet.
> >>
> >> Apart from that, the output really looks good, but in the end your
> >> Android VM faults when trying to access the GPU (data-abort at physical
> >> address 0x30001740). That is because the GPU is set as secure within the
> >> kernel device initialization (more precisely the Central Security Unit
> >> initialization) in file:
> >> repos/base-hw/src/core/include/spec/imx53/trustzone/csu.h
> >>
> >> The GPU is set as secure like the "Image Processing Unit" (framebuffer
> >> device), because we enabled the DMA channel of the framebuffer driver to
> >> access secure memory, as it is driven by Genode's framebuffer driver
> >> that runs within the secure world. Sadly the GPU device uses the same
> >> DMA channel ID, and thereby the GPU is allowed to access secure memory
> >> via DMA too. Therefore, we set the GPU to be used by the secure world
> only.
> >>
> >> If you want to use the GPU within the normal world (Android) for
> >> demonstration purposes only, and do not matter about DMA device attacks,
> >> you can also re-set the GPU to be unsecure (search for GPU 2D and 3D in
> >> the csu.h file).
> >>
> >> Regards
> >> Stefan
> >>
> >>>
> >>> Thanks,
> >>>
> >>> On Mon, Dec 28, 2015 at 4:48 AM, Joseph Lee <leejose911 at ...9...>
> >> wrote:
> >>>
> >>>> Hi everyone,
> >>>>
> >>>> i am currently trying to run trustzone demo on imx53 Quick Start Board
> >>>> (qsb). In which i want to run Android OS in the normal world. i
> followed
> >>>> the instruction in this link (
> >>>>
> >>
> https://github.com/skalk/genode/blob/i.MX53_tablet_demo/os/src/server/vmm/imx53/README
> >> )
> >>>> and built the uImage successfully. I put the uImage on the SD card
> >>>> partition (/dev/mmcblk0p1). However, when try to boot the uImage, it
> >> gets
> >>>> stuck after displaying the following outputs. I have attached the
> whole
> >> log
> >>>> messages. FYI, the SD card has two partitions(/dev/mmcblk0p1 and
> >>>> /dev/mmcblk0p2) with ext4 format.
> >>>>
> >>>> mmc0: new high speed SDHC card at address 0007
> >>>> mmcblk0: mmc0:0007 SD32G 28.9 GiB
> >>>>  mmcblk0: p1 p2
> >>>> init: cannot open '/initlogo.rle'
> >>>> EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts:
> >>>> (null)
> >>>> EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
> >>>> init: Unable to open persistent property directory /data/property
> >> errno: 2
> >>>> init: cannot find '/system/bin/sh', disabling 'console'
> >>>> init: cannot find '/system/bin/servicemanager', disabling
> >> 'servicemanager'
> >>>> init: cannot find '/system/bin/vold', disabling 'vold'
> >>>> init: cannot find '/system/bin/netd', disabling 'netd'
> >>>> init: cannot find '/system/bin/dispd', disabling 'dispd'
> >>>> init: cannot find '/system/bin/debuggerd', disabling 'debuggerd'
> >>>> init: cannot find '/system/bin/app_process', disabling 'zygote'
> >>>> init: cannot find '/system/bin/mediaserver', disabling 'media'
> >>>> init: cannot find '/system/bin/dbus-daemon', disabling 'dbus'
> >>>> init: cannot find '/system/bin/installd', disabling 'installd'
> >>>> init: cannot find '/system/etc/install-recovery.sh', disabling
> >>>> 'flash_recovery'
> >>>> init: cannot find '/system/bin/keystore', disabling 'keystore'
> >>>> init: cannot find '/system/bin/rild', disabling 'ril-daemon'
> >>>> init: cannot find '/system/bin/magd', disabling 'magd'
> >>>> init: cannot find '/system/bin/wlan_tool', disabling 'wlan_tool'
> >>>>
> >>>> could you please let me know what is missing?
> >>>>
> >>>> thank you!
> >>>>
> >>>
> >>>
> >>>
> >>>
> >>
> ------------------------------------------------------------------------------
> >>>
> >>>
> >>>
> >>> _______________________________________________
> >>> genode-main mailing list
> >>> genode-main at lists.sourceforge.net
> >>> https://lists.sourceforge.net/lists/listinfo/genode-main
> >>>
> >>
> >> --
> >> Stefan Kalkowski
> >> Genode Labs
> >>
> >> http://www.genode-labs.com/ · http://genode.org/
> >>
> >>
> >>
> ------------------------------------------------------------------------------
> >> _______________________________________________
> >> genode-main mailing list
> >> genode-main at lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/genode-main
> >>
> >
> >
> >
> >
> ------------------------------------------------------------------------------
> >
> >
> >
> > _______________________________________________
> > genode-main mailing list
> > genode-main at lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/genode-main
> >
>
> --
> Stefan Kalkowski
> Genode Labs
>
> http://www.genode-labs.com/ · http://genode.org/
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> genode-main mailing list
> genode-main at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/genode-main
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.genode.org/pipermail/users/attachments/20160111/8e5f81c4/attachment.html>
-------------- next part --------------
## Booting kernel from Legacy Image at 71000000 ...
   Image Name:   
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    5206016 Bytes = 5 MiB
   Load Address: 70010000
   Entry Point:  70010000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK

Starting kernel ...

kernel initialized
Genode 15.11
int main(): --- create local services ---
int main(): --- start init ---
int main(): transferred 246 MB to init
int main(): --- init created, waiting for exit condition ---
[init] Could not open ROM session for module "ld.lib.so"
[init] parent provides
[init]   service "ROM"
[init]   service "RAM"
[init]   service "IRQ"
[init]   service "IO_MEM"
[init]   service "IO_PORT"
[init]   service "CAP"
[init]   service "PD"
[init]   service "RM"
[init]   service "CPU"
[init]   service "LOG"
[init]   service "SIGNAL"
[init]   service "VM"
[init] child "tz_vmm"
[init]   RAM quota:  10203136
[init]   ELF binary: tz_vmm
[init]   priority:   0
[init -> tz_vmm] Start virtual machine ...
Initializing cgroup subsys cpu
Linux version 2.6.35.3-01162-gecaa8dd-dirty (rlorriaux at rl-linux) (gcc version 4.4.3 (GCC) ) #1 PREEMPT Mon Nov 14 15:00:29 PST 2011
CPU: ARMv7 Processor [412fc085] revision 5 (ARMv7), cr=10c53c7f
CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
Machine: Freescale MX53 LOCO Board
Memory policy: ECC disabled, Data cache writeback
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 40640
Kernel command line: console=ttymxc0,115200 androidboot.console=ttymxc0 lpj=4997120 video=mxcdi0fb:RGB666,XGA gpu_memory=64M
PID hash table entries: 1024 (order: 0, 4096 bytes)
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
allocated 819200 bytes of page_cgroup
please try 'cgroup_disable=memory' option if you don't want memory cgroups
Memory: 160MB = 160MB total
Memory: 151368k/151368k available, 12472k reserved, 0K highmem
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    DMA     : 0xf9e00000 - 0xffe00000   (  96 MB)
    vmalloc : 0x8a800000 - 0xf4000000   (1688 MB)
    lowmem  : 0x80000000 - 0x8a000000   ( 160 MB)
    pkmap   : 0x7fe00000 - 0x80000000   (   2 MB)
    modules : 0x7f000000 - 0x7fe00000   (  14 MB)
      .init : 0x80008000 - 0x80039000   ( 196 kB)
      .text : 0x80039000 - 0x80892000   (8548 kB)
      .data : 0x808b2000 - 0x8091b6c0   ( 422 kB)
SLUB: Genslabs=11, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
Hierarchical RCU implementation.
	RCU-based detection of stalled CPUs is disabled.
	Verbose stalled-CPUs detection is disabled.
NR_IRQS:368
MXC GPIO hardware
MXC IRQ initialized
MXC_Early serial console at MMIO 0x53fbc000 (options '115200')
bootconsole [ttymxc0] enabled
Console: colour dummy device 80x30
Calibrating delay loop (skipped) preset value.. 999.42 BogoMIPS (lpj=4997120)
pid_max: default: 32768 minimum: 301
Security Framework initialized
Mount-cache hash table entries: 512
Initializing cgroup subsys debug
Initializing cgroup subsys ns
Initializing cgroup subsys cpuacct
Initializing cgroup subsys memory
Initializing cgroup subsys devices
Initializing cgroup subsys freezer
Initializing cgroup subsys blkio
CPU: Testing write buffer coherency: ok
regulator: core version 0.5
NET: Registered protocol family 16
i.MX IRAM pool: 128 KB at 0x8a840000
FAILED TO RELEASE IRAM PARTITION
CPU is i.MX0 Revision 0.0
[init -> tz_vmm] Cpu state:
[init -> tz_vmm]   Register     Virt     Phys
[init -> tz_vmm] ---------------------------------
[init -> tz_vmm]   r0         = 8a82c000 [63fa0000]
[init -> tz_vmm]   r1         = 00000002 [00000000]
[init -> tz_vmm]   r2         = 00000035 [00000000]
[init -> tz_vmm]   r3         = f7ed8fff [53fd8fff]
[init -> tz_vmm]   r4         = 8091bbe8 [8091bbe8]
[init -> tz_vmm]   r5         = 808b6a40 [808b6a40]
[init -> tz_vmm]   r6         = 8091b9c4 [8091b9c4]
[init -> tz_vmm]   r7         = 808b6a38 [808b6a38]
[init -> tz_vmm]   r8         = 8002e98c [8002e98c]
[init -> tz_vmm]   r9         = 412fc085 [00000000]
[init -> tz_vmm]   r10        = 0000001f [00000000]
[init -> tz_vmm]   r11        = 00000000 [00000000]
[init -> tz_vmm]   r12        = 00000003 [00000000]
[init -> tz_vmm]   sp         = 00000000 [00000000]
[init -> tz_vmm]   lr         = 00000000 [00000000]
[init -> tz_vmm]   ip         = 80042c1c [80042c1c]
[init -> tz_vmm]   cpsr       = 60000093
[init -> tz_vmm]   sp_und     = 8091b9f8 [8091b9f8]
[init -> tz_vmm]   lr_und     = 8091b9f8 [8091b9f8]
[init -> tz_vmm]   spsr_und   = 00000000 [00000000]
[init -> tz_vmm]   sp_svc     = 808b3f80 [808b3f80]
[init -> tz_vmm]   lr_svc     = 80042dc8 [80042dc8]
[init -> tz_vmm]   spsr_svc   = 60000013 [00000000]
[init -> tz_vmm]   sp_abt     = 8091b9ec [8091b9ec]
[init -> tz_vmm]   lr_abt     = 8091b9ec [8091b9ec]
[init -> tz_vmm]   spsr_abt   = 00000000 [00000000]
[init -> tz_vmm]   sp_irq     = 8091b9e0 [8091b9e0]
[init -> tz_vmm]   lr_irq     = 80039a40 [80039a40]
[init -> tz_vmm]   spsr_irq   = 60000093 [00000000]
[init -> tz_vmm]   sp_fiq     = 00000000 [00000000]
[init -> tz_vmm]   lr_fiq     = 00000000 [00000000]
[init -> tz_vmm]   spsr_fiq   = 00000000 [00000000]
[init -> tz_vmm]   ttbr0      = 80004019
[init -> tz_vmm]   ttbr1      = 80004019
[init -> tz_vmm]   ttbrc      = 00000000
[init -> tz_vmm]   dfar       = 8a82c00c [63fa000c]
[init -> tz_vmm]   exception  = data_abort
[init -> tz_vmm] Could not handle data-abort will exit!



More information about the users mailing list