Commit Graph

225 Commits

Author SHA1 Message Date
Champ-Goblem
cf4325b535 kernel: Add CONFIG_TASKSTATS (and related) configs
Knowing that the upstream project provides a "ready to use" version of
the kernel, it's good to include an easy way to users to monitor
performance, and that's what we're doing by enabling the TASKSTATS (and
related) kernel configs.

This has been present as part of older kernels, but I couldn't
reasonably find the reason why it's been dropped.

Signed-off-by: Champ-Goblem <cameron@northflank.com>
Signed-off-by: Fabiano Fidêncio <fidencio@northflank.com>
2025-04-24 11:51:21 +02:00
Shunsuke Kimura
c0af0b43e0 kernel: Update the outdated usage in the readme
Since it is difficult to update the README when modifying the options of ./build-kernel.sh,
instead of update the README, we encourage users to run the -h command.

Fixes: #11065

Signed-off-by: Shunsuke Kimura <pbrehpuum@gmail.com>
2025-03-31 23:29:58 +09:00
Kevin Zhao
211a36559c runtime-go: qemu: Fix sandbox start failing with virtio-mem enable on arm64
Also add CONFIG_VIRTIO_MEM to arm64 platform

Signed-off-by: Kevin Zhao <kevin.zhao@linaro.org>
2025-03-26 22:31:00 +08:00
Ruoqing He
3c8a8ca9c2 kernel: Enable riscv kernel build
Modify `build-kernel.sh` to enable building of riscv64 kernel.

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-03-13 13:43:29 +08:00
Ruoqing He
e316f633d8 kernel: Bump kata_config_version
Bump kata_config_version since riscv kernel build is introduced.

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-03-13 13:43:29 +08:00
Ruoqing He
31446b8be8 kernel: Skip ACPI common fragment for riscv
ACPI is not yet ratified and is still frequently evolving, disable
acpi.conf for riscv architecture.

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-03-13 13:43:29 +08:00
Ruoqing He
ebd1214b2e kernel: Introduce riscv mmu fragment conf
Memory hotplug and related features is required, enable them in
`mmu.conf`.

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-03-13 13:43:29 +08:00
Ruoqing He
734f5d07a9 kernel: Introduce riscv pci fragment conf
AIA (Advanced Interrupt Architecture) is available and enabled by
default after v6.10 kernel, provide pci.conf to make proper use of IMSIC
of AIA.

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-03-13 13:43:29 +08:00
Ruoqing He
19d78ca844 kernel: Introduce riscv base fragment conf
Create `riscv` folder for riscv64 architecture to be inferred while
constructing kernel configuration, and introduce `base.conf` which
builds 64-bit kernel and with KVM built-in to kernel.

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
2025-03-13 13:43:29 +08:00
stevenhorsman
e33ad56cf4 kernel: bump kata_config_version
Bump kernel version as the build-kernel script
was updated (even if there was no functional change).

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-03-04 09:39:10 +00:00
stevenhorsman
c5ff513e0b shellcheck: Fix shellcheck SC2068
> Double quote array expansions to avoid re-splitting elements

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2025-03-04 09:35:46 +00:00
Zvonko Kaiser
c4e4e14b32 kernel: bump kata_config_version
Mandatory update to have a unique kernel version name

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-02-28 15:18:15 +00:00
Zvonko Kaiser
493ba63c77 gpu: Provide KBUILD_SIGN_PIN to the build.sh
At the proper step pass-through the var KBUILD_SIGN_PIN
so that the kernel_headers step has the PIN for encrypting
the signing key.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-02-28 01:31:35 +00:00
Zvonko Kaiser
c2cb89532b gpu: Add the proper handling in build-kernel.sh
If KBUILD_SIGN_PIN is provided we can encrypt the signing key
for out-of-tree builds and second round jobs in GHA

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-02-28 01:31:35 +00:00
Zvonko Kaiser
bc8360e8a9 gpu: Add proper config for module signing
We want to enable module signing in Kata and Coco

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-02-28 01:31:34 +00:00
Simon Kaegi
f5edbfd696 kernel: support loop device in v6.8+ kernels
Set CONFIG_BLK_DEV_WRITE_MOUNTED=y to restore previous kernel behaviour.

Kernel v6.8+ will by default block buffer writes to block devices mounted by filesystems.
This unfortunately is what we need to use mounted loop devices needed by some teams
to build OSIs and as an overlay backing store.

More info on this config item [here](https://cateee.net/lkddb/web-lkddb/BLK_DEV_WRITE_MOUNTED.html)

Fixes: #10808

Signed-off-by: Simon Kaegi <simon.kaegi@gmail.com>
2025-02-17 13:47:35 +01:00
Jakub Ledworowski
42531cf6c4 kernel: Add CONFIG_TMPFS_XATTR to confidential kernel
During pull inside the guest, overlayfs expects xattrs.

Fixes: [guest-components#876](https://github.com/confidential-containers/guest-components/issues/876)

Signed-off-by: Jakub Ledworowski <jakub.ledworowski@intel.com>
2025-01-27 07:07:54 +01:00
Fabiano Fidêncio
c653719270 kernel: Ensure no cgroupsv1 is used
Let's ensure that we're fully running the guest on cgroupsv2.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2025-01-23 17:25:56 +01:00
Zvonko Kaiser
91c6d524f8 gpu: Fix arm64 kernel build
CONFIG_IOASID (not configurable) in newer kernels.
Removing it.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2025-01-22 18:15:57 +00:00
Hui Zhu
42f5ef9ff1 kernel: config: Add CONFIG_VIRTIO_BALLOON to virtio.conf
Add CONFIG_VIRTIO_BALLOON to virtio.conf to open virtio-balloon.

Fixes: #10710

Signed-off-by: Hui Zhu <teawater@antgroup.com>
2025-01-21 10:34:04 +08:00
Fabiano Fidêncio
f563f0d3fc versions: Update kernel to v6.12.8
There are lots of configs removed from latest kernel. Update them here
for convenience of next kernel upgrade.

Remove CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE [1]
Remove CONFIG_IP_NF_TARGET_CLUSTERIP [2]
Remove CONFIG_NET_SCH_CBQ [3]
Remove CONFIG_AUTOFS4_FS [4]
Remove CONFIG_EMBEDDED [5]
Remove CONFIG_ARCH_RANDOM & CONFIG_RANDOM_TRUST_CPU [6]

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v6.6&id=a7e4676e8e2cb158a4d24123de778087955e1b36
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v6.6&id=9db5d918e2c07fa09fab18bc7addf3408da0c76f
[3] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v6.6&id=051d442098421c28c7951625652f61b1e15c4bd5
[4] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v6.6&id=1f2190d6b7112d22d3f8dfeca16a2f6a2f51444e
[5] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v6.6&id=ef815d2cba782e96b9aad9483523d474ed41c62a
[6] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v6.2&id=b9b01a5625b5a9e9d96d14d4a813a54e8a124f4b

Apart from the removals, CONFIG_CPU_MITIGATIONS is now a dependency for
CONFIG_RETPOLINE (which has been renamed to CONFIG_MITIGATION_RETPOLINE)
and CONFIG_PAGE_TABLE_ISOLATION (which has been renamed to
CONFIG_MITIGATION_PAGE_TABLE_ISOLATION).  I've added that to the
whitelist because we still build older versions of the kernel that
do not have that dependency.

Fixes: #8408
Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2025-01-06 21:48:20 +01:00
Hui Zhu
f9c63d20a4 kernel/configs: Add mglru, debugfs and psi to dragonball-experimental
Add mglru, debugfs and psi to dragonball-experimental/mem_agent.conf to
support mem_agent function.

Fixes: #10625

Signed-off-by: Hui Zhu <teawater@antgroup.com>
2024-12-06 09:59:59 +08:00
Crypt0s
563a6887e2 kernel: add CONFIG_KEYS=y to enable kernel keyring
KinD checks for the presence of this (and other) kernel configuration
via scripts like
https://blog.hypriot.com/post/verify-kernel-container-compatibility/ or
attempts to directly use /proc/sys/kernel/keys/ without checking to see
if it exists, causing an exit when it does not see it.

Docker/it's consumers apparently expect to be able to use the kernel
keyring and it's associated syscalls from/for containers.

There aren't any known downsides to enabling this except that it would
by definition enable additional syscalls defined in
https://man7.org/linux/man-pages/man7/keyrings.7.html which are
reachable from userspace. This minimally increases the attack surface of
the Kata Kernel, but this attack surface is minimal (especially since
the kernel is most likely being executed by some kind of hypervisor) and
highly restricted compared to the utility of enabling this feature to
get further containerization compatibility.

Signed-off-by: Crypt0s <BryanHalf@gmail.com>
2024-11-15 09:30:06 +01:00
Fabiano Fidêncio
f7b31ccd6c kernel: bump kata_config_version
Due to the changes done in the previous commits.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2024-11-05 12:26:57 +01:00
Fabiano Fidêncio
a52ea32b05 build: kernel: Learn how to deal with release candidates
So far we were not prepared to deal with release candidates as those:
* Do not have a sha256sum in the sha256sums provided by the kernel cdn
* Come from a different URL (directly from Linus)
* Have a different suffix (.tar.gz, instead of .tar.xz)

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2024-11-05 12:26:02 +01:00
Fabiano Fidêncio
ee1a17cffc build: kernel: Take kernel_url into consideration
Let's make sure the kernel_url is actually used whenever it's passed to
the function.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2024-11-05 12:26:02 +01:00
Fabiano Fidêncio
9a0b501042 build: kernel: Remove tee specific function
As, thankfully, we're relying on upstream kernels for TEEs.

Signed-off-by: Fabiano Fidêncio <fabiano@fidencio.org>
2024-11-05 12:26:02 +01:00
Gabriela Cervantes
69ee287e50 packaging: Remove kernel config repo variable as it is unused
This PR removes the kernel config repo variable at the build kernel
script as it is not used.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-10-29 17:09:52 +00:00
Gabriela Cervantes
616eb8b19b packaging: Remove unused variable in build kernel script
This PR removes an unused variable in the build kernel script.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-10-09 20:02:56 +00:00
Hui Zhu
9c1b5238b3 kernel/configs: Add ballon and f_reporting to dragonball-experimental
Add CONFIG_PAGE_REPORTING, CONFIG_BALLOON_COMPACTION and
CONFIG_VIRTIO_BALLOON to dragonball-experimental configs to open
dragonball function and free page reporting function.

Signed-off-by: Hui Zhu <teawater@antgroup.com>
2024-09-04 17:25:30 +08:00
Lei Huang
20f6979d8f build: add kernel config for Nvidia DPU/ConnectX adapter
With Nvidia DPU or ConnectX network adapter, VF can do VFIO passthrough
to guest VM in `guest-kernel` mode. In the guest kernel, the adapter's
driver is required to claim the VFIO device and create network interface.

Signed-off-by: Lei Huang <leih@nvidia.com>
2024-07-18 22:29:16 -07:00
Fupan Li
65f2bfb8c4
Merge pull request #9967 from zvonkok/kernel-dragonball-6.1.x
dragonball: kernel dragonball 6.1.x
2024-07-17 14:38:06 +08:00
Gabriela Cervantes
7061272b4e kernel: bump kata config version
This PR bumps the kata config version as the kernel scripts were
modified.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-07-09 20:04:24 +02:00
Gabriela Cervantes
de848c1458 packaging: Remove CI variable from build kernel script
This PR removes the CI variable from build kernel script which
is not longer supported it as this was part of the jenkins
environment.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-07-09 20:04:24 +02:00
Zvonko Kaiser
7990d3a154 dragonball: Update kata config version
Mandatory update

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-07-04 17:24:16 +00:00
Zvonko Kaiser
26446d1edb dragonball: Update patches
After v5.14 there is no cpu_hotplug_begin function
now cpus_write_lock same for cpu_hotplug_done = cpus_write_unlock

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-07-04 17:23:24 +00:00
Zvonko Kaiser
ad574b7e10 dragonball: Add patches for 6.1.x
Ported the 5.10 patchs to 6.1.x

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-07-04 17:06:39 +00:00
Hyounggyu Choi
9cb12dfa88 kernel: Add CONFIG_S390_UV_UAPI for s390x
While enabling the attestation for IBM SE, it was observed that
a kernel config `CONFIG_S390_UV_UAPI` is missing.
This config is required to present an ultravisor in the guest VM.
Ths commit adds the missing config.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-06-20 13:15:33 +02:00
Beraldo Leal
d3a5eb299a tools: bumping kernel config version
Lets make ci happy.

Signed-off-by: Beraldo Leal <bleal@redhat.com>
2024-05-31 13:28:34 -04:00
Beraldo Leal
c99ba42d62 deps: bumping yq to v4.40.7
Since yq frequently updates, let's upgrade to a version from February to
bypass potential issues with versions 4.41-4.43 for now. We can always
upgrade to the newest version if necessary.

Fixes #9354
Depends-on:github.com/kata-containers/tests#5818

Signed-off-by: Beraldo Leal <bleal@redhat.com>
2024-05-31 13:28:34 -04:00
Zvonko Kaiser
c95ae5a502 ci: kernel no sudo
Build kernel without sudo docker this is not needed. This is part 4 of N

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-05-28 11:19:08 +00:00
Zvonko Kaiser
4d0f42a145 deploy: Fix wrong pushing of artifacts
Added explicit case statements for nvidia-gpu and
nvidia-gpu-confidential

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-05-10 14:08:32 +00:00
Zvonko Kaiser
fb0b821771 kernel: Add caching of kernel-headers
Fixes: #9481

We need to cache the kernel-headers for the NVIDIA GPU initrd/image build.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-05-08 11:30:39 +00:00
Hyounggyu Choi
a792dc3e2b kernel: Adjust s390x config for confidential containers
`CONFIG_TN3270_TTY` and `CONFIG_S390_AP_IOMMU` are dropped for s390x
in 6.7.x which is used for a confidential kernel.
But they are still used for a vanilla kernel. So we need to add them
to the whitelist.

Fixes: #9465

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-04-15 10:28:59 +02:00
GabyCT
12947b1ba6
Merge pull request #9344 from GabyCT/topic/kerneldoc
docs: Remove stale kernel information
2024-04-03 11:13:54 -06:00
Gabriela Cervantes
ddef2be4f1 docs: Remove stale kernel information
This PR removes stale kernel information from the README document.

Fixes #9343

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-03-25 15:57:00 +00:00
Alex Lyn
079d894496 kernel: bump version in kata config version
Fixes: #9140

Signed-off-by: Alex Lyn <alex.lyn@antgroup.com>
2024-03-25 20:25:27 +08:00
Alex Lyn
bc309b9865 kernel: add CONFIG_CRYPTO_ECDSA into whitelist
CONFIG_CRYPTO_ECDSA is not supported in older kernels such as 5.10.x
which may cause building broken problem if we build such kernel with
NVIDIA GPU in version 5.10.x

So this patch is to add CONFIG_CRYPTO_ECDSA into whitelist.conf to
avoid break building guest kernel with NVIDIA GPU.

Fixes: #9140

Signed-off-by: Alex Lyn <alex.lyn@antgroup.com>
2024-03-25 08:05:31 +08:00
Gabriela Cervantes
12be4cf828 docs: Remove stale kernel information at README documentation
This PR removes stale kernel information at README documentation.

Fixes #9218

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-03-05 16:46:45 +00:00
Jimmy-Xu
5ada7329b8 gpu: fix build guest kernel with nvidia gpu
- enable CONFIG_MTRR,CONFIG_X86_PAT on x86_64 for nvidia gpu
- optimize -f of build-kernel.sh, clean old kernel path and config before setup
- add kernel 5.16.x

Fixes: #9143

Signed-off-by: Jimmy-Xu <xjimmyshcn@gmail.com>
2024-03-04 09:40:42 +08:00