Skip to content
Draft
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
9 changes: 9 additions & 0 deletions internal/uvm/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,15 @@ func verifyOptions(_ context.Context, options interface{}) error {
return errors.New("resource partition ID and CPU group ID cannot be set at the same time")
}
}
if runtime.GOARCH == "arm64" {
// ARM64 specific checks for currently unsupported features. These can be removed when the features are supported on ARM64.
if opts.VPMemDeviceCount > 0 {
return errors.New("VPMem devices are not supported on ARM64")
}
if opts.KernelDirect {
return errors.New("KernelDirectBoot is not supported on ARM64")
}
}
case *OptionsWCOW:
if opts.EnableDeferredCommit && !opts.AllowOvercommit {
return errors.New("EnableDeferredCommit is not supported on physically backed VMs")
Expand Down
19 changes: 15 additions & 4 deletions internal/uvm/create_lcow.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"net"
"os"
"path/filepath"
"runtime"
"strings"

"github.com/Microsoft/go-winio"
Expand Down Expand Up @@ -152,6 +153,11 @@ func defaultLCOWOSBootFilesPath() string {
func NewDefaultOptionsLCOW(id, owner string) *OptionsLCOW {
// Use KernelDirect boot by default on all builds that support it.
kernelDirectSupported := osversion.Build() >= 18286
var vPmemCount uint32 = DefaultVPMEMCount
if runtime.GOARCH == "arm64" {
kernelDirectSupported = false
vPmemCount = 0
}
opts := &OptionsLCOW{
Options: newDefaultOptions(id, owner),
KernelFile: KernelFile,
Expand All @@ -163,7 +169,7 @@ func NewDefaultOptionsLCOW(id, owner string) *OptionsLCOW {
ForwardStdout: false,
ForwardStderr: true,
OutputHandlerCreator: parseLogrus,
VPMemDeviceCount: DefaultVPMEMCount,
VPMemDeviceCount: vPmemCount,
VPMemSizeBytes: DefaultVPMemSizeBytes,
VPMemNoMultiMapping: osversion.Get().Build < osversion.V19H1,
PreferredRootFSType: PreferredRootFSTypeInitRd,
Expand All @@ -180,7 +186,6 @@ func NewDefaultOptionsLCOW(id, owner string) *OptionsLCOW {
}

opts.UpdateBootFilesPath(context.TODO(), defaultLCOWOSBootFilesPath())

return opts
}

Expand Down Expand Up @@ -807,14 +812,20 @@ func makeLCOWDoc(ctx context.Context, opts *OptionsLCOW, uvm *UtilityVM) (_ *hcs
vmDebugging := false
if opts.ConsolePipe != "" {
vmDebugging = true
kernelArgs += " 8250_core.nr_uarts=1 8250_core.skip_txen_test=1 console=ttyS0,115200"
if runtime.GOARCH == "arm64" {
kernelArgs += " console=ttyAMA0,115200"
} else {
kernelArgs += " 8250_core.nr_uarts=1 8250_core.skip_txen_test=1 console=ttyS0,115200"
}
doc.VirtualMachine.Devices.ComPorts = map[string]hcsschema.ComPort{
"0": { // Which is actually COM1
NamedPipe: opts.ConsolePipe,
},
}
} else {
kernelArgs += " 8250_core.nr_uarts=0"
if runtime.GOARCH != "arm64" {
kernelArgs += " 8250_core.nr_uarts=0"
}
}

if opts.EnableGraphicsConsole {
Expand Down