Skip to content

Commit 1f31fdd

Browse files
committed
Disable video console in SNP mode
Video console is not supported when a UVM is being started in SNP isolation mode. It is anyway always disabled when starting a pod, but uvmboot tool always enabled it until now. This change only enables it if the isolation mode isn't SNP. Also, adds a new log statement to log the generated UVM HCS doc. Signed-off-by: Amit Barve <ambarve@microsoft.com>
1 parent 0fc5d6e commit 1f31fdd

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

internal/tools/uvmboot/conf_wcow.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,10 @@ var cwcowCommand = cli.Command{
114114
options.DisableSecureBoot = cwcowDisableSecureBoot
115115
options.GuestStateFilePath = cwcowVMGSPath
116116
options.IsolationType = cwcowIsolationMode
117-
// always enable graphics console with uvmboot - helps with testing/debugging
118-
options.EnableGraphicsConsole = true
117+
118+
// graphics console helps with testing/debugging however, it
119+
// doesn't work in SNP isolation mode.
120+
options.EnableGraphicsConsole = cwcowIsolationMode != "SecureNestedPaging"
119121
options.WritableEFI = cwcowWritableEFI
120122

121123
var err error

internal/uvm/create_wcow.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package uvm
55
import (
66
"context"
77
"encoding/base64"
8+
"encoding/json"
89
"fmt"
910
"maps"
1011
"os"
@@ -354,7 +355,7 @@ func prepareSecurityConfigDoc(ctx context.Context, uvm *UtilityVM, opts *Options
354355

355356
enableHCL := true
356357
doc.VirtualMachine.SecuritySettings = &hcsschema.SecuritySettings{
357-
EnableTpm: false,
358+
EnableTpm: false, // TPM MUST always remain false in confidential mode as per the design
358359
Isolation: &hcsschema.IsolationSettings{
359360
IsolationType: "SecureNestedPaging",
360361
HclEnabled: &enableHCL,
@@ -531,6 +532,10 @@ func CreateWCOW(ctx context.Context, opts *OptionsWCOW) (_ *UtilityVM, err error
531532
return nil, fmt.Errorf("error in preparing config doc: %w", err)
532533
}
533534

535+
// log the HCS doc for debugging purposes, we don't care about the JSON marshalling errors here
536+
jsondoc, _ := json.Marshal(doc)
537+
log.G(ctx).Tracef("UVM HCS doc: %s", jsondoc)
538+
534539
err = uvm.create(ctx, doc)
535540
if err != nil {
536541
return nil, fmt.Errorf("error while creating the compute system: %w", err)

0 commit comments

Comments
 (0)