WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

RE: [Xen-devel] [PATCH]Add option hpetbroadcast to force enablinghpet_br

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: RE: [Xen-devel] [PATCH]Add option hpetbroadcast to force enablinghpet_broadcast
From: "Wei, Gang" <gang.wei@xxxxxxxxx>
Date: Wed, 16 Jul 2008 16:34:32 +0800
Cc: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Delivery-date: Wed, 16 Jul 2008 01:34:58 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <094BCE01AFBE9646AF220B0B3F367AAB03499961@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <094BCE01AFBE9646AF220B0B3F367AAB03499961@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcjnCCBRUlUUaMJLQ42ltFGtCQAcYgAFnfjg
Thread-topic: [Xen-devel] [PATCH]Add option hpetbroadcast to force enablinghpet_broadcast
Resend as attachment.

Jimmy

On Wednesday, July 16, 2008 1:52 PM, Wei, Gang wrote:
> Add option hpetbroadcast to force enabling hpet_broadcast.
> 
> This option can be used for test & experiment purpose.
> 
> Signed-off-by: Wei Gang <gang.wei@xxxxxxxxx>
> 
> diff -r e7d4c937c92e xen/arch/x86/time.c
> --- a/xen/arch/x86/time.c     Wed Jul 16 11:04:41 2008 +0800
> +++ b/xen/arch/x86/time.c     Wed Jul 16 11:33:56 2008 +0800
> @@ -1035,21 +1035,36 @@ void __init early_time_init(void)
>      setup_irq(0, &irq0);
>  }
> 
> +/* force_hpet_broadcast: if true, force using hpet_broadcast to fix
> lapic stop
> +   issue for deep C state with pit disabled */
> +static int force_hpet_broadcast;
> +boolean_param("hpetbroadcast", force_hpet_broadcast);
> +
>  /* keep pit enabled for pit_broadcast working while cpuidle enabled
*/
>  static int disable_pit_irq(void)
>  {
> -    if ( !using_pit && cpu_has_apic && !xen_cpuidle )
> +    if ( !using_pit && cpu_has_apic && (!xen_cpuidle ||
> force_hpet_broadcast) )
>      {
> -        /* Disable PIT CH0 timer interrupt. */
> -        outb_p(0x30, PIT_MODE);
> -        outb_p(0, PIT_CH0);
> -        outb_p(0, PIT_CH0);
> -
>          /*
>           * If we do not rely on PIT CH0 then we can use HPET for
> one-shot
>           * timer emulation when entering deep C states.
>           */
> -        /*hpet_broadcast_init(); XXX dom0 may rely on RTC interrupt
> delivery */
> +        /* XXX dom0 may rely on RTC interrupt delivery, so only
enable
> +           hpet_broadcast if force_hpet_broadcast */
> +        if ( xen_cpuidle && force_hpet_broadcast )
> +        {
> +            hpet_broadcast_init();
> +            if ( !hpet_broadcast_is_available() )
> +            {
> +                printk("HPET broadcast init failed, fall back to PIT
> broadcast.\n");
> +                return 0;
> +            }
> +        }
> +
> +        /* Disable PIT CH0 timer interrupt. */
> +        outb_p(0x30, PIT_MODE);
> +        outb_p(0, PIT_CH0);
> +        outb_p(0, PIT_CH0);
>      }
> 
>      return 0;
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel

Attachment: hpet-broadcast-force-using-option.patch
Description: hpet-broadcast-force-using-option.patch

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>