From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43304) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKjOL-0006EA-N6 for qemu-devel@nongnu.org; Tue, 04 Mar 2014 02:03:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WKjOF-0001mV-He for qemu-devel@nongnu.org; Tue, 04 Mar 2014 02:03:53 -0500 Received: from mail-pd0-f180.google.com ([209.85.192.180]:38694) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKjOF-0001jA-BP for qemu-devel@nongnu.org; Tue, 04 Mar 2014 02:03:47 -0500 Received: by mail-pd0-f180.google.com with SMTP id v10so2696190pde.25 for ; Mon, 03 Mar 2014 23:03:45 -0800 (PST) Message-ID: <53157AC7.7070303@ozlabs.ru> Date: Tue, 04 Mar 2014 18:03:35 +1100 From: Alexey Kardashevskiy MIME-Version: 1.0 References: <1392253715-5416-1-git-send-email-aik@ozlabs.ru> In-Reply-To: <1392253715-5416-1-git-send-email-aik@ozlabs.ru> Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] xics-kvm: fix reset function List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paul Mackerras , qemu-ppc@nongnu.org, Alexander Graf On 02/13/2014 12:08 PM, Alexey Kardashevskiy wrote: > Currently interrupt priorities are set to 0 (highest) at the very > beginning of the guest execution which is not correct and makes the guest > produce random interrupt error messages such as: > "Interrupt 0x1001 (real) is invalid, disabling it". > This also prevents interrupt states from correct migration. > > This initializes priority to 0xFF as the emulated XICS does. Ping? Pretty simple patch suggested by Paul Mackerras. > Signed-off-by: Alexey Kardashevskiy > --- > hw/intc/xics_kvm.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c > index c203646..eaf94d9 100644 > --- a/hw/intc/xics_kvm.c > +++ b/hw/intc/xics_kvm.c > @@ -269,6 +269,15 @@ static void ics_kvm_set_irq(void *opaque, int srcno, int val) > > static void ics_kvm_reset(DeviceState *dev) > { > + ICSState *ics = ICS(dev); > + int i; > + > + memset(ics->irqs, 0, sizeof(ICSIRQState) * ics->nr_irqs); > + for (i = 0; i < ics->nr_irqs; i++) { > + ics->irqs[i].priority = 0xff; > + ics->irqs[i].saved_priority = 0xff; > + } > + > ics_set_kvm_state(ICS(dev), 1); > } > > -- Alexey