Received: from eggs.gnu.org ([2001:4830:134:3::10]:57556) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cWjmB-00045e-WB for qemu-devel@nongnu.org; Thu, 26 Jan 2017 08:07:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cWjm9-0008Ts-4W for qemu-devel@nongnu.org; Thu, 26 Jan 2017 08:07:43 -0500 Received: from mail.ispras.ru ([83.149.199.45]:46022) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cWjm8-0008Ti-Sh for qemu-devel@nongnu.org; Thu, 26 Jan 2017 08:07:41 -0500 From: "Pavel Dovgalyuk" References: <20170126123411.5412.44769.stgit@PASHA-ISP> <20170126123429.5412.94368.stgit@PASHA-ISP> <000c01d277d4$9d56f6e0$d804e4a0$@ru> In-Reply-To: Date: Thu, 26 Jan 2017 16:07:44 +0300 Message-ID: <000d01d277d5$2f285f00$8d791d00$@ru> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Language: ru Subject: Re: [Qemu-devel] [PATCH v8 3/9] apic: save apic_delivered flag List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: 'Paolo Bonzini' , 'Pavel Dovgalyuk' , qemu-devel@nongnu.org Cc: kwolf@redhat.com, peter.maydell@linaro.org, quintela@redhat.com, jasowang@redhat.com, mst@redhat.com, kraxel@redhat.com > From: Paolo Bonzini [mailto:paolo.bonzini@gmail.com] On Behalf Of Paolo Bonzini > On 26/01/2017 14:03, Pavel Dovgalyuk wrote: > >> From: Paolo Bonzini [mailto:pbonzini@redhat.com] > >> On 26/01/2017 13:34, Pavel Dovgalyuk wrote: > >>> This patch implements saving/restoring of static apic_delivered variable. > >>> > >>> v8: saving static variable only for one of the APICs > >>> > >>> Signed-off-by: Pavel Dovgalyuk > >>> --- > >>> hw/intc/apic_common.c | 37 +++++++++++++++++++++++++++++++++++++ > >>> include/hw/i386/apic_internal.h | 2 ++ > >>> 2 files changed, 39 insertions(+) > >>> > >>> diff --git a/hw/intc/apic_common.c b/hw/intc/apic_common.c > >>> index d78c885..edacb16 100644 > >>> --- a/hw/intc/apic_common.c > >>> +++ b/hw/intc/apic_common.c > >>> @@ -384,6 +384,29 @@ static bool apic_common_sipi_needed(void *opaque) > >>> return s->wait_for_sipi != 0; > >>> } > >>> > >>> +static bool apic_irq_delivered_needed(void *opaque) > >>> +{ > >>> + static APICCommonState *first_apic; > >>> + APICCommonState *s = APIC_COMMON(opaque); > >>> + if (!first_apic) { > >>> + first_apic = s; > >>> + } > >>> + return s == first_apic; > >> > >> Should also check " && apic_irq_delivered != 0". > > > > Reset of this variable when machine reboots is also forgotten. > > Ok, I'll queue this patch with the condition changed, can you send one > for reset? Ok, I'll send it with the next version of the series. Pavel Dovgalyuk