diff options
author | Suraj Jitindar Singh <sjitindarsingh@gmail.com> | 2019-04-29 18:57:45 +1000 |
---|---|---|
committer | Paul Mackerras <paulus@ozlabs.org> | 2019-04-30 19:31:52 +1000 |
commit | 7ae9bda7edf3dac56c9abaeec264ac08d399a1ff (patch) | |
tree | ae044dcf73a1a34461fb13d5fee7f3c9edf25381 /arch/powerpc/kvm/book3s_hv_builtin.c | |
parent | 1f80ba3d201e55ec204f93af372d09412ab42d76 (diff) | |
download | linux-7ae9bda7edf3dac56c9abaeec264ac08d399a1ff.tar.gz |
KVM: PPC: Book3S HV: Handle virtual mode in XIVE VCPU push code
The code in book3s_hv_rmhandlers.S that pushes the XIVE virtual CPU
context to the hardware currently assumes it is being called in real
mode, which is usually true. There is however a path by which it can
be executed in virtual mode, in the case where indep_threads_mode = N.
A virtual CPU executing on an offline secondary thread can take a
hypervisor interrupt in virtual mode and return from the
kvmppc_hv_entry() call after the kvm_secondary_got_guest label.
It is possible for it to be given another vcpu to execute before it
gets to execute the stop instruction. In that case it will call
kvmppc_hv_entry() for the second VCPU in virtual mode, and the XIVE
vCPU push code will be executed in virtual mode. The result in that
case will be a host crash due to an unexpected data storage interrupt
caused by executing the stdcix instruction in virtual mode.
This fixes it by adding a code path for virtual mode, which uses the
virtual TIMA pointer and normal load/store instructions.
[paulus@ozlabs.org - wrote patch description]
Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Diffstat (limited to 'arch/powerpc/kvm/book3s_hv_builtin.c')
0 files changed, 0 insertions, 0 deletions