All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@web.de>
To: Sam King <kingst@gmail.com>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: PATCH: debugging apic
Date: Wed, 29 Sep 2010 08:44:39 +0200	[thread overview]
Message-ID: <4CA2E057.80204@web.de> (raw)
In-Reply-To: <4CA248C5.2020409@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1507 bytes --]

Am 28.09.2010 21:57, Sam King wrote:
>  Thanks to Bernhard Kauer for pointing out the problem.  Apparently if
> software disables LVT_LINT0 when there is a pending CPU_HARD_INTERRUPT
> you can get into trouble.  I attached a patch that fixes the problem by
> resetting the interrupt_request.  I am not sure if we need to do the
> same for LINT1, but this fixed the incorrect GPF I was getting.
> 

...
[ please inline patches ]

> *** hw/apic.c	2010-07-22 07:39:04.000000000 -0500
> --- ../qemu-0.12.5-fixed/hw/apic.c	2010-09-28 14:45:55.476945540 -0500
> ***************
> *** 841,846 ****
> --- 841,851 ----
>               s->lvt[n] = val;
>               if (n == APIC_LVT_TIMER)
>                   apic_timer_update(s, qemu_get_clock(vm_clock));
> + 
> +             if(n == APIC_LVT_LINT0) {
> +                 if((val & APIC_LVT_MASKED) && (env->interrupt_request & CPU_INTERRUPT_HARD))
> +                     cpu_reset_interrupt(env, CPU_INTERRUPT_HARD);
> +             }
>           }
>           break;
>       case 0x38:

This actually points out open issues, but more work is required:

You need to consider other potentially pending interrupts as well, thus
you must not blindly reset here. And the same is true for invocations of
apic_deliver_pic_intr(..., 0). The APIC has to save the PIC line state
and forward it according to its current LVT mask state, which includes
raising the interrupt if the mask is removed while the PIC line is high.

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 259 bytes --]

  reply	other threads:[~2010-09-29  6:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-28 15:15 [Qemu-devel] debugging apic Sam King
2010-09-28 19:57 ` [Qemu-devel] PATCH: " Sam King
2010-09-29  6:44   ` Jan Kiszka [this message]
2010-09-29 16:47     ` [Qemu-devel] " Sam King
2010-09-29  0:53 ` [Qemu-devel] " TeLeMan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4CA2E057.80204@web.de \
    --to=jan.kiszka@web.de \
    --cc=kingst@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.