summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'agraf/xen-next' into stagingAnthony Liguori2011-07-2910-33/+162
|\
| * xen: implement unplug protocol in xen_platformStefano Stabellini2011-07-264-2/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The unplug protocol is necessary to support PV drivers in the guest: the drivers expect to be able to "unplug" emulated disks and nics before initializing the Xen PV interfaces. It is responsibility of the guest to make sure that the unplug is done before the emulated devices or the PV interface start to be used. We use pci_for_each_device to walk the PCI bus, identify the devices and disks that we want to disable and dynamically unplug them. Changes in v2: - use PCI_CLASS constants; - replace pci_unplug_device with qdev_unplug; - do not import hw/ide/internal.h in xen_platform.c; Changes in v3: - introduce piix3-ide-xen, that support hot-unplug; - move the unplug code to hw/ide/piix.c; - just call qdev_unplug from xen_platform.c to unplug the IDE disks; Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Alexander Graf <agraf@suse.de>
| * vl.c: Check the asked ram_size later.Anthony PERARD2011-07-261-6/+10
| | | | | | | | | | | | | | | | | | | | As a Xen guest can have more than 2GB of RAM on a 32bit host, we move the conditions after than we now if we run one Xen or not. [agraf] separate xen branch from ram_size check Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Alexander Graf <agraf@suse.de>
| * xen: Fix the memory registration to reflect of what is done by Xen.Anthony PERARD2011-07-261-7/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A Xen guest memory is allocated by libxc. But this memory is not allocated continuously, instead, it leaves the VGA IO memory space not allocated, same for the MMIO space (at HVM_BELOW_4G_MMIO_START of size HVM_BELOW_4G_MMIO_LENGTH). So to reflect that, we do not register the physical memory for this two holes. But we still keep only one RAMBlock for the all RAM as it is more easier than have two separate blocks (1 above 4G). Also this prevent QEMU from use the MMIO space for a ROM. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Alexander Graf <agraf@suse.de>
| * cpu-common: Have a ram_addr_t of uint64 with Xen.Anthony PERARD2011-07-263-5/+14
| | | | | | | | | | | | | | | | In Xen case, memory can be bigger than the host memory. that mean a 32bits host (and QEMU) should be able to handle a RAM address of 64bits. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Alexander Graf <agraf@suse.de>
| * xen: make xen_enabled even more cleverAlexander Graf2011-07-262-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using xen_enabled() we're currently only checking if xen is enabled at all during the build. But what if you want to build multiple targets out of which only one can potentially run xen code? That means that for generic code we'll still have to fall back to the variable and potentially slow the code down, but it's not as important as that is mostly xen device emulation which is not touched for non-xen targets. The target specific code however can with this patch see that it's unable to ever execute xen code. We can thus always return 0 on xen_enabled(), giving gcc enough hints to evict the mapcache code from the target memory management code. Signed-off-by: Alexander Graf <agraf@suse.de> Acked-by: Anthony PERARD <anthony.perard@citrix.com>
| * xen: remove CONFIG_XEN_MAPCACHEAlexander Graf2011-07-261-3/+0
| | | | | | | | | | | | | | We were still exporting CONFIG_XEN_MAPCACHE, even though it's completely unused by now. Remove it. Signed-off-by: Alexander Graf <agraf@suse.de>
| * exec.c: Use ram_addr_t in cpu_physical_memory_rw(...).Anthony PERARD2011-07-261-2/+2
| | | | | | | | | | | | | | | | | | | | As the variable pd and addr1 inside the function cpu_physical_memory_rw are mean to handle a RAM address, they should be of the ram_addr_t type instead of unsigned long. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Alexander Graf <agraf@suse.de>
| * xen: Fix xen_enabled().Anthony PERARD2011-07-261-1/+1
| | | | | | | | | | | | | | | | Use the "host" CONFIG_ define instead of the "target" one. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Alexander Graf <agraf@suse.de>
| * xen: introduce xen_change_state_handlerAnthony PERARD2011-07-261-7/+18
| | | | | | | | | | | | | | | | | | | | | | Remove the call to xenstore_record_dm_state from xen_main_loop_prepare that is HVM specific. Add a new vm_change_state_handler shared between xen_pv and xen_hvm machines to record the VM state to xenstore. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* | Merge remote-tracking branch 'kraxel/migration.2' into stagingAnthony Liguori2011-07-299-0/+52
|\ \
| * | usb-serial doesn't support migrationGerd Hoffmann2011-07-201-0/+7
| | | | | | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | usb-net doesn't support migrationGerd Hoffmann2011-07-201-0/+6
| | | | | | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | usb-bt doesn't support migrationGerd Hoffmann2011-07-201-0/+6
| | | | | | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | usb-wacom doesn't support migrationGerd Hoffmann2011-07-201-0/+6
| | | | | | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | usb storage: first migration support bits.Gerd Hoffmann2011-07-201-0/+12
| | | | | | | | | | | | | | | | | | | | | Tag vmstate as unmigratable for the time being, to be removed when mgration support is finished. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | ehci doesn't support migrationGerd Hoffmann2011-07-201-0/+7
| | | | | | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | ahci doesn't support migrationGerd Hoffmann2011-07-201-0/+6
| | | | | | | | | | | | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
| * | vmstate: add no_migrate flag to VMStateDescriptionGerd Hoffmann2011-07-202-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | This allows to easily tag devices as non-migratable, so any attempt to migrate a virtual machine with the device in question active will make migration fail. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* | | monitor: fix build breakage with --disable-vncTeLeMan2011-07-291-0/+2
| | | | | | | | | | | | | | | | | | | | | The breakage was introduced by the commit 13661089810d3e59931f3e80d7cb541b99af7071 Signed-off-by: TeLeMan <geleman@gmail.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | | Allow to leave type on default in -machineJan Kiszka2011-07-291-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | This allows to specify -machine options without setting an explicit machine type. We will pick the default machine in this case. Requesting the list of available machines is still possible via '-machine ?' e.g. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | | CODING_STYLE: explicitly allow braceless 'else if'Avi Kivity2011-07-291-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's already allowed by the example; there are about 1800 instances in the tree; and disallowing it would lead to if (a) { ... } else { if (b) { ... } else { if (c) { ... } else { if (d) { ... } else { ... } } } } instead of if (a) { ... } else if (b) { ... } else if (c) { ... } else if (d) { ... } else { ... } which is more readable. Acked-by: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | | Fix a compilation error in xen-mapcache.cStefan Berger2011-07-291-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes a compilation error in xen-mapcache.c . /home/stefanb/qemu/qemu-git/xen-mapcache.c: In function ‘xen_ram_addr_from_mapcache’: /home/stefanb/qemu/qemu-git/xen-mapcache.c:240:42: error: variable ‘pentry’ set but not used [-Werror=unused-but-set-variable] cc1: all warnings being treated as errors Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | | multiboot: Fix bss segment supportGöran Weinholt2011-07-291-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Multiboot images can specify a bss segment. The boot loader must clear the memory of the bss and ensure that no modules or structures are allocated inside it. Several fields are provided in the Multiboot header that were previously not used properly. The header is now used to determine how much data should be read from the image and how much memory should be reserved to the bss segment. Signed-off-by: Göran Weinholt <goran@weinholt.se> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | | configure: add --disable-zlib-testAlon Levy2011-07-291-9/+14
| | | | | | | | | | | | | | | | | | | | | | | | This is required for building libcacard which doesn't itself require zlib without bringing in this requirement to the build environment. Signed-off-by: Alon Levy <alevy@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | | Add missing trace call to oslib-posix.c:qemu_vmalloc()Jes Sorensen2011-07-291-1/+4
| | | | | | | | | | | | | | | | | | Acked-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | | Fix last sector write on sd cardDr. David Alan Gilbert2011-07-291-8/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When writing the last sector of an SD card using WRITE_MULTIPLE_BLOCK QEmu throws an error saying that we've run off the end, and leaves itself in the wrong state. Tested on ARM Vexpress model. Signed-off-by: Dr. David Alan Gilbert <david.gilbert@linaro.org> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | | move unaligned memory access functions to bswap.hPaolo Bonzini2011-07-294-448/+477
| | | | | | | | | | | | | | | | | | | | | | | | This is just code movement, and moving the fpu/ include path from target-dependent to target-independent Make variables. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | | softfloat: change default nan definitions to variablesPaolo Bonzini2011-07-292-51/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most definitions in softfloat.h are really target-independent, but the file is not because it includes definitions of the default NaN values. Change those to variables to allow including softfloat.h from files that are not compiled per-target. By making them const, the compiler is allowed to optimize them into softfloat functions that use them. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | | move WORDS_ALIGNED to qemu-common.hPaolo Bonzini2011-07-292-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | This is not a CPU interface, and a configure test would not be too precise. So just add it to qemu-common.h. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | | showing a splash picture when startwayne2011-07-295-4/+199
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added options to let qemu transfer two configuration files to bios: "bootsplash.bmp" and "etc/boot-menu-wait", which could be specified by command -boot splash=P,splash-time=T P is jpg/bmp file name or an absolute path, T have a max value of 0xffff, unit is ms. With these two options, if user invoke qemu with menu=on option, then a splash picture would be showed in a given time. For example: qemu -boot menu=on,splash=/root/boot.bmp,splash-time=5000 would make boot.bmp shown as a brand with 5 seconds in the booting up process. This feature need the new seabios's support, which could be got from git. Signed-off-by: Wayne Xia <xiawenc@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | | usb-ohci: convert to MemoryRegionAvi Kivity2011-07-291-25/+17
| | | | | | | | | | | | | | | | | | Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | | sysbus: add MemoryRegion based memory management APIAvi Kivity2011-07-292-3/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | Allow registering sysbus device memory using a MemoryRegion. Once all users are converted, sysbus_init_mmio() and sysbus_init_mmio_cb() will be removed. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | | pci: add MemoryRegion based BAR management APIAvi Kivity2011-07-292-8/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | Allow registering a BAR using a MemoryRegion. Once all users are converted, pci_register_bar() and pci_register_bar_simple() will be removed. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | | pci: pass address space to pci bus when createdAvi Kivity2011-07-2922-35/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is now done sloppily, via get_system_memory(). Eventually callers will be converted to stop using that. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | | pc: move global memory map out of pc_init1() and into its callersAvi Kivity2011-07-291-7/+8
| | | | | | | | | | | | | | | Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | | pc: convert pc_memory_init() to memory APIAvi Kivity2011-07-292-19/+41
| | | | | | | | | | | | | | | | | | Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | | pc: grab system_memoryAvi Kivity2011-07-293-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | While eventually this should come from the machine initialization function, take a short cut to avoid converting all machines now. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | | ioport: register ranges by byte aligned addresses alwaysAvi Kivity2011-07-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The I/O port space is byte addressable, even for word and long accesses. An example is the VMware svga card, which has long ports on offsets 0, 1, and 2. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | | exec.c: initialize memory mapAvi Kivity2011-07-291-0/+19
| | | | | | | | | | | | | | | | | | | | | Allocate the root memory region and initialize it. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | | memory: transaction APIAvi Kivity2011-07-292-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow changes to the memory hierarchy to be accumulated and made visible all at once. This reduces computational effort, especially when an accelerator (e.g. kvm) is involved. Useful when a single register update causes multiple changes to an address space. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | | memory: separate building the final memory map into two stepsAvi Kivity2011-07-291-9/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of adding and deleting regions in one pass, do a delete pass followed by an add pass. This fixes the following case: from: 0x0000-0x0fff ram (a1) 0x1000-0x1fff mmio (a2) 0x2000-0x2fff ram (a3) to: 0x0000-0x2fff ram (b1) The single pass algorithm removed a1, added b2, then removed a2 and a3, which caused the wrong memory map to be built. The two pass algorithm removes a1, a2, and a3, then adds b1. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | | memory: add ioeventfd supportAvi Kivity2011-07-292-0/+269
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As with the rest of the memory API, the caller associates an eventfd with an address, and the memory API takes care of registering or unregistering when the address is made visible or invisible to the guest. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | | memory: add backward compatibility for old mmio registrationAvi Kivity2011-07-292-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | This eases the transition to the new API. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | | memory: add backward compatibility for old portio registrationAvi Kivity2011-07-292-0/+49
| | | | | | | | | | | | | | | | | | Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | | memory: I/O address space supportAvi Kivity2011-07-293-1/+64
| | | | | | | | | | | | | | | | | | | | | | | | Allow registering I/O ports via the same mechanism as mmio ranges. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | | memory: late initialization of ram_addrAvi Kivity2011-07-292-4/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For non-RAM memory regions, we cannot tell whether this is an I/O region or an MMIO region. Since the qemu backing registration is different for the two, we have to defer initialization until we know which address space we are in. These shenanigans will be removed once the backing registration is unified with the memory API. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | | memory: rename MemoryRegion::has_ram_addr to ::terminatesAvi Kivity2011-07-292-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | I/O regions will not have ram_addrs, so this is a better name. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | | memory: abstract address space operationsAvi Kivity2011-07-291-30/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prepare for multiple address space support by abstracting away the details of registering a memory range with qemu's flat representation into an AddressSpace object. Note operations which are memory specific are not abstracted, since they will never be called on I/O address spaces anyway. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* | | Internal interfaces for memory APIAvi Kivity2011-07-292-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | get_system_memory() provides the root of the memory hierarchy. This interface is intended to be private between memory.c and exec.c. If this file is included elsewhere, it should be regarded as a bug (or TODO item). However, it will be temporarily needed for the conversion to hierarchical memory routing. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
OpenPOWER on IntegriCloud