From 52f6449b7001a0853cf76208fdb7cf90c31c5739 Mon Sep 17 00:00:00 2001 From: "James O. D. Hunt" Date: Mon, 11 Sep 2023 09:28:07 +0100 Subject: [PATCH 1/3] kata-manager: Remove initcall_debug kernel option Removed the addition of the `initcall_debug` kernel option when agent debugging enabled. This option has nothing to do with the agent. If the user wishes to use this option, they can add it to the `kernel_params=` setting in the Kata configuration file's hypervisor stanza. Signed-off-by: James O. D. Hunt --- utils/kata-manager.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/kata-manager.sh b/utils/kata-manager.sh index 249a510fa3..1dfc369f3f 100755 --- a/utils/kata-manager.sh +++ b/utils/kata-manager.sh @@ -593,7 +593,7 @@ configure_kata() sudo sed -i \ -e 's/^# *\(enable_debug\).*=.*$/\1 = true/g' \ - -e 's/^kernel_params = "\(.*\)"/kernel_params = "\1 agent.log=debug initcall_debug"/g' \ + -e 's/^kernel_params = "\(.*\)"/kernel_params = "\1 agent.log=debug"/g' \ "$cfg_to" info "Configured $kata_project for full debug (delete $cfg_to to use pristine $kata_project configuration)" From 976d10150c6c774232b23f2bec6863071ec4057f Mon Sep 17 00:00:00 2001 From: "James O. D. Hunt" Date: Mon, 11 Sep 2023 09:32:19 +0100 Subject: [PATCH 2/3] runtime-rs: hypervisor: Remove debug kernel options Removed the following kernel command line options: - `earlyprintk=ttyS0` - `initcall_debug` Both these options are only useful when debugging a guest kernel failure which is not a common occurrence. Further, the `earlyprintk=` option can have a large negative performance impact (it can increase the VM boot time significantly). If the user wishes to use either of these options, they can add them to the `kernel_params=` setting in the Kata configuration file's hypervisor stanza. Fixes: #7886. Signed-off-by: James O. D. Hunt --- src/runtime-rs/crates/hypervisor/src/kernel_param.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/runtime-rs/crates/hypervisor/src/kernel_param.rs b/src/runtime-rs/crates/hypervisor/src/kernel_param.rs index e2804dd95c..9521ebac7e 100644 --- a/src/runtime-rs/crates/hypervisor/src/kernel_param.rs +++ b/src/runtime-rs/crates/hypervisor/src/kernel_param.rs @@ -56,8 +56,6 @@ impl KernelParams { // default kernel params let mut params = vec![ Param::new("reboot", "k"), - Param::new("earlyprintk", "ttyS0"), - Param::new("initcall_debug", ""), Param::new("panic", "1"), Param::new("systemd.unit", "kata-containers.target"), Param::new("systemd.mask", "systemd-networkd.service"), From c0f697fcc5fda54df6e03013719081f85623fff0 Mon Sep 17 00:00:00 2001 From: "James O. D. Hunt" Date: Mon, 11 Sep 2023 12:11:14 +0100 Subject: [PATCH 3/3] runtime: Allow kernel_params annotation To support the removal of the `initcall_debug` and `earlyprintk=` options from the default guest kernel cmdline, add `kernel_params` to the list of enabled annotations to allow those kernel options (or others) to be set using `kata-deploy` for either runtime. Signed-off-by: James O. D. Hunt --- src/runtime-rs/Makefile | 2 +- src/runtime/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runtime-rs/Makefile b/src/runtime-rs/Makefile index 496a9b1c20..8dd730ac8d 100644 --- a/src/runtime-rs/Makefile +++ b/src/runtime-rs/Makefile @@ -122,7 +122,7 @@ DEFMEMSZ := 2048 DEFMEMSLOTS := 10 ##VAR DEFBRIDGES= Default number of bridges DEFBRIDGES := 0 -DEFENABLEANNOTATIONS := [] +DEFENABLEANNOTATIONS := [\"kernel_params\"] DEFDISABLEGUESTSECCOMP := true DEFDISABLEGUESTEMPTYDIR := false ##VAR DEFAULTEXPFEATURES=[features] Default experimental features enabled diff --git a/src/runtime/Makefile b/src/runtime/Makefile index 05ee9e2d2e..bde1e22feb 100644 --- a/src/runtime/Makefile +++ b/src/runtime/Makefile @@ -194,7 +194,7 @@ DEFMEMSLOTS := 10 DEFMAXMEMSZ := 0 #Default number of bridges DEFBRIDGES := 1 -DEFENABLEANNOTATIONS := [\"enable_iommu\", \"virtio_fs_extra_args\"] +DEFENABLEANNOTATIONS := [\"enable_iommu\", \"virtio_fs_extra_args\", \"kernel_params\"] DEFDISABLEGUESTSECCOMP := true DEFDISABLEGUESTEMPTYDIR := false #Default experimental features enabled