mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-29 04:04:45 +00:00
hypervisors: Confidential Guests do not support NVDIMM
NVDIMM is also not supported with Confidential Guests and Virtio Block devices should be used instead. Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
This commit is contained in:
parent
f50ff9f798
commit
a8827e0c78
@ -26,6 +26,7 @@ image = "@IMAGEPATH@"
|
||||
# - CPU Hotplug
|
||||
# - Device Hotplug
|
||||
# - Memory Hotplug
|
||||
# - NVDIMM devices
|
||||
#
|
||||
# Default false
|
||||
# confidential_guest = true
|
||||
|
@ -27,6 +27,7 @@ machine_type = "@MACHINETYPE@"
|
||||
# - CPU Hotplug
|
||||
# - Device Hotplug
|
||||
# - Memory Hotplug
|
||||
# - NVDIMM devices
|
||||
#
|
||||
# Default false
|
||||
# confidential_guest = true
|
||||
@ -286,6 +287,9 @@ pflashes = []
|
||||
|
||||
# If false and nvdimm is supported, use nvdimm device to plug guest image.
|
||||
# Otherwise virtio-block device is used.
|
||||
#
|
||||
# nvdimm is not supported when `confidential_guest = true`.
|
||||
#
|
||||
# Default is false
|
||||
#disable_image_nvdimm = true
|
||||
|
||||
|
@ -271,6 +271,9 @@ func (clh *cloudHypervisor) CreateVM(ctx context.Context, id string, network Net
|
||||
|
||||
// First take the default parameters defined by this driver
|
||||
params := commonNvdimmKernelRootParams
|
||||
if clh.config.ConfidentialGuest {
|
||||
params = commonVirtioblkKernelRootParams
|
||||
}
|
||||
params = append(params, clhKernelParams...)
|
||||
|
||||
// Followed by extra debug parameters if debug enabled in configuration file
|
||||
@ -296,13 +299,24 @@ func (clh *cloudHypervisor) CreateVM(ctx context.Context, id string, network Net
|
||||
}
|
||||
|
||||
if imagePath != "" {
|
||||
pmem := chclient.NewPmemConfig(imagePath)
|
||||
*pmem.DiscardWrites = true
|
||||
if clh.config.ConfidentialGuest {
|
||||
disk := chclient.NewDiskConfig(imagePath)
|
||||
disk.SetReadonly(true)
|
||||
|
||||
if clh.vmconfig.Pmem != nil {
|
||||
*clh.vmconfig.Pmem = append(*clh.vmconfig.Pmem, *pmem)
|
||||
if clh.vmconfig.Disks != nil {
|
||||
*clh.vmconfig.Disks = append(*clh.vmconfig.Disks, *disk)
|
||||
} else {
|
||||
clh.vmconfig.Disks = &[]chclient.DiskConfig{*disk}
|
||||
}
|
||||
} else {
|
||||
clh.vmconfig.Pmem = &[]chclient.PmemConfig{*pmem}
|
||||
pmem := chclient.NewPmemConfig(imagePath)
|
||||
*pmem.DiscardWrites = true
|
||||
|
||||
if clh.vmconfig.Pmem != nil {
|
||||
*clh.vmconfig.Pmem = append(*clh.vmconfig.Pmem, *pmem)
|
||||
} else {
|
||||
clh.vmconfig.Pmem = &[]chclient.PmemConfig{*pmem}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
initrdPath, err := clh.config.InitrdAssetPath()
|
||||
|
@ -132,6 +132,11 @@ func newQemuArch(config HypervisorConfig) (qemuArch, error) {
|
||||
if err := q.enableProtection(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if !q.qemuArchBase.disableNvdimm {
|
||||
hvLogger.WithField("subsystem", "qemuAmd64").Warn("Nvdimm is not supported with confidential guest, disabling it.")
|
||||
q.qemuArchBase.disableNvdimm = true
|
||||
}
|
||||
}
|
||||
|
||||
if config.SGXEPCSize != 0 {
|
||||
|
@ -83,6 +83,11 @@ func newQemuArch(config HypervisorConfig) (qemuArch, error) {
|
||||
if err := q.enableProtection(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if !q.qemuArchBase.disableNvdimm {
|
||||
hvLogger.WithField("subsystem", "qemuPPC64le").Warn("Nvdimm is not supported with confidential guest, disabling it.")
|
||||
q.qemuArchBase.disableNvdimm = true
|
||||
}
|
||||
}
|
||||
|
||||
q.handleImagePath(config)
|
||||
|
@ -77,6 +77,11 @@ func newQemuArch(config HypervisorConfig) (qemuArch, error) {
|
||||
if err := q.enableProtection(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if !q.qemuArchBase.disableNvdimm {
|
||||
hvLogger.WithField("subsystem", "qemuS390x").Warn("Nvdimm is not supported with confidential guest, disabling it.")
|
||||
q.qemuArchBase.disableNvdimm = true
|
||||
}
|
||||
}
|
||||
|
||||
if config.ImagePath != "" {
|
||||
|
Loading…
Reference in New Issue
Block a user