Add test for arm64 Linux with 64K page size#290658
Conversation
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @lszomoruMatched files:
|
There was a problem hiding this comment.
Pull request overview
This pull request adds testing support for ARM64 Linux systems with 64K page size, addressing issue #268354 where VSCode crashes on aarch64 Linux systems configured with 64K pages. Since the 64K page configuration cannot be set in a running VM, the implementation uses QEMU system emulation with a custom 64K kernel.
Changes:
- Adds QEMU-based emulation infrastructure for testing 64K page size scenarios
- Extends Azure Pipeline configuration to include a new Ubuntu 24.04 ARM64 64K page test
- Adds iproute2 dependency to support networking setup in the QEMU VM
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 16 comments.
Show a summary per file
| File | Description |
|---|---|
| test/sanity/scripts/run-qemu-64k.sh | New script that sets up QEMU system emulation with a 64K kernel, exports container filesystem, and runs tests in the VM |
| test/sanity/scripts/run-docker.sh | Extended to accept --page-size parameter and delegate to QEMU script when 64k is specified |
| test/sanity/scripts/qemu-init.sh | New init script for the QEMU VM that mounts filesystems, sets up networking, and runs tests |
| test/sanity/containers/ubuntu.dockerfile | Adds iproute2 package needed for networking commands in QEMU VM |
| test/sanity/containers/entrypoint.sh | Adds logging of system information including page size |
| build/azure-pipelines/product-sanity-tests.yml | Adds new test job for Ubuntu 24.04 ARM64 with 64K page size |
| build/azure-pipelines/common/sanity-tests.yml | Adds pageSize parameter support and skips Docker cache saving for 64K tests |
Comments suppressed due to low confidence (5)
test/sanity/scripts/run-docker.sh:58
- The $ARGS variable should be quoted to properly preserve spaces and special characters in arguments. Without quotes, the shell will perform word splitting and glob expansion on the arguments.
$ARGS
test/sanity/scripts/run-qemu-64k.sh:86
- The disk image file created by mktemp is not cleaned up at the end of the script. This will leave a 2GB file in /tmp on every test run, which could quickly consume disk space. Add cleanup for DISK_IMG before exit.
DISK_IMG=$(mktemp)
dd if=/dev/zero of="$DISK_IMG" bs=1M count=2048 status=none
sudo mkfs.ext4 -q -d "$ROOTFS_DIR" "$DISK_IMG"
sudo rm -rf "$ROOTFS_DIR"
echo "Starting QEMU VM with 64K page size kernel"
timeout 1800 qemu-system-aarch64 \
-M virt \
-cpu max,pauth-impdef=on \
-accel tcg,thread=multi \
-m 4096 \
-smp 2 \
-kernel "$VMLINUZ" \
-append "console=ttyAMA0 root=/dev/vda rw init=/init net.ifnames=0" \
-drive file="$DISK_IMG",format=raw,if=virtio \
-netdev user,id=net0 \
-device virtio-net-pci,netdev=net0 \
-nographic \
-no-reboot \
|| true
echo "Extracting test results from disk image"
MOUNT_DIR=$(mktemp -d)
sudo mount -o loop "$DISK_IMG" "$MOUNT_DIR"
if [ -f "$MOUNT_DIR/root/results.xml" ]; then
cp "$MOUNT_DIR/root/results.xml" "$TEST_DIR/results.xml"
fi
EXIT_CODE=$(cat "$MOUNT_DIR/exit-code" 2>/dev/null || echo 1)
sudo umount "$MOUNT_DIR"
exit $EXIT_CODE
test/sanity/scripts/run-qemu-64k.sh:85
- The MOUNT_DIR temporary directory is not cleaned up after unmounting. While the mount itself is cleaned up, the empty directory remains.
MOUNT_DIR=$(mktemp -d)
sudo mount -o loop "$DISK_IMG" "$MOUNT_DIR"
if [ -f "$MOUNT_DIR/root/results.xml" ]; then
cp "$MOUNT_DIR/root/results.xml" "$TEST_DIR/results.xml"
fi
EXIT_CODE=$(cat "$MOUNT_DIR/exit-code" 2>/dev/null || echo 1)
sudo umount "$MOUNT_DIR"
test/sanity/scripts/run-qemu-64k.sh:35
- Using sudo with unquoted variables could be a security risk if TEST_DIR or ROOTFS_DIR contain spaces or special characters. Quote both variables to prevent shell injection and glob expansion.
sudo cp -r "$TEST_DIR"/* "$ROOTFS_DIR/root/"
test/sanity/scripts/run-qemu-64k.sh:84
- The cat command reading exit-code could fail if the file doesn't exist, returning 1 as a fallback. However, if cat fails for other reasons (e.g., permission issues), the error will be suppressed by '2>/dev/null || echo 1'. This could mask real problems. Consider checking if the file exists first or distinguishing between different failure modes.
EXIT_CODE=$(cat "$MOUNT_DIR/exit-code" 2>/dev/null || echo 1)
| parameters: | ||
| name: ubuntu_24_04_arm64_64k | ||
| displayName: Ubuntu 24.04 arm64 (64K page) | ||
| poolName: 1es-ubuntu-22.04-x64 |
There was a problem hiding this comment.
Having the host as arm64 should help speed up the emulation, any reason amd64 was chosen here for the pool ?
There was a problem hiding this comment.
That was the initial idea, but it was failing on arm64 pool. That said, I start with a different distro, so I'll give it another try.
|
Thank you @dmitrivMS 👏 |
64k page config cannot be set in a running VM, so using emulator with core replacement to run this test.
Related to #268354
This test is kind of slow, so we may want to run it more selectively.