On Tue, 2019-02-12 at 00:58:29 UTC, Paul Mackerras wrote: > Commit 24be85a23d1f ("powerpc/powernv: Clear PECE1 in LPCR via stop-api > only on Hotplug", 2017-07-21) added two calls to opal_slw_set_reg() > inside pnv_cpu_offline(), with the aim of changing the LPCR value in > the SLW image to disable wakeups from the decrementer while a CPU is > offline. However, pnv_cpu_offline() gets called each time a secondary > CPU thread is woken up to participate in running a KVM guest, that is, > not just when a CPU is offlined. > > Since opal_slw_set_reg() is a very slow operation (with observed > execution times around 20 milliseconds), this means that an offline > secondary CPU can often be busy doing the opal_slw_set_reg() call > when the primary CPU wants to grab all the secondary threads so that > it can run a KVM guest. This leads to messages like "KVM: couldn't > grab CPU n" being printed and guest execution failing. > > There is no need to reprogram the SLW image on every KVM guest entry > and exit. So that we do it only when a CPU is really transitioning > between online and offline, this moves the calls to > pnv_program_cpu_hotplug_lpcr() into pnv_smp_cpu_kill_self(). > > Fixes: 24be85a23d1f ("powerpc/powernv: Clear PECE1 in LPCR via stop-api only > on Hotplug") > Cc: sta...@vger.kernel.org # v4.14+ > Signed-off-by: Paul Mackerras <pau...@ozlabs.org>
Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/19f8a5b5be2898573a5e1dc1db93e8d4 cheers