mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v4 0/3] LoongArch: KVM: Add Binary Translation extension support
@ 2024-06-26  6:32 Bibo Mao
  2024-06-26  6:32 ` [PATCH v4 1/3] LoongArch: KVM: Add HW " Bibo Mao
                   ` (2 more replies)
  0 siblings, 3 replies; 27+ messages in thread
From: Bibo Mao @ 2024-06-26  6:32 UTC (permalink / raw)
  To: Tianrui Zhao, Huacai Chen; +Cc: WANG Xuerui, kvm, loongarch, linux-kernel

Loongson Binary Translation (LBT) is used to accelerate binary
translation, which contains 4 scratch registers (scr0 to scr3), x86/ARM
eflags (eflags) and x87 fpu stack pointer (ftop).

Like FPU extension, here late enabling method is used for LBT. LBT context
is saved/restored on vcpu context switch path.

Also this patch set BT capability detection, and BT register get/set
interface for userspace vmm, so that vm supports migration with BT
extension.

---
v3 ... v4:
  1. Merge LBT feature detection for VM and VCPU into one patch.
  2. Move function declaration such as kvm_lose_lbt()/kvm_check_fcsr()/
kvm_enable_lbt_fpu() from header file to c file, since it is only
used in one c file.

v2 ... v3:
  1. Split KVM_LOONGARCH_VM_FEAT_LBT capability checking into three
sub-features, KVM_LOONGARCH_VM_FEAT_X86BT/KVM_LOONGARCH_VM_FEAT_ARMBT
and KVM_LOONGARCH_VM_FEAT_MIPSBT. Return success only if host supports
the sub-feature.

v1 ... v2:
  1. With LBT register read or write interface to userpace, replace
device attr method with KVM_GET_ONE_REG method, since lbt register is
vcpu register and can be added in kvm_reg_list in future.
  2. Add vm device attr ctrl marcro KVM_LOONGARCH_VM_FEAT_CTRL, it is
used to get supported LBT feature before vm or vcpu is created.
---
Bibo Mao (3):
  LoongArch: KVM: Add HW Binary Translation extension support
  LoongArch: KVM: Add LBT feature detection function
  LoongArch: KVM: Add vm migration support for LBT registers

 arch/loongarch/include/asm/kvm_host.h |   8 ++
 arch/loongarch/include/asm/kvm_vcpu.h |  10 +++
 arch/loongarch/include/uapi/asm/kvm.h |  15 ++++
 arch/loongarch/kvm/exit.c             |   9 ++
 arch/loongarch/kvm/vcpu.c             | 121 +++++++++++++++++++++++++-
 arch/loongarch/kvm/vm.c               |  44 +++++++++-
 6 files changed, 205 insertions(+), 2 deletions(-)


base-commit: 55027e689933ba2e64f3d245fb1ff185b3e7fc81
-- 
2.39.3


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

end of thread, other threads:[~2024-07-09  1:45 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-26  6:32 [PATCH v4 0/3] LoongArch: KVM: Add Binary Translation extension support Bibo Mao
2024-06-26  6:32 ` [PATCH v4 1/3] LoongArch: KVM: Add HW " Bibo Mao
2024-06-26  6:32 ` [PATCH v4 2/3] LoongArch: KVM: Add LBT feature detection function Bibo Mao
2024-06-30  2:07   ` Huacai Chen
2024-07-01  1:27     ` maobibo
2024-07-01 10:26       ` Huacai Chen
2024-07-02  1:51         ` maobibo
2024-07-02  1:59           ` Huacai Chen
2024-07-02  2:25             ` maobibo
2024-07-02  2:34               ` Huacai Chen
2024-07-02  4:12                 ` maobibo
2024-07-02  7:28                   ` Huacai Chen
2024-07-02  8:42                     ` maobibo
2024-07-02 15:43                       ` Huacai Chen
2024-07-03  3:15                         ` maobibo
2024-07-03 15:35                           ` Huacai Chen
2024-07-04  1:24                             ` maobibo
2024-07-08  9:51                               ` Huacai Chen
2024-07-09  1:45                                 ` maobibo
2024-07-04  1:35                             ` maobibo
2024-07-04 19:44                               ` Jiaxun Yang
2024-07-05  1:21                                 ` maobibo
2024-07-05  3:19                                   ` Jiaxun Yang
2024-07-05  3:46                                     ` maobibo
2024-07-05  4:09                                       ` Jiaxun Yang
2024-07-05  5:05                                         ` maobibo
2024-06-26  6:32 ` [PATCH v4 3/3] LoongArch: KVM: Add vm migration support for LBT registers Bibo Mao

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®