Compile a customized kernel that runs on HYP mode

Hi,

I’m trying to run Linux on Xen. So I have to boot the board’s CPU in HYP mode instead of the default SVC mode.

Now I have a compiled u-boot from the upstreamed u-boot that can boot the CPU into HYP mode. However, the default L4T linux kernel cannot run on CPU with HYP mode. (It has to run on SVC mode as far as I can tell.)

So I want to compile a linux kernel that can run on HYP mode.

I used Jan Kiszka’s development tree - git.kiszka.org Git - linux.git/summary, branch queues/assorted which has some of the PSCI patches required to boot linux.

I enable the CONFIG_XEN and the PSCI config based on the .config file that was used for the NVIDIA L4T source code. I cross compile the source code on Ubuntu 12.04 and the device trees. I copied both the new compiled zImage and the new compiled dtb into the /boot folder on the board and add a new entry.

However, when I boot the board, I can tell that the new compiled kernel cannot boot at all. The system hangs after the message “Start Kernels…”
If I boot the CPU into SVC mode, I can boot into the original L4T kernel.

My question is:

Does anyone have a working Linux repo that can run on Jetson TK1 board with HYP mode?
If yes, could you share the .config file as well?

Thank you very much for your time and help in this question!

I didn’t tried to run on HYP mode, BUT I recompiled many kernels this I got the Jetson last week :

  • Copying the .config file from 2 differents versions of the kernel may not always work
    For the .config file, you may generate a default config file:
make tegra_defconfig
  • you have to use the dtb file provided by the kernel:
make dtbs && make dtbs_install

And of course, point the DTB parameter to the new dtb file.

Hope this will help !

HI, thank you so much for your help!

Can I know which kernel repo you used?
In the kernel repo I used, when I use

make tega_defconfig

, it cannot find the default config… :-(
So I think the repo matters.

Thank you so much!

make tegra_defconfig

works!!

I forgot to use cross compiler to compile, that’s why it cannot find the config…

Thank you so~~~~ much!

Good !

Keep us updated with your experiments, I’m interested in running some (lights) VMs as well.

Yes. The linux kernel tree from Jan Kiszka’s development tree - git.kiszka.org Git - linux.git/summary, branch queues/assorted works for HYP mode. However, this kernel cannot boot as a dom0 in Xen environment… :-(

I’m wondering if anyone has ever succeed in boot a Linux in Xen or KVM?

Thanks,