# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 76f4c7ea7602cc6c44e55a312983840aa0f222a8
# Parent f71bb61e0500decbe074239f21cca9be2c6e210e
This patch fixes a bug where raise_softirq(SCHEDULE_SOFTIRQ) is called
upon a hlt instruction from a VMX guest, causing repeated VMExits when
the guest is idle. At the same time, it disables the monitor/mwait
feature as it's not feasible to implement for vcpu.
Signed-off-by: Xiaofeng Ling <xiaofeng.ling@xxxxxxxxx>
Signed-off-by: Asit Mallick <asit.k.mallick@xxxxxxxxx>
Signed-off-by: Jun Nakajima <jun.nakajima@xxxxxxxxx>
diff -r f71bb61e0500 -r 76f4c7ea7602 xen/arch/x86/vmx.c
--- a/xen/arch/x86/vmx.c Wed Sep 21 16:36:46 2005
+++ b/xen/arch/x86/vmx.c Wed Sep 21 16:58:55 2005
@@ -471,6 +471,8 @@
}
#endif
+ /* Unsupportable for virtualised CPUs. */
+ clear_bit(X86_FEATURE_MWAIT & 31, &ecx);
}
regs->eax = (unsigned long) eax;
@@ -1461,7 +1463,7 @@
*/
void vmx_vmexit_do_hlt(void)
{
- raise_softirq(SCHEDULE_SOFTIRQ);
+ do_block();
}
static inline void vmx_vmexit_do_extint(struct cpu_user_regs *regs)
@@ -1509,12 +1511,6 @@
do_IRQ(regs);
break;
}
-}
-
-volatile unsigned long do_mwait_count;
-static inline void vmx_vmexit_do_mwait(void)
-{
- raise_softirq(SCHEDULE_SOFTIRQ);
}
#define BUF_SIZ 256
@@ -1798,9 +1794,7 @@
__update_guest_eip(inst_len);
break;
case EXIT_REASON_MWAIT_INSTRUCTION:
- __get_instruction_length(inst_len);
- __update_guest_eip(inst_len);
- vmx_vmexit_do_mwait();
+ __vmx_bug(®s);
break;
default:
__vmx_bug(®s); /* should not happen */
diff -r f71bb61e0500 -r 76f4c7ea7602 xen/arch/x86/vmx_intercept.c
--- a/xen/arch/x86/vmx_intercept.c Wed Sep 21 16:36:46 2005
+++ b/xen/arch/x86/vmx_intercept.c Wed Sep 21 16:58:55 2005
@@ -28,6 +28,7 @@
#include <xen/sched.h>
#include <asm/current.h>
#include <io_ports.h>
+#include <xen/event.h>
#ifdef CONFIG_VMX
@@ -205,6 +206,7 @@
/* Set the pending intr bit, and send evtchn notification to myself. */
if (test_and_set_bit(vpit->vector, vpit->intr_bitmap))
vpit->pending_intr_nr++; /* already set, then count the pending intr */
+ evtchn_set_pending(vpit->v, iopacket_port(vpit->v->domain));
/* pick up missed timer tick */
if ( missed_ticks > 0 ) {
@@ -281,6 +283,7 @@
}
vpit->intr_bitmap = intr;
+ vpit->v = d;
vpit->scheduled = NOW() + vpit->period;
set_ac_timer(&vpit->pit_timer, vpit->scheduled);
diff -r f71bb61e0500 -r 76f4c7ea7602 xen/include/asm-x86/vmx_virpit.h
--- a/xen/include/asm-x86/vmx_virpit.h Wed Sep 21 16:36:46 2005
+++ b/xen/include/asm-x86/vmx_virpit.h Wed Sep 21 16:58:55 2005
@@ -35,8 +35,8 @@
unsigned int count; /* the 16 bit channel count */
unsigned int init_val; /* the init value for the counter */
-
-} ;
+ struct vcpu *v;
+};
/* to hook the ioreq packet to get the PIT initializaiton info */
extern void vmx_hooks_assist(struct vcpu *d);
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|