~ubuntu-branches/ubuntu/trusty/qemu/trusty

« back to all changes in this revision

Viewing changes to pc-bios/optionrom/multiboot.S

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn
  • Date: 2013-10-22 22:47:07 UTC
  • mfrom: (1.8.3) (10.1.42 sid)
  • Revision ID: package-import@ubuntu.com-20131022224707-1lya34fw3k3f24tv
Tags: 1.6.0+dfsg-2ubuntu1
* Merge 1.6.0~rc0+dfsg-2exp from debian experimental.  Remaining changes:
  - debian/control
    * update maintainer
    * remove libiscsi, usb-redir, vde, vnc-jpeg, and libssh2-1-dev
      from build-deps
    * enable rbd
    * add qemu-system and qemu-common B/R to qemu-keymaps
    * add D:udev, R:qemu, R:qemu-common and B:qemu-common to
      qemu-system-common
    * qemu-system-arm, qemu-system-ppc, qemu-system-sparc:
      - add qemu-kvm to Provides
      - add qemu-common, qemu-kvm, kvm to B/R
      - remove openbios-sparc from qemu-system-sparc D
      - drop openbios-ppc and openhackware Depends to Suggests (for now)
    * qemu-system-x86:
      - add qemu-common to Breaks/Replaces.
      - add cpu-checker to Recommends.
    * qemu-user: add B/R:qemu-kvm
    * qemu-kvm:
      - add armhf armel powerpc sparc to Architecture
      - C/R/P: qemu-kvm-spice
    * add qemu-common package
    * drop qemu-slof which is not packaged in ubuntu
  - add qemu-system-common.links for tap ifup/down scripts and OVMF link.
  - qemu-system-x86.links:
    * remove pxe rom links which are in kvm-ipxe
    * add symlink for kvm.1 manpage
  - debian/rules
    * add kvm-spice symlink to qemu-kvm
    * call dh_installmodules for qemu-system-x86
    * update dh_installinit to install upstart script
    * run dh_installman (Closes: #709241) (cherrypicked from 1.5.0+dfsg-2)
  - Add qemu-utils.links for kvm-* symlinks.
  - Add qemu-system-x86.qemu-kvm.upstart and .default
  - Add qemu-system-x86.modprobe to set nesting=1
  - Add qemu-system-common.preinst to add kvm group
  - qemu-system-common.postinst: remove bad group acl if there, then have
    udev relabel /dev/kvm.
  - New linaro patches from qemu-linaro rebasing branch
  - Dropped patches:
    * xen-simplify-xen_enabled.patch
    * sparc-linux-user-fix-missing-symbols-in-.rel-.rela.plt-sections.patch
    * main_loop-do-not-set-nonblocking-if-xen_enabled.patch
    * xen_machine_pv-do-not-create-a-dummy-CPU-in-machine-.patch
    * virtio-rng-fix-crash
  - Kept patches:
    * expose_vms_qemu64cpu.patch - updated
    * linaro arm patches from qemu-linaro rebasing branch
  - New patches:
    * fix-pci-add: change CONFIG variable in ifdef to make sure that
      pci_add is defined.
* Add linaro patches
* Add experimental mach-virt patches for arm virtualization.
* qemu-system-common.install: add debian/tmp/usr/lib to install the
  qemu-bridge-helper

Show diffs side-by-side

added added

removed removed

Lines of Context:
89
89
 
90
90
        /* Initialize multiboot mmap structs using int 0x15(e820) */
91
91
        xor             %ebx, %ebx
92
 
        /* mmap start after first size */
93
 
        movl            $4, %edi
 
92
        /* Start storing mmap data at %es:0 */
 
93
        xor             %edi, %edi
94
94
 
95
95
mmap_loop:
 
96
        /* The multiboot entry size has offset -4, so leave some space */
 
97
        add             $4, %di
96
98
        /* entry size (mmap struct) & max buffer size (int15) */
97
99
        movl            $20, %ecx
98
 
        /* store entry size */
99
 
        /* old as(1) doesn't like this insn so emit the bytes instead:
100
 
        movl            %ecx, %es:-4(%edi)
101
 
        */
102
 
        .dc.b           0x26,0x67,0x66,0x89,0x4f,0xfc
103
100
        /* e820 */
104
101
        movl            $0x0000e820, %eax
105
102
        /* 'SMAP' magic */
107
104
        int             $0x15
108
105
 
109
106
mmap_check_entry:
110
 
        /* last entry? then we're done */
 
107
        /* Error or last entry already done? */
111
108
        jb              mmap_done
112
 
        and             %bx, %bx
113
 
        jz              mmap_done
114
 
        /* valid entry, so let's loop on */
115
109
 
116
110
mmap_store_entry:
117
 
        /* %ax = entry_number * 24 */
118
 
        mov             $24, %ax
119
 
        mul             %bx
120
 
        mov             %ax, %di
 
111
        /* store entry size */
 
112
        /* old as(1) doesn't like this insn so emit the bytes instead:
 
113
        movl            %ecx, %es:-4(%edi)
 
114
        */
 
115
        .dc.b           0x26,0x67,0x66,0x89,0x4f,0xfc
 
116
 
 
117
        /* %edi += entry_size, store as mbs_mmap_length */
 
118
        add             %ecx, %edi
121
119
        movw            %di, %fs:0x2c
122
 
        /* %di = 4 + (entry_number * 24) */
123
 
        add             $4, %di
124
 
        jmp             mmap_loop
 
120
 
 
121
        /* Continuation value 0 means last entry */
 
122
        test            %ebx, %ebx
 
123
        jnz             mmap_loop
125
124
 
126
125
mmap_done:
 
126
        /* Calculate upper_mem field: The amount of memory between 1 MB and
 
127
           the first upper memory hole. Get it from the mmap. */
 
128
        xor             %di, %di
 
129
        mov             $0x100000, %edx
 
130
upper_mem_entry:
 
131
        cmp             %fs:0x2c, %di
 
132
        je              upper_mem_done
 
133
        add             $4, %di
 
134
 
 
135
        /* Skip if type != 1 */
 
136
        cmpl            $1, %es:16(%di)
 
137
        jne             upper_mem_next
 
138
 
 
139
        /* Skip if > 4 GB */
 
140
        movl            %es:4(%di), %eax
 
141
        test            %eax, %eax
 
142
        jnz             upper_mem_next
 
143
 
 
144
        /* Check for contiguous extension (base <= %edx < base + length) */
 
145
        movl            %es:(%di), %eax
 
146
        cmp             %eax, %edx
 
147
        jb              upper_mem_next
 
148
        addl            %es:8(%di), %eax
 
149
        cmp             %eax, %edx
 
150
        jae             upper_mem_next
 
151
 
 
152
        /* If so, update %edx, and restart the search (mmap isn't ordered) */
 
153
        mov             %eax, %edx
 
154
        xor             %di, %di
 
155
        jmp             upper_mem_entry
 
156
 
 
157
upper_mem_next:
 
158
        addl            %es:-4(%di), %edi
 
159
        jmp             upper_mem_entry
 
160
 
 
161
upper_mem_done:
 
162
        sub             $0x100000, %edx
 
163
        shr             $10, %edx
 
164
        mov             %edx, %fs:0x8
 
165
 
127
166
real_to_prot:
128
167
        /* Load the GDT before going into protected mode */
129
168
lgdt: