KVM: PPC: Book3S HV P9: Add kvmppc_stop_thread to match kvmppc_start_thread

Small cleanup makes it a bit easier to match up entry and exit
operations.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: Fabiano Rosas <farosas@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20211123095231.1036501-22-npiggin@gmail.com
This commit is contained in:
Nicholas Piggin 2021-11-23 19:51:59 +10:00 коммит произвёл Michael Ellerman
Родитель 2251fbe763
Коммит cf99dedb4b
1 изменённых файлов: 9 добавлений и 2 удалений

Просмотреть файл

@ -3070,6 +3070,13 @@ static void kvmppc_start_thread(struct kvm_vcpu *vcpu, struct kvmppc_vcore *vc)
kvmppc_ipi_thread(cpu);
}
/* Old path does this in asm */
static void kvmppc_stop_thread(struct kvm_vcpu *vcpu)
{
vcpu->cpu = -1;
vcpu->arch.thread_cpu = -1;
}
static void kvmppc_wait_for_nap(int n_threads)
{
int cpu = smp_processor_id();
@ -4310,8 +4317,6 @@ static int kvmhv_p9_guest_entry(struct kvm_vcpu *vcpu, u64 time_limit,
dec = (s32) dec;
tb = mftb();
vcpu->arch.dec_expires = dec + tb;
vcpu->cpu = -1;
vcpu->arch.thread_cpu = -1;
store_spr_state(vcpu);
@ -4808,6 +4813,8 @@ int kvmhv_run_single_vcpu(struct kvm_vcpu *vcpu, u64 time_limit,
}
vtime_account_guest_exit();
kvmppc_stop_thread(vcpu);
powerpc_local_irq_pmu_restore(flags);
cpumask_clear_cpu(pcpu, &kvm->arch.cpu_in_guest);