Skip to content

Commit 1054d41

Browse files
committed
Run performance tests with userspace bounce buffers
Now that we have userspace bounce buffers, we can run secret freedom tests (including perf tests!) with then, which additionally allows us to run them on x86 too. Remove the swiotlb test cases from the performance tests, as the performance impact here was shown too significant. Signed-off-by: Patrick Roy <[email protected]>
1 parent d66c7ba commit 1054d41

File tree

3 files changed

+12
-23
lines changed

3 files changed

+12
-23
lines changed

tests/conftest.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -376,16 +376,12 @@ def io_engine(request):
376376
return request.param
377377

378378

379-
# 4MiB is the smallest swiotlb size that seems to generally work for all
380-
# perf tests. 2MiB makes the vsock throughput test consistently fail, and 1MiB makes
381-
# the network throughput test occasionally fail (both due to connection issues).
382-
# The block test passes even with the minimum of 1MiB. We pick 8 to have enough
383-
# buffer to the failing cases.
384379
secret_free_test_cases = [None]
385-
if platform.machine() == "aarch64":
386-
secret_free_test_cases.append((8, False))
387-
if global_props.instance != "m6g.metal":
388-
secret_free_test_cases.append((8, True))
380+
if (
381+
global_props.host_linux_version_metrics == "next"
382+
and global_props.instance != "m6g.metal"
383+
):
384+
secret_free_test_cases.append((0, True))
389385

390386

391387
@pytest.fixture(params=secret_free_test_cases)

tests/integration_tests/functional/test_secret_freedom.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
# SPDX-License-Identifier: Apache-2.0
33
"""Test secret-freedom related functionality."""
44

5-
import platform
6-
75
import pytest
86

97
from framework import defs
@@ -23,17 +21,13 @@
2321
]
2422

2523

26-
@pytest.mark.skipif(
27-
platform.machine() != "aarch64",
28-
reason="only ARM can boot secret free VMs with I/O devices",
29-
)
3024
def test_secret_free_boot(microvm_factory, guest_kernel_linux_6_1, rootfs):
3125
"""Tests that a VM can boot if all virtio devices are bound to a swiotlb region, and
3226
that this swiotlb region is actually discovered by the guest."""
3327
vm = microvm_factory.build(guest_kernel_linux_6_1, rootfs)
3428
vm.spawn()
3529
vm.memory_monitor = None
36-
vm.basic_config(memory_config={"initial_swiotlb_size": 8, "secret_free": True})
30+
vm.basic_config(memory_config={"secret_free": True})
3731
vm.add_net_iface()
3832
vm.start()
3933

@@ -54,7 +48,7 @@ def test_secret_free_initrd(microvm_factory, guest_kernel):
5448
vcpu_count=1,
5549
boot_args="console=ttyS0 reboot=k panic=1 pci=off no-kvmclock",
5650
use_initrd=True,
57-
memory_config={"initial_swiotlb_size": 64, "secret_free": True},
51+
memory_config={"secret_free": True},
5852
)
5953

6054
uvm.start()
@@ -65,16 +59,12 @@ def test_secret_free_initrd(microvm_factory, guest_kernel):
6559
serial.rx(token=f"rootfs on / type {INITRD_FILESYSTEM}")
6660

6761

68-
@pytest.mark.skipif(
69-
platform.machine() != "aarch64",
70-
reason="only ARM can boot secret free VMs with I/O devices",
71-
)
7262
def test_secret_free_snapshot_creation(microvm_factory, guest_kernel_linux_6_1, rootfs):
7363
"""Test that snapshot creation works for secret hidden VMs"""
7464
vm = microvm_factory.build(guest_kernel_linux_6_1, rootfs)
7565
vm.spawn()
7666
vm.memory_monitor = None
77-
vm.basic_config(memory_config={"initial_swiotlb_size": 8, "secret_free": True})
67+
vm.basic_config(memory_config={"secret_free": True})
7868
vm.add_net_iface()
7969
vm.start()
8070

tests/integration_tests/performance/test_block_ab.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,12 @@ def test_block_performance(
154154
"""
155155
Execute block device emulation benchmarking scenarios.
156156
"""
157-
if memory_config is not None and "6.1" not in guest_kernel_acpi.name:
157+
if memory_config[0] != 0 and "6.1" not in guest_kernel_acpi.name:
158158
pytest.skip("swiotlb only supported on aarch64/6.1")
159159

160+
if memory_config is not None and io_engine == "Async":
161+
pytest.skip("userspace bounce buffers not supported with async block engine")
162+
160163
vm = microvm_factory.build(guest_kernel_acpi, rootfs, monitor_memory=False)
161164
vm.spawn(log_level="Info", emit_metrics=True)
162165
vm.basic_config(

0 commit comments

Comments
 (0)