qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] qemu: Fix inject-nmi


From: Jan Kiszka
Subject: Re: [Qemu-devel] [PATCH] qemu: Fix inject-nmi
Date: Thu, 22 Sep 2011 16:51:59 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

On 2011-09-22 11:50, Lai Jiangshan wrote:
> 
> From: KAMEZAWA Hiroyuki <address@hidden>
> Subject: [PATCH] Fix inject-nmi
> 
> Now, inject-nmi sends NMI to all cpus...but this doesn't emulate
> pc hardware 'NMI button', which triggers LINT1.
> 
> So, now, LINT1 mask is ignored by inject-nmi and NMIs are sent to
> all cpus without checking LINT1 mask.
> 
> Because Linux masks LINT1 of cpus other than 0, this makes trouble.
> For example, kdump cannot run sometimes.
> ---
>  hw/apic.c |    7 +++++++
>  hw/apic.h |    1 +
>  monitor.c |    4 ++--
>  3 files changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/apic.c b/hw/apic.c
> index 69d6ac5..020305b 100644
> --- a/hw/apic.c
> +++ b/hw/apic.c
> @@ -205,6 +205,13 @@ void apic_deliver_pic_intr(DeviceState *d, int level)
>      }
>  }
>  
> +void apic_deliver_lint1_intr(DeviceState *d)
> +{
> +    APICState *s = DO_UPCAST(APICState, busdev.qdev, d);
> +
> +   apic_local_deliver(s, APIC_LVT_LINT1);

This will cause a qemu crash when apic_state is NULL (non-SMP 486
systems). Moreover: wrong indention.

You know that this won't work for qemu-kvm with in-kernel irqchip? You
may want to provide a patch for that tree, emulating the unavailable
LINT1 injection via testing the APIC configration and then raising an
NMI as before if it is accepted.

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux



reply via email to

[Prev in Thread] Current Thread [Next in Thread]