From 241c355e07c57303abbcab78f3322490c3d52ede Mon Sep 17 00:00:00 2001 From: Jianyong Wu Date: Thu, 31 Aug 2023 06:13:06 +0000 Subject: [PATCH] clh:arm64: use arm AMBA uart for hypervisor debug cloud hypervisor on arm64 only support arm AMBA UART(pl011) as tty. So, the console should be set to "ttyAMA0" instead of "ttyS0" when enable hypervisor debug mode. Fixes: #5080 Signed-off-by: Jianyong Wu --- src/runtime/virtcontainers/clh.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/runtime/virtcontainers/clh.go b/src/runtime/virtcontainers/clh.go index 04aba85457..b8e3abe89c 100644 --- a/src/runtime/virtcontainers/clh.go +++ b/src/runtime/virtcontainers/clh.go @@ -22,6 +22,7 @@ import ( "os/user" "path/filepath" "regexp" + "runtime" "strconv" "strings" "sync" @@ -271,6 +272,10 @@ var clhDebugKernelParams = []Param{ {"console", "ttyS0,115200n8"}, // enable serial console } +var clhArmDebugKernelParams = []Param{ + {"console", "ttyAMA0,115200n8"}, // enable serial console +} + var clhDebugConfidentialGuestKernelParams = []Param{ {"console", "hvc0"}, // enable HVC console } @@ -527,6 +532,8 @@ func (clh *cloudHypervisor) CreateVM(ctx context.Context, id string, network Net if clh.config.Debug { if clh.config.ConfidentialGuest { params = append(params, clhDebugConfidentialGuestKernelParams...) + } else if runtime.GOARCH == "arm64" { + params = append(params, clhArmDebugKernelParams...) } else { params = append(params, clhDebugKernelParams...) }