]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: PPC: Book3S PR: Fix svcpu copying with preemption enabled
authorAlexander Graf <agraf@suse.de>
Wed, 31 Jan 2018 21:24:58 +0000 (22:24 +0100)
committerPaul Mackerras <paulus@ozlabs.org>
Thu, 1 Feb 2018 02:35:33 +0000 (13:35 +1100)
commit4ec4c881150650d4a6b64a042f560cbcd2f1fe8f
tree42e29efe5409097e294b425a1e62cadb0b05b19a
parent68b2ac7e7ba89cfbbe39fd422cdfeb89acddf983
KVM: PPC: Book3S PR: Fix svcpu copying with preemption enabled

When copying between the vcpu and svcpu, we may get scheduled away onto
a different host CPU which in turn means our svcpu pointer may change.

That means we need to atomically copy to and from the svcpu with preemption
disabled, so that all code around it always sees a coherent state.

Reported-by: Simon Guo <wei.guo.simon@gmail.com>
Fixes: 7eea21f3fc35 ("KVM: PPC: Book3S: PR: Enable interrupts earlier")
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
arch/powerpc/include/asm/kvm_book3s.h
arch/powerpc/kvm/book3s_interrupts.S
arch/powerpc/kvm/book3s_pr.c