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: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Subject: RE: [Xen-devel] [PATCH] Append 'nohpet' in dom0 cmdline to prevent dom0 from using HPET
From: "Wei, Gang" <gang.wei@xxxxxxxxx>
Date: Fri, 16 Oct 2009 10:51:45 +0800
Accept-language: en-US
Acceptlanguage: en-US
Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Delivery-date: Thu, 15 Oct 2009 19:53:59 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4AD7DB11.2070207@xxxxxxxx>
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> <4AD7DB11.2070207@xxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcpOCNHzp26f7826TiWxxwGv+FjfQgAAI1Hw
Thread-topic: [Xen-devel] [PATCH] Append 'nohpet' in dom0 cmdline to prevent dom0 from using HPET
Resend.

Disable HPET in Xen pv dom0

Xen is using HPET to wakeup cpu from deep c-states, so the HPET usage in dom0
must be fobidden. In 2.6.18-xen, the HPET was by default disabled in config
file. For upstream kernel built for pv dom0, it is not practical to disable dom0
HPET usage in that way because the same image may be also using as bare metal 
kernerl. So do it in Xen specific setup code.

Signed-off-by: Wei Gang <gang.wei@xxxxxxxxx>

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..c73381b 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -34,6 +34,12 @@ 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);
+#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 = {
@@ -282,6 +288,12 @@ void __init xen_arch_setup(void)
        }
 #endif
 
+       /* 
+        * Xen hypervisor uses HPET to wakeup cpu from deep c-states,
+        * so the HPET usage in dom0 must be forbidden.
+        */
+       disable_hpet(NULL);
+
        memcpy(boot_command_line, xen_start_info->cmd_line,
               MAX_GUEST_CMDLINE > COMMAND_LINE_SIZE ?
               COMMAND_LINE_SIZE : MAX_GUEST_CMDLINE);

Attachment: pv-dom0-nohpet-v3.patch
Description: pv-dom0-nohpet-v3.patch

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