From 241c355e07c57303abbcab78f3322490c3d52ede Mon Sep 17 00:00:00 2001 From: Jianyong Wu Date: Thu, 31 Aug 2023 06:13:06 +0000 Subject: [PATCH 1/2] 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...) } From 7f5e77bcb81539310eb1c67275ba49bac5221cc2 Mon Sep 17 00:00:00 2001 From: Jianyong Wu Date: Thu, 31 Aug 2023 06:13:52 +0000 Subject: [PATCH 2/2] kernel: enable Arm pl011 support Enable pl011 (ttyAMA0) support in kernel for aarch64. Fixes: #5080 Signed-off-by: Jianyong Wu --- tools/packaging/kernel/configs/fragments/arm64/serial.conf | 4 ++++ tools/packaging/kernel/kata_config_version | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/packaging/kernel/configs/fragments/arm64/serial.conf b/tools/packaging/kernel/configs/fragments/arm64/serial.conf index 6c76fd2964..b519e6819e 100644 --- a/tools/packaging/kernel/configs/fragments/arm64/serial.conf +++ b/tools/packaging/kernel/configs/fragments/arm64/serial.conf @@ -1,3 +1,7 @@ # This option is used for all 8250 compatible serial ports # that are probed through device tree. CONFIG_SERIAL_OF_PLATFORM=y + +# Enable Arm AMBA UART +CONFIG_SERIAL_AMBA_PL011=y +CONFIG_SERIAL_AMBA_PL011_CONSOLE=y diff --git a/tools/packaging/kernel/kata_config_version b/tools/packaging/kernel/kata_config_version index ee977b5ecd..4699eb3cc9 100644 --- a/tools/packaging/kernel/kata_config_version +++ b/tools/packaging/kernel/kata_config_version @@ -1 +1 @@ -115 +116