How to use Xen for linux(ubuntu) and Android

Hi

We are using Hikey960 board V2.
We want achieve below listed features:

  1. We want enable Xen support.
  2. We need to use Linux(Ubuntu) as Dom0 and Android as DomU.

Followed instruction in the Hikey960 board WiKi page to build Linux Xen and grub, but information is not clear.
Please point us:

  1. Which repository should be used to clone the source for Linux(Ubuntu)
  2. Which repository should be used to clone the source for Xen and grub
  3. Which commit ID to use.
  4. Build steps to be followed

Thanks

Looks like we cross-posted but either way the page on the Xen wiki remains (as far as I know) the best available documentation for Xen users, so the advice I offered earlier (start with Debian working first and then the instructions on the Xen wiki will make more sense) still applies:

You can eventually swap out Debian for Ubuntu if you want to but starting from a system that has working UEFI, working grub and working GNU/Linux OS should make it easier for you to make confident decisions.

Thanks Daniel.

Tried to flash the pre-built binary for Debian package.(Downloaded from below link).

While booting getting following logs.

[ 2.841748] uart-pl011 fff32000.serial: no DMA platform data
[ 2.843166] mmc1: new SDIO card at address 0001
[ 3.749222] ufshcd-hisi ff3b0000.ufs: ufshcd_query_flag: Sending flag query for idn 3 failed, err = -11
[ 5.285217] ufshcd-hisi ff3b0000.ufs: ufshcd_query_flag: Sending flag query for idn 3 failed, err = -11
[ 5.294620] ufshcd-hisi ff3b0000.ufs: ufshcd_query_flag_retry: query attribute, opcode 5, idn 3, failed with error -11 after 3 retires
[ 6.821188] ufshcd-hisi ff3b0000.ufs: __ufshcd_query_descriptor: opcode 0x01 for idn 8 failed, index 0, err = -11

Please point some pre-built links so that we can use it and take it as reference

@Vikram Current Debian image (snapshot) kernel has limited features enabled for hikey960. But you should be able to get Linux uart prompt. It should suffice your purpose to update EFI (/boot/efi) partition and eventually replacing Debian with Ubuntu.

BTW, if you need to have full kernel features for hikey960 then build and install 96boards-hikey kernel.

Thanks Sumit.

I have already built this source code and flashed. But no luck, it is stopping at after Grub.

@Vikram Can you share the steps and boot-logs for kernel update?

BTW, a useful doc for kernel update: Build & Update Linux kernel on HiKey

Sumith,

Please find the steps followed for kernel upgrade:
git clone https://github.com/96boards-hikey/linux.git
cd linux
git checkout origin/hikey960-upstream-rebase
export CROSS_COMPILE=aarch64-linux-gnu-
export ARCH=arm64
make defconfig
make -j8

Download rootfs from below link and followed the steps.
https://releases.linaro.org/debian/images/developer-arm64/latest/linaro-stretch-developer-20170720-71.tar.gz
sudo tar -xzf linaro-stretch-developer-20170720-71.tar.gz
sudo mv binary rootfs
sudo cp Image rootfs/boot
sudo cp Image.dtb rootfs/boot

Flashing binaries:
fastboot flash ptable prebuilt/prm_ptable.img
fastboot flash fastboot prebuilt/l-loader.bin
fastboot flash fip prebuilt/fip.bin
fastboot flash boot boot-linaro-stretch-developer-hikey-20180521-18.img
fastboot flash system rootfs.img

Thanks for link. Have one question, whether the link shared is for Hikey or Hikey960

Using steps you provided, Linux (/boot/Image) and DTB (/boot/Image.dtb) path should be updated in the GRUB menu after pressing “e”.

It should work for hikey960 too. You need to replace kernel build with 96boards-hikey.

Followed the steps provided in the below link

Facing below issues.
make bindeb-pkg LOCALVERSION=-hikey-linaro
scripts/kconfig/conf --silentoldconfig Kconfig
CHK include/config/kernel.release
/bin/bash ./scripts/package/mkdebian
dpkg-buildpackage -j1 -r"fakeroot -u" -a$(cat debian/arch) -b -nc -uc
dpkg-buildpackage: source package linux-4.15.3-hikey-linaro-00154-gf449b3c
dpkg-buildpackage: source version 4.15.3-hikey-linaro-00154-gf449b3c-1
dpkg-buildpackage: source distribution trusty
dpkg-buildpackage: source changed by Anonymous
dpkg-buildpackage: host architecture arm64
dpkg-source --before-build linux
dpkg-checkbuilddeps: Unmet build dependencies: libssl-dev
dpkg-buildpackage: warning: build dependencies/conflicts unsatisfied; aborting
dpkg-buildpackage: warning: (Use -d flag to override.)
make[1]: *** [bindeb-pkg] Error 3
make: *** [bindeb-pkg] Error 2

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.