Skip to content

Commit 6fd6cd4

Browse files
author
Manish Ranjan Mahanta
committed
Adding changes in internal\builder\vm
Signed-off-by: Manish Ranjan Mahanta <mmahanta@microsoft.com>
1 parent 853abfa commit 6fd6cd4

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

internal/builder/vm/lcow/boot.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"fmt"
88
"os"
99
"path/filepath"
10+
"runtime"
1011

1112
runhcsoptions "github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options"
1213
hcsschema "github.com/Microsoft/hcsshim/internal/hcs/schema2"
@@ -87,6 +88,11 @@ func parseBootOptions(ctx context.Context, opts *runhcsoptions.Options, annotati
8788
// uncompressed and simply named 'kernel' it will still be used
8889
// uncompressed automatically.
8990
kernelDirectBootSupported := osversion.Build() >= 18286
91+
if runtime.GOARCH == "arm64" {
92+
// KernelDirectBoot is currently not supported by Hyper-V on arm64.
93+
// Todo: enable this by default once KernelDirectBoot on arm64 is supported.
94+
kernelDirectBootSupported = false
95+
}
9096
useKernelDirect := oci.ParseAnnotationsBool(ctx, annotations, shimannotations.KernelDirectBoot, kernelDirectBootSupported)
9197

9298
log.G(ctx).WithFields(logrus.Fields{

internal/builder/vm/lcow/devices.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"context"
77
"fmt"
88
"path/filepath"
9+
"runtime"
910
"strings"
1011

1112
"github.com/Microsoft/hcsshim/internal/controller/device/vpci"
@@ -45,8 +46,9 @@ func parseDeviceOptions(
4546
vpmemCount := oci.ParseAnnotationsUint32(ctx, annotations, shimannotations.VPMemCount, vmutils.DefaultVPMEMCount)
4647
vpmemSize := oci.ParseAnnotationsUint64(ctx, annotations, shimannotations.VPMemSize, vmutils.DefaultVPMemSizeBytes)
4748

48-
// VPMem is not supported by the enlightened kernel for SNP (confidential VMs).
49-
if isFullyPhysicallyBacked || isConfidential {
49+
// VPMem is not supported by the enlightened kernel for SNP (confidential VMs, and Hyper-V on arm64).
50+
// Todo: Remove arm64 check once VPMem is supported by Hyper-V on arm64.
51+
if isFullyPhysicallyBacked || isConfidential || runtime.GOARCH == "arm64" {
5052
vpmemCount = 0
5153
}
5254

0 commit comments

Comments
 (0)