public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@qumranet.com>
To: Alex Williamson <alex.williamson@hp.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>, kvm-devel <kvm@vger.kernel.org>
Subject: Re: Re: [kvm-devel] [PATCH 2/5] SCI fixes (v2)
Date: Wed, 28 May 2008 16:06:08 +0300	[thread overview]
Message-ID: <483D58C0.7060209@qumranet.com> (raw)
In-Reply-To: <1211978270.14859.40.camel@bling>

Alex Williamson wrote:
> Yeah, it kinda seems like there is.  With this change, the timer expires
> and we go through this path:
>
> pm_tmr_timer()
> 	-> pm_update_sci()
> 		-> get_pmsts()
> 		-> qemu_set_irq() [but not for a TMFOF_EN]
> 		-> qemu_mod_timer()
> 		bump tmr_overlfow_time
>
> We bumped tmr_overflow_time in pm_update_sci after setting the timer to
> expire on the old value.  Unless something goes horribly wrong with
> timers, we'll always get the timer event before overflow time and
> get_pmsts never adds in the TMROF_EN bit to the status flag.  We
> therefore never toggle the SCI interrupt because of a timer overflow,
> and we never report a timer overflow status to the guest.
>
> The author of this patch is correct that the timer in the original code
> only goes off a couple times before we del_timer().  However, I think
> the way it's supposed to work is that we set the timer overflow status,
> toggle the SCI, then wait for the OSPM to come in through
> pm_ioport_writew() to clear the timer overflow status, at which point we
> call pm_update_sci() mod_timer and start it all over again.  At least
> that's the way I see it working after removing this change.
>
> It doesn't make much sense to bump tmr_overflow_time so that we never
> hit it, unless I'm completely misunderstanding the code.  Thanks,
>   

You're right; a quick run with that patch reverted (and not) showed it 
clearly.

I guess it was merged before we had sci working properly; otherwise I 
can't explain how it worked then.

I reverted that patch.

-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


  reply	other threads:[~2008-05-28 13:06 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-04 15:11 [PATCH 0/5] Support for the Kernel Virtual Machine interface (v3) Anthony Liguori
     [not found] ` <1202137865-20232-1-git-send-email-aliguori-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2008-02-04 15:11   ` [PATCH 1/5] Use correct types to enable > 2G support (v3) Anthony Liguori
     [not found]     ` <1202137865-20232-2-git-send-email-aliguori-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2008-02-04 15:29       ` Izik Eidus
     [not found]         ` <1202138985.18306.7.camel-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2008-02-04 15:33           ` Anthony Liguori
     [not found]             ` <47A73040.3030501-rdkfGonbjUSkNkDKm+mE6A@public.gmane.org>
2008-02-04 15:43               ` Izik Eidus
2008-02-04 15:31       ` Anthony Liguori
2008-04-08 21:50     ` [Qemu-devel] " Aurelien Jarno
2008-04-09 19:52       ` [Qemu-devel] [PATCH 1/5] Use correct types toenable " Sebastian Herbszt
2008-02-04 15:11   ` [PATCH 2/5] SCI fixes (v2) Anthony Liguori
2008-05-27  3:05     ` [kvm-devel] " Alex Williamson
2008-05-27 18:28       ` Anthony Liguori
2008-05-28  6:27         ` Avi Kivity
2008-05-28 12:37           ` Alex Williamson
2008-05-28 13:06             ` Avi Kivity [this message]
2008-05-28 21:50               ` Alex Williamson
2008-02-04 15:11   ` [PATCH 3/5] Fix daemonize options (v2) Anthony Liguori
2008-02-04 15:11   ` [PATCH 4/5] Tell BIOS about the number of CPUs (v2) Anthony Liguori
2008-02-04 15:11   ` [PATCH 5/5] QEMU support for the Kernel Virtual Machine interface (v3) Anthony Liguori

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=483D58C0.7060209@qumranet.com \
    --to=avi@qumranet.com \
    --cc=alex.williamson@hp.com \
    --cc=aliguori@us.ibm.com \
    --cc=kvm@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox