From cbdbe06f14173b56f73d93789d39e36745755404 Mon Sep 17 00:00:00 2001 From: Nicolin Chen Date: Tue, 22 Jul 2025 07:21:44 +0000 Subject: [PATCH 1/2] NVIDIA: SAUCE: README Testing command: cmdqv=",cmdqv=on" vm_image="/home/nicolinc/vm2-nic.qcow2" qemu-system-aarch64 \ -object iommufd,id=iommufd0 \ -machine hmat=on -machine virt,accel=kvm,gic-version=3,ras=on,highmem-mmio-size=4T \ -cpu host -smp cpus=62 -m size=16G,slots=2,maxmem=256G -nographic \ -object memory-backend-file,size=8G,id=m0,mem-path=/hugepages/,prealloc=on,share=off \ -object memory-backend-file,size=8G,id=m1,mem-path=/hugepages/,prealloc=on,share=off \ -numa node,memdev=m0,cpus=0-61,nodeid=0 -numa node,memdev=m1,nodeid=1 \ -numa node,nodeid=2 -numa node,nodeid=3 -numa node,nodeid=4 -numa node,nodeid=5 \ -numa node,nodeid=6 -numa node,nodeid=7 -numa node,nodeid=8 -numa node,nodeid=9 \ -numa node,nodeid=10 -numa node,nodeid=11 -numa node,nodeid=12 -numa node,nodeid=13 \ -numa node,nodeid=14 -numa node,nodeid=15 -numa node,nodeid=16 -numa node,nodeid=17 \ -numa node,nodeid=18 -numa node,nodeid=19 -numa node,nodeid=20 -numa node,nodeid=21 \ -numa node,nodeid=22 -numa node,nodeid=23 -numa node,nodeid=24 -numa node,nodeid=25 \ -numa node,nodeid=26 -numa node,nodeid=27 -numa node,nodeid=28 -numa node,nodeid=29 \ -numa node,nodeid=30 -numa node,nodeid=31 -numa node,nodeid=32 -numa node,nodeid=33 \ -device pxb-pcie,id=pcie.1,bus_nr=1,bus=pcie.0 \ -device arm-smmuv3,primary-bus=pcie.1,id=smmuv3.1,accel=on,ats=on,ril=off,pasid=on,oas=48${cmdqv} \ -device pcie-root-port,id=pcie.port1,bus=pcie.1,chassis=1,io-reserve=0 \ -device vfio-pci-nohotplug,host=0009:01:00.0,bus=pcie.port1,rombar=0,id=dev0,iommufd=iommufd0 \ -object acpi-generic-initiator,id=gi0,pci-dev=dev0,node=2 \ -object acpi-generic-initiator,id=gi1,pci-dev=dev0,node=3 \ -object acpi-generic-initiator,id=gi2,pci-dev=dev0,node=4 \ -object acpi-generic-initiator,id=gi3,pci-dev=dev0,node=5 \ -object acpi-generic-initiator,id=gi4,pci-dev=dev0,node=6 \ -object acpi-generic-initiator,id=gi5,pci-dev=dev0,node=7 \ -object acpi-generic-initiator,id=gi6,pci-dev=dev0,node=8 \ -object acpi-generic-initiator,id=gi7,pci-dev=dev0,node=9 \ -device pxb-pcie,id=pcie.9,bus_nr=9,bus=pcie.0 \ -device arm-smmuv3,primary-bus=pcie.9,id=smmuv3.2,accel=on,ats=on,ril=off,pasid=on,oas=48${cmdqv} \ -device pcie-root-port,id=pcie.port9,bus=pcie.9,chassis=2,io-reserve=0 \ -device vfio-pci-nohotplug,host=0019:01:00.0,bus=pcie.port9,rombar=0,id=dev1,iommufd=iommufd0 \ -object acpi-generic-initiator,id=gi8,pci-dev=dev1,node=10 \ -object acpi-generic-initiator,id=gi9,pci-dev=dev1,node=11 \ -object acpi-generic-initiator,id=gi10,pci-dev=dev1,node=12 \ -object acpi-generic-initiator,id=gi11,pci-dev=dev1,node=13 \ -object acpi-generic-initiator,id=gi12,pci-dev=dev1,node=14 \ -object acpi-generic-initiator,id=gi13,pci-dev=dev1,node=15 \ -object acpi-generic-initiator,id=gi14,pci-dev=dev1,node=16 \ -object acpi-generic-initiator,id=gi15,pci-dev=dev1,node=17 \ -device pxb-pcie,id=pcie.17,bus_nr=17,bus=pcie.0 \ -device arm-smmuv3,primary-bus=pcie.17,id=smmuv3.3,accel=on,ats=on,ril=off,pasid=on,oas=48${cmdqv} \ -device pcie-root-port,id=pcie.port17,bus=pcie.17,chassis=3,io-reserve=0 \ -device vfio-pci-nohotplug,host=0029:01:00.0,bus=pcie.port17,rombar=0,id=dev2,iommufd=iommufd0 \ -object acpi-generic-initiator,id=gi16,pci-dev=dev2,node=18 \ -object acpi-generic-initiator,id=gi17,pci-dev=dev2,node=19 \ -object acpi-generic-initiator,id=gi18,pci-dev=dev2,node=20 \ -object acpi-generic-initiator,id=gi19,pci-dev=dev2,node=21 \ -object acpi-generic-initiator,id=gi20,pci-dev=dev2,node=22 \ -object acpi-generic-initiator,id=gi21,pci-dev=dev2,node=23 \ -object acpi-generic-initiator,id=gi22,pci-dev=dev2,node=24 \ -object acpi-generic-initiator,id=gi23,pci-dev=dev2,node=25 \ -device pxb-pcie,id=pcie.25,bus_nr=25,bus=pcie.0 \ -device arm-smmuv3,primary-bus=pcie.25,id=smmuv3.4,accel=on,ats=on,ril=off,pasid=on,oas=48${cmdqv} \ -device pcie-root-port,id=pcie.port25,bus=pcie.25,chassis=4,io-reserve=0 \ -device vfio-pci-nohotplug,host=0039:01:00.0,bus=pcie.port25,rombar=0,id=dev3,iommufd=iommufd0 \ -object acpi-generic-initiator,id=gi24,pci-dev=dev3,node=26 \ -object acpi-generic-initiator,id=gi25,pci-dev=dev3,node=27 \ -object acpi-generic-initiator,id=gi26,pci-dev=dev3,node=28 \ -object acpi-generic-initiator,id=gi27,pci-dev=dev3,node=29 \ -object acpi-generic-initiator,id=gi28,pci-dev=dev3,node=30 \ -object acpi-generic-initiator,id=gi29,pci-dev=dev3,node=31 \ -object acpi-generic-initiator,id=gi30,pci-dev=dev3,node=32 \ -object acpi-generic-initiator,id=gi31,pci-dev=dev3,node=33 \ -bios /usr/share/AAVMF/AAVMF_CODE.fd \ -device nvme,drive=nvme0,serial=deadbeaf1,bus=pcie.0 \ -drive file=${vm_image},index=0,media=disk,format=qcow2,if=none,id=nvme0 \ -device e1000,romfile=/home/nicolinc/efi-e1000.rom,netdev=net0,bus=pcie.0 \ -netdev user,id=net0,hostfwd=tcp::5558-:22,hostfwd=tcp::5586-:5586 Signed-off-by: Nicolin Chen (cherry picked from commit be26efe816413dfffdaf7963471868e0d4c9f2ac) Signed-off-by: Matthew R. Ochs Signed-off-by: Shameer Kolothum -- 2.43.0 (cherry picked from commit dbb463f189c4211c9fb02348cddaa882f10dd28b https://github.com/shamiali2008/qemu-master/tree/sep302025_nvidia_stable-10.1-vcmdq) Signed-off-by: Matthew R. Ochs From a814fb3dca1fdc052d1300523ca58ef41c08c44a Mon Sep 17 00:00:00 2001 From: Mitchell Augustin Date: Tue, 14 Oct 2025 18:40:55 -0500 Subject: [PATCH 2/2] CANONICAL: [Infrastructure] Add Canonical Build CI Adds a GitHub Action pipeline to automatically build a source package that can be signed and uploaded to an LP builder Signed-off-by: Mitchell Augustin --- .github/workflows/build-source-package.yml | 115 +++++++++++++++++++++ debian/build-source-package-from-git.sh | 31 ++++++ 2 files changed, 146 insertions(+) create mode 100644 .github/workflows/build-source-package.yml create mode 100755 debian/build-source-package-from-git.sh diff --git a/.github/workflows/build-source-package.yml b/.github/workflows/build-source-package.yml new file mode 100644 index 00000000000..0b22e94691e --- /dev/null +++ b/.github/workflows/build-source-package.yml @@ -0,0 +1,115 @@ +# Builds a Debian source package for QEMU + +name: Build Debian Source Package + +on: + push: + branches: + - 'nvidia/latest' + - 'mochs/latest' + + # Allow manual triggering of the workflow from the GitHub UI + workflow_dispatch: + +jobs: + build-source-package: + # arm64 is the primary platform of interest for this project + runs-on: ubuntu-24.04 + + steps: + # Step 1: Check out the repository's code + - name: Checkout repository + uses: actions/checkout@v4 + with: + # Fetch all history for all tags and branches, which can be necessary + # for tools like git-buildpackage to determine version numbers. + fetch-depth: 0 + + # Step 2: Install Debian packaging tools and build dependencies + - name: Install Build Dependencies + run: | + sudo apt-get update + + sudo DEBIAN_FRONTEND=noninteractive apt-get install -y devscripts equivs fakeroot git-buildpackage + + # Use mk-build-deps to parse debian/control, create a dummy package + # with all build dependencies, and install it. This ensures all + # required build dependencies are present. + # The --no-install-recommends flag keeps the environment minimal. + sudo mk-build-deps -i --tool="apt-get -y --no-install-recommends" + # Remove debs that this generates from the working directory after install + rm -f qemu-build-deps* + + # Step 3: Generate Upstream Tarball + - name: Generate Upstream Tarball + run: | + # Extract source name and upstream version from debian/changelog. + # The first sed command strips any epoch (e.g., "1:") from the start of the version. + # The second sed command strips the Debian revision from the end of the version string. + # dpkg-parsechangelog is in the dpkg-dev package, a dependency of devscripts. + export SOURCE_NAME=$(dpkg-parsechangelog -S Source) + export UPSTREAM_VERSION=$(dpkg-parsechangelog -S Version | sed 's/^[0-9]\+://' | sed 's/-[^-]*$//') + + git config --global user.email "robot@builder.local" + git config --global user.name "Builder Robot" + # Create the .orig.tar.gz in the parent directory. + ./debian/build-source-package-from-git.sh + + # Step 4: Upload Workspace for Debugging + - name: Upload Workspace for Debugging + uses: actions/upload-artifact@v4 + with: + name: pre-build-workspace + path: . + + # Step 5: Build the Debian source package + - name: Build Source Package + run: | + # Use debuild to create the source package. + # -S: Build a source package only (no binaries). + # -us: Do not sign the source package. + # -uc: Do not sign the .changes file. + # This command will find and use the .orig.tar.gz we just created. + current_dir=$(pwd) + cd deb + # There should only be one thing in here, which is the tarball we'll extract + # so wildcard should be OK in this instance. + ls + tar -xvf $(ls -d * | head -n 1) + ls + cd $(ls -d */ | head -n 1) + debuild -S -us -uc + cd "$current_dir" + + # Step 6: Log MD5 Checksums + - name: Log MD5 Checksums as Annotations + run: | + # Change to the parent directory where artifacts were created. + current_dir=$(pwd) + cd deb + mkdir source_package_artifacts + + # Iterate over all the generated build artifacts. + for file in *.dsc *.orig.tar.* *.debian.tar.* *.changes *source.build *source.buildinfo; do + # Check if files matching the pattern exist before processing. + if [ -f "$file" ]; then + # Calculate the MD5 sum and format it for the annotation. + # The output of md5sum is "CHECKSUM FILENAME". + checksum=$(md5sum "$file") + + # Echo the checksum as a workflow notice annotation. + # This will make it easily visible in the GitHub Actions UI. + echo "::notice title=MD5 Checksum::$checksum" + mv "$file" source_package_artifacts + fi + done + mv source_package_artifacts "$current_dir" + + # Step 7: Upload the generated source package files as artifacts + - name: Upload Debian Source Package Artifacts + uses: actions/upload-artifact@v4 + with: + # Name of the artifact bundle to be displayed in the GitHub UI + name: debian-source-package + + path: source_package_artifacts diff --git a/debian/build-source-package-from-git.sh b/debian/build-source-package-from-git.sh new file mode 100755 index 00000000000..ab16d10db4a --- /dev/null +++ b/debian/build-source-package-from-git.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# +# Produce a deb source package that can be uploaded to a Debian/Ubuntu builder. + +if [[ $(git --no-optional-locks status -uno --porcelain) ]]; then + echo "ERROR: git repository is not clean" + echo "Try running:" + echo " git submodule foreach --recursive 'git reset --hard && git clean -fdx'" + exit 1 +fi + +# Update submodules +git clean -xdf +git submodule update --init --recursive + +# Clean up and include everything in the package +find subprojects/ -type d -name .git -exec rm -rf {} \; +find . -name .gitignore -exec rm -f {} \; + +meson subprojects download + +find subprojects/ -type d -name .git -exec rm -rf {} \; +find . -name .gitignore -exec rm -f {} \; + +# Import submodules in git +git add . +git commit -s -a -m "[DROP THIS] Include submodules for packaging" + +# Produce an orig tarball +mkdir -p deb +git archive --prefix=qemu-10.1.0/ -o deb/qemu_10.1.0+nvidia1.orig.tar.gz HEAD