rpms/kernel-xen-2.6/F-7 xen-vpic-set-vector.patch, NONE, 1.1.2.1 kernel-xen.spec, 1.26, 1.26.2.1

Eduardo Habkost (ehabkost) fedora-extras-commits at redhat.com
Tue May 22 15:03:01 UTC 2007


Author: ehabkost

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

Modified Files:
      Tag: private-ehabkost-sct-fv-patches-branch
	kernel-xen.spec 
Added Files:
      Tag: private-ehabkost-sct-fv-patches-branch
	xen-vpic-set-vector.patch 
Log Message:
HV: allow HVM virtual PICs to have their interrupt vector reprogrammed



xen-vpic-set-vector.patch:

--- NEW FILE xen-vpic-set-vector.patch ---
Date: Tue, 22 May 2007 15:00:35 +0100
From: "Stephen C. Tweedie" <sct at redhat.com>
Subject: [patch 1/2] HV: allow HVM virtual PICs to have their interrupt vector reprogrammed


Hi,

> So the fix here is to first of all extend the virtual PIC provided by
> the hypervisor, supporting a new 2-byte control sequence which lets the
> guests change the interrupt vectors _without_ fully reinitialising the
> PIC

And this is the patch for that.  The new control sequence is:

Write 0xff to ICW1: this is an otherwise unused value, since it has bit
4 set (ie. it's an initialisation register write), and yet bits 5--7 are
also set (only valid for MCS-80 mode, which the Xen vPIC doesn't emulate
at all.)  This sets the PIC to expect ICW2 to follow, just as ICW1
usually does, except that it does not reset the PIC internal state.

Write the new vector to ICW2: completes the initialisation sequence.
This the same as a normal ICW2 write, except that it does not expect to
be followed by the usual ICW3/ICW4 writes.

Note that the flag used to indicate this "special" ICW1 write is shared
between the two vPICs (master and slave), so it is not legal for the
guest to write 0xff to both master/slave ICW1 before following up with
the ICW2 writes.  But since the only software that will use this is the
modified vmxassist, that's OK.

--Stephen

---
Index: xen/arch/x86/hvm/vpic.c
===================================================================
--- xen/arch/x86/hvm/vpic.c
+++ xen/arch/x86/hvm/vpic.c
@@ -178,13 +178,23 @@ static void vpic_ioport_write(struct hvm
 {
     int priority, cmd, irq;
     uint8_t mask;
+    static int custom_revector_flag = 0;
 
     vpic_lock(vpic);
 
     addr &= 1;
     if ( addr == 0 )
     {
-        if ( val & 0x10 )
+	if ( val == 0xff ) {
+	    /* Extension to the PIC: lets us rewrite the icw2 vector
+	     * without fully reinitialising the PIC, used by vmxassist
+	     * to preserve icw2 vector translations across transitions
+	     * into and back out of 32-bit mode.
+	     */
+	    vpic->init_state = 1;
+	    custom_revector_flag = 1;
+	}
+        else if ( val & 0x10 )
         {
             /* ICW1 */
             /* Clear edge-sensing logic. */
@@ -268,6 +278,10 @@ static void vpic_ioport_write(struct hvm
             /* ICW2 */
             vpic->irq_base = val & 0xf8;
             vpic->init_state++;
+	    if (custom_revector_flag) {
+		custom_revector_flag = 0;
+		vpic->init_state = 0;
+	    }
             if ( !(vpic->init_state & 8) )
                 break; /* CASCADE mode: wait for write to ICW3. */
             /* SNGL mode: fall through (no ICW3). */


Index: kernel-xen.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/F-7/kernel-xen.spec,v
retrieving revision 1.26
retrieving revision 1.26.2.1
diff -u -r1.26 -r1.26.2.1
--- kernel-xen.spec	22 May 2007 12:39:00 -0000	1.26
+++ kernel-xen.spec	22 May 2007 15:02:26 -0000	1.26.2.1
@@ -487,6 +487,9 @@
 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
+
 # END OF PATCH DEFINITIONS
 
 BuildRoot: %{_tmppath}/kernel-%{KVERREL}-root-%{_target_cpu}
@@ -1123,6 +1126,7 @@
 # Any necessary hypervisor patches go here
 %patch20000 -p1
 %patch20001 -p1
+%patch20002 -p1
 
 # Update the Makefile version strings
 sed -i -e 's/\(^export XEN_BUILDER.*$\)/\1'%{?dist}'/' Makefile
@@ -2014,6 +2018,10 @@
 
 %changelog
 * Tue May 22 2007 Eduardo Habkost <ehabkost at redhat.com>
+- HV: allow HVM virtual PICs to have their interrupt vector reprogrammed
+  (part of fix for rawhide FV booting on rawhide Xen)
+
+* Tue May 22 2007 Eduardo Habkost <ehabkost at redhat.com>
 - Add patch from bug #209429: linux-2.6-xen-iscsi-x86_64-no_iommu_init.patch
 
 * Thu May 10 2007  <quintela at redhat.com>




More information about the fedora-extras-commits mailing list