]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: PPC: Book3S HV P9: Move setting HDEC after switching to guest LPCR
authorNicholas Piggin <npiggin@gmail.com>
Fri, 28 May 2021 09:07:29 +0000 (19:07 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 10 Jun 2021 12:12:12 +0000 (22:12 +1000)
commit04e8df9636e1609168dfca275f15e6ab3b52f76b
tree6157e508faebd07186bab68cf7e2187c2fb92a02
parentcb1fba340822bb4113c38ee546d478ab938c4432
KVM: PPC: Book3S HV P9: Move setting HDEC after switching to guest LPCR

LPCR[HDICE]=0 suppresses hypervisor decrementer exceptions on some
processors, so it must be enabled before HDEC is set.

Rather than set it in the host LPCR then setting HDEC, move the HDEC
update to after the guest MMU context (including LPCR) is loaded.
There shouldn't be much concern with delaying HDEC by some 10s or 100s
of nanoseconds by setting it a bit later.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: Fabiano Rosas <farosas@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210528090752.3542186-10-npiggin@gmail.com
arch/powerpc/kvm/book3s_hv.c