diff --git a/tests/framework/utils_cpuid.py b/tests/framework/utils_cpuid.py index 52976d5964a..6f339b115f9 100644 --- a/tests/framework/utils_cpuid.py +++ b/tests/framework/utils_cpuid.py @@ -29,6 +29,7 @@ class CpuModel(str, Enum): ARM_NEOVERSE_N1 = "ARM_NEOVERSE_N1" ARM_NEOVERSE_V1 = "ARM_NEOVERSE_V1" ARM_NEOVERSE_V2 = "ARM_NEOVERSE_V2" + ARM_NEOVERSE_V3 = "ARM_NEOVERSE_V3" INTEL_CASCADELAKE = "INTEL_CASCADELAKE" INTEL_ICELAKE = "INTEL_ICELAKE" INTEL_SAPPHIRE_RAPIDS = "INTEL_SAPPHIRE_RAPIDS" @@ -48,6 +49,7 @@ class CpuModel(str, Enum): "0xd0c": "ARM_NEOVERSE_N1", "0xd40": "ARM_NEOVERSE_V1", "0xd4f": "ARM_NEOVERSE_V2", + "0xd84": "ARM_NEOVERSE_V3", }, } diff --git a/tests/integration_tests/functional/test_cpu_features_aarch64.py b/tests/integration_tests/functional/test_cpu_features_aarch64.py index 2cafe5f6352..3e710c36fa8 100644 --- a/tests/integration_tests/functional/test_cpu_features_aarch64.py +++ b/tests/integration_tests/functional/test_cpu_features_aarch64.py @@ -31,6 +31,10 @@ "paca pacg sve sve2 sveaes svebitperm svepmull svesha3 svebf16 svei8mm".split() ) +G5_FEATS = G4_FEATS | set("afp ecv".split()) + +G5_SVE_AND_PAC = G4_SVE_AND_PAC + @pin_cpu_template(ALL_CPU_TEMPLATES) def test_guest_cpu_features(uvm_any): @@ -55,6 +59,16 @@ def test_guest_cpu_features(uvm_any): expected_cpu_features = G4_FEATS case CpuModel.ARM_NEOVERSE_V2, "AARCH64_WITH_SVE_AND_PAC": expected_cpu_features = G4_FEATS | G4_SVE_AND_PAC + case CpuModel.ARM_NEOVERSE_V3, "None": + expected_cpu_features = G5_FEATS + case CpuModel.ARM_NEOVERSE_V3, "AARCH64_WITH_SVE_AND_PAC": + expected_cpu_features = G5_FEATS | G5_SVE_AND_PAC + + if ( + global_props.cpu_model == CpuModel.ARM_NEOVERSE_V3 + and vm.guest_kernel_version >= (6, 1) + ): + expected_cpu_features = expected_cpu_features | {"wfxt"} guest_feats = set(vm.ssh.check_output(CPU_FEATURES_CMD).stdout.split()) assert guest_feats == expected_cpu_features diff --git a/tests/integration_tests/functional/test_cpu_features_host_vs_guest.py b/tests/integration_tests/functional/test_cpu_features_host_vs_guest.py index b13e5c21a43..c5aa2d2d7fa 100644 --- a/tests/integration_tests/functional/test_cpu_features_host_vs_guest.py +++ b/tests/integration_tests/functional/test_cpu_features_host_vs_guest.py @@ -647,6 +647,41 @@ def test_host_vs_guest_cpu_features(uvm): assert host_feats - guest_feats == expected_host_minus_guest assert guest_feats - host_feats == expected_guest_minus_host + case CpuModel.ARM_NEOVERSE_V3: + expected_guest_minus_host = set() + expected_host_minus_guest = { + "paca", + "pacg", + "sve", + "sve2", + "sveaes", + "svebf16", + "svebitperm", + "svei8mm", + "svepmull", + "svesha3", + } + + # The "wfxt" (FEAT_WFxT) hwcap is exposed to userspace from kernel + # v6.1 (absent in v5.10, including Amazon Linux 5.10). + host_has_wfxt = global_props.host_linux_version_tpl >= (6, 1) + guest_has_wfxt = vm.guest_kernel_version >= (6, 1) + + if host_has_wfxt and not guest_has_wfxt: + expected_host_minus_guest |= {"wfxt"} + if not host_has_wfxt and guest_has_wfxt: + expected_guest_minus_host |= {"wfxt"} + + host_has_ssbs = global_props.host_os not in { + "amzn2", + "amzn2023", + } and global_props.host_linux_version_tpl < (6, 11) + if not host_has_ssbs: + expected_guest_minus_host |= {"ssbs"} + + assert host_feats - guest_feats == expected_host_minus_guest + assert guest_feats - host_feats == expected_guest_minus_host + case _: # only fail if running in CI if os.environ.get("BUILDKITE") is not None: