]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: PPC: Add giveup_ext() hook to PPC KVM ops
authorSimon Guo <wei.guo.simon@gmail.com>
Mon, 21 May 2018 05:24:22 +0000 (13:24 +0800)
committerPaul Mackerras <paulus@ozlabs.org>
Tue, 22 May 2018 09:51:13 +0000 (19:51 +1000)
commitc78ef9f58f8978614e7947321f6c4f3f074cc4f9
tree6a232907545e27d9b7fb61839a95a75b74f29c26
parent1365380d747ef862fc854e7c14eef0b36923dac0
KVM: PPC: Add giveup_ext() hook to PPC KVM ops

Currently HV will save math regs(FP/VEC/VSX) when trap into host. But
PR KVM will only save math regs when qemu task switch out of CPU, or
when returning from qemu code.

To emulate FP/VEC/VSX mmio load, PR KVM need to make sure that math
regs were flushed firstly and then be able to update saved VCPU
FPR/VEC/VSX area reasonably.

This patch adds giveup_ext() field to KVM ops. Only PR KVM has non-NULL
giveup_ext() ops. kvmppc_complete_mmio_load() can invoke that hook
(when not NULL) to flush math regs accordingly, before updating saved
register vals.

Math regs flush is also necessary for STORE, which will be covered
in later patch within this patch series.

Signed-off-by: Simon Guo <wei.guo.simon@gmail.com>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
arch/powerpc/include/asm/kvm_ppc.h
arch/powerpc/kvm/book3s_pr.c
arch/powerpc/kvm/powerpc.c