Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752479AbdLLUSt (ORCPT ); Tue, 12 Dec 2017 15:18:49 -0500 Received: from gate.crashing.org ([63.228.1.57]:48003 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752102AbdLLUSs (ORCPT ); Tue, 12 Dec 2017 15:18:48 -0500 Message-ID: <1513109890.2303.42.camel@kernel.crashing.org> Subject: Re: [PATCH] KVM: PPC: Book3S HV: Fix pending_pri value in kvmppc_xive_get_icp() From: Benjamin Herrenschmidt To: Laurent Vivier , kvm-ppc@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Paul Mackerras , Michael Ellerman , =?ISO-8859-1?Q?C=E9dric?= Le Goater Date: Wed, 13 Dec 2017 07:18:10 +1100 In-Reply-To: <20171212172356.2397-1-lvivier@redhat.com> References: <20171212172356.2397-1-lvivier@redhat.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.2 (3.26.2-1.fc27) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 886 Lines: 25 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 Acked-by: Benjamin Herrenschmidt