Hello community,
here is the log from the commit of package xen
checked in at Sat Nov 4 09:29:16 CET 2006.
--------
--- arch/i386/xen/xen.changes 2006-10-30 23:36:11.000000000 +0100
+++ /mounts/work_src_done/STABLE/xen/xen.changes 2006-11-01 19:16:12.000000000 +0100
@@ -1,0 +2,12 @@
+Tue Nov 01 11:16:05 MST 2006 - kallan@novell.com
+
+- Backport xen-unstable changesets 12040 to address spurious
+ interrupts with PV drivers in HVM guests.
+
+-------------------------------------------------------------------
+Tue Oct 31 13:56:04 MST 2006 - ccoffing@novell.com
+
+- Backport xen-unstable changesets 1184[1-3] to address SVM
+ interrupt injection issues. Replaces earlier (broken) patches.
+
+-------------------------------------------------------------------
Old:
----
svm_inj_fix_001.patch
svm_inj_fix_002.patch
New:
----
xu-11841-svm-interrupt-delivery.diff
xu-11842-svm-interrupt-delivery.diff
xu-11843-svm-no-double-nmi.diff
xu-12040-pv-spurious-interrupt.diff
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ xen.spec ++++++
--- /var/tmp/diff_new_pack.fF4GBo/_old 2006-11-04 09:28:47.000000000 +0100
+++ /var/tmp/diff_new_pack.fF4GBo/_new 2006-11-04 09:28:47.000000000 +0100
@@ -19,7 +19,7 @@
%define with_pvfb 0
%define xen_build_dir xen-3.0.3-testing
Version: 3.0.3_11774
-Release: 1
+Release: 4
License: GNU General Public License (GPL) - all versions
Group: System/Kernel
Autoreqprov: on
@@ -70,8 +70,10 @@
## Upstream (or upstream soon):
Patch100: xen-pvfb-2.patch
Patch101: xen-pvfb-3.patch
-Patch102: svm_inj_fix_001.patch
-Patch103: svm_inj_fix_002.patch
+Patch102: xu-11841-svm-interrupt-delivery.diff
+Patch103: xu-11842-svm-interrupt-delivery.diff
+Patch104: xu-11843-svm-no-double-nmi.diff
+Patch105: xu-12040-pv-spurious-interrupt.diff
## Debugging:
Patch200: xen-enable-hvm-debug.diff
## Future / need to be re-ported:
@@ -404,6 +406,8 @@
%endif
%patch102 -p1
%patch103 -p1
+%patch104 -p1
+%patch105 -p1
# Now our patches...
%patch1 -p1
%patch2 -p1
@@ -732,6 +736,12 @@
%{insserv_cleanup}
%changelog -n xen
+* Wed Nov 01 2006 - kallan@novell.com
+- Backport xen-unstable changesets 12040 to address spurious
+ interrupts with PV drivers in HVM guests.
+* Tue Oct 31 2006 - ccoffing@novell.com
+- Backport xen-unstable changesets 1184[1-3] to address SVM
+ interrupt injection issues. Replaces earlier (broken) patches.
* Mon Oct 30 2006 - ccoffing@novell.com
- /var/lib/xen/images should not be world readable. (#214638)
- Update to xen-3.0.3-0 (changeset 11774; no code changes).
++++++ init.xend ++++++
--- arch/i386/xen/init.xend 2006-10-30 23:12:25.000000000 +0100
+++ /mounts/work_src_done/STABLE/xen/init.xend 2006-10-31 00:45:58.000000000 +0100
@@ -85,7 +85,7 @@
# - netbk and blkbk when the dom0 hotplug events occur
# (in xen-network-common.sh and block-common.sh)
# but for now it's safest to have them loaded when xend starts in dom0.
- modprobe blktap 2>/dev/null || true
+ modprobe blkbktap 2>/dev/null || true
modprobe blkbk 2>/dev/null || true
modprobe netloop 2>/dev/null || true
modprobe netbk 2>/dev/null || true
++++++ xu-11841-svm-interrupt-delivery.diff ++++++
# HG changeset patch
# User kfraser@localhost.localdomain
# Date Fri Oct 20 10:09:55 2006 +0100
# Node ID 2fbf11ad58f37313350e71f98f2eadb8ac37a8e4
# parent: 02506a7443155611d6bbf03e49fbf193e96d24db
[HVM][SVM] Fix 1/2 to interrupt delivery logic.
This patch uses the VINTR intercept to signal the hypervisor when a
guest can take an interrupt. When guest's interrupts are masked by
EFLAGS.IF or the guests are in an interrupt shadow, we create a 'fake'
virtual interrupt to inject while also enabling the VINTR intercept.
When the guest _can_ take interrupts, the hypervisor will #VMEXIT
on VINTR. The VINTR exit handler then clears the VINTR intercept bit
and clears the V_IRQ bit so that svm_intr_assist() can inject a
legitimate interrupt.
Signed-off-by: Travis Betak
Signed-off-by: Wei Huang
Signed-off-by: Tom Woller
Index: xen-3.0.3-testing/xen/arch/x86/hvm/svm/intr.c
===================================================================
--- xen-3.0.3-testing.orig/xen/arch/x86/hvm/svm/intr.c
+++ xen-3.0.3-testing/xen/arch/x86/hvm/svm/intr.c
@@ -43,7 +43,7 @@
* to be suitable for SVM.
*/
-static inline int svm_inject_extint(struct vcpu *v, int trap, int error_code)
+static inline int svm_inject_extint(struct vcpu *v, int trap)
{
struct vmcb_struct *vmcb = v->arch.hvm_svm.vmcb;
vintr_t intr;
@@ -87,6 +87,16 @@ asmlinkage void svm_intr_assist(void)
re_injecting = 1;
}
+ /*
+ * create a 'fake' virtual interrupt on to intercept as soon
+ * as the guest _can_ take interrupts
+ */
+ if (irq_masked(vmcb->rflags) || vmcb->interrupt_shadow) {
+ vmcb->general1_intercepts |= GENERAL1_INTERCEPT_VINTR;
+ svm_inject_extint(v, 0x0); /* actual vector doesn't really matter */
+ return;
+ }
+
/* Guest's interrputs masked? */
rflags = vmcb->rflags;
if (irq_masked(rflags)) {
@@ -146,7 +156,7 @@ asmlinkage void svm_intr_assist(void)
}
/* let's inject this interrupt */
TRACE_3D(TRC_VMX_INT, v->domain->domain_id, intr_vector, 0);
- svm_inject_extint(v, intr_vector, VMX_DELIVER_NO_ERROR_CODE);
+ svm_inject_extint(v, intr_vector);
hvm_interrupt_post(v, intr_vector, intr_type);
break;
case APIC_DM_SMI:
Index: xen-3.0.3-testing/xen/arch/x86/hvm/svm/svm.c
===================================================================
--- xen-3.0.3-testing.orig/xen/arch/x86/hvm/svm/svm.c
+++ xen-3.0.3-testing/xen/arch/x86/hvm/svm/svm.c
@@ -2802,6 +2802,11 @@ asmlinkage void svm_vmexit_handler(struc
svm_inject_exception(v, TRAP_double_fault, 1, 0);
break;
+ case VMEXIT_VINTR:
+ vmcb->vintr.fields.irq = 0;
+ vmcb->general1_intercepts &= ~GENERAL1_INTERCEPT_VINTR;
+ break;
+
case VMEXIT_INTR:
break;
++++++ xu-11842-svm-interrupt-delivery.diff ++++++
# HG changeset patch
# User kfraser@localhost.localdomain
# Date Fri Oct 20 10:10:36 2006 +0100
# Node ID c436ab500c9988f3a295f66b690ad7a98c16b54f
# parent: 2fbf11ad58f37313350e71f98f2eadb8ac37a8e4
[HVM][SVM] Fix 2/2 to nterrupt delivery logic.
Add flag to indicate that an exception event needs injecting, and to
delay the ext interrupt injection.
Remove unnecessary check of RFLAGS.IF for ExtInt injection.
Signed-off-by: Travis Betak
Signed-off-by: Wei Huang
Signed-off-by: Tom Woller
Index: xen-3.0.3-testing/xen/arch/x86/hvm/svm/intr.c
===================================================================
--- xen-3.0.3-testing.orig/xen/arch/x86/hvm/svm/intr.c
+++ xen-3.0.3-testing/xen/arch/x86/hvm/svm/intr.c
@@ -62,7 +62,7 @@ static inline int svm_inject_extint(stru
// printf( "IRQ = %d\n", trap );
return 0;
}
-
+
asmlinkage void svm_intr_assist(void)
{
struct vcpu *v = current;
@@ -74,7 +74,6 @@ asmlinkage void svm_intr_assist(void)
int intr_type = APIC_DM_EXTINT;
int intr_vector = -1;
int re_injecting = 0;
- unsigned long rflags;
ASSERT(vmcb);
@@ -82,12 +81,19 @@ asmlinkage void svm_intr_assist(void)
/* Previous Interrupt delivery caused this Intercept? */
if (vmcb->exitintinfo.fields.v && (vmcb->exitintinfo.fields.type == 0)) {
v->arch.hvm_svm.saved_irq_vector = vmcb->exitintinfo.fields.vector;
-// printk("Injecting PF#: saving IRQ from ExitInfo\n");
vmcb->exitintinfo.bytes = 0;
re_injecting = 1;
}
/*
+ * If event requires injecting then do not inject int.
+ */
+ if (unlikely(v->arch.hvm_svm.inject_event)) {
+ v->arch.hvm_svm.inject_event = 0;
+ return;
+ }
+
+ /*
* create a 'fake' virtual interrupt on to intercept as soon
* as the guest _can_ take interrupts
*/
@@ -97,14 +103,6 @@ asmlinkage void svm_intr_assist(void)
return;
}
- /* Guest's interrputs masked? */
- rflags = vmcb->rflags;
- if (irq_masked(rflags)) {
- HVM_DBG_LOG(DBG_LEVEL_1, "Guest IRQs masked: rflags: %lx", rflags);
- /* bail out, we won't be injecting an interrupt this time */
- return;
- }
-
/* Previous interrupt still pending? */
if (vmcb->vintr.fields.irq) {
// printk("Re-injecting IRQ from Vintr\n");
@@ -157,7 +155,6 @@ asmlinkage void svm_intr_assist(void)
/* let's inject this interrupt */
TRACE_3D(TRC_VMX_INT, v->domain->domain_id, intr_vector, 0);
svm_inject_extint(v, intr_vector);
- hvm_interrupt_post(v, intr_vector, intr_type);
break;
case APIC_DM_SMI:
case APIC_DM_NMI:
@@ -168,6 +165,7 @@ asmlinkage void svm_intr_assist(void)
BUG();
break;
}
+ hvm_interrupt_post(v, intr_vector, intr_type);
}
}
Index: xen-3.0.3-testing/xen/arch/x86/hvm/svm/svm.c
===================================================================
--- xen-3.0.3-testing.orig/xen/arch/x86/hvm/svm/svm.c
+++ xen-3.0.3-testing/xen/arch/x86/hvm/svm/svm.c
@@ -196,6 +196,7 @@ static inline void svm_inject_exception(
ASSERT(vmcb->eventinj.fields.v == 0);
vmcb->eventinj = event;
+ v->arch.hvm_svm.inject_event=1;
}
static void stop_svm(void)
@@ -2589,7 +2590,7 @@ asmlinkage void svm_vmexit_handler(struc
save_svm_cpu_user_regs(v, regs);
vmcb->tlb_control = 1;
-
+ v->arch.hvm_svm.inject_event = 0;
if (exit_reason == VMEXIT_INVALID)
{
Index: xen-3.0.3-testing/xen/include/asm-x86/hvm/svm/vmcb.h
===================================================================
--- xen-3.0.3-testing.orig/xen/include/asm-x86/hvm/svm/vmcb.h
+++ xen-3.0.3-testing/xen/include/asm-x86/hvm/svm/vmcb.h
@@ -484,6 +484,7 @@ struct arch_svm_struct {
u32 *msrpm;
u64 vmexit_tsc; /* tsc read at #VMEXIT. for TSC_OFFSET */
int saved_irq_vector;
+ u32 inject_event;
u32 launch_core;
u32 asid_core;
++++++ xu-11843-svm-no-double-nmi.diff ++++++
# HG changeset patch
# User kfraser@localhost.localdomain
# Date Fri Oct 20 10:11:45 2006 +0100
# Node ID 899836e04387bec0fc9f7c080e03ca9c4b9b11fd
# parent: c436ab500c9988f3a295f66b690ad7a98c16b54f
[HVM][SVM] Avoid double-execution of NMI handler.
Remove the do_nmi() call from the vmexit logic, as the NMI is held
pending and will be handled in the context of the host when the STGI
instruction is executed.
Signed-off-by: Tom Woller
Index: xen-3.0.3-testing/xen/arch/x86/hvm/svm/svm.c
===================================================================
--- xen-3.0.3-testing.orig/xen/arch/x86/hvm/svm/svm.c
+++ xen-3.0.3-testing/xen/arch/x86/hvm/svm/svm.c
@@ -54,7 +54,6 @@
/* External functions. We should move these to some suitable header file(s) */
-extern void do_nmi(struct cpu_user_regs *, unsigned long);
extern int inst_copy_from_guest(unsigned char *buf, unsigned long guest_eip,
int inst_len);
extern uint32_t vlapic_update_ppr(struct vlapic *vlapic);
@@ -2730,7 +2729,6 @@ asmlinkage void svm_vmexit_handler(struc
break;
case VMEXIT_NMI:
- do_nmi(regs, 0);
break;
case VMEXIT_SMI:
++++++ xu-12040-pv-spurious-interrupt.diff ++++++
# HG changeset patch
# User Steven Smith
# Date Tue Oct 31 11:38:55 2006 +0000
# Node ID 79a40acadb41fbe5e5b88b20de5fe53f4dd6b413
# parent: b2371c9e05f5146767464db8504214ae2b77c25c
[PV-ON-HVM] Don't generate lots of spurious interrupts when using event
channel upcalls.
The issue here was that the Xen platform PCI interrupt is only updated
when you return from the hypervisor into guest context, and so remained
asserted for a short interval after the interrupt handler ran. If
it happened that the first subsequent trap to the hypervisor was
for unmasking the 8259 interrupt again, the unmasking caused the interrupt
to be reinjected. This caused an edge on the chaining interrupt from
the slave PIC to the master. The platform interrupt on the slave
would then be cleared as we returned to the guest, and so you
eventually end up injecting an interrupt on the master chained
interrupt with nothing pending on the slave, which shows up as
a spurious interrupt in the guest.
Signed-off-by: Steven Smith
--- a/unmodified_drivers/linux-2.6/platform-pci/evtchn.c Tue Oct 31 11:31:34 2006 +0000
+++ b/unmodified_drivers/linux-2.6/platform-pci/evtchn.c Tue Oct 31 11:38:55 2006 +0000
@@ -167,11 +167,17 @@ irqreturn_t evtchn_interrupt(int irq, vo
l2 = s->evtchn_pending[l1i] & ~s->evtchn_mask[l1i];
}
}
+
+ /* Make sure the hypervisor has a chance to notice that the
+ upcall_pending condition has been cleared, so that we don't
+ try and reinject the interrupt again. */
+ (void)HYPERVISOR_xen_version(0, NULL);
+
return IRQ_HANDLED;
}
void force_evtchn_callback(void)
{
- evtchn_interrupt(0, NULL, NULL);
+ (void)HYPERVISOR_xen_version(0, NULL);
}
EXPORT_SYMBOL(force_evtchn_callback);
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org