mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-16 07:05:14 +00:00
Merge a3ce465070
into 9379a18c8a
This commit is contained in:
commit
67571493b6
@ -72,6 +72,9 @@ valid_hypervisor_paths = @QEMUSNPVALIDHYPERVISORPATHS@
|
|||||||
# for the SNP_LAUNCH_FINISH command defined in the SEV-SNP firmware ABI (QEMU default: all-zero)
|
# for the SNP_LAUNCH_FINISH command defined in the SEV-SNP firmware ABI (QEMU default: all-zero)
|
||||||
#snp_id_auth = ""
|
#snp_id_auth = ""
|
||||||
|
|
||||||
|
# SNP Guest Policy, the ‘POLICY’ parameter to the SNP_LAUNCH_START command.
|
||||||
|
#snp_guest_policy = 196608
|
||||||
|
|
||||||
# Optional space-separated list of options to pass to the guest kernel.
|
# Optional space-separated list of options to pass to the guest kernel.
|
||||||
# For example, use `kernel_params = "vsyscall=emulate"` if you are having
|
# For example, use `kernel_params = "vsyscall=emulate"` if you are having
|
||||||
# trouble running pre-2.15 glibc.
|
# trouble running pre-2.15 glibc.
|
||||||
|
@ -72,6 +72,9 @@ valid_hypervisor_paths = @QEMUVALIDHYPERVISORPATHS@
|
|||||||
# for the SNP_LAUNCH_FINISH command defined in the SEV-SNP firmware ABI (QEMU default: all-zero)
|
# for the SNP_LAUNCH_FINISH command defined in the SEV-SNP firmware ABI (QEMU default: all-zero)
|
||||||
#snp_id_auth = ""
|
#snp_id_auth = ""
|
||||||
|
|
||||||
|
# SNP Guest Policy, the ‘POLICY’ parameter to the SNP_LAUNCH_START command.
|
||||||
|
#snp_guest_policy = 196608
|
||||||
|
|
||||||
# Optional space-separated list of options to pass to the guest kernel.
|
# Optional space-separated list of options to pass to the guest kernel.
|
||||||
# For example, use `kernel_params = "vsyscall=emulate"` if you are having
|
# For example, use `kernel_params = "vsyscall=emulate"` if you are having
|
||||||
# trouble running pre-2.15 glibc.
|
# trouble running pre-2.15 glibc.
|
||||||
|
@ -330,6 +330,9 @@ type Object struct {
|
|||||||
// for the SNP_LAUNCH_FINISH command defined in the SEV-SNP firmware ABI (default: all-zero)
|
// for the SNP_LAUNCH_FINISH command defined in the SEV-SNP firmware ABI (default: all-zero)
|
||||||
SnpIdAuth string
|
SnpIdAuth string
|
||||||
|
|
||||||
|
// SnpGuestPolicy is the integer representation of the SEV-SNP guest policy.
|
||||||
|
SnpGuestPolicy *uint64
|
||||||
|
|
||||||
// Raw byte slice of initdata digest
|
// Raw byte slice of initdata digest
|
||||||
InitdataDigest []byte
|
InitdataDigest []byte
|
||||||
}
|
}
|
||||||
@ -415,6 +418,9 @@ func (object Object) QemuParams(config *Config) []string {
|
|||||||
if object.SnpIdAuth != "" {
|
if object.SnpIdAuth != "" {
|
||||||
objectParams = append(objectParams, fmt.Sprintf("id-auth=%s", object.SnpIdAuth))
|
objectParams = append(objectParams, fmt.Sprintf("id-auth=%s", object.SnpIdAuth))
|
||||||
}
|
}
|
||||||
|
if object.SnpGuestPolicy != nil {
|
||||||
|
objectParams = append(objectParams, fmt.Sprintf("policy=%d", *object.SnpGuestPolicy))
|
||||||
|
}
|
||||||
if len(object.InitdataDigest) > 0 {
|
if len(object.InitdataDigest) > 0 {
|
||||||
// due to https://github.com/confidential-containers/qemu/blob/amd-snp-202402240000/qapi/qom.json#L926-L929
|
// due to https://github.com/confidential-containers/qemu/blob/amd-snp-202402240000/qapi/qom.json#L926-L929
|
||||||
// hostdata in SEV-SNP should be exactly 32 bytes
|
// hostdata in SEV-SNP should be exactly 32 bytes
|
||||||
|
@ -109,6 +109,7 @@ type hypervisor struct {
|
|||||||
RemoteHypervisorSocket string `toml:"remote_hypervisor_socket"`
|
RemoteHypervisorSocket string `toml:"remote_hypervisor_socket"`
|
||||||
SnpIdBlock string `toml:"snp_id_block"`
|
SnpIdBlock string `toml:"snp_id_block"`
|
||||||
SnpIdAuth string `toml:"snp_id_auth"`
|
SnpIdAuth string `toml:"snp_id_auth"`
|
||||||
|
SnpGuestPolicy *uint64 `toml:"snp_guest_policy"`
|
||||||
HypervisorPathList []string `toml:"valid_hypervisor_paths"`
|
HypervisorPathList []string `toml:"valid_hypervisor_paths"`
|
||||||
JailerPathList []string `toml:"valid_jailer_paths"`
|
JailerPathList []string `toml:"valid_jailer_paths"`
|
||||||
VirtioFSDaemonList []string `toml:"valid_virtio_fs_daemon_paths"`
|
VirtioFSDaemonList []string `toml:"valid_virtio_fs_daemon_paths"`
|
||||||
@ -992,6 +993,7 @@ func newQemuHypervisorConfig(h hypervisor) (vc.HypervisorConfig, error) {
|
|||||||
ExtraMonitorSocket: extraMonitorSocket,
|
ExtraMonitorSocket: extraMonitorSocket,
|
||||||
SnpIdBlock: h.SnpIdBlock,
|
SnpIdBlock: h.SnpIdBlock,
|
||||||
SnpIdAuth: h.SnpIdAuth,
|
SnpIdAuth: h.SnpIdAuth,
|
||||||
|
SnpGuestPolicy: h.SnpGuestPolicy,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -473,6 +473,9 @@ type HypervisorConfig struct {
|
|||||||
// for the SNP_LAUNCH_FINISH command defined in the SEV-SNP firmware ABI (default: all-zero)
|
// for the SNP_LAUNCH_FINISH command defined in the SEV-SNP firmware ABI (default: all-zero)
|
||||||
SnpIdAuth string
|
SnpIdAuth string
|
||||||
|
|
||||||
|
// SnpGuestPolicy is the integer representation of the SEV-SNP guest policy.
|
||||||
|
SnpGuestPolicy *uint64
|
||||||
|
|
||||||
// KernelParams are additional guest kernel parameters.
|
// KernelParams are additional guest kernel parameters.
|
||||||
KernelParams []Param
|
KernelParams []Param
|
||||||
|
|
||||||
|
@ -38,6 +38,8 @@ type qemuAmd64 struct {
|
|||||||
snpIdBlock string
|
snpIdBlock string
|
||||||
|
|
||||||
snpIdAuth string
|
snpIdAuth string
|
||||||
|
|
||||||
|
snpGuestPolicy *uint64
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -126,11 +128,12 @@ func newQemuArch(config HypervisorConfig) (qemuArch, error) {
|
|||||||
protection: noneProtection,
|
protection: noneProtection,
|
||||||
legacySerial: config.LegacySerial,
|
legacySerial: config.LegacySerial,
|
||||||
},
|
},
|
||||||
vmFactory: factory,
|
vmFactory: factory,
|
||||||
snpGuest: config.SevSnpGuest,
|
snpGuest: config.SevSnpGuest,
|
||||||
qgsPort: config.QgsPort,
|
qgsPort: config.QgsPort,
|
||||||
snpIdBlock: config.SnpIdBlock,
|
snpIdBlock: config.SnpIdBlock,
|
||||||
snpIdAuth: config.SnpIdAuth,
|
snpIdAuth: config.SnpIdAuth,
|
||||||
|
snpGuestPolicy: config.SnpGuestPolicy,
|
||||||
}
|
}
|
||||||
|
|
||||||
if config.ConfidentialGuest {
|
if config.ConfidentialGuest {
|
||||||
@ -315,6 +318,7 @@ func (q *qemuAmd64) appendProtectionDevice(devices []govmmQemu.Device, firmware,
|
|||||||
CBitPos: cpuid.AMDMemEncrypt.CBitPosition,
|
CBitPos: cpuid.AMDMemEncrypt.CBitPosition,
|
||||||
ReducedPhysBits: 1,
|
ReducedPhysBits: 1,
|
||||||
InitdataDigest: initdataDigest,
|
InitdataDigest: initdataDigest,
|
||||||
|
SnpGuestPolicy: q.snpGuestPolicy,
|
||||||
}
|
}
|
||||||
if q.snpIdBlock != "" && q.snpIdAuth != "" {
|
if q.snpIdBlock != "" && q.snpIdAuth != "" {
|
||||||
obj.SnpIdBlock = q.snpIdBlock
|
obj.SnpIdBlock = q.snpIdBlock
|
||||||
|
Loading…
Reference in New Issue
Block a user