qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: Beth Kon <eak@us.ibm.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/2] Make HPET Legacy Only
Date: Mon, 10 Aug 2009 09:44:46 -0500	[thread overview]
Message-ID: <4A80325E.9020505@codemonkey.ws> (raw)
In-Reply-To: <1249049162-685-1-git-send-email-eak@us.ibm.com>

Beth Kon wrote:
> Because of unavailability of IOAPIC interrupt lines, HPET currently 
> supports only legacy mode, where the legacy timer interrupt (inti2) is
> used. This patch makes this explicit by reducing the number of timers 
> supported by HPET to 2 (the 2 legacy timers) and advertising no
> available IOAPIC interrupt lines.
>
> This patch also adds a check, suggested by Andriy Gapon, to ensure that
> the interrupt chosen by the guest is one of those advertised by the HPET
> as available. This is currently a noop since HPET advertises none as 
> available, but in the event of future expansion and availability of 
> IOAPIC interrupt lines, or implementation of level-triggered interrupts
> that can share interrupt lines, this code will be in place. 
>
> This subset of HPET capability (legacy-only) is reasonable, since the 
> basic operation of linux and windows only uses the HPET in legacy mode, 
> at least that's what all my testing so far has shown. Only userspace
> access to the hpet would use non-legacy timers.
>
>
>
>
> diff --git a/hw/hpet.c b/hw/hpet.c
> index 01b10aa..56fa27c 100644
> --- a/hw/hpet.c
> +++ b/hw/hpet.c
> @@ -47,12 +47,16 @@ uint32_t hpet_in_legacy_mode(void)
>          return 0;
>  }
>  
> -static uint32_t timer_int_route(struct HPETTimer *timer)
> -{
> -    uint32_t route;
> -    route = (timer->config & HPET_TN_INT_ROUTE_MASK) >> HPET_TN_INT_ROUTE_SHIFT;
> -    return route;
> -}
> +/* future code for when non-legacy interrupts are supported
> + * (when spare ioapic interrupts are available)
> + * static uint32_t timer_int_route(struct HPETTimer *timer)
> + * {
> + *    uint32_t route;
> + *    route = (timer->config & HPET_TN_INT_ROUTE_CNF_MASK) 
> + *                              >> HPET_TN_INT_ROUTE_CNF_SHIFT;
> + *    return route;
> + *}
> + */
>   

Please don't introduce dead code.  It will just rot.  A comment would 
suffice.

Regards,

Anthony Liguori

      parent reply	other threads:[~2009-08-10 14:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-31 14:06 [Qemu-devel] [PATCH 1/2] Make HPET Legacy Only Beth Kon
2009-07-31 14:06 ` [Qemu-devel] [PATCH 2/2] Make HPET Legacy Only - BIOS change Beth Kon
2009-08-10 14:44 ` Anthony Liguori [this message]

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=4A80325E.9020505@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=eak@us.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).