Skip to content

Commit 1b63b64

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 dfe97ec commit 1b63b64

File tree

3 files changed

+18
-23
lines changed

3 files changed

+18
-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: 9 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,16 @@
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(
31+
memory_config={"secret_free": True},
32+
boot_args="console=ttyS0 reboot=k panic=1 pci=off no-kvmclock",
33+
)
3734
vm.add_net_iface()
3835
vm.start()
3936

@@ -54,7 +51,7 @@ def test_secret_free_initrd(microvm_factory, guest_kernel):
5451
vcpu_count=1,
5552
boot_args="console=ttyS0 reboot=k panic=1 pci=off no-kvmclock",
5653
use_initrd=True,
57-
memory_config={"initial_swiotlb_size": 64, "secret_free": True},
54+
memory_config={"secret_free": True},
5855
)
5956

6057
uvm.start()
@@ -65,16 +62,15 @@ def test_secret_free_initrd(microvm_factory, guest_kernel):
6562
serial.rx(token=f"rootfs on / type {INITRD_FILESYSTEM}")
6663

6764

68-
@pytest.mark.skipif(
69-
platform.machine() != "aarch64",
70-
reason="only ARM can boot secret free VMs with I/O devices",
71-
)
7265
def test_secret_free_snapshot_creation(microvm_factory, guest_kernel_linux_6_1, rootfs):
7366
"""Test that snapshot creation works for secret hidden VMs"""
7467
vm = microvm_factory.build(guest_kernel_linux_6_1, rootfs)
7568
vm.spawn()
7669
vm.memory_monitor = None
77-
vm.basic_config(memory_config={"initial_swiotlb_size": 8, "secret_free": True})
70+
vm.basic_config(
71+
memory_config={"secret_free": True},
72+
boot_args="console=ttyS0 reboot=k panic=1 pci=off no-kvmclock",
73+
)
7874
vm.add_net_iface()
7975
vm.start()
8076

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)