mirror of
https://github.com/torvalds/linux.git
synced 2026-09-24 06:24:02 +02:00
LoongArch: KVM: Set vcpu->cpu before IN_GUEST_MODE is set
In function kvm_make_vcpu_request(), it will send IPI to physical CPU
when vCPU is in IN_GUEST_MODE mode. And physical CPU is set in function
kvm_check_vpid(), thus it should be called before IN_GUEST_MODE is set.
Otherwise IPI will send to wrong old physical CPU where vCPU is running.
Cc: stable@vger.kernel.org
Fixes: 2fc3bd86db ("LoongArch: KVM: Implement basic vcpu interfaces")
Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
This commit is contained in:
parent
fd4021529f
commit
32d05564a6
|
|
@ -300,10 +300,10 @@ static int kvm_pre_enter_guest(struct kvm_vcpu *vcpu)
|
|||
*/
|
||||
local_irq_disable();
|
||||
kvm_deliver_exception(vcpu);
|
||||
kvm_check_vpid(vcpu);
|
||||
/* Make sure the vcpu mode has been written */
|
||||
smp_store_mb(vcpu->mode, IN_GUEST_MODE);
|
||||
kvm_deliver_intr(vcpu);
|
||||
kvm_check_vpid(vcpu);
|
||||
|
||||
/*
|
||||
* Called after function kvm_check_vpid()
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user