Merge pull request #7806 from jongwu/clh_serial

clh:arm64: use arm AMBA UART for hypervisor debug
This commit is contained in:
Jeremi Piotrowski 2023-09-18 12:29:07 +02:00 committed by GitHub
commit dfa6af54df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 1 deletions

View File

@ -22,6 +22,7 @@ import (
"os/user" "os/user"
"path/filepath" "path/filepath"
"regexp" "regexp"
"runtime"
"strconv" "strconv"
"strings" "strings"
"sync" "sync"
@ -271,6 +272,10 @@ var clhDebugKernelParams = []Param{
{"console", "ttyS0,115200n8"}, // enable serial console {"console", "ttyS0,115200n8"}, // enable serial console
} }
var clhArmDebugKernelParams = []Param{
{"console", "ttyAMA0,115200n8"}, // enable serial console
}
var clhDebugConfidentialGuestKernelParams = []Param{ var clhDebugConfidentialGuestKernelParams = []Param{
{"console", "hvc0"}, // enable HVC console {"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.Debug {
if clh.config.ConfidentialGuest { if clh.config.ConfidentialGuest {
params = append(params, clhDebugConfidentialGuestKernelParams...) params = append(params, clhDebugConfidentialGuestKernelParams...)
} else if runtime.GOARCH == "arm64" {
params = append(params, clhArmDebugKernelParams...)
} else { } else {
params = append(params, clhDebugKernelParams...) params = append(params, clhDebugKernelParams...)
} }

View File

@ -1,3 +1,7 @@
# This option is used for all 8250 compatible serial ports # This option is used for all 8250 compatible serial ports
# that are probed through device tree. # that are probed through device tree.
CONFIG_SERIAL_OF_PLATFORM=y CONFIG_SERIAL_OF_PLATFORM=y
# Enable Arm AMBA UART
CONFIG_SERIAL_AMBA_PL011=y
CONFIG_SERIAL_AMBA_PL011_CONSOLE=y

View File

@ -1 +1 @@
115 116