All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86 linux: prevent halted VCPUs from eating up CPU bandwidth
@ 2006-05-29 14:35 Jan Beulich
  2006-05-29 14:59 ` Keir Fraser
  0 siblings, 1 reply; 6+ messages in thread
From: Jan Beulich @ 2006-05-29 14:35 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 130 bytes --]

Since there was no reply to an earlier inquiry regarding this, here's a patch.

Signed-off-by: Jan Beulich <jbeulich@novell.com>


[-- Attachment #2: xenlinux-x86-better-halt.patch --]
[-- Type: text/plain, Size: 1832 bytes --]

Index: head-2006-05-26/include/asm-i386/bugs.h
===================================================================
--- head-2006-05-26.orig/include/asm-i386/bugs.h	2006-03-20 06:53:29.000000000 +0100
+++ head-2006-05-26/include/asm-i386/bugs.h	2006-05-26 13:55:43.000000000 +0200
@@ -92,6 +92,7 @@ static void __init check_fpu(void)
 
 static void __init check_hlt(void)
 {
+#ifndef CONFIG_XEN
 	printk(KERN_INFO "Checking 'hlt' instruction... ");
 	if (!boot_cpu_data.hlt_works_ok) {
 		printk("disabled\n");
@@ -102,6 +103,7 @@ static void __init check_hlt(void)
 	halt();
 	halt();
 	printk("OK.\n");
+#endif
 }
 
 /*
Index: head-2006-05-26/include/asm-i386/mach-xen/asm/system.h
===================================================================
--- head-2006-05-26.orig/include/asm-i386/mach-xen/asm/system.h	2006-04-24 11:43:43.000000000 +0200
+++ head-2006-05-26/include/asm-i386/mach-xen/asm/system.h	2006-05-26 12:26:22.000000000 +0200
@@ -625,8 +625,8 @@ do {									\
 		preempt_enable_no_resched();				\
 } while (0)
 
-#define safe_halt()		((void)0)
-#define halt()			((void)0)
+#define safe_halt()		({ __sti(); halt(); })
+#define halt()			((void)HYPERVISOR_block())
 
 #define __save_and_cli(x)						\
 do {									\
Index: head-2006-05-26/include/asm-x86_64/mach-xen/asm/system.h
===================================================================
--- head-2006-05-26.orig/include/asm-x86_64/mach-xen/asm/system.h	2006-04-24 11:43:43.000000000 +0200
+++ head-2006-05-26/include/asm-x86_64/mach-xen/asm/system.h	2006-05-26 12:26:08.000000000 +0200
@@ -424,8 +424,8 @@ do {									\
 	preempt_enable_no_resched();					\
 	___x; })
 
-#define safe_halt()		((void)0)
-#define halt()			((void)0)
+#define safe_halt()		({ __sti(); halt(); })
+#define halt()			((void)HYPERVISOR_block())
 
 void cpu_idle_wait(void);
 

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-05-30  9:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-29 14:35 [PATCH] x86 linux: prevent halted VCPUs from eating up CPU bandwidth Jan Beulich
2006-05-29 14:59 ` Keir Fraser
2006-05-30  8:11   ` Jan Beulich
2006-05-30  8:49     ` Keir Fraser
2006-05-30  9:21       ` Jan Beulich
2006-05-30  9:30         ` Keir Fraser

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.