rpms/kernel-xen-2.6/F-7 xen-vpic-irqbase-mode.patch, NONE, 1.1 kernel-xen.spec, 1.46, 1.47 xen-vpic-set-vector.patch, 1.2, NONE

Eduardo Habkost (ehabkost) fedora-extras-commits at redhat.com
Thu Sep 13 19:58:32 UTC 2007


Author: ehabkost

Update of /cvs/pkgs/rpms/kernel-xen-2.6/F-7
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv27758

Modified Files:
	kernel-xen.spec 
Added Files:
	xen-vpic-irqbase-mode.patch 
Removed Files:
	xen-vpic-set-vector.patch 
Log Message:
HV-side of fix for bug #248398: HVM domain hangs during (F-7) install

Backport of fix from xen-unstable: 15239:656b8175f4f2.

This replaces xen-vpic-set-vector.patch, that didn't go upstream and
didn't have its user-space part added to the xen package.


xen-vpic-irqbase-mode.patch:

--- NEW FILE xen-vpic-irqbase-mode.patch ---
# HG changeset patch
# User kfraser at localhost.localdomain
# Node ID 656b8175f4f24b5bb3a761e62c496075510914ed
# Parent  345ae2e61ba0130cf4913fee13b378c4e21d24e7
hvm: Respect irqbase set by protected mode in mode switching with VMXAssist.

RHEL4U4 PAE SMP guest currently crashes, and we found changeset 15214
introduced it. This patch fixes it.

Signed-off-by: Xin Li <xin.b.li at intel.com>
Signed-off-by: Dexuan Cui <dexuan.cui at intel.com>
xen-unstable changeset: 15239:656b8175f4f24b5bb3a761e62c496075510914ed
xen-unstable date: Fri Jun 08 11:19:55 2007 +0100

Index: xen/arch/x86/hvm/vmx/vmx.c
===================================================================
--- xen/arch/x86/hvm/vmx/vmx.c
+++ xen/arch/x86/hvm/vmx/vmx.c
@@ -1878,8 +1878,8 @@ enum { VMX_ASSIST_INVOKE = 0, VMX_ASSIST
 static int vmx_assist(struct vcpu *v, int mode)
 {
     struct vmx_assist_context c;
-    u32 magic;
-    u32 cp;
+    struct hvm_hw_vpic *vpic = v->domain->arch.hvm_domain.vpic;
+    u32 magic, cp;
 
     /* make sure vmxassist exists (this is not an error) */
     if (hvm_copy_from_guest_phys(&magic, VMXASSIST_MAGIC_OFFSET,
@@ -1913,6 +1913,10 @@ static int vmx_assist(struct vcpu *v, in
                 goto error;
             if ( vmx_world_restore(v, &c) != 0 )
                 goto error;
+            v->arch.hvm_vmx.pm_irqbase[0] = vpic[0].irq_base;
+            v->arch.hvm_vmx.pm_irqbase[1] = vpic[1].irq_base;
+            vpic[0].irq_base = NR_EXCEPTION_HANDLER;
+            vpic[1].irq_base = NR_EXCEPTION_HANDLER + 8;
             v->arch.hvm_vmx.vmxassist_enabled = 1;
             return 1;
         }
@@ -1931,6 +1935,13 @@ static int vmx_assist(struct vcpu *v, in
                 goto error;
             if ( vmx_world_restore(v, &c) != 0 )
                 goto error;
+            if ( v->arch.hvm_vmx.irqbase_mode ) {
+                vpic[0].irq_base = c.rm_irqbase[0] & 0xf8;
+                vpic[1].irq_base = c.rm_irqbase[1] & 0xf8;
+            } else {
+                vpic[0].irq_base = v->arch.hvm_vmx.pm_irqbase[0];
+                vpic[1].irq_base = v->arch.hvm_vmx.pm_irqbase[1];
+            }
             v->arch.hvm_vmx.vmxassist_enabled = 0;
             return 1;
         }
Index: xen/arch/x86/hvm/vpic.c
===================================================================
--- xen/arch/x86/hvm/vpic.c
+++ xen/arch/x86/hvm/vpic.c
@@ -174,7 +174,8 @@ static int vpic_intack(struct hvm_hw_vpi
     return irq;
 }
 
-static void vpic_ioport_write(struct hvm_hw_vpic *vpic, uint32_t addr, uint32_t val)
+static void vpic_ioport_write(
+    struct hvm_hw_vpic *vpic, uint32_t addr, uint32_t val)
 {
     int priority, cmd, irq;
     uint8_t mask;
@@ -265,6 +266,11 @@ static void vpic_ioport_write(struct hvm
             vpic->imr = val;
             break;
         case 1:
+#if 1 /* Delete me when vmxassist is retired. */
+            /* Which mode is irqbase programmed in? */
+            current->arch.hvm_vmx.irqbase_mode =
+                current->arch.hvm_vmx.vmxassist_enabled;
+#endif
             /* ICW2 */
             vpic->irq_base = val & 0xf8;
             vpic->init_state++;
Index: xen/include/asm-x86/hvm/vmx/vmcs.h
===================================================================
--- xen/include/asm-x86/hvm/vmx/vmcs.h
+++ xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -77,7 +77,11 @@ struct arch_vmx_struct {
     unsigned long        cpu_cr2; /* save CR2 */
     unsigned long        cpu_cr3;
     struct vmx_msr_state msr_state;
+
+    /* Following fields are all specific to vmxassist. */
     unsigned long        vmxassist_enabled:1;
+    unsigned long        irqbase_mode:1;
+    unsigned char        pm_irqbase[2];
 };
 
 struct vmcs_struct *vmx_alloc_host_vmcs(void);
Index: xen/include/public/hvm/vmx_assist.h
===================================================================
--- xen/include/public/hvm/vmx_assist.h
+++ xen/include/public/hvm/vmx_assist.h
@@ -35,6 +35,10 @@
 
 #ifndef __ASSEMBLY__
 
+#define NR_EXCEPTION_HANDLER    32
+#define NR_INTERRUPT_HANDLERS   16
+#define NR_TRAPS        (NR_EXCEPTION_HANDLER+NR_INTERRUPT_HANDLERS)
+
 union vmcs_arbytes {
     struct arbyte_fields {
         unsigned int seg_type : 4,
@@ -98,6 +102,8 @@ struct vmx_assist_context {
     uint32_t  ldtr_limit;
     uint32_t  ldtr_base;
     union vmcs_arbytes ldtr_arbytes;
+
+    unsigned char rm_irqbase[2];
 };
 typedef struct vmx_assist_context vmx_assist_context_t;
 


Index: kernel-xen.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/F-7/kernel-xen.spec,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -r1.46 -r1.47
--- kernel-xen.spec	12 Sep 2007 20:39:00 -0000	1.46
+++ kernel-xen.spec	13 Sep 2007 19:57:59 -0000	1.47
@@ -519,8 +519,8 @@
 Patch20000: xen-compile-fix.patch
 Patch20001: xen-version-strings.patch
 
-# HV part for rawhide FV booting on rawhide Xen
-Patch20002: xen-vpic-set-vector.patch
+# Fix graphical boot (e.g. F7 DVD booting) under Full Virtualization
+Patch20002: xen-vpic-irqbase-mode.patch
 
 # END OF PATCH DEFINITIONS
 
@@ -2058,6 +2058,12 @@
 #  - tux.
 
 %changelog
+* Thu Sep 13 2007 Eduardo Habkost <ehabkost at redhat.com>
+- Hypervisor-side of fix for bug #248398: HVM domain hangs during (F-7)
+  install. Backport of fix from xen-unstable: 15239:656b8175f4f2.
+  This replaces xen-vpic-set-vector.patch, that didn't go upstream and
+  didn't have its user-space part added to the xen package.
+
 * Wed Sep 12 2007 Eduardo Habkost <ehabkost at redhat.com>
 - Disable CONFIG_HIGHPTE. It is not reliable and causes performance loss
   under Xen


--- xen-vpic-set-vector.patch DELETED ---




More information about the fedora-extras-commits mailing list