Here is what I do:
I use the instruction in http://www.jetsonhacks.com/2017/03/25/build-kernel-and-modules-nvidia-jetson-tx2/ to get kernel source code and build kernel on tx2 board.
I enable “Tegra Virtualization Support” and “Kernel-based Virtual Machine (KVM) support” options from kernel configuration and build the kernel.
First I get the following error:
include/linux/irqchip/arm-gic.h: Assembler messages:
include/linux/irqchip/arm-gic.h:100: Error: unknown mnemonic enum' --
enum domain_gic_pm_event{’
include/linux/irqchip/arm-gic.h:101: Error: unknown mnemonic mod_domain_power_on' --
mod_domain_power_on,’
include/linux/irqchip/arm-gic.h:102: Error: unknown mnemonic mod_domain_power_off' --
mod_domain_power_off’
include/linux/irqchip/arm-gic.h:103: Error: junk at end of line, first unrecognized character is `}’
scripts/Makefile.build:297: recipe for target ‘arch/arm64/kvm/vgic-v2-switch.o’ failed
make[1]: *** [arch/arm64/kvm/vgic-v2-switch.o] Error 1
Makefile:958: recipe for target ‘arch/arm64/kvm’ failed
I am able to fix this error by the following changes in “include/linux/irqchip/arm-gic.h”
+#ifndef ASSEMBLY
enum domain_gic_pm_event {
MOD_DOMAIN_POWER_ON,
MOD_DOMAIN_POWER_OFF
};
-#ifndef ASSEMBLY
But after building kernel again I get this error:
CC init/version.o
LD init/built-in.o
drivers/built-in.o: In function nvmap_populate_ivm_carveout': /usr/src/kernel/kernel-4.4/drivers/video/tegra/../../../../nvmap//drivers/video/tegra/nvmap/nvmap_init.c:209: undefined reference to
tegra_hv_mempool_reserve’
/usr/src/kernel/kernel-4.4/drivers/video/tegra/…/…/…/…/nvmap//drivers/video/tegra/nvmap/nvmap_init.c:209:(.init.text+0x5950): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `tegra_hv_mempool_reserve’
Makefile:944: recipe for target ‘vmlinux’ failed
make: *** [vmlinux] Error 1
CHK include/config/kernel.release
Can you let me know how to get around these and enabled KVM on Jetson-tx2 board?
BTW, I want to do some instrumentations using KVM, so containers does not work for me and I don’t care about the speed of visualization.
Thank you,
Mamad