mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-05 16:37:50 +00:00
KVM: PPC: Book3S HV P9: Clear vcpu cpu fields before enabling host irqs
On guest entry, vcpu->cpu and vcpu->arch.thread_cpu are set after disabling host irqs. On guest exit there is a window whre tick time accounting briefly enables irqs before these fields are cleared. Move them up to ensure they are cleared before host irqs are run. This is possibly not a problem, but is more symmetric and makes the fields less surprising. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20220908132545.4085849-1-npiggin@gmail.com
This commit is contained in:
parent
0a5bfb824a
commit
bc91c04bff
1 changed files with 3 additions and 3 deletions
|
@ -4629,6 +4629,9 @@ int kvmhv_run_single_vcpu(struct kvm_vcpu *vcpu, u64 time_limit,
|
|||
|
||||
set_irq_happened(trap);
|
||||
|
||||
vcpu->cpu = -1;
|
||||
vcpu->arch.thread_cpu = -1;
|
||||
|
||||
context_tracking_guest_exit();
|
||||
if (!vtime_accounting_enabled_this_cpu()) {
|
||||
local_irq_enable();
|
||||
|
@ -4644,9 +4647,6 @@ int kvmhv_run_single_vcpu(struct kvm_vcpu *vcpu, u64 time_limit,
|
|||
}
|
||||
vtime_account_guest_exit();
|
||||
|
||||
vcpu->cpu = -1;
|
||||
vcpu->arch.thread_cpu = -1;
|
||||
|
||||
powerpc_local_irq_pmu_restore(flags);
|
||||
|
||||
preempt_enable();
|
||||
|
|
Loading…
Reference in a new issue