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] Append 'nohpet' in dom0 cmdline to prevent dom0

To: "Wei, Gang" <gang.wei@xxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] Append 'nohpet' in dom0 cmdline to prevent dom0 from using HPET
From: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Date: Thu, 15 Oct 2009 19:31:45 -0700
Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Delivery-date: Thu, 15 Oct 2009 19:32:06 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <8FED46E8A9CA574792FC7AACAC38FE7714FCC2F556@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: <8FED46E8A9CA574792FC7AACAC38FE7714FCC2ED95@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <4AD62D4A.7030301@xxxxxxxx> <8FED46E8A9CA574792FC7AACAC38FE7714FCC2EFBF@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <4AD75A7B.7000404@xxxxxxxx> <8FED46E8A9CA574792FC7AACAC38FE7714FCC2F471@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <8FED46E8A9CA574792FC7AACAC38FE7714FCC2F556@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.4pre) Gecko/20090922 Fedora/3.0-2.7.b4.fc11 Lightning/1.0pre Thunderbird/3.0b4
On 10/15/09 19:19, Wei, Gang wrote:
> Wei, Gang wrote:
>   
>> Jeremy Fitzhardinge wrote:
>>     
>>> Well, making disable_hpet() non-static and calling it from Xen setup
>>> is the same as appending nohpet to the command line, but less hacky.
>>>       
>> Yes, you are right. I mixed disable_hpet() with hpet_disable(). I
>> just try to avoid changes in normal kernel code. If such slight
>> change is acceptable, please just make it this way.  
>>     
> Here is the new patch.
>
> diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
> index 9b32c88..366e1e5 100644
> --- a/arch/x86/kernel/hpet.c
> +++ b/arch/x86/kernel/hpet.c
> @@ -96,7 +96,7 @@ static int __init hpet_setup(char *str)
>  }
>  __setup("hpet=", hpet_setup);
>  
> -static int __init disable_hpet(char *str)
> +int __init disable_hpet(char *str)
>  {
>       boot_hpet_disable = 1;
>       return 1;
> diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
> index 5eeeedb..3774578 100644
> --- a/arch/x86/xen/setup.c
> +++ b/arch/x86/xen/setup.c
> @@ -34,6 +34,10 @@ extern void xen_sysenter_target(void);
>  extern void xen_syscall_target(void);
>  extern void xen_syscall32_target(void);
>  
> +#ifdef CONFIG_HPET_TIMER
> +extern int __init disable_hpet(char *str);
> +#endif
>   
It would be better to add

#else
static inline int disable_hpet(char *str) { return 0; }
#endif


> +
>  static unsigned long __init xen_release_chunk(phys_addr_t start_addr, 
> phys_addr_t end_addr)
>  {
>       struct xen_memory_reservation reservation = {
> @@ -280,6 +284,10 @@ void __init xen_arch_setup(void)
>               printk(KERN_INFO "ACPI in unprivileged domain disabled\n");
>               disable_acpi();
>       }
> +#endif 
> +
> +#ifdef CONFIG_HPET_TIMER
> +     disable_hpet(NULL);
>  #endif
>   
and do without the #ifdef here.  Also, it wouldn't hurt to put a small
explanatory message here.

    J

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel