| From: |
| Bibo Mao <maobibo-AT-loongson.cn> |
| To: |
| Tianrui Zhao <zhaotianrui-AT-loongson.cn>, Huacai Chen <chenhuacai-AT-kernel.org> |
| Subject: |
| [PATCH v2 0/4] LoongArch: KVM: Add Binary Translation extension support |
| Date: |
| Thu, 23 May 2024 11:10:19 +0800 |
| Message-ID: |
| <20240523031023.709347-1-maobibo@loongson.cn> |
| Cc: |
| WANG Xuerui <kernel-AT-xen0n.name>, kvm-AT-vger.kernel.org, loongarch-AT-lists.linux.dev, linux-kernel-AT-vger.kernel.org |
| Archive-link: |
| Article |
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.
---
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 (4):
LoongArch: KVM: Add HW Binary Translation extension support
LoongArch: KVM: Add LBT feature detection with cpucfg
LoongArch: KVM: Add vm migration support for LBT registers
LoongArch: KVM: Add VM LBT feature detection support
arch/loongarch/include/asm/kvm_host.h | 8 ++
arch/loongarch/include/asm/kvm_vcpu.h | 10 +++
arch/loongarch/include/uapi/asm/kvm.h | 13 +++
arch/loongarch/kvm/exit.c | 9 ++
arch/loongarch/kvm/vcpu.c | 121 +++++++++++++++++++++++++-
arch/loongarch/kvm/vm.c | 34 +++++++-
6 files changed, 193 insertions(+), 2 deletions(-)
base-commit: 29c73fc794c83505066ee6db893b2a83ac5fac63
--
2.39.3