qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

tests: disassemble-aml.sh: generate AML in readable format

On systems where the IASL tool exists, we can convert
extected ACPI tables to ASL format, which is useful
for debugging and documentation purposes.
This script does this for all ACPI tables under tests/data/acpi/.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

+53
+52
tests/data/acpi/disassemle-aml.sh
··· 1 + #!/usr/bin/bash 2 + 3 + outdir= 4 + while getopts "o:" arg; do 5 + case ${arg} in 6 + o ) 7 + outdir=$OPTARG 8 + ;; 9 + \? ) 10 + echo "Usage: ./tests/data/acpi/disassemle-aml.sh [-o <output-directory>]" 11 + exit 1 12 + ;; 13 + 14 + esac 15 + done 16 + 17 + for machine in tests/data/acpi/* 18 + do 19 + if [[ ! -d "$machine" ]]; 20 + then 21 + continue 22 + fi 23 + 24 + if [[ "${outdir}" ]]; 25 + then 26 + mkdir -p "${outdir}"/${machine} || exit $? 27 + fi 28 + for aml in $machine/* 29 + do 30 + if [[ "$aml" == $machine/*.dsl ]]; 31 + then 32 + continue 33 + fi 34 + if [[ "$aml" == $machine/SSDT*.* ]]; 35 + then 36 + dsdt=${aml/SSDT*./DSDT.} 37 + extra="-e ${dsdt}" 38 + elif [[ "$aml" == $machine/SSDT* ]]; 39 + then 40 + dsdt=${aml/SSDT*/DSDT}; 41 + extra="-e ${dsdt}" 42 + else 43 + extra="" 44 + fi 45 + asl=${aml}.dsl 46 + if [[ "${outdir}" ]]; 47 + then 48 + asl="${outdir}"/${machine}/${asl} 49 + fi 50 + iasl -d -p ${asl} ${extra} ${aml} 51 + done 52 + done
+1
tests/data/acpi/rebuild-expected-aml.sh
··· 36 36 echo '/* List of comma-separated changed AML files to ignore */' > ${SRC_PATH}/tests/qtest/bios-tables-test-allowed-diff.h 37 37 38 38 echo "The files were rebuilt and can be added to git." 39 + echo "You can use ${SRC_PATH}/tests/data/acpi/disassemle-aml.sh to disassemble them to ASL." 39 40 40 41 if [ -z "$old_allowed_dif" ]; then 41 42 echo "Note! Please do not commit expected files with source changes"