clh: Add confidential_guest to the config file

ConfidentialGuest is an option already present and exposed for QEMU,
which is used for using Kata Containers together with different sorts of
Guest Protections, such as TDX and SEV for x86_64, PEF for ppc64le, and
SE for s390x.

Right now we error out in case confidential_guest is enabled, as we will
be implementing the needed blocks for this as part of this series.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
This commit is contained in:
Fabiano Fidêncio 2022-02-24 19:44:26 +01:00
parent 9621c59691
commit 29ee870d20
3 changed files with 13 additions and 0 deletions

View File

@ -15,6 +15,14 @@ path = "@CLHPATH@"
kernel = "@KERNELPATH_CLH@" kernel = "@KERNELPATH_CLH@"
image = "@IMAGEPATH@" image = "@IMAGEPATH@"
# Enable confidential guest support.
# Toggling that setting may trigger different hardware features, ranging
# from memory encryption to both memory and CPU-state encryption and integrity.
# The Kata Containers runtime dynamically detects the available feature set and
# aims at enabling the largest possible one.
# Default false
# confidential_guest = true
# List of valid annotation names for the hypervisor # List of valid annotation names for the hypervisor
# Each member of the list is a regular expression, which is the base name # Each member of the list is a regular expression, which is the base name
# of the annotation, e.g. "path" for io.katacontainers.config.hypervisor.path" # of the annotation, e.g. "path" for io.katacontainers.config.hypervisor.path"

View File

@ -877,6 +877,7 @@ func newClhHypervisorConfig(h hypervisor) (vc.HypervisorConfig, error) {
SGXEPCSize: defaultSGXEPCSize, SGXEPCSize: defaultSGXEPCSize,
EnableAnnotations: h.EnableAnnotations, EnableAnnotations: h.EnableAnnotations,
DisableSeccomp: h.DisableSeccomp, DisableSeccomp: h.DisableSeccomp,
ConfidentialGuest: h.ConfidentialGuest,
}, nil }, nil
} }

View File

@ -215,6 +215,10 @@ func (clh *cloudHypervisor) CreateVM(ctx context.Context, id string, network Net
return err return err
} }
if clh.config.ConfidentialGuest {
return errors.New("confidential guest is not yet supported with Cloud Hypervisor")
}
clh.id = id clh.id = id
clh.state.state = clhNotReady clh.state.state = clhNotReady