From 57ea620f914ffb067e79137cd6b51895f74d4933 Mon Sep 17 00:00:00 2001 From: Patrick Roy Date: Wed, 26 Feb 2025 11:20:00 +0000 Subject: [PATCH 1/5] Reduce amount of data downloaded from GitHub in resources/rebuild.sh Use a tree-less git checkout [1], which reduces the amount of data downloaded by ~60% (from >3GiB to ~1GiB currently) when cloneing the upstream amazon linux repository from GitHub. It will now download some stuff during checkout, but this is significantly less than a full clone, as we're only checking out a handful of tags. We sadly cannot use a `--depth=1` checkout because we need access to all tags, in chronological order, and for this, we need at least the commit metadata itself fetched locally (even git ls-remote --tags will not sort tags without first fetching these). [1]: https://github.blog/open-source/git/get-up-to-speed-with-partial-clone-and-shallow-clone/ Signed-off-by: Patrick Roy --- resources/rebuild.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/resources/rebuild.sh b/resources/rebuild.sh index 90bac7addb7..56afd1bdbac 100755 --- a/resources/rebuild.sh +++ b/resources/rebuild.sh @@ -120,7 +120,7 @@ EOF } function clone_amazon_linux_repo { - [ -d linux ] || git clone https://github.com/amazonlinux/linux linux + [ -d linux ] || git clone --no-checkout --filter=tree:0 https://github.com/amazonlinux/linux } # prints the git tag corresponding to the newest and best matching the provided kernel version $1 @@ -145,7 +145,8 @@ function build_al_kernel { local KERNEL_VERSION=$(echo $KERNEL_CFG | grep -Po "microvm-kernel-ci-$ARCH-\K(\d+\.\d+)") pushd linux - make distclean + # fails immediately after clone because nothing is checked out + make distclean || true git checkout $(get_tag $KERNEL_VERSION) From 9ff2c7b574d6e889895ee05841ba54ebc7aa43f1 Mon Sep 17 00:00:00 2001 From: Patrick Roy Date: Wed, 26 Feb 2025 12:40:46 +0000 Subject: [PATCH 2/5] fix: Add keyboard drivers to CI guest kernels Firecracker supports sending a CTRL+ALT+DEL event to the guest, to trigger a reboot, and we had an integration test for this. However, the integration test was broken (see #5050), and actually, our guest kernels dont have the necessary drivers compiled in to actually receive the CTRL+ALT+DEL. Fix this by actually enabling the relavant Kconfigs. We don't re-build the artifacts just yet, as it'll happen anyway in a few days when we branch off the next release. Suggested-by: Riccardo Mancini Signed-off-by: Patrick Roy --- resources/guest_configs/ci.config | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/resources/guest_configs/ci.config b/resources/guest_configs/ci.config index 7bbf1fb1f56..166ab94db3f 100644 --- a/resources/guest_configs/ci.config +++ b/resources/guest_configs/ci.config @@ -5,3 +5,10 @@ CONFIG_SQUASHFS_ZSTD=y # aarch64 only TBD split into a separate file CONFIG_DEVMEM=y # CONFIG_ARM64_ERRATUM_3194386 is not set +# Needed for CTRL+ALT+DEL support +CONFIG_SERIO=y +CONFIG_SERIO_I8042=y +CONFIG_SERIO_LIBPS2=y +CONFIG_SERIO_GSCPS2=y +CONFIG_KEYBOARD_ATKBD=y +CONFIG_INPUT_KEYBOARD=y \ No newline at end of file From ecad2fd70c4d7f0364ecf1145ae85bde21f6ba72 Mon Sep 17 00:00:00 2001 From: Egor Lazarchuk Date: Wed, 26 Feb 2025 17:00:16 +0000 Subject: [PATCH 3/5] feat: add support got Graviton 4 cpu detection First step to test m8g is to identify if you run on m8g. Signed-off-by: Egor Lazarchuk --- tests/framework/utils_cpuid.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/framework/utils_cpuid.py b/tests/framework/utils_cpuid.py index dabfb220240..979f4478c8b 100644 --- a/tests/framework/utils_cpuid.py +++ b/tests/framework/utils_cpuid.py @@ -28,6 +28,7 @@ class CpuModel(str, Enum): AMD_GENOA = "AMD_GENOA" ARM_NEOVERSE_N1 = "ARM_NEOVERSE_N1" ARM_NEOVERSE_V1 = "ARM_NEOVERSE_V1" + ARM_NEOVERSE_V2 = "ARM_NEOVERSE_V2" INTEL_SKYLAKE = "INTEL_SKYLAKE" INTEL_CASCADELAKE = "INTEL_CASCADELAKE" INTEL_ICELAKE = "INTEL_ICELAKE" @@ -41,7 +42,11 @@ class CpuModel(str, Enum): "Intel(R) Xeon(R) Platinum 8375C CPU": "INTEL_ICELAKE", }, CpuVendor.AMD: {"AMD EPYC 7R13": "AMD_MILAN", "AMD EPYC 9R14": "AMD_GENOA"}, - CpuVendor.ARM: {"0xd0c": "ARM_NEOVERSE_N1", "0xd40": "ARM_NEOVERSE_V1"}, + CpuVendor.ARM: { + "0xd0c": "ARM_NEOVERSE_N1", + "0xd40": "ARM_NEOVERSE_V1", + "0xd4f": "ARM_NEOVERSE_V2", + }, } From 32ebbbec8146fe1f76b25251a827af9ed84ff01d Mon Sep 17 00:00:00 2001 From: Egor Lazarchuk Date: Wed, 26 Feb 2025 14:40:57 +0000 Subject: [PATCH 4/5] feat: add Graviton 4 guest cpu features Add new set of guest features specific for graviton 4. Signed-off-by: Egor Lazarchuk --- .../integration_tests/functional/test_cpu_features_aarch64.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/integration_tests/functional/test_cpu_features_aarch64.py b/tests/integration_tests/functional/test_cpu_features_aarch64.py index 2068194a894..5b667d0b34d 100644 --- a/tests/integration_tests/functional/test_cpu_features_aarch64.py +++ b/tests/integration_tests/functional/test_cpu_features_aarch64.py @@ -24,6 +24,8 @@ G3_SVE_AND_PAC = set("paca pacg sve svebf16 svei8mm".split()) +G4_FEATS = (G3_FEATS | set("bti flagm2 frint sb".split())) - set("sm3 sm4".split()) + def test_guest_cpu_features(uvm_any): """Check the CPU features for a microvm with different CPU templates""" @@ -43,6 +45,8 @@ def test_guest_cpu_features(uvm_any): expected_cpu_features = G3_FEATS | G3_SVE_AND_PAC case CpuModel.ARM_NEOVERSE_V1, None: expected_cpu_features = G3_FEATS + case CpuModel.ARM_NEOVERSE_V2, None: + expected_cpu_features = G4_FEATS guest_feats = set(vm.ssh.check_output(CPU_FEATURES_CMD).stdout.split()) assert guest_feats == expected_cpu_features From dd0bf861ca43f99375b1eb76b275bbc5e45085b1 Mon Sep 17 00:00:00 2001 From: Egor Lazarchuk Date: Wed, 26 Feb 2025 16:53:55 +0000 Subject: [PATCH 5/5] feat: add Graviton 4 host vs guest cpu difference Add additional Graviton 4 cpu features to the host vs guest test. Signed-off-by: Egor Lazarchuk --- .../functional/test_cpu_features_host_vs_guest.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 d2fd4936328..c8075faa505 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 @@ -257,12 +257,21 @@ def test_host_vs_guest_cpu_features(uvm_nano): assert host_feats - guest_feats == expected_host_minus_guest assert guest_feats - host_feats == expected_guest_minus_host - case CpuModel.ARM_NEOVERSE_V1: + case CpuModel.ARM_NEOVERSE_V1 | CpuModel.ARM_NEOVERSE_V2: expected_guest_minus_host = set() # KVM does not enable PAC or SVE features by default # and Firecracker does not enable them either. expected_host_minus_guest = {"paca", "pacg", "sve", "svebf16", "svei8mm"} + if CPU_MODEL == CpuModel.ARM_NEOVERSE_V2: + expected_host_minus_guest |= { + "svebitperm", + "svesha3", + "sveaes", + "sve2", + "svepmull", + } + # Upstream kernel v6.11+ hides "ssbs" from "lscpu" on Neoverse-N1 and Neoverse-V1 since # they have an errata whereby an MSR to the SSBS special-purpose register does not # affect subsequent speculative instructions, permitting speculative store bypassing for