]> xenbits.xensource.com Git - qemu-xen-3.4-testing.git/commit
Remove most uses of phys_ram_base in hw/pc.c
authorIan Jackson <iwj@mariner.uk.xensource.com>
Mon, 17 Mar 2008 15:48:42 +0000 (15:48 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Mon, 12 May 2008 11:20:10 +0000 (12:20 +0100)
commit1fe1f4559e3efa5f4e30587212573c572b770369
tree608ff1bf174ac0c9df4001089e2bc920e741b09c
parentb0fca6158660c13b611dc4cf390b2fb2fd4cba5e
Remove most uses of phys_ram_base in hw/pc.c

In this patch, I remove all the direct uses of phys_ram_base
from hw/pc.c, except for those presently needed to construct the
arguments to the vga init functions.

This involved:
 * Getting rid of various additions and subtractions of phys_ram_base
 * Changing the types of the guest physical addresses in load_linux
   from uint8_t* to target_phys_addr_t
 * Replacing calls to memcpy and pstrcpy with
   cpu_physical_memory_write (and a new pstrcpy_targphys function)
 * Replacing most calls to fread with a new fread_targphys function
 * Deprecating load_image in favour of a new load_image_targphys
 * Removing (rather than fixing up) the unused function load_kernel

I noticed that load_image doesn't take a buffer size argument - it
just overwrites the destination buffer with file data, extending as
long as the file happens to be.  In most cases this is probably not an
exploitable vulnerability, but it seems poor practice.  Hence
load_image_targphys's extra argument.
hw/pc.c
loader.c
sysemu.h