As memory hotplug for arm64 by acpi is not ready on qemu, we choose "probe" instead. You can refer to [1] to get more infomation about "probe". The process of memory hotplug by "probe" in kata lies below: firstly, add memory in qemu qmp; secondly, echo the start phyical address of that memory to /sys/devices/system/memory/probe, which will be done through kata-agent; thirdly, excute online op, then this newly added memory is capable to be used. All functions in this patch will be called after "echo" op. It can be divided into two parts: 1. create page table for that memory; 2. add that memory to memblock. In this patch, NUMA must be turned off for not all arm64 machine supports NUMA. As the newly added memory should be placed from 2T to 6T which is decided in qemu and phyical address and virtual address will be one-one mapping when create pgd for that memory, we must config ARM64_VA_BITS as 48. Also some configs should be turned on, especially "ARCH_MEMORY_PROBE". We have tested this patch integrated with another patch which performed that echo op. It works well when using "-m" in command line when start a kata-container on aarch64 machine. This patch derived from Maciej Bielski. You can refer to [2] to get full infomation about it. [1] https://www.kernel.org/doc/Documentation/memory-hotplug.txt [2] https://lkml.org/lkml/2017/11/23/183 Fixes: #309 Signed-off-by: Jianyong Wu <jianyong.wu@arm.com> Signed-off-by: Jia He <justin.he@arm.com> Signed-off-by: Penny Zheng <penny.zheng@arm.com>
Build Kata Containers Kernel
This document explains the steps to build a compatible kernel with Kata Containers. To do this use build-kernel.sh, this script automates the process to build a kernel for Kata Containers.
Setup kernel source code
./build-kernel.sh setup
The script ./build-kernel.sh tries to apply the patches from
${GOPATH}/src/github.com/kata-containers/packaging/kernel/patches/ when it
sets up a kernel. If you want to add a source modification, add a patch on this
directory.
The script also adds a kernel config file from
${GOPATH}/src/github.com/kata-containers/packaging/kernel/configs/ to .config
in the kernel source code. You can modify it as needed.
Build the kernel
After the kernel source code is ready it is possible to build the kernel.
./build-kernel.sh build
Install the Kernel in the default path for Kata
Kata Containers uses some default path to search a kernel to boot. To install on this path, the following command will install it to the default Kata containers path.
./build-kernel.sh install