How to use Xen for linux(ubuntu) and Android

I have Ubuntu xenial distro installed and “make bindeb-pkg LOCALVERSION=-hikey-linaro” could work fine. Also following is libssl-dev version info:

$ apt-cache policy libssl-dev
libssl-dev:
  Installed: 1.0.2g-1ubuntu4.13
  Candidate: 1.0.2g-1ubuntu4.13
  Version table:
 *** 1.0.2g-1ubuntu4.13 500
        500 http://in.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages
        100 /var/lib/dpkg/status
     1.0.2g-1ubuntu4 500
        500 http://in.archive.ubuntu.com/ubuntu xenial/main amd64 Packages

I have Ubuntu(14.04) trusty distro installed.

apt-cache policy libssl-dev
libssl-dev:
Installed: 1.0.1f-1ubuntu2.26
Candidate: 1.0.1f-1ubuntu2.26
Version table:
*** 1.0.1f-1ubuntu2.26 0
500 Index of /ubuntu/ trusty-updates/main amd64 Packages
500 Index of /ubuntu trusty-security/main amd64 Packages
100 /var/lib/dpkg/status
1.0.1f-1ubuntu2 0
500 Index of /ubuntu/ trusty/main amd64 Packages

Do you have any working binaries? Is it possible to attached it here?
If it works at my end I can use it as reference.

Thanks

Hi Vikram,

Have you installed Android as domU successfully?

Thanks

Hi Ramblech,

We are able to get Android as domU with the console and USB working. We tried a lot to get display working, but due to lack of display subsystem information we were blocked.

Hi Vikram,
Thank you very much for reply,
do you know that whether hikey970 can run xen?

Please find the link.

Have you solved this error?

Hi @Vikram,

I tried to install Xen as well, but with no success. I followed the steps on Xen wiki. But, I faced a problem that it could not found the rootfs (the xen+kernel loaded successfully). Can you kindly share the steps that works for you?

Cheers!

Here is the error

[ 33.588175] VFS: Cannot open root device “sdd10” or unknown-block(0,0): error -6
[ 33.595477] Please append a correct “root=” boot option; here are the available partitions:
[ 33.603898] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[ 33.612208] CPU: 2 PID: 1 Comm: swapper/0 Not tainted 4.14.0-rc7-linaro-hikey960+ #2
[ 33.620008] Hardware name: HiKey960 (DT)
[ 33.623996] Call trace:
[ 33.626520] [] dump_backtrace+0x0/0x3c8
[ 33.631976] [] show_stack+0x14/0x20
[ 33.637096] [] dump_stack+0x98/0xb8
[ 33.642209] [] panic+0x114/0x27c
[ 33.647068] [] mount_block_root+0x178/0x250
[ 33.652873] [] mount_root+0x11c/0x134
[ 33.658163] [] prepare_namespace+0x13c/0x184
[ 33.664060] [] kernel_init_freeable+0x200/0x224
[ 33.670220] [] kernel_init+0x10/0x100
[ 33.675508] [] ret_from_fork+0x10/0x18
[ 33.680892] SMP: stopping secondary CPUs
[ 33.684885] Kernel Offset: disabled
[ 33.688431] CPU features: 0x002004
[ 33.691895] Memory Limit: none
[ 33.695022] —[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

@scorpionzezz: You sure you are posting on the right thread? Based on your root device I guess you are using hikey970 rather than hikey960.

hi @danielt, my board is hikey960 v2. I tried to install fresh debian using sdcard / onboard memory, both works fine, just with this custom rootfs (xen) does not work.

My mistake. I thought hikey960 still used eMMC and first UFS board was hikey970 so when I say sdd10 I was confused (however I was wrong hikey960 uses UFS too).

@danielt

no problem :slight_smile:

I downloaded the Fastboot files from: Debian Downloads for HiKey960 - 96Boards

and then use boot-linaro-stretch-developer-hikey-20181217-25.img and rootfs-linaro-stretch-developer-hikey-20181217-25.img

it works fine, but when I tried to make own rootfs (like on xen wiki), the rootfs does not detected somehow.

You didn’t share full boot logs so I can’t check this myself but the kernel normally sends out debug messages as it parses the partition tables… did if find any partitions at all (e.g. has it failed to scan the UFS or is it simply that sdd10 does not exist).

PS I have no practical experience with Xen (some architecture knowledge but I’ve never actually tried to use it)… however “tried to make own rootfs” could easily create problems unrelated to Xen which is why I’m asking the above :wink:

HI @danielt,

here is the full logs: Xen 4.11.1 (c/s Thu Nov 29 15:04:11 2018 +0100 git:96cbd0893f) EFI loader Xen - Pastebin.com

I tried also to did this: Board Recovery for HiKey960 - 96Boards

but still without any success to boot the Xen. Other things I tried to do is using the SDCard, I tried to flash the image to the SD card and replace the GRUB (from my own compiled GRUB) on the /boot/efi, but somehow when I rebooted it still uses the old GRUB instead of the one that I compiled.

Hmn… the logs show problems with UFS (messages like: ufshcd-hi3660 ff3b0000.ufs: ufshcd_query_flag: Sending flag query for idn 3 failed, err = -11) so the kernel is not enumerating any of the partitions.

If this doesn’t ring any bells with @Vikram then I think you might have to ask what could cause this type of problem within the Xen community.

In the mean time though it does look from the logs as though USB3 is working fine. You might be able to unblock yourself in the mean time but putting the rootfs on a USB stick.

Hello scorpionzezz,

We faced same issue with hynix UFS in linux kernel 4.14. UFS driver initialization has a issue. You need to add 2 lines of code which solves this issue. You can take 4.9 kernel as reference and fix this issue. Currently i dont have access to the code base

Hi @Vikram,

when you have access, can you zip all the images files and the UEFI that you used?

Cheers!

Hi @scorpionzezz,

Could you check this patch [1] has been included in your local code base? This patch has been merged into AOSP hikey kernel code base.

[1] https://android-review.googlesource.com/c/kernel/hikey-linaro/+/750912

Hi @leo-yan

thanks! I will take a look, I need to downgrade the UEFI first, because now I’m using the UEFI from 4.19.5 kernel based Debian snapshot image release for HiKey960 - #12 by Mani and seems like it even does want to load the Xen.

I will get back to you will the result.

Cheers!