Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions internal/tools/uvmboot/conf_wcow.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,10 @@ var cwcowCommand = cli.Command{
options.DisableSecureBoot = cwcowDisableSecureBoot
options.GuestStateFilePath = cwcowVMGSPath
options.IsolationType = cwcowIsolationMode
// always enable graphics console with uvmboot - helps with testing/debugging
options.EnableGraphicsConsole = true

// graphics console helps with testing/debugging however, it
// doesn't work in SNP isolation mode.
options.EnableGraphicsConsole = cwcowIsolationMode != "SecureNestedPaging"
options.WritableEFI = cwcowWritableEFI

var err error
Expand Down
3 changes: 3 additions & 0 deletions internal/uvm/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ func verifyOptions(_ context.Context, options interface{}) error {
if opts.SecurityPolicyEnabled && opts.GuestStateFilePath == "" {
return fmt.Errorf("GuestStateFilePath must be provided when enabling security policy")
}
if opts.IsolationType == "SecureNestedPaging" && opts.EnableGraphicsConsole {
return fmt.Errorf("graphics console cannot be enabled with SecureNestedPaging isolation mode")
}
if opts.ResourcePartitionID != nil {
if opts.CPUGroupID != "" {
return errors.New("resource partition ID and CPU group ID cannot be set at the same time")
Expand Down
16 changes: 13 additions & 3 deletions internal/uvm/create_wcow.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ func prepareSecurityConfigDoc(ctx context.Context, uvm *UtilityVM, opts *Options

enableHCL := true
doc.VirtualMachine.SecuritySettings = &hcsschema.SecuritySettings{
EnableTpm: false,
EnableTpm: false, // TPM MUST always remain false in confidential mode as per the design
Isolation: &hcsschema.IsolationSettings{
IsolationType: "SecureNestedPaging",
HclEnabled: &enableHCL,
Expand Down Expand Up @@ -522,10 +522,20 @@ func CreateWCOW(ctx context.Context, opts *OptionsWCOW) (_ *UtilityVM, err error
var doc *hcsschema.ComputeSystem
if opts.SecurityPolicyEnabled {
doc, err = prepareSecurityConfigDoc(ctx, uvm, opts)
log.G(ctx).Tracef("CreateWCOW prepareSecurityConfigDoc result doc: %v err %v", doc, err)
if logrus.IsLevelEnabled(logrus.TraceLevel) {
log.G(ctx).WithFields(logrus.Fields{
"doc": log.Format(ctx, doc),
logrus.ErrorKey: err,
}).Trace("CreateWCOW prepareSecurityConfigDoc")
}
} else {
doc, err = prepareConfigDoc(ctx, uvm, opts)
log.G(ctx).Tracef("CreateWCOW prepareConfigDoc result doc: %v err %v", doc, err)
if logrus.IsLevelEnabled(logrus.TraceLevel) {
log.G(ctx).WithFields(logrus.Fields{
"doc": log.Format(ctx, doc),
logrus.ErrorKey: err,
}).Trace("CreateWCOW prepareConfigDoc")
}
}
if err != nil {
return nil, fmt.Errorf("error in preparing config doc: %w", err)
Expand Down