mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] KVM: LoongArch: selftests: MAINTAINERS coverage and a VM leak
@ 2026-11-23 10:06 Gokul K
  2026-11-23 10:07 ` [PATCH 1/2] MAINTAINERS: Add the LoongArch KVM selftests directory Gokul K
  2026-11-23 10:07 ` [PATCH 2/2] KVM: LoongArch: selftests: Free the VM when the PMU test skips Gokul K
  0 siblings, 2 replies; 3+ messages in thread
From: Gokul K @ 2026-11-23 10:06 UTC (permalink / raw)
  To: Tianrui Zhao, Bibo Mao, Huacai Chen, Paolo Bonzini, Shuah Khan,
	kvm, loongarch, linux-kselftest
  Cc: Sean Christopherson, Song Gao, linux-kernel

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.

[1] https://lore.kernel.org/all/20260428053204.1018608-1-nichen@iscas.ac.cn/

Gokul K (2):
  MAINTAINERS: Add the LoongArch KVM selftests directory
  KVM: LoongArch: selftests: Free the VM when the PMU test skips

 MAINTAINERS                                      | 1 +
 tools/testing/selftests/kvm/loongarch/pmu_test.c | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

-- 
2.54.0



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] MAINTAINERS: Add the LoongArch KVM selftests directory
  2026-11-23 10:06 [PATCH 0/2] KVM: LoongArch: selftests: MAINTAINERS coverage and a VM leak Gokul K
@ 2026-11-23 10:07 ` Gokul K
  2026-11-23 10:07 ` [PATCH 2/2] KVM: LoongArch: selftests: Free the VM when the PMU test skips Gokul K
  1 sibling, 0 replies; 3+ messages in thread
From: Gokul K @ 2026-11-23 10:07 UTC (permalink / raw)
  To: Tianrui Zhao, Bibo Mao, Huacai Chen, Paolo Bonzini, Shuah Khan,
	kvm, loongarch, linux-kselftest
  Cc: Sean Christopherson, Song Gao, linux-kernel

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
loongarch@lists.linux.dev for patches to those tests. arm64, riscv, s390
and x86 each list both forms.

Signed-off-by: Gokul K <gokul02k@gmail.com>
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index f53047aa8d3c..fed2245b979f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -14327,6 +14327,7 @@ 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 <chenhuacai@kernel.org>
-- 
2.54.0



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 2/2] KVM: LoongArch: selftests: Free the VM when the PMU test skips
  2026-11-23 10:06 [PATCH 0/2] KVM: LoongArch: selftests: MAINTAINERS coverage and a VM leak Gokul K
  2026-11-23 10:07 ` [PATCH 1/2] MAINTAINERS: Add the LoongArch KVM selftests directory Gokul K
@ 2026-11-23 10:07 ` Gokul K
  1 sibling, 0 replies; 3+ messages in thread
From: Gokul K @ 2026-11-23 10:07 UTC (permalink / raw)
  To: Tianrui Zhao, Bibo Mao, Huacai Chen, Paolo Bonzini, Shuah Khan,
	kvm, loongarch, linux-kselftest
  Cc: Sean Christopherson, Song Gao, linux-kernel

main() 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.

Fixes: 11c840192768 ("KVM: LoongArch: selftests: Add basic PMU event counting test")
Signed-off-by: Gokul K <gokul02k@gmail.com>
---
 tools/testing/selftests/kvm/loongarch/pmu_test.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/kvm/loongarch/pmu_test.c b/tools/testing/selftests/kvm/loongarch/pmu_test.c
index ec3fefb9ea97..c9dd3cf5de06 100644
--- a/tools/testing/selftests/kvm/loongarch/pmu_test.c
+++ b/tools/testing/selftests/kvm/loongarch/pmu_test.c
@@ -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) {
-- 
2.54.0



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-23 10:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-23 10:06 [PATCH 0/2] KVM: LoongArch: selftests: MAINTAINERS coverage and a VM leak Gokul K
2026-11-23 10:07 ` [PATCH 1/2] MAINTAINERS: Add the LoongArch KVM selftests directory Gokul K
2026-11-23 10:07 ` [PATCH 2/2] KVM: LoongArch: selftests: Free the VM when the PMU test skips Gokul K

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®