Commit Graph

73 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
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
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
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
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
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
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
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
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
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
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
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
Fabiano Fidêncio
6c3338271b
packaging: kernel: Remove sev/snp/tdx specific stuff
Now we're using a "confidential" image that has support for all of
those.

Fixes: #9010 -- part II
       #8982 -- part II
       #8978 -- part II

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-13 19:07:33 +01:00
Fabiano Fidêncio
4394dacb88
packaging: Build the confidential kernel with MEASURED_ROOTFS support
This is already done for the TDX kernel, and should have been done also
for the confidential one.

This action requires us to bump the kernel version as the resulting
kernel will be different from the cached one.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-02 21:13:06 +01:00
Fabiano Fidêncio
5d2906c36a
packaging: Bump the kata config kernel version
Just to make sure we won't use cached components.

Fixes: #6415

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-01 16:57:15 +01:00
Zvonko Kaiser
4fc34323ae gpu: Add NVIDIA GPU Confidential kernel target
This is a follow up to the work of minimizing targets, unifying TDX,SNP builds for NVIDIA GPUs

Fixes: #8828

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2024-01-22 14:58:57 +00:00
Fabiano Fidêncio
8b2f43a2c2
build: Add "confidential" kernel
We're using a Kernel based on v6.7, which should include all te
patches needed for SEV / SNP / TDX.

By doing this, later on, we'll be able to stop building the specific
kernel for each one of the targets we have for the TEEs.

Let's note that we've introduced the "confidential" target for the
kernel builder script, while the TEE specific builds are being kept as
they're -- at least for now.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-01-09 14:35:45 -03:00
Chao Wu
f9e0a4bd7e upcall: introduce pci device add & del kernel patch
add pci add and del guest kernel patch as the extension
in the upcall device manager server side.

also, dump config version to 120 since we need to add config
for dragonball pci in upcall

fixes: #8741

Signed-off-by: Gerry Liu <gerry@linux.alibaba.com>
Signed-off-by: Helin Guo <helinguo@linux.alibaba.com>
Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
2023-12-28 16:21:30 +08:00
Fabiano Fidêncio
03c3f4275e kernel: Add CONFIG_TDX_GUEST_DRIVER to the tdx.conf
The driver enables the userspace interface to communicate with the TDX
module to request the TDX guest details, like the attestation report.

Fixes: #8555

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-12-04 10:25:59 +01:00
ChengyuZhu6
6de01eacfd kernel: backport erofs patch to 6.1.52 guest kernel
Backport the erofs patch from linux kernel to solve the error #8083

Fixes: #8083

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
Co-authored-by: Gao Xiang <hsiangkao@linux.alibaba.com>
2023-11-21 15:22:40 +08:00
Alexandru Matei
bfd1ce30e1 kernel: Fix vsock packets drop when the vsock driver starts
The virtio vsock driver has a small window during initialization
where it can silently drop replies to connection requests.
Because no reply is sent, kata waits for 10 seconds and in the
end it generates a connection timeout error in HybridVSockDialer.

Fixes: #8291

Signed-off-by: Alexandru Matei <alexandru.matei@uipath.com>
2023-11-14 11:02:52 +02:00
Jianyong Wu
7f5e77bcb8 kernel: enable Arm pl011 support
Enable pl011 (ttyAMA0) support in kernel for aarch64.

Fixes: #5080
Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
2023-09-15 01:45:16 +00:00
Jeremi Piotrowski
1b02f89e4f packaging: kernel: Enable VIRTIO_IOMMU on x86_64
Cloud Hypervisor exposes a VIRTIO_IOMMU device to the VM when IOMMU support is
enabled. We need to add it to the whitelist because dragonball uses kernel
v5.10 which restricted VIRTIO_IOMMU to ARM64 only.

Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
2023-09-14 14:23:28 +02:00
Fabiano Fidêncio
fde34610cd kernel: Add erofs patches needed for CC related work
All the patches have already been merged upstream and they've just been
cherry-picked to this branch.

Fixes: #7885

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-09-11 10:39:37 +02:00
Fabiano Fidêncio
8115a0522d versions: tdx: Update Kernel to 6.2 + TDX
This is the version that's been used and tested inside Intel, and it
matches with https://github.com/intel/tdx-tools/releases/tag/2023ww15.

Fixes: #7770

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-08-28 13:11:34 +02:00
Jianyong Wu
7923de8999 static-build: cross build kernel
Prepare cross build environment based on current Dockerfile.

Fixes: #6557
Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
2023-08-01 22:10:46 +02:00
Jeremi Piotrowski
950b89ffac versions: Update kernel to version v6.1.38
Kernel v6.1.38 is the current latest LTS version, switch to it.  No
patches should be necessary. Some CONFIG options have been removed:

- CONFIG_MEMCG_SWAP is covered by CONFIG_SWAP and CONFIG_MEMCG
- CONFIG_ARCH_RANDOM is unconditionally compiled in
- CONFIG_ARM64_CRYPTO is covered by CONFIG_CRYPTO and ARCH=arm64

Fixes: #6086
Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
2023-07-18 10:04:21 +02:00
Zvonko Kaiser
2c8dfde168 kernel: Update kernel config name
Fixes: #7294

When installing the kernel config adjust the name like
the vmlinuz and vmlinux files so that any added suffixes
are also reflected in the kernel config name.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2023-07-14 06:50:35 +00:00
Zvonko Kaiser
9318e022af gpu: Add CC relates configs
For the GPU CC use case we need to set several crypto algorithms.
The driver relies on them in the CC case.

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2023-06-14 07:56:53 +00:00
Arron Wang
31c0ad2076 packaging: Add cryptsetup support in Guest kernel and rootfs
Add required kernel config for dm-crypt/dm-integrity/dm-verity
and related crypto config.

Add userspace command line tools for disk encryption support
and ext4 file system utilities.

Fixes: #6674

Signed-off-by: Arron Wang <arron.wang@intel.com>
2023-06-06 12:30:07 +02:00
Archana Shinde
9228815ad2 kernel: Modify build-kernel.sh to accomodate for changes in version.yaml
There were recent changes for the tdx kernel in the version.yaml that are
not currently accounted for in the build-kernel.sh script.
Attempts to setup a tdx kernel to build local changes seemed to not download
the tdx kernel. Instead the mainline kernel is downloaded which has no
tdx-related changes.

The version.yaml has a new entry for tdx kernel. Use that instead for
setting up and downloading the tdx kernel.

Fixes: #6984

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2023-05-30 13:44:58 -07:00
xuejun-xj
ffe3157a46 dragonball: add arm64 patches for upcall
The vcpu hotplug/hotunplug feature is implemented with upcall. This commit
add three patches to support the feature on aarch64. Patches:
> 0005: add support of upcall on aarch64
> 0006: skip activate offline cpus' MSI interrupt
> 0007: set the correct boot cpu number

Fixes: #6010

Signed-off-by: xuejun-xj <jiyunxue@linux.alibaba.com>
2023-05-30 15:51:08 +08:00
Zvonko Kaiser
aca6ff7289 gpu: Build and Ship an GPU enabled Kernel
With each release make sure we ship a GPU and TEE enabled kernel

Fixes: #6553

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2023-04-14 07:52:42 +00:00
Fabiano Fidêncio
f33345c311 versions: Update Kernel TDX version
Let's update the Kernel TDX version to what's the latest tested release
of the Intel TDX tools with Kata Containers.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-04-11 15:23:42 +02:00
Zvonko Kaiser
fe86c08a63 tools: Avoid building the kernel twice
Two different kernel build targets (build,install) have both instructions to
build the kernel, hence it was executed twice. Install should only do
install and build should only do build.

Fixes: #6588

Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2023-04-04 05:44:44 +00:00