mirror of
https://github.com/torvalds/linux.git
synced 2026-05-26 16:12:59 +02:00
LoongArch: KVM: Move LBT capability check in exception handler
Like FPU exception handler, check LBT capability in the LBT exception handler rather than function kvm_own_lbt(). Signed-off-by: Bibo Mao <maobibo@loongson.cn> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
This commit is contained in:
parent
37da26e0e8
commit
b1388a9598
|
|
@ -820,8 +820,10 @@ static int kvm_handle_lasx_disabled(struct kvm_vcpu *vcpu, int ecode)
|
|||
|
||||
static int kvm_handle_lbt_disabled(struct kvm_vcpu *vcpu, int ecode)
|
||||
{
|
||||
if (kvm_own_lbt(vcpu))
|
||||
if (!kvm_guest_has_lbt(&vcpu->arch))
|
||||
kvm_queue_exception(vcpu, EXCCODE_INE, 0);
|
||||
else
|
||||
kvm_own_lbt(vcpu);
|
||||
|
||||
return RESUME_GUEST;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1304,9 +1304,6 @@ int kvm_arch_vcpu_ioctl_set_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)
|
|||
#ifdef CONFIG_CPU_HAS_LBT
|
||||
int kvm_own_lbt(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
if (!kvm_guest_has_lbt(&vcpu->arch))
|
||||
return -EINVAL;
|
||||
|
||||
preempt_disable();
|
||||
if (!(vcpu->arch.aux_inuse & KVM_LARCH_LBT)) {
|
||||
set_csr_euen(CSR_EUEN_LBTEN);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user