KVM: PPC: Book3S PR: Fix svcpu copying with preemption enabled

commit 07ae5389e9 upstream.

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: 3d3319b45e ("KVM: PPC: Book3S: PR: Enable interrupts earlier")
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
This commit is contained in:
Alexander Graf 2018-01-31 22:24:58 +01:00 • committed by Ben Hutchings
commit a6681bea45
3 changed files with 12 additions and 18 deletions