]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: selftests: Add aarch64 get-reg-list test
authorAndrew Jones <drjones@redhat.com>
Thu, 29 Oct 2020 20:17:01 +0000 (21:17 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Sun, 8 Nov 2020 11:02:45 +0000 (06:02 -0500)
commit3839f6da276035b022d2f42bd0c8ffead0c30e38
treeb80e59954045c52d8d39d3a6becc385c38fae3f9
parent63f9b52f2a9ac82f8a87b1630def72d646c8d178
KVM: selftests: Add aarch64 get-reg-list test

Check for KVM_GET_REG_LIST regressions. The blessed list was
created by running on v4.15 with the --core-reg-fixup option.
The following script was also used in order to annotate system
registers with their names when possible. When new system
registers are added the names can just be added manually using
the same grep.

while read reg; do
if [[ ! $reg =~ ARM64_SYS_REG ]]; then
printf "\t$reg\n"
continue
fi
encoding=$(echo "$reg" | sed "s/ARM64_SYS_REG(//;s/),//")
if ! name=$(grep "$encoding" ../../../../arch/arm64/include/asm/sysreg.h); then
printf "\t$reg\n"
continue
fi
name=$(echo "$name" | sed "s/.*SYS_//;s/[\t ]*sys_reg($encoding)$//")
printf "\t$reg\t/* $name */\n"
done < <(aarch64/get-reg-list --core-reg-fixup --list)

Signed-off-by: Andrew Jones <drjones@redhat.com>
Message-Id: <20201029201703.102716-3-drjones@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/.gitignore
tools/testing/selftests/kvm/Makefile
tools/testing/selftests/kvm/aarch64/get-reg-list.c [new file with mode: 0644]
tools/testing/selftests/kvm/include/kvm_util.h
tools/testing/selftests/kvm/lib/kvm_util.c