From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeremy Fitzhardinge Subject: Re: [PATCH] Append 'nohpet' in dom0 cmdline to prevent dom0 from using HPET Date: Thu, 15 Oct 2009 19:31:45 -0700 Message-ID: <4AD7DB11.2070207@goop.org> References: <8FED46E8A9CA574792FC7AACAC38FE7714FCC2ED95@PDSMSX501.ccr.corp.intel.com> <4AD62D4A.7030301@goop.org> <8FED46E8A9CA574792FC7AACAC38FE7714FCC2EFBF@PDSMSX501.ccr.corp.intel.com> <4AD75A7B.7000404@goop.org> <8FED46E8A9CA574792FC7AACAC38FE7714FCC2F471@PDSMSX501.ccr.corp.intel.com> <8FED46E8A9CA574792FC7AACAC38FE7714FCC2F556@PDSMSX501.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <8FED46E8A9CA574792FC7AACAC38FE7714FCC2F556@PDSMSX501.ccr.corp.intel.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "Wei, Gang" Cc: Xen-devel , Keir Fraser List-Id: xen-devel@lists.xenproject.org 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