All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] KVM: LoongArch: selftests: Add FPU test case
@ 2026-06-16  2:26 Bibo Mao
  2026-06-16  2:26 ` [PATCH v3 1/2] KVM: LoongArch: selftests: Enable LASX feature by auto detect method Bibo Mao
  2026-06-16  2:26 ` [PATCH v3 2/2] KVM: LoongArch: selftests: Add FPU test case Bibo Mao
  0 siblings, 2 replies; 5+ messages in thread
From: Bibo Mao @ 2026-06-16  2:26 UTC (permalink / raw)
  To: Huacai Chen; +Cc: kvm, loongarch, linux-kernel, linux-kselftest

Here add FPU test case and verify FPU register get and set APIs, the
FPU width supports 64/128/256 bits. It is important for VM migration.
---
v2 ... v3:
  1. Remove __vm_has_feature() and use __kvm_has_device_attr() directly
     when checking LSX/LASX feature in patch 2.

v1 ... v2:
  1. Replace hardcode value with CSR_EUEN_XXX when enable FPU access.
  2. Add attribute __aligned(64) with kvm_fpureg variable with better FPU
     save and restore.
  3. Add clobber $f0 register with inline assemble language with
     fld.d/vld/xvld instruction.
  4. Add fallthrough between UCALL_DONE and UCALL_SYNC switch case
     sentences.
  5. Remove sync_global_from_guest() between vcpu_fpu_get() ioctl test
     case, since the buffer is not modified with such instructions
     fld.d/vld/xvld.
  6. Modify FPU register with random value rather than plus 0x10, and
     random() is replaced with value 0x10.
---
Bibo Mao (2):
  KVM: LoongArch: selftests: Enable LASX feature by auto detect method
  KVM: LoongArch: selftests: Add FPU test case

 tools/testing/selftests/kvm/Makefile.kvm      |   1 +
 .../kvm/include/loongarch/processor.h         |  18 +++
 .../selftests/kvm/lib/loongarch/processor.c   |  12 +-
 .../selftests/kvm/loongarch/fpu_test.c        | 138 ++++++++++++++++++
 4 files changed, 168 insertions(+), 1 deletion(-)
 create mode 100644 tools/testing/selftests/kvm/loongarch/fpu_test.c


base-commit: 8cd9520d35a6c38db6567e97dd93b1f11f185dc6
-- 
2.39.3


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

end of thread, other threads:[~2026-06-16  2:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-16  2:26 [PATCH v3 0/2] KVM: LoongArch: selftests: Add FPU test case Bibo Mao
2026-06-16  2:26 ` [PATCH v3 1/2] KVM: LoongArch: selftests: Enable LASX feature by auto detect method Bibo Mao
2026-06-16  2:39   ` sashiko-bot
2026-06-16  2:26 ` [PATCH v3 2/2] KVM: LoongArch: selftests: Add FPU test case Bibo Mao
2026-06-16  2:34   ` sashiko-bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.