rpms/kvm/devel kvm-74-pxe-boot.patch,NONE,1.1 kvm.spec,1.69,1.70

Glauber Costa glommer at fedoraproject.org
Tue Sep 9 15:46:56 UTC 2008


Author: glommer

Update of /cvs/pkgs/rpms/kvm/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv4833

Modified Files:
	kvm.spec 
Added Files:
	kvm-74-pxe-boot.patch 
Log Message:
fix pxe booting, apply upstream patch



kvm-74-pxe-boot.patch:

--- NEW FILE kvm-74-pxe-boot.patch ---
commit c0a04f0e130fa98da8b89e74debd379c2f08d120
Author: aliguori <aliguori at c046a42c-6fe2-441c-8c8c-71466251a162>
Date:   Tue Sep 9 14:49:02 2008 +0000

    Fix up pxe boot (Glauber Costa)
    
    As discussed in
    http://lists.gnu.org/archive/html/qemu-devel/2008-08/msg00667.html,
    current pxe boot is broken for some use cases. The problem
    goes away if we reduce the number of allowed bits in the address space
    to 32 (which has the side effect of reducing guest max mem size to 4Gb).
    
    After digging for a while, it turns out that it happens because pxelinux
    tries to access address 0x10009e9a6, which does not fit a 32-bit address.
    A closer look, however, reveals this access is totally valid: It's just
    0x9e9a6 with an add carry.
    
    To avoid this, this patch casts the address passed to the POPL macro to
    a 32-bit value. This is also done, although just theorectically, for
    PUSHL too.
    
    Signed-off-by: Glauber Costa <glommer at redhat.com>
    Signed-off-by: Anthony Liguori <aliguori at us.ibm.com>
    Reported-by: Chris Lalancette <clalance at redhat.com>
    CC: Eduardo Habkost <ehabkost at redhat.com>
    
    
    
    git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5182 c046a42c-6fe2-441c-8c8c-71466251a162

diff --git a/target-i386/op_helper.c b/target-i386/op_helper.c
index 32cdf2a..23f3080 100644
--- a/qemu/target-i386/op_helper.c
+++ b/qemu/target-i386/op_helper.c
@@ -590,6 +590,10 @@ do {\
 #define SET_ESP(val, sp_mask) ESP = (ESP & ~(sp_mask)) | ((val) & (sp_mask))
 #endif
 
+/* in 64-bit machines, this can overflow. So this segment addition macro
+ * can be used to trim the value to 32-bit whenever needed */
+#define SEG_ADDL(ssp, sp, sp_mask) ((uint32_t)((ssp) + (sp & (sp_mask))))
+
 /* XXX: add a is_user flag to have proper security support */
 #define PUSHW(ssp, sp, sp_mask, val)\
 {\
@@ -600,7 +604,7 @@ do {\
 #define PUSHL(ssp, sp, sp_mask, val)\
 {\
     sp -= 4;\
-    stl_kernel((ssp) + (sp & (sp_mask)), (val));\
+    stl_kernel(SEG_ADDL(ssp, sp, sp_mask), (uint32_t)(val));\
 }
 
 #define POPW(ssp, sp, sp_mask, val)\
@@ -611,7 +615,7 @@ do {\
 
 #define POPL(ssp, sp, sp_mask, val)\
 {\
-    val = (uint32_t)ldl_kernel((ssp) + (sp & (sp_mask)));\
+    val = (uint32_t)ldl_kernel(SEG_ADDL(ssp, sp, sp_mask));\
     sp += 4;\
 }
 


Index: kvm.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kvm/devel/kvm.spec,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -r1.69 -r1.70
--- kvm.spec	28 Aug 2008 12:44:56 -0000	1.69
+++ kvm.spec	9 Sep 2008 15:46:26 -0000	1.70
@@ -1,7 +1,7 @@
 Summary: Kernel-based Virtual Machine
 Name: kvm
 Version: 74
-Release: 2%{?dist}
+Release: 3%{?dist}
 License: GPLv2+ and LGPLv2+
 Group: Development/Tools
 URL: http://%{name}.sf.net
@@ -10,6 +10,7 @@
 Source1: %{name}.modules
 Patch0: %{name}-bootmenu.patch
 Patch1: %{name}-62-block-rw-range-check.patch
+Patch2: %{name}-74-pxe-boot.patch
 # patches from upstream qemu
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: SDL-devel
@@ -38,6 +39,7 @@
 %setup -q
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
 
 %build
 
@@ -108,6 +110,9 @@
 %{_sysconfdir}/sysconfig/modules/%{name}.modules
 
 %changelog
+* Tue Sep 09 2008 Glauber Costa <glommer at redhat.com> - 74-3
+- fix pxe booting. Needed for oVirt
+
 * Thu Aug 28 2008 Glauber Costa <glommer at redhat.com> - 74-2
 - just a tag increase, because CVS is so awesome...
 




More information about the fedora-extras-commits mailing list