mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-27 07:48:55 +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
|
# - CPU Hotplug
|
||||||
# - Device Hotplug
|
# - Device Hotplug
|
||||||
# - Memory Hotplug
|
# - Memory Hotplug
|
||||||
|
# - NVDIMM devices
|
||||||
#
|
#
|
||||||
# Default false
|
# Default false
|
||||||
# confidential_guest = true
|
# confidential_guest = true
|
||||||
|
@ -27,6 +27,7 @@ machine_type = "@MACHINETYPE@"
|
|||||||
# - CPU Hotplug
|
# - CPU Hotplug
|
||||||
# - Device Hotplug
|
# - Device Hotplug
|
||||||
# - Memory Hotplug
|
# - Memory Hotplug
|
||||||
|
# - NVDIMM devices
|
||||||
#
|
#
|
||||||
# Default false
|
# Default false
|
||||||
# confidential_guest = true
|
# confidential_guest = true
|
||||||
@ -286,6 +287,9 @@ pflashes = []
|
|||||||
|
|
||||||
# If false and nvdimm is supported, use nvdimm device to plug guest image.
|
# If false and nvdimm is supported, use nvdimm device to plug guest image.
|
||||||
# Otherwise virtio-block device is used.
|
# Otherwise virtio-block device is used.
|
||||||
|
#
|
||||||
|
# nvdimm is not supported when `confidential_guest = true`.
|
||||||
|
#
|
||||||
# Default is false
|
# Default is false
|
||||||
#disable_image_nvdimm = true
|
#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
|
// First take the default parameters defined by this driver
|
||||||
params := commonNvdimmKernelRootParams
|
params := commonNvdimmKernelRootParams
|
||||||
|
if clh.config.ConfidentialGuest {
|
||||||
|
params = commonVirtioblkKernelRootParams
|
||||||
|
}
|
||||||
params = append(params, clhKernelParams...)
|
params = append(params, clhKernelParams...)
|
||||||
|
|
||||||
// Followed by extra debug parameters if debug enabled in configuration file
|
// 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 != "" {
|
if imagePath != "" {
|
||||||
pmem := chclient.NewPmemConfig(imagePath)
|
if clh.config.ConfidentialGuest {
|
||||||
*pmem.DiscardWrites = true
|
disk := chclient.NewDiskConfig(imagePath)
|
||||||
|
disk.SetReadonly(true)
|
||||||
|
|
||||||
if clh.vmconfig.Pmem != nil {
|
if clh.vmconfig.Disks != nil {
|
||||||
*clh.vmconfig.Pmem = append(*clh.vmconfig.Pmem, *pmem)
|
*clh.vmconfig.Disks = append(*clh.vmconfig.Disks, *disk)
|
||||||
|
} else {
|
||||||
|
clh.vmconfig.Disks = &[]chclient.DiskConfig{*disk}
|
||||||
|
}
|
||||||
} else {
|
} 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 {
|
} else {
|
||||||
initrdPath, err := clh.config.InitrdAssetPath()
|
initrdPath, err := clh.config.InitrdAssetPath()
|
||||||
|
@ -132,6 +132,11 @@ func newQemuArch(config HypervisorConfig) (qemuArch, error) {
|
|||||||
if err := q.enableProtection(); err != nil {
|
if err := q.enableProtection(); err != nil {
|
||||||
return nil, err
|
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 {
|
if config.SGXEPCSize != 0 {
|
||||||
|
@ -83,6 +83,11 @@ func newQemuArch(config HypervisorConfig) (qemuArch, error) {
|
|||||||
if err := q.enableProtection(); err != nil {
|
if err := q.enableProtection(); err != nil {
|
||||||
return nil, err
|
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)
|
q.handleImagePath(config)
|
||||||
|
@ -77,6 +77,11 @@ func newQemuArch(config HypervisorConfig) (qemuArch, error) {
|
|||||||
if err := q.enableProtection(); err != nil {
|
if err := q.enableProtection(); err != nil {
|
||||||
return nil, err
|
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 != "" {
|
if config.ImagePath != "" {
|
||||||
|
Loading…
Reference in New Issue
Block a user