aboutsummaryrefslogtreecommitdiff
path: root/xen-all.c
AgeCommit message (Collapse)AuthorFilesLines
2012-10-23Rename target_phys_addr_t to hwaddrAvi Kivity1-18/+18
target_phys_addr_t is unwieldly, violates the C standard (_t suffixes are reserved) and its purpose doesn't match the name (most target_phys_addr_t addresses are not target specific). Replace it with a finger-friendly, standards conformant hwaddr. Outstanding patchsets can be fixed up with the command git rebase -i --exec 'find -name "*.[ch]" | xargs s/target_phys_addr_t/hwaddr/g' origin Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-10-22memory: use AddressSpace for MemoryListener filteringAvi Kivity1-1/+1
Using the AddressSpace type reduces confusion, as you can't accidentally supply the MemoryRegion you're interested in. Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2012-10-15xen: drop no-op MemoryListener callbacksAvi Kivity1-32/+0
Removes quite a bit of useless code. Signed-off-by: Avi Kivity <avi@redhat.com>
2012-10-05cleanup useless return sentenceAmos Kong1-1/+0
This patch cleans up return sentences in the end of void functions. Reported-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Amos Kong <akong@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
2012-10-03xen: Set the vram dirty when an error occur.Anthony PERARD1-1/+2
If the call to xc_hvm_track_dirty_vram() fails, then we set dirtybit on all the video ram. This case happens during migration. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2012-10-03xen: Introduce xen_modified_memory.Anthony PERARD1-0/+21
This function is to be used during live migration. Every write access to the guest memory should call this funcion so the Xen tools knows which pages are dirty. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2012-10-03QMP, Introduce xen-set-global-dirty-log command.Anthony PERARD1-0/+15
This command is used during a migration of a guest under Xen. It calls memory_global_dirty_log_start or memory_global_dirty_log_stop according to the argument pass to the command. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
2012-08-22xen-all.c: fix multiply issue for int and uint typesDongxiao Xu1-8/+16
If the two multiply operands are int and uint types separately, the int type will be transformed to uint firstly, which is not the intent in our code piece. The fix is to add (int64_t) transform for the uint type before the multiply. Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2012-07-12memory: pass EventNotifier, not eventfdPaolo Bonzini1-2/+4
Under Win32, EventNotifiers will not have event_notifier_get_fd, so we cannot call it in common code such as hw/virtio-pci.c. Pass a pointer to the notifier, and only retrieve the file descriptor in kvm-specific code. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2012-06-21Introduce Xen PCI Passthrough, qdeviceAllen Kay1-0/+12
A more complete history can be found here: git://xenbits.xensource.com/qemu-xen-unstable.git Signed-off-by: Allen Kay <allen.m.kay@intel.com> Signed-off-by: Guy Zana <guy@neocleus.com> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2012-05-17Call xc_domain_shutdown with the reboot flag when the guest requests a reboot.John V. Baboval1-7/+11
Signed-off-by: John V. Baboval <john.baboval@virtualcomputer.com> Signed-off-by: Tom Goetz <tom.goetz@virtualcomputer.com> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2012-05-17xen: disable rtc_clockStefano Stabellini1-0/+4
rtc_clock is only used by the RTC emulator (mc146818rtc.c), however Xen has its own RTC emulator in the hypervisor so we can disable it. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2012-04-17xen: add a dummy xc_hvm_inject_msi for Xen < 4.2Stefano Stabellini1-1/+1
xc_hvm_inject_msi is only available on Xen >= 4.2: add a dummy compatibility function for Xen < 4.2. Also enable msi support only on Xen >= 4.2. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Anthony PERARD <anthony.perard@citrix.com>
2012-04-13xen: introduce an event channel for buffered io event notificationsStefano Stabellini1-6/+39
Use the newly introduced HVM_PARAM_BUFIOREQ_EVTCHN to receive notifications for buffered io events. After the first notification is received leave the event channel masked and setup a timer to process the rest of the batch. Once we have completed processing the batch, unmask the event channel and delete the timer. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2012-04-13Xen: basic HVM MSI injection support.Wei Liu1-0/+5
Signed-off-by: Wei Liu <wei.liu2@citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2012-03-19Merge remote-tracking branch 'sstabellini/saverestore-8' into stagingAnthony Liguori1-2/+102
* sstabellini/saverestore-8: xen: do not allocate RAM during INMIGRATE runstate xen mapcache: check if memory region has moved. xen: record physmap changes to xenstore Set runstate to INMIGRATE earlier Introduce "xen-save-devices-state" cirrus_vga: do not reset videoram Conflicts: qapi-schema.json Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-03-19xen: do not allocate RAM during INMIGRATE runstateAnthony PERARD1-0/+8
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2012-03-19xen mapcache: check if memory region has moved.Anthony PERARD1-1/+17
This patch changes the xen_map_cache behavior. Before trying to map a guest addr, mapcache will look into the list of range of address that have been moved (physmap/set_memory). There is currently one memory space like this, the vram, "moved" from were it's allocated to were the guest will look into. This help to have a succefull migration. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2012-03-19xen: record physmap changes to xenstoreStefano Stabellini1-1/+77
Write to xenstore any physmap changes so that the hypervisor can be aware of them. Read physmap changes from xenstore on boot. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2012-03-14Rename CPUState -> CPUArchStateAndreas Färber1-2/+2
Scripted conversion: for file in *.[hc] hw/*.[hc] hw/kvm/*.[hc] linux-user/*.[hc] linux-user/m68k/*.[hc] bsd-user/*.[hc] darwin-user/*.[hc] tcg/*/*.[hc] target-*/cpu.h; do sed -i "s/CPUState/CPUArchState/g" $file done All occurrences of CPUArchState are expected to be replaced by QOM CPUState, once all targets are QOM'ified and common fields have been extracted. Signed-off-by: Andreas Färber <afaerber@suse.de> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
2012-03-01Merge remote-tracking branch 'qemu-kvm/memory/core' into stagingAnthony Liguori1-1/+32
* qemu-kvm/memory/core: (30 commits) memory: allow phys_map tree paths to terminate early memory: unify PhysPageEntry::node and ::leaf memory: change phys_page_set() to set multiple pages memory: switch phys_page_set() to a recursive implementation memory: replace phys_page_find_alloc() with phys_page_set() memory: simplify multipage/subpage registration memory: give phys_page_find() its own tree search loop memory: make phys_page_find() return a MemoryRegionSection memory: move tlb flush to MemoryListener commit callback memory: unify the two branches of cpu_register_physical_memory_log() memory: fix RAM subpages in newly initialized pages memory: compress phys_map node pointers to 16 bits memory: store MemoryRegionSection pointers in phys_map memory: unify phys_map last level with intermediate levels memory: remove first level of l1_phys_map memory: change memory registration to rebuild the memory map on each change memory: support stateless memory listeners memory: split memory listener for the two address spaces xen: ignore I/O memory regions memory: allow MemoryListeners to observe a specific address space ...
2012-02-29memory: support stateless memory listenersAvi Kivity1-0/+16
Current memory listeners are incremental; that is, they are expected to maintain their own state, and receive callbacks for changes to that state. This patch adds support for stateless listeners; these work by receiving a ->begin() callback (which tells them that new state is coming), a sequence of ->region_add() and ->region_nop() callbacks, and then a ->commit() callback which signifies the end of the new state. They should ignore ->region_del() callbacks. Signed-off-by: Avi Kivity <avi@redhat.com>
2012-02-29xen: ignore I/O memory regionsAvi Kivity1-1/+1
Signed-off-by: Avi Kivity <avi@redhat.com>
2012-02-29memory: allow MemoryListeners to observe a specific address spaceAvi Kivity1-1/+1
Ignore any regions not belonging to a specified address space. Signed-off-by: Avi Kivity <avi@redhat.com>
2012-02-29memory: move ioeventfd ops to MemoryListenerAvi Kivity1-0/+14
This way the accelerator (kvm) can handle them directly. Signed-off-by: Avi Kivity <avi@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
2012-02-29memory: switch memory listeners to a QTAILQAvi Kivity1-0/+1
This allows reverse iteration, which in turns allows consistent ordering among multiple listeners: l1->add l2->add l2->del l1->del Signed-off-by: Avi Kivity <avi@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
2012-02-24suspend: switch acpi s3 to new infrastructure.Gerd Hoffmann1-5/+6
This patch switches pc s3 suspend over to the new infrastructure. The cmos_s3 qemu_irq is killed, the new notifier is used instead. The xen hack goes away with that too, the hypercall can simply be done in a notifier function now. This patch also makes the guest actually stay suspended instead of leaving suspend instantly, so it is useful for more than just testing whenever the suspend/resume cycle actually works. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-25memory: change dirty setting APIs to take a sizeBlue Swirl1-1/+2
Instead of each target knowing or guessing the guest page size, just pass the desired size of dirtied memory area. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2012-01-13prepare for future GPLv2+ relicensingPaolo Bonzini1-0/+2
All files under GPLv2 will get GPLv2+ changes starting tomorrow. event_notifier.c and exec-obsolete.h were only ever touched by Red Hat employees and can be relicensed now. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2012-01-05xen: Fix after recent change in dirty bitmap tracking.Anthony PERARD1-20/+18
A recent patch set from Avi break the dirty bitmap support of Xen. But this is because xen_sync_dirty_bitmap will return an error for an unhandled memory range (a0000 - bffff). However this is not a fatal error, so we should just continue instead of aborting. There is now an error printed when the Xen call failed. Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2012-01-04xen: convert framebuffer dirty tracking to memory APIAvi Kivity1-3/+2
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@redhat.com>
2012-01-04vmstate, memory: decouple vmstate from memory APIAvi Kivity1-1/+2
Currently creating a memory region automatically registers it for live migration. This differs from other state (which is enumerated in a VMStateDescription structure) and ties the live migration code into the memory core. Decouple the two by introducing a separate API, vmstate_register_ram(), for registering a RAM block for migration. Currently the same implementation is reused, but later it can be moved into a separate list, and registrations can be moved to VMStateDescription blocks. Signed-off-by: Avi Kivity <avi@redhat.com>
2012-01-03xen: convert to MemoryListener APIAvi Kivity1-58/+82
Signed-off-by: Avi Kivity <avi@redhat.com>
2011-12-20xen, vga: add API for registering the framebufferAvi Kivity1-0/+6
Xen currently uses the name of a memory region to determine whether it is the framebuffer. Replace with an explicit API. Signed-off-by: Avi Kivity <avi@redhat.com>
2011-12-19xen: convert to memory APIAvi Kivity1-19/+22
Undo the private implementation of qemu_ram_alloc(); use the global one (which calls right back into xen_ram_alloc()). Signed-off-by: Avi Kivity <avi@redhat.com>
2011-12-19memory, xen: pass MemoryRegion to xen_ram_alloc()Avi Kivity1-1/+1
Currently xen_ram_alloc() relies on ram_addr, which is going away. Give it something else to use as a cookie. Signed-off-by: Avi Kivity <avi@redhat.com>
2011-09-15Drop the vm_running global variableLuiz Capitulino1-1/+1
Use runstate_is_running() instead, which is introduced by this commit. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2011-09-15Replace the VMSTOP macros with a proper state typeLuiz Capitulino1-4/+6
Today, when notifying a VM state change with vm_state_notify(), we pass a VMSTOP macro as the 'reason' argument. This is not ideal because the VMSTOP macros tell why qemu stopped and not exactly what the current VM state is. One example to demonstrate this problem is that vm_start() calls vm_state_notify() with reason=0, which turns out to be VMSTOP_USER. This commit fixes that by replacing the VMSTOP macros with a proper state type called RunState. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2011-09-09xen: use uint64_t instead of target_ulong in cpu_ioreq_moveStefano Stabellini1-1/+1
cpu_ioreq_move might move 8 bytes at a time so we must make sure that the temporary variable can hold 8 bytes. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2011-08-20Use glib memory allocation and free functionsAnthony Liguori1-7/+7
qemu_malloc/qemu_free no longer exist after this commit. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-07-26xen: Fix the memory registration to reflect of what is done by Xen.Anthony PERARD1-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>
2011-07-26cpu-common: Have a ram_addr_t of uint64 with Xen.Anthony PERARD1-1/+1
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>
2011-07-26xen: introduce xen_change_state_handlerAnthony PERARD1-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>
2011-07-23notifier: Pass data argument to callbackJan Kiszka1-1/+1
This allows to pass additional information to the notifier callback which is useful if sender and receiver do not share any other distinct data structure. Will be used first for the clock reset notifier. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-07-17xen_console: support the new extended xenstore protocolStefano Stabellini1-0/+60
Since CS 21994 on xen-unstable.hg and CS 466608f3a32e1f9808acdf832a5843af37e5fcec on qemu-xen-unstable.git, few changes have been introduced to the PV console xenstore protocol, as described by the document docs/misc/console.txt under xen-unstable.hg. From the Qemu point of view, very few modifications are needed to correctly support the protocol: read from xenstore the "output" node that tell us what the output of the PV console is going to be. In case the output is a tty, write to xenstore the device name. Changes in v2: - fix error paths: free malloc'ed strings and close the xenstore connection before returning; - remove useless snprintf in xenstore_store_pv_console_info if i == 0. Changes in v3: - replace xs_daemon_open/xs_daemon_close with xs_open/xs_close. Changes in v4: - add a compatibility implementation of xs_open/xs_close. Changes in v5: - fix code style. [agraf] fix build error due to missing stub Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2011-07-17xen: add vkbd support for PV on HVM guestsStefano Stabellini1-0/+1
Register the vkbd backend even when running as device emulator for HVM guests: it is useful because it doesn't need a frequent timer like usb. Check whether the XenInput DisplayState has been set in the initialise state, rather than the input state. In case the DisplayState hasn't been set and there is no vfb for this domain, then set the XenInput DisplayState to the default one. Changed in v2: - use qemu_free instead of free; Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2011-07-17xen: enable console and disk backend in HVM modeStefano Stabellini1-0/+8
Initialize the Xen console backend and the Xen disk backend even when running in HVM mode so that PV on HVM drivers can connect to them. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2011-07-17xen: Clean up map cache API namingJan Kiszka1-2/+2
The map cache is a Xen thing, so its API should make this clear. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2011-06-22Merge remote-tracking branch 'qmp/for-anthony' into stagingAnthony Liguori1-1/+1
2011-06-19xen: only track the linear framebufferStefano Stabellini1-0/+14
Xen can only do dirty bit tracking for one memory region, so we should explicitly avoid trying to track anything but the vga vram region. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Alexander Graf <agraf@suse.de>