KVM: LoongArch: selftests: MAINTAINERS coverage and a VM leak
v2 cover KVM: LoongArch: selftests: MAINTAINERS coverage and a VM leak
Two small fixes to the LoongArch KVM selftests. Patch 2 frees the VM on the PMU test's skip path. Patch 1 came out of routing it:
get_maintainer.pl did not name the LoongArch KVM maintainers for tools/testing/selftests/kvm/loongarch/, because the MAINTAINERS entry does not cover that directory, so this series would otherwise have gone to Paolo, Sean and Shuah only.
Based on loongarch-kvm in linux-loongson.git.
Patch 2's hunk sits next to the one in "KVM: selftests: Convert comma to semicolon" [1], which is not applied yet. They do not overlap and apply in either order.
Compile-tested only. Patch 2 builds: tools/testing/selftests/kvm/loongarch/ pmu_test links for loongarch64 with a GCC 15.2.1 cross compiler, using glibc from Debian's loong64 port as the sysroot. The binary was not run. Patch 2 changes the PMU-not-enabled skip path, which only runs on a LoongArch host whose VM config leaves the PMU off.
Changes in v2:
- 1/2: also drop the lib/loongarch/ line, which */loongarch/ already covers, so the entry matches the other arches (Zenghui Yu)
- 2/2: unchanged
v1: https://lore.kernel.org/all/[email protected]/
[1] https://lore.kernel.org/all/[email protected]/
Gokul K (2):
MAINTAINERS: Add the LoongArch KVM selftests directory
KVM: LoongArch: selftests: Free the VM when the PMU test skips
MAINTAINERS | 2 +- tools/testing/selftests/kvm/loongarch/pmu_test.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-)
Signature · 1 line
2.54.0
PATCH v2 1/2 MAINTAINERS: Add the LoongArch KVM selftests directory
The KVM/LoongArch entry covers tools/testing/selftests/kvm/*/loongarch/ and lib/loongarch/, but not tools/testing/selftests/kvm/loongarch/, where the tests themselves live. The */loongarch/ pattern needs a directory between kvm/ and loongarch/, so it does not match it.
As a result get_maintainer.pl omits the LoongArch KVM maintainers and [email protected] for patches to those tests.
Add the directory, and drop lib/loongarch/, which */loongarch/ already covers. The entry then lists the same two forms as arm64, riscv, s390 and x86.
--- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
MAINTAINERS +1 -1
@@ -14326,7 +14326,7 @@ F: arch/loongarch/include/asm/kvm* F: arch/loongarch/include/uapi/asm/kvm* F: arch/loongarch/kvm/ F: tools/testing/selftests/kvm/*/loongarch/ -F: tools/testing/selftests/kvm/lib/loongarch/ +F: tools/testing/selftests/kvm/loongarch/ KERNEL VIRTUAL MACHINE FOR MIPS (KVM/mips) M: Huacai Chen <[email protected]>
Signature · 1 line
2.54.0
PATCH v2 2/2 KVM: LoongArch: selftests: Free the VM when the PMU test skips
In reply to Gokul Kmain() creates the VM before asking whether it has the PMU feature, and when it does not, returns KSFT_SKIP directly. That skips the done: label through which every other exit frees the VM. Set ret and jump there instead.
--- tools/testing/selftests/kvm/loongarch/pmu_test.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tools/testing/selftests/kvm/loongarch/pmu_test.c +2 -1
@@ -176,7 +176,8 @@ int main(int argc, char *argv[])pr_info ("PMU is enabled in VM\n" ); }else {print_skip ("PMU not enabled by VM config\n" ); -return KSFT_SKIP ; + ret =KSFT_SKIP ; + goto done; }while (1 ) {
Signature · 1 line
2.54.0