mirror of
https://github.com/kata-containers/kata-containers.git
synced 2026-08-08 23:54:51 +00:00
config: boot composable nvidia base image + gpu/coco extensions
Flip the runtime-rs NVIDIA GPU configs (plain/tdx/snp) from the monolithic
image to the driver-agnostic nvidia base boot image plus a cold-plugged,
driver-versioned gpu extension mounted at /run/kata-extensions/gpu.
Confidential runtime-rs configs additionally cold-plug the CoCo
guest-components extension and enforce the nvidia base dm-verity hash.
The Go runtime keeps booting the monolithic nvidia-gpu / nvidia-gpu-confidential
images, mirroring the CoCo split where runtime-rs is the first-class citizen and
Go stays on the monolithic layout.
Add the IMAGE{NAME,PATH}_NV_{BASE,EXTENSION} and NVIDIAGPUEXTENSIONVERITYPARAMS
make vars (runtime-rs only), and read the nvidia base + gpu-extension root
hashes into runtime-rs's shim-v2 opts while the Go opts keep reading the
monolithic nvidia-gpu / nvidia-gpu-confidential hashes.
Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
Assisted-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -465,12 +465,22 @@ endif
|
||||
KERNELPATH_NV = $(KERNELDIR)/$(KERNELNAME_NV)
|
||||
IMAGENAME_NV = $(PROJECT_TAG)-nvidia-gpu.img
|
||||
IMAGEPATH_NV = $(PKGDATADIR)/$(IMAGENAME_NV)
|
||||
# Composable NVIDIA stack: driver-agnostic nvidia base boot image plus the
|
||||
# driver-versioned gpu extension (cold-plugged and mounted at /run/kata-extensions/gpu).
|
||||
IMAGENAME_NV_BASE = $(PROJECT_TAG)-nvidia.img
|
||||
IMAGEPATH_NV_BASE = $(PKGDATADIR)/$(IMAGENAME_NV_BASE)
|
||||
IMAGENAME_NV_EXTENSION = $(PROJECT_TAG)-nvidia-gpu-extension.img
|
||||
IMAGEPATH_NV_EXTENSION = $(PKGDATADIR)/$(IMAGENAME_NV_EXTENSION)
|
||||
KERNELPARAMS_NV := cgroup_no_v1=all pci=realloc pci=nocrs pci=assign-busses
|
||||
|
||||
KERNELPARAMS_CONFIDENTIAL_NV = $(KERNELPARAMS_NV)
|
||||
KERNELPARAMS_CONFIDENTIAL_NV += "nvrc.smi.srs=1"
|
||||
|
||||
# Verity params for the nvidia base boot image (root_hash_nvidia.txt)
|
||||
# and for the gpu extension (root_hash_nvidia-gpu-extension.txt); filled in by the
|
||||
# shim-v2 build from the emitted root-hash files.
|
||||
KERNELVERITYPARAMS_NV ?=
|
||||
NVIDIAGPUEXTENSIONVERITYPARAMS ?=
|
||||
DEFAULTVCPUS_NV := 1
|
||||
DEFAULTMEMORY_NV := 8192
|
||||
DEFOVERHEADVCPUS_NV := 0.5
|
||||
@@ -499,7 +509,6 @@ endif
|
||||
IMAGEPATH_CONFIDENTIAL_NV = $(PKGDATADIR)/$(IMAGENAME_CONFIDENTIAL_NV)
|
||||
KERNELNAME_CONFIDENTIAL_NV = $(call MAKE_KERNEL_NAME_NV,compressed)
|
||||
KERNELPATH_CONFIDENTIAL_NV = $(KERNELDIR)/$(KERNELNAME_CONFIDENTIAL_NV)
|
||||
KERNELVERITYPARAMS_CONFIDENTIAL_NV ?=
|
||||
FIRMWARESNPPATH_NV := $(FIRMWARE_SNP_PATH)
|
||||
FIRMWARETDVFPATH_NV := $(FIRMWARETDVFPATH)
|
||||
|
||||
@@ -649,6 +658,11 @@ USER_VARS += IMAGECONFIDENTIALNAME
|
||||
USER_VARS += IMAGEPATH
|
||||
USER_VARS += IMAGEPATH_CLH_AZURE
|
||||
USER_VARS += IMAGEPATH_NV
|
||||
USER_VARS += IMAGENAME_NV_BASE
|
||||
USER_VARS += IMAGEPATH_NV_BASE
|
||||
USER_VARS += IMAGENAME_NV_EXTENSION
|
||||
USER_VARS += IMAGEPATH_NV_EXTENSION
|
||||
USER_VARS += NVIDIAGPUEXTENSIONVERITYPARAMS
|
||||
USER_VARS += IMAGECONFIDENTIALPATH
|
||||
USER_VARS += COCOIMAGENAME
|
||||
USER_VARS += COCOIMAGEPATH
|
||||
@@ -816,7 +830,6 @@ USER_VARS += IMAGENAME_CONFIDENTIAL_NV
|
||||
USER_VARS += IMAGEPATH_CONFIDENTIAL_NV
|
||||
USER_VARS += KERNELNAME_CONFIDENTIAL_NV
|
||||
USER_VARS += KERNELPATH_CONFIDENTIAL_NV
|
||||
USER_VARS += KERNELVERITYPARAMS_CONFIDENTIAL_NV
|
||||
USER_VARS += FIRMWARESNPPATH_NV
|
||||
USER_VARS += FIRMWARETDVFPATH_NV
|
||||
USER_VARS += CONFIG_QEMU_NVIDIA_GPU_SNP_IN
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
[hypervisor.qemu]
|
||||
path = "@QEMUPATH@"
|
||||
kernel = "@KERNELPATH_NV@"
|
||||
image = "@IMAGEPATH_NV@"
|
||||
image = "@IMAGEPATH_NV_BASE@"
|
||||
machine_type = "@MACHINETYPE@"
|
||||
|
||||
# rootfs filesystem type:
|
||||
@@ -850,3 +850,12 @@ kubelet_root_dir = "@DEFKUBELETROOTDIR@"
|
||||
# When set (together with a non-"no-port" cold_plug_vfio), the runtime can cold-plug
|
||||
# devices discovered via the Pod Resources API. Path is typically under kubelet root-dir.
|
||||
pod_resource_api_sock = "@DEFPODRESOURCEAPISOCK_NV@"
|
||||
|
||||
# The GPU driver stack (userspace binaries, libraries, configs, firmware and the
|
||||
# NVIDIA kernel modules) ships in a separate, driver-versioned extension image that
|
||||
# is cold-plugged alongside the nvidia base boot image. NVRC mounts it at
|
||||
# /run/kata-extensions/gpu and resolves the GPU stack from there.
|
||||
[[hypervisor.qemu.guest_extension_images]]
|
||||
name = "gpu"
|
||||
path = "@IMAGEPATH_NV_EXTENSION@"
|
||||
verity_params = "@NVIDIAGPUEXTENSIONVERITYPARAMS@"
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
[hypervisor.qemu]
|
||||
path = "@QEMUSNPPATH@"
|
||||
kernel = "@KERNELPATH_CONFIDENTIAL_NV@"
|
||||
image = "@IMAGEPATH_CONFIDENTIAL_NV@"
|
||||
image = "@IMAGEPATH_NV_BASE@"
|
||||
machine_type = "@MACHINETYPE@"
|
||||
|
||||
# Enable confidential guest support.
|
||||
@@ -102,7 +102,7 @@ kernel_params = "@KERNELPARAMS_CONFIDENTIAL_NV@"
|
||||
# Optional dm-verity parameters (comma-separated key=value list):
|
||||
# root_hash=...,salt=...,data_blocks=...,data_block_size=...,hash_block_size=...
|
||||
# These are used by the runtime to assemble dm-verity kernel params.
|
||||
kernel_verity_params = "@KERNELVERITYPARAMS_CONFIDENTIAL_NV@"
|
||||
kernel_verity_params = "@KERNELVERITYPARAMS_NV@"
|
||||
|
||||
# Path to the firmware.
|
||||
# If you want that qemu uses the default firmware leave this option empty
|
||||
@@ -782,3 +782,19 @@ kubelet_root_dir = "@DEFKUBELETROOTDIR@"
|
||||
# When set (together with a non-"no-port" cold_plug_vfio), the runtime can cold-plug
|
||||
# devices discovered via the Pod Resources API. Path is typically under kubelet root-dir.
|
||||
pod_resource_api_sock = "@DEFPODRESOURCEAPISOCK_NV@"
|
||||
|
||||
# The GPU driver stack (userspace binaries, libraries, configs, firmware and the
|
||||
# NVIDIA kernel modules) ships in a separate, driver-versioned extension image that
|
||||
# is cold-plugged alongside the nvidia base boot image. NVRC mounts it at
|
||||
# /run/kata-extensions/gpu and resolves the GPU stack from there.
|
||||
[[hypervisor.qemu.guest_extension_images]]
|
||||
name = "gpu"
|
||||
path = "@IMAGEPATH_NV_EXTENSION@"
|
||||
verity_params = "@NVIDIAGPUEXTENSIONVERITYPARAMS@"
|
||||
|
||||
# Confidential guests additionally cold-plug the CoCo guest-components extension
|
||||
# (attestation-agent, confidential-data-hub, ...) mounted at /run/kata-extensions/coco.
|
||||
[[hypervisor.qemu.guest_extension_images]]
|
||||
name = "coco"
|
||||
path = "@COCOIMAGEPATH@"
|
||||
verity_params = "@COCOVERITYPARAMS@"
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
[hypervisor.qemu]
|
||||
path = "@QEMUTDXPATH@"
|
||||
kernel = "@KERNELPATH_CONFIDENTIAL_NV@"
|
||||
image = "@IMAGEPATH_CONFIDENTIAL_NV@"
|
||||
image = "@IMAGEPATH_NV_BASE@"
|
||||
machine_type = "@MACHINETYPE@"
|
||||
tdx_quote_generation_service_socket_port = @QEMUTDXQUOTEGENERATIONSERVICESOCKETPORT@
|
||||
|
||||
@@ -78,7 +78,7 @@ kernel_params = "@KERNELPARAMS_CONFIDENTIAL_NV@"
|
||||
# Optional dm-verity parameters (comma-separated key=value list):
|
||||
# root_hash=...,salt=...,data_blocks=...,data_block_size=...,hash_block_size=...
|
||||
# These are used by the runtime to assemble dm-verity kernel params.
|
||||
kernel_verity_params = "@KERNELVERITYPARAMS_CONFIDENTIAL_NV@"
|
||||
kernel_verity_params = "@KERNELVERITYPARAMS_NV@"
|
||||
|
||||
# Path to the firmware.
|
||||
# If you want that qemu uses the default firmware leave this option empty
|
||||
@@ -758,3 +758,19 @@ kubelet_root_dir = "@DEFKUBELETROOTDIR@"
|
||||
# When set (together with a non-"no-port" cold_plug_vfio), the runtime can cold-plug
|
||||
# devices discovered via the Pod Resources API. Path is typically under kubelet root-dir.
|
||||
pod_resource_api_sock = "@DEFPODRESOURCEAPISOCK_NV@"
|
||||
|
||||
# The GPU driver stack (userspace binaries, libraries, configs, firmware and the
|
||||
# NVIDIA kernel modules) ships in a separate, driver-versioned extension image that
|
||||
# is cold-plugged alongside the nvidia base boot image. NVRC mounts it at
|
||||
# /run/kata-extensions/gpu and resolves the GPU stack from there.
|
||||
[[hypervisor.qemu.guest_extension_images]]
|
||||
name = "gpu"
|
||||
path = "@IMAGEPATH_NV_EXTENSION@"
|
||||
verity_params = "@NVIDIAGPUEXTENSIONVERITYPARAMS@"
|
||||
|
||||
# Confidential guests additionally cold-plug the CoCo guest-components extension
|
||||
# (attestation-agent, confidential-data-hub, ...) mounted at /run/kata-extensions/coco.
|
||||
[[hypervisor.qemu.guest_extension_images]]
|
||||
name = "coco"
|
||||
path = "@COCOIMAGEPATH@"
|
||||
verity_params = "@COCOVERITYPARAMS@"
|
||||
|
||||
Reference in New Issue
Block a user