Skip to content

Commit aa8c9ca

Browse files
Manciukicbchalios
authored andcommitted
feat: add swiotlb=noforce to default kernel command line
swiotlb=noforce disables SWIOTLB, which is enabled by the kernel if the physical addresses exceed 32b. This is not needed for us and causes 64MB to be wasted on the microvm. Signed-off-by: Riccardo Mancini <[email protected]> Signed-off-by: Babis Chalios <[email protected]>
1 parent d34d1ab commit aa8c9ca

File tree

9 files changed

+16
-13
lines changed

9 files changed

+16
-13
lines changed

src/vmm/src/vmm_config/boot_source.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ use serde::{Deserialize, Serialize};
1414
/// - `i8042.noaux` do not probe the i8042 controller for an attached mouse (save boot time);
1515
/// - `i8042.nomux` do not probe i8042 for a multiplexing controller (save boot time);
1616
/// - `i8042.dumbkbd` do not attempt to control kbd state via the i8042 (save boot time).
17-
pub const DEFAULT_KERNEL_CMDLINE: &str =
18-
"reboot=k panic=1 nomodule 8250.nr_uarts=0 i8042.noaux i8042.nomux i8042.dumbkbd";
17+
/// - `swiotlb=noforce` disable software bounce buffers (SWIOTLB)
18+
pub const DEFAULT_KERNEL_CMDLINE: &str = "reboot=k panic=1 nomodule 8250.nr_uarts=0 i8042.noaux \
19+
i8042.nomux i8042.dumbkbd swiotlb=noforce";
1920

2021
/// Strongly typed data structure used to configure the boot source of the
2122
/// microvm.

tests/framework/microvm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ def basic_config(
807807
808808
If boot_args is None, the default boot_args in Firecracker is
809809
reboot=k panic=1 nomodule 8250.nr_uarts=0 i8042.noaux i8042.nomux
810-
i8042.nopnp i8042.dumbkbd
810+
i8042.nopnp i8042.dumbkbd swiotlb=noforce
811811
812812
if PCI is disabled, Firecracker also passes to the guest pci=off
813813

tests/framework/microvm_helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def enable_console(self):
127127
raise RuntimeError(".spawn already called, too late to enable the console")
128128
if self.vm.boot_args is None:
129129
self.vm.boot_args = ""
130-
self.vm.boot_args += "console=ttyS0 reboot=k panic=1"
130+
self.vm.boot_args += "console=ttyS0 reboot=k panic=1 swiotlb=noforce"
131131
self.vm.jailer.daemonize = False
132132
self.vm.jailer.new_pid_ns = False
133133

tests/framework/vm_config_missing_vcpu_count.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"boot-source": {
33
"kernel_image_path": "vmlinux.bin",
4-
"boot_args": "console=ttyS0 reboot=k panic=1"
4+
"boot_args": "console=ttyS0 reboot=k panic=1 swiotlb=noforce"
55
},
66
"drives": [
77
{

tests/integration_tests/functional/test_error_code.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def test_enosys_error_code(uvm_plain):
2525
vm.memory_monitor = None
2626
vm.basic_config(
2727
vcpu_count=1,
28-
boot_args="reboot=k panic=1 init=/usr/local/bin/devmemread",
28+
boot_args="reboot=k panic=1 swiotlb=noforce init=/usr/local/bin/devmemread",
2929
)
3030
vm.start()
3131

tests/integration_tests/functional/test_kernel_cmdline.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def test_init_params(uvm_plain):
2121
# Ubuntu version from the /etc/issue file.
2222
vm.basic_config(
2323
vcpu_count=1,
24-
boot_args="console=ttyS0 reboot=k panic=1 init=/bin/cat -- /etc/issue",
24+
boot_args="console=ttyS0 reboot=k panic=1 swiotlb=noforce init=/bin/cat -- /etc/issue",
2525
)
2626

2727
vm.start()

tests/integration_tests/functional/test_serial_io.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def test_serial_after_snapshot(uvm_plain, microvm_factory):
5555
microvm.basic_config(
5656
vcpu_count=2,
5757
mem_size_mib=256,
58-
boot_args="console=ttyS0 reboot=k panic=1",
58+
boot_args="console=ttyS0 reboot=k panic=1 swiotlb=noforce",
5959
)
6060
serial = Serial(microvm)
6161
serial.open()
@@ -99,7 +99,9 @@ def test_serial_console_login(uvm_plain_any):
9999
microvm.memory_monitor = None
100100

101101
# Set up the microVM with 1 vCPU and a serial console.
102-
microvm.basic_config(vcpu_count=1, boot_args="console=ttyS0 reboot=k panic=1")
102+
microvm.basic_config(
103+
vcpu_count=1, boot_args="console=ttyS0 reboot=k panic=1 swiotlb=noforce"
104+
)
103105

104106
microvm.start()
105107

@@ -144,7 +146,7 @@ def test_serial_dos(uvm_plain_any):
144146
# Set up the microVM with 1 vCPU and a serial console.
145147
microvm.basic_config(
146148
vcpu_count=1,
147-
boot_args="console=ttyS0 reboot=k panic=1",
149+
boot_args="console=ttyS0 reboot=k panic=1 swiotlb=noforce",
148150
)
149151
microvm.add_net_iface()
150152
microvm.start()
@@ -178,7 +180,7 @@ def test_serial_block(uvm_plain_any):
178180
test_microvm.basic_config(
179181
vcpu_count=1,
180182
mem_size_mib=512,
181-
boot_args="console=ttyS0 reboot=k panic=1",
183+
boot_args="console=ttyS0 reboot=k panic=1 swiotlb=noforce",
182184
)
183185
test_microvm.add_net_iface()
184186
test_microvm.start()

tests/integration_tests/performance/test_boottime.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
DEFAULT_BOOT_ARGS = (
1414
"reboot=k panic=1 nomodule 8250.nr_uarts=0"
15-
" i8042.noaux i8042.nomux i8042.nopnp i8042.dumbkbd"
15+
" i8042.noaux i8042.nomux i8042.nopnp i8042.dumbkbd swiotlb=noforce"
1616
)
1717

1818

tests/integration_tests/performance/test_initrd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def test_microvm_initrd_with_serial(uvm_with_initrd, huge_pages):
3535
vm.basic_config(
3636
add_root_device=False,
3737
vcpu_count=1,
38-
boot_args="console=ttyS0 reboot=k panic=1",
38+
boot_args="console=ttyS0 reboot=k panic=1 swiotlb=noforce",
3939
use_initrd=True,
4040
huge_pages=huge_pages,
4141
)

0 commit comments

Comments
 (0)