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 <jianyong.wu@arm.com>
This commit is contained in:
Jianyong Wu 2023-08-31 06:13:06 +00:00
parent 6fe5cd3bd5
commit 241c355e07

View File

@ -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...)
}