summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTao Cui <cuitao@kylinos.cn>2026-08-10 12:21:50 +0800
committerHuacai Chen <chenhuacai@loongson.cn>2026-08-10 12:21:50 +0800
commita5518ad7ef7dc1837258d37ba0a11dcb5d7ecaba (patch)
treedd93d95e32fd498cb1e90b6438611855f5040728
parentdb2ddb87143519e20a95aa36c60b36107b736a58 (diff)
downloadlinux-stable-a5518ad7ef7dc1837258d37ba0a11dcb5d7ecaba.tar.gz
linux-stable-a5518ad7ef7dc1837258d37ba0a11dcb5d7ecaba.zip
LoongArch: KVM: Advertise already-supported capabilities
Several LoongArch KVM features are fully implemented but were never reported through their standard KVM_CHECK_EXTENSION probes, so userspace cannot discover them. Advertise the ones that already work so as to have a real consumer: - KVM_CAP_VCPU_ATTRIBUTES: per-vCPU device-attribute ioctls are implemented (CPUCFG, PVTIME control); advertise the discovery cap. - KVM_CAP_STEAL_TIME: steal time works end-to-end (host-side record plus guest-side paravirt), the probe returns kvm_pvtime_supported(). This doesn't add new functionalities; it only makes existing features discoverable via the standard probe. Reviewed-by: Bibo Mao <maobibo@loongson.cn> Signed-off-by: Tao Cui <cuitao@kylinos.cn> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
-rw-r--r--arch/loongarch/kvm/vm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/loongarch/kvm/vm.c b/arch/loongarch/kvm/vm.c
index 1317c718f896..0a51931d6f6e 100644
--- a/arch/loongarch/kvm/vm.c
+++ b/arch/loongarch/kvm/vm.c
@@ -122,6 +122,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
case KVM_CAP_IOEVENTFD:
case KVM_CAP_MP_STATE:
case KVM_CAP_SET_GUEST_DEBUG:
+ case KVM_CAP_VCPU_ATTRIBUTES:
r = 1;
break;
case KVM_CAP_NR_VCPUS:
@@ -136,6 +137,9 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
case KVM_CAP_NR_MEMSLOTS:
r = KVM_USER_MEM_SLOTS;
break;
+ case KVM_CAP_STEAL_TIME:
+ r = kvm_pvtime_supported();
+ break;
default:
r = 0;
break;