OSDN Git Service

KVM: PPC: Book3S HV: Check for updated HDSISR on P9 HDSI exception
authorMichael Neuling <mikey@neuling.org>
Fri, 15 Sep 2017 05:26:14 +0000 (15:26 +1000)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 22 Sep 2017 08:45:46 +0000 (10:45 +0200)
commite001fa78d44d0b5c7b1498d1e4a038740efa3b1e
tree2e9f3888f00ccfeb4ad997bdafbadd7ad1810dfe
parent44889942b6eb356eab27ce25fe10701adfec7776
KVM: PPC: Book3S HV: Check for updated HDSISR on P9 HDSI exception

On POWER9 DD2.1 and below, sometimes on a Hypervisor Data Storage
Interrupt (HDSI) the HDSISR is not be updated at all.

To work around this we put a canary value into the HDSISR before
returning to a guest and then check for this canary when we take a
HDSI. If we find the canary on a HDSI, we know the hardware didn't
update the HDSISR. In this case we return to the guest to retake the
HDSI which should correctly update the HDSISR the second time HDSI
entry.

After talking to Paulus we've applied this workaround to all POWER9
CPUs. The workaround of returning to the guest shouldn't ever be
triggered on well behaving CPU. The extra instructions should have
negligible performance impact.

Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/powerpc/kvm/book3s_hv_rmhandlers.S