~davewalker/ubuntu/maverick/qemu-kvm/623830

« back to all changes in this revision

Viewing changes to debian/patches/fix-multiboot-compilation.patch

  • Committer: Bazaar Package Importer
  • Author(s): Serge Hallyn
  • Date: 2010-08-10 08:51:54 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100810085154-ok0jzlkr75dplmc7
Tags: 0.12.5+noroms-0ubuntu1
* New upstream release
* Removed patch which is now upstream:
  0001-Fix-missing-symbols-in-.rel-.rela.plt-sections.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
commit 590bf491a49670843ee902c47f7ab1de5e9acd06
2
 
Author: Alexander Graf <agraf@suse.de>
3
 
Date:   Wed Jun 2 01:56:50 2010 +0200
4
 
 
5
 
    Fix multiboot compilation
6
 
    
7
 
    Commit dd4239d6574ca41c94fc0d0f77ddc728510ffc57 broke multiboot. It replaced the
8
 
    instruction "rep insb (%dx), %es:(%edi)" by the binary output of
9
 
    "addr32 rep insb (%dx), %es:(%di)".
10
 
    
11
 
    Linuxboot calls the respective helper function in a code16 section. So the
12
 
    original instruction was automatically translated to its "addr32" equivalent.
13
 
    For multiboot, we're running in code32 so gcc didn't add the "addr32" which
14
 
    breaks the instruction.
15
 
    
16
 
    This patch splits that helper function in one which uses addr32 and one which
17
 
    does not, so everyone's happy.
18
 
    
19
 
    The good news is that nobody probably cared so far. The bundled multiboot.bin
20
 
    binary was built before the change and is thus correct.
21
 
    
22
 
    Please also put this patch into -stable.
23
 
    
24
 
    Signed-off-by: Alexander Graf <agraf@suse.de>
25
 
    Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
26
 
 
27
 
Origin: upstream, http://git.kernel.org/?p=virt/kvm/qemu-kvm.git;a=commit;h=590bf491a49670843ee902c47f7ab1de5e9acd06
28
 
Bug-ubuntu: https://bugs.launchpad.net/ubuntu/+source/qemu-kvm/+bug/598649
29
 
 
30
 
diff --git a/pc-bios/optionrom/linuxboot.S b/pc-bios/optionrom/linuxboot.S
31
 
index 8aebe51..c109363 100644
32
 
--- a/pc-bios/optionrom/linuxboot.S
33
 
+++ b/pc-bios/optionrom/linuxboot.S
34
 
@@ -106,10 +106,10 @@ copy_kernel:
35
 
        /* We're now running in 16-bit CS, but 32-bit ES! */
36
 
 
37
 
        /* Load kernel and initrd */
38
 
-       read_fw_blob(FW_CFG_KERNEL)
39
 
-       read_fw_blob(FW_CFG_INITRD)
40
 
-       read_fw_blob(FW_CFG_CMDLINE)
41
 
-       read_fw_blob(FW_CFG_SETUP)
42
 
+       read_fw_blob_addr32(FW_CFG_KERNEL)
43
 
+       read_fw_blob_addr32(FW_CFG_INITRD)
44
 
+       read_fw_blob_addr32(FW_CFG_CMDLINE)
45
 
+       read_fw_blob_addr32(FW_CFG_SETUP)
46
 
 
47
 
        /* And now jump into Linux! */
48
 
        mov             $0, %eax
49
 
diff --git a/pc-bios/optionrom/optionrom.h b/pc-bios/optionrom/optionrom.h
50
 
index 4dcb906..fbdd48a 100644
51
 
--- a/pc-bios/optionrom/optionrom.h
52
 
+++ b/pc-bios/optionrom/optionrom.h
53
 
@@ -50,13 +50,7 @@
54
 
        bswap           %eax
55
 
 .endm
56
 
 
57
 
-/*
58
 
- * Read a blob from the fw_cfg device.
59
 
- * Requires _ADDR, _SIZE and _DATA values for the parameter.
60
 
- *
61
 
- * Clobbers:   %eax, %edx, %es, %ecx, %edi
62
 
- */
63
 
-#define read_fw_blob(var)                              \
64
 
+#define read_fw_blob_pre(var)                          \
65
 
        read_fw         var ## _ADDR;                   \
66
 
        mov             %eax, %edi;                     \
67
 
        read_fw         var ## _SIZE;                   \
68
 
@@ -65,10 +59,32 @@
69
 
        mov             $BIOS_CFG_IOPORT_CFG, %edx;     \
70
 
        outw            %ax, (%dx);                     \
71
 
        mov             $BIOS_CFG_IOPORT_DATA, %dx;     \
72
 
-       cld;                                            \
73
 
+       cld
74
 
+
75
 
+/*
76
 
+ * Read a blob from the fw_cfg device.
77
 
+ * Requires _ADDR, _SIZE and _DATA values for the parameter.
78
 
+ *
79
 
+ * Clobbers:   %eax, %edx, %es, %ecx, %edi
80
 
+ */
81
 
+#define read_fw_blob(var)                              \
82
 
+       read_fw_blob_pre(var);                          \
83
 
        /* old as(1) doesn't like this insn so emit the bytes instead: \
84
 
        rep insb        (%dx), %es:(%edi);              \
85
 
        */                                              \
86
 
+       .dc.b           0xf3,0x6c
87
 
+
88
 
+/*
89
 
+ * Read a blob from the fw_cfg device in forced addr32 mode.
90
 
+ * Requires _ADDR, _SIZE and _DATA values for the parameter.
91
 
+ *
92
 
+ * Clobbers:   %eax, %edx, %es, %ecx, %edi
93
 
+ */
94
 
+#define read_fw_blob_addr32(var)                               \
95
 
+       read_fw_blob_pre(var);                          \
96
 
+       /* old as(1) doesn't like this insn so emit the bytes instead: \
97
 
+       addr32 rep insb (%dx), %es:(%edi);              \
98
 
+       */                                              \
99
 
        .dc.b           0x67,0xf3,0x6c
100
 
 
101
 
 #define OPTION_ROM_START                                       \