From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753048AbdLVLYI (ORCPT ); Fri, 22 Dec 2017 06:24:08 -0500 Received: from ozlabs.org ([103.22.144.67]:38247 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751241AbdLVLYG (ORCPT ); Fri, 22 Dec 2017 06:24:06 -0500 X-powerpc-patch-notification: thanks X-powerpc-patch-commit: 7333b5aca412d6ad02667b5a513485838a91b136 In-Reply-To: <20171212172356.2397-1-lvivier@redhat.com> To: Laurent Vivier , kvm-ppc@vger.kernel.org From: Michael Ellerman Cc: linux-kernel@vger.kernel.org, =?utf-8?q?C=C3=A9dric_Le_Goater?= , linuxppc-dev@lists.ozlabs.org Subject: Re: KVM: PPC: Book3S HV: Fix pending_pri value in kvmppc_xive_get_icp() Message-Id: <3z35kD3TMXz9sMN@ozlabs.org> Date: Fri, 22 Dec 2017 22:24:04 +1100 (AEDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > Acked-by: Benjamin Herrenschmidt Applied to powerpc fixes, thanks. https://git.kernel.org/powerpc/c/7333b5aca412d6ad02667b5a513485 cheers