Re: [PATCH v2 27/29] LoongArch: KVM: Implement vcpu world switch

From: Tianrui Zhao
Date: Tue Feb 21 2023 - 07:58:30 EST




在 2023年02月21日 16:18, Paolo Bonzini 写道:
On 2/20/23 07:57, Tianrui Zhao wrote:
+ or a0, s0, zero
+ or a1, s1, zero
+ ld.d t8, a2, KVM_ARCH_HANDLE_EXIT
+ jirl ra,t8, 0
+ ori t0, zero, CSR_CRMD_IE
+ csrxchg zero, t0, LOONGARCH_CSR_CRMD

_kvm_handle_exit returns with the interrupts disabled.

Can you please add a comment to explain why CRMD.IE needs to be cleared here, or remove these two instructions if unnecessary?

Paolo

Thanks, the interrupts have already been disabled when _kvm_handle_exit returns, and I will remove the two instructions.

Thanks
Tianrui Zhao


+ or a2, s1, zero
+ addi.d a2, a2, KVM_VCPU_ARCH
+
+ andi t0, a0, RESUME_HOST
+ bnez t0, ret_to_host