On Mon, Apr 29, 2019 at 06:57:45PM +1000, Paul Mackerras wrote: > From: Suraj Jitindar Singh <sjitindarsingh@xxxxxxxxx> > > 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@xxxxxxxxxx - wrote patch description] > > Signed-off-by: Paul Mackerras <paulus@xxxxxxxxxx> Patch applied to my kvm-ppc-next tree. Paul.