When we migrate a VM from a POWER8 host (XICS) to a POWER9 host
(XICS-on-XIVE), we have an error:
qemu-kvm: Unable to restore KVM interrupt controller state \
(0xff000000) for CPU 0: Invalid argument
This is because kvmppc_xics_set_icp() checks the new state
is internaly consistent, and especially:
...
1129 if (xisr == 0) {
1130 if (pending_pri != 0xff)
1131 return -EINVAL;
...
On the other side, kvmppc_xive_get_icp() doesn't set
neither the pending_pri value, nor the xisr value (set to 0)
(and kvmppc_xive_set_icp() ignores the pending_pri value)
As xisr is 0, pending_pri must be set to 0xff.
Signed-off-by: Laurent Vivier <redacted>
---
arch/powerpc/kvm/book3s_xive.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
@@ -725,7 +725,8 @@ u64 kvmppc_xive_get_icp(struct kvm_vcpu *vcpu)/* Return the per-cpu state for state saving/migration */return(u64)xc->cppr<<KVM_REG_PPC_ICP_CPPR_SHIFT|-(u64)xc->mfrr<<KVM_REG_PPC_ICP_MFRR_SHIFT;+(u64)xc->mfrr<<KVM_REG_PPC_ICP_MFRR_SHIFT|+(u64)0xff<<KVM_REG_PPC_ICP_PPRI_SHIFT;}intkvmppc_xive_set_icp(structkvm_vcpu*vcpu,u64icpval)
From: Benjamin Herrenschmidt <benh@kernel.crashing.org> Date: 2017-12-12 20:18:49
On Tue, 2017-12-12 at 18:23 +0100, Laurent Vivier wrote:
When we migrate a VM from a POWER8 host (XICS) to a POWER9 host
(XICS-on-XIVE), we have an error:
qemu-kvm: Unable to restore KVM interrupt controller state \
(0xff000000) for CPU 0: Invalid argument
This is because kvmppc_xics_set_icp() checks the new state
is internaly consistent, and especially:
...
1129 if (xisr == 0) {
1130 if (pending_pri != 0xff)
1131 return -EINVAL;
...
On the other side, kvmppc_xive_get_icp() doesn't set
neither the pending_pri value, nor the xisr value (set to 0)
(and kvmppc_xive_set_icp() ignores the pending_pri value)
As xisr is 0, pending_pri must be set to 0xff.
Signed-off-by: Laurent Vivier <redacted>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
From: Michael Ellerman <hidden> Date: 2017-12-22 11:24:08
On Tue, 2017-12-12 at 17:23:56 UTC, Laurent Vivier wrote:
When we migrate a VM from a POWER8 host (XICS) to a POWER9 host
(XICS-on-XIVE), we have an error:
qemu-kvm: Unable to restore KVM interrupt controller state \
(0xff000000) for CPU 0: Invalid argument
This is because kvmppc_xics_set_icp() checks the new state
is internaly consistent, and especially:
...
1129 if (xisr == 0) {
1130 if (pending_pri != 0xff)
1131 return -EINVAL;
...
On the other side, kvmppc_xive_get_icp() doesn't set
neither the pending_pri value, nor the xisr value (set to 0)
(and kvmppc_xive_set_icp() ignores the pending_pri value)
As xisr is 0, pending_pri must be set to 0xff.
Signed-off-by: Laurent Vivier <redacted>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>