aboutsummaryrefslogtreecommitdiffstats
path: root/tools/ioemu
Commit message (Collapse)AuthorAgeFilesLines
* Remove internal tools/ioemu tree.Keir Fraser2008-09-18439-203956/+0
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* ioemu: Fix bug in map cacheKeir Fraser2008-09-091-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | This small patch fixes an issue leading to a crash (segfault, although with earlier changesets I was seeing sigbus - not sure what changed) in qemu-dm when the following conditions occur: 1. A valid mapping for a bucket on a low address exists 2. Immediately after accessing memory mapped in this bucket, an access occurs to a high (beyond assigned ram) address beyond the 1GB limit for 32bit map cache wrapping around to the previous bucket's entry number. 3. The next call to map cache again accesses the low address. In this scenario, the guest mem for the low bucket has been unmapped by the remap_bucket caused by 2., but because the valid_mapping bit-test fails, map_cache returns before last_address_index has been updated. The subsequent call to map_cache therefore never remaps the low, valid bucket and instead returns a vaddr pointing to memory that has failed to get mapped. Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com>
* ioemu: various fixes to 18394:dade7f0bdc8dKeir Fraser2008-09-092-1/+10
| | | | | | | | | | | | | - fix ioemu segv with old firmware Without notifying ioemu of address, ioemu will segv. - fix qemu-dm segv with malicous firmware If notifying ioemu more than once, ioemu will segv. Usually such cases don't happen, but malicious guest can do it intentionally. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
* ioemu: fix offset of MSI-X memory-mapped table.Keir Fraser2008-09-051-1/+1
| | | | | | | | | Current code does not set dev->msix->table_off variable. The offset of MSI-X memory mapped table is treated as 0. The wrong region is unmapped from guest physical memory space. As a result, guest device driver can't access memory mapped resource. Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
* ioemu: support PCI Express Capability Structure version 1.Keir Fraser2008-09-042-4/+155
| | | | Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
* ioemu: fix multiple pci-attach/pci-detach by removing the meaningless irq_indexKeir Fraser2008-09-012-7/+0
| | | | | | | | For HVM guest, we can't do pci-attach/pci-detach for >64 times due to the meaningless checking in pci_register_device(). I made a test of 300 times of attach/detach and everything now works well. Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
* ioemu, passthru: make upper field of 64 bit bar writable.Keir Fraser2008-08-281-5/+0
| | | | Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
* ioemu: Add SEEK_STAT in all non-error cases except sleep request,Keir Fraser2008-08-271-14/+14
| | | | | | | | since our seek times are virtually 0. Although this flag is deprecated by newer ATA standards, Linux at least checks it for CD drives, and would timeout in some cases if we do not set it. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* hvm: Use main memory for video memory.Keir Fraser2008-08-276-198/+223
| | | | | | | | | | | | | | | | | | | | | | | | | | When creating an HVM domain, if e.g. another domain is created before qemu allocates video memory, the extra 8MB memory ballooning is not available any more, because it got consumed by the other domain. This fixes it by taking video memory from the main memory: - make hvmloader use e820_malloc to reserve some of the main memory and notify ioemu of its address through the Xen platform PCI card. - add XENMAPSPACE_mfn to the xen_add_to_physmap memory op, to allow ioemu to move the MFNs between the original position and the PCI mapping, when LFB acceleration is disabled/enabled - add a remove_from_physmap memory op, to allow ioemu to unmap it completely for the case of old guests with acceleration disabled. - add xc_domain_memory_translate_gpfn_list to libxc to allow ioemu to get the MFNs of the video memory. - have xend save the PCI memory space instead of ioemu: if a memory page is there, the guest can access it like usual memory, so xend can safely be responsible to save it. The extra benefit is that live migration will apply the logdirty optimization there too. - handle old saved images, populating the video memory from ioemu if really needed. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* ioemu: Fix unmapping issue on hot-removing pass-thru deviceKeir Fraser2008-08-201-1/+1
| | | | Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
* MSI-X: enhancementKeir Fraser2008-08-132-14/+11
| | | | Signed-off-by: Yu Zhao <yu.zhao@intel.com>
* prefix mini-os lists with minios_, drop QEMU_ prefix from QEMU_LIST_*Keir Fraser2008-08-0810-70/+70
| | | | | | That permits to reduce the amount of difference with upstream. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* ioemu: fix typo in serial emulationKeir Fraser2008-08-081-1/+1
| | | | | | | There is a small bug on the serial emulation code that prevents kgdb from working correctly over the serial. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* ioemu-stubdom: fix initialization of vm_change_state_headKeir Fraser2008-08-061-0/+2
| | | | | | | That is actually a no-op since it just sets it to NULL again, but makes sense. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* ioemu: Fix I/O BAR mapping problemKeir Fraser2008-08-061-1/+3
| | | | | | | Check BAR type indicator to avoid I/O BAR being mistaken as 64-bit = memory BAR. Signed-off-by: Yu Zhao <yu.zhao@intel.com>
* ioemu: fix a bug in serial_loadKeir Fraser2008-08-061-1/+0
| | | | | | | Currently we are trying to read the same value twice in the serial_load function, this patch fixes that. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* ioemu: Do not pass -m (memory) option to qemu, as ioemu-remote rejectsKeir Fraser2008-08-051-11/+8
| | | | | | | | | memory sizes greater than 2GB when built as a 32-bit binary. Instead, direct HVM Linux loading approximates end of low memory via a different method. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* stubdom: fix read-only disks accessKeir Fraser2008-08-041-0/+4
| | | | | | | There is no need for a flush on read-only disks. It would actually even error out and disturb the guest. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* ioemu, passthrough: fix flag for expansion rom base address register.Keir Fraser2008-08-011-0/+7
| | | | | | | | | | | | | | | pt_bar_reg_parse() is called for expansion rom base address register. Currently it returns PT_BAR_FLAG_MEM if bit 0 is 0. It returns PT_BAR_FLAG_IO if bit 0 is 1. But bit 0 in expansion rom base address register is enable bit. If bit 0 is 1 for some reason, it returns PT_BAR_FLAG_IO. Expansion rom is mapped to memory space. It should return PT_BAR_FLAG_MEM. After applying this patch, it returns PT_BAR_FLAG_MEM regardless of bit 0, when it is called for expansion rom base address register. Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
* ioemu, passthrough: fix corrupting register value in pt_pci_write_config().Keir Fraser2008-08-011-1/+2
| | | | | | | | | I forgot to shift value read from real device. If the emulated register offset is not aligned with 4 byte, the write emulation will not be handled well because of corrupting register value read from real device. The patch fixes this issue. Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
* ioemu: fix libpci error handling.Keir Fraser2008-08-011-6/+4
| | | | | | | | | | | libpci returns ALL F when error occurs. Currently, if libpci returns ALL F, emulation stops. But it is possible that the field of real register which is read by guest software is ALL F. After applying this patch, if libpci returns ALL F, ioemu will log warning message and continue the emulation. Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
* ioemu, passthrough: fix writing handlers for base address registers.Keir Fraser2008-08-011-80/+99
| | | | | | | | | | | | | | | | This patch fixes writing handlers for base address registers (include expansion rom base address register) as follows. It can be applied to both ioemu-remote and ioemu. - Current implementation can not work fine when base address registers are accessed via 1 byte write access and 2 byte write access. This patch enables them. - Currently guest software can set address which is not aligned with resource size and page size. The patch does not allow guest software to set unaligned address. Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
* ioemu, passthrough: fix log messages and commentsKeir Fraser2008-08-012-47/+61
| | | | | | | | | | | | - fix log messages to make analysis easier when issue occurs. - remove verbose message. - add comments in the source code. - fix wrong comments in the source code. Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
* ioemu: fix warnings in pass-through.h and pass-through.cKeir Fraser2008-07-302-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch backports following changes of ioemu-remote to ioemu. It fixs warning in tools/ioemu/hw/pass-through.h and tools/ioemu/hw/pass-through.c. commit 30f00a0284a5ee356de6f6095e52173f2234145b Author: Ian Jackson <ian.jackson@eu.citrix.com> Date: Fri Jul 18 16:02:23 2008 +0100 hw/pass-through.c: pt_unregister_regions returns void It only ever falls off the end, and its return value is not used by its one caller. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> commit 439836900dad41f66234d2a14981aa2a90d4d346 Author: Ian Jackson <ian.jackson@eu.citrix.com> Date: Tue Jul 22 11:55:18 2008 +0100 Add missing cast for printf of maddr commit cf5b00e6b714eb5f900d55471d85956b09cb8fd9 Author: Ian Jackson <ian.jackson@eu.citrix.com> Date: Thu Jul 24 13:57:10 2008 +0100 pass-through.h: Sprinkle some #ifdefs to cope with pciutils-dev versions Some versions of pciutils-dev contain #defines which others are lacking. To avoid spurious compiler warnings we add some #ifdefs. *sigh* Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp> Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
* tools: remove type parameter from xc_physdev_map_pirq{,_msi}()Keir Fraser2008-07-242-6/+3
| | | | | | ... as it's implied by the function name. Signed-off-by: Jan Beulich <jbeulich@novell.com>
* ioemu: fix spurious track_dirty_vram warningKeir Fraser2008-07-241-2/+2
| | | | Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* ioemu: Fix hvmloader erroneous debugging printsKeir Fraser2008-07-221-3/+3
| | | | Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* ioemu: fix vram tracking when !s->lfb_addrKeir Fraser2008-07-221-41/+42
| | | | | | | When we don't have an LFB (standard VGA), we can not and do not need vram tracking at all since we always get explicit dirtying. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* ioemu: fix the devices loop.Keir Fraser2008-07-171-3/+7
| | | | | Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com> Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
* ioemu: Fix issues when passthrough device is hot-removed from HVM domain.Keir Fraser2008-07-163-1/+48
| | | | | | | | | | | When passthrough device is hot removed from HVM domain by "xm pci-detach" command, following issues occur. The patch fixes them. - Allocated memory is not deallocated. - Unbind interrupt with invalid interrupt pin. - MSI-X memory mapped register area is not unmapped. Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
* Revert 18025:07c7aef164 -- go back to 8MB VRAM.Keir Fraser2008-07-141-1/+1
| | | | | | | We may well want it in future anyway, and changing it makes save/restore compatibility difficult. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* ioemu: sdl without OpenGl fixKeir Fraser2008-07-141-2/+1
| | | | | Signed-off-by: Frederic Guihery <sygus@cat-lan.com> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* ioemu: drop shadow vramKeir Fraser2008-07-111-162/+37
| | | | | | | We can now actually drop the shadow vram entirely thanks to dirty page tracking. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* ioemu: drop unused 4MB video memoryKeir Fraser2008-07-101-1/+1
| | | | | | | Since we only emulate the cirrus VGA video card which is only able to expose 4MB video memory, we don't need more than that. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* ioemu: create a rom-protect platform flag.Keir Fraser2008-07-101-17/+73
| | | | | Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* ioemu: pass-through: XC_PAGE_SIZE should be usedKeir Fraser2008-07-091-1/+1
| | | | Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
* ioemu: pass-through: pt_bar_mapping fixKeir Fraser2008-07-091-8/+11
| | | | | | | | | | | In pt_bar_mapping function, r->addr should not be changed by invalid value(-1). This value(-1) causes failure of mapping BAR when I/O Space or Memory Space enable bit is updated repeatedly by native windows driver. This situation occurs in Windows Vista guest. Signed-off-by: Naoki Nishiguchi <nisiguti@jp.fujitsu.com>
* stubdom: Fix modified_memory size calculationKeir Fraser2008-07-081-2/+2
| | | | | | >> is less prioritized than - Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* Fix passthrough of PCI capability structures.Keir Fraser2008-07-081-2/+2
| | | | Signed-off-by: Naoki Nishiguchi <nisiguti@jp.fujitsu.com>
* ioemu: e1000: fix a TSE bugKeir Fraser2008-07-071-19/+32
| | | | | | | | Previously, all data descriptors used TSE context descriptor. It's not correct, per spec, data descriptor uses TSE bit to indicate whether use TSE. Legacy data descripter never use TSE. Signed-off-by; Anthony Xu <anthony.xu@intel.com>
* numa: Extend MEMOP_ allocation functions to take a node argument.Keir Fraser2008-07-051-2/+3
| | | | | | | | | The address_bits field will be limited to 8 bits and is now embedded in the mem_flags member, which additionally contains the node number (limited to 8 bit). Signed-off-by: Andre Przywara <andre.przywara@amd.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* ioemu: Support more Capability Structures (including MSI/MSI-X)Keir Fraser2008-07-046-638/+2476
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and Device Specific Registers for pt device. I implemented following Capability Structures and Device Specific Registers. * Configuration Header Type 0 -> emulation. "emulation" does not mean no accessing real I/O device. Access real I/O device, but guest value and real value might be different. * MSI Capability Structure -> emulation. Behavior is not changed from existed implementation in pt-msi.c, although code is changed. * MSI-X Capability Structure -> emulation. Behavior is not changed from existed implementation in pt-msi.c, although code is changed. * PCI Express Capability Structure -> emulation. * PCI Power Management Capability Structure -> emulation. * Vital Product Data Capability Structure -> emulation. Emulated register is only Next Capability Pointer Register. All other registers are passthrough. * Vendor Specific Capability Structure -> emulation Emulated register is only Next Capability Pointer Register. All other registers are passthrough. * Device Specific Register (exclude capability structures) -> passthrough. The device drivers in guest domain are allowed to access Device Specific Register. So various I/O device will work. I assigned following device to guest domain, and they worked fine. - PCIe NIC (MSI) - PCI NIC (MSI) - UHCI (INTx interrupt) - IDE Controller (INTx interrupt) Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
* ioemu: Explicitly define certain PCI/MSI macros.Keir Fraser2008-07-031-2/+24
| | | | | From: Haitao Shan <haitao.shan@intel.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* stubdom: PCI passthrough support via PV-PCIKeir Fraser2008-07-023-3/+4
| | | | Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* ioemu: Add check for mapping MSI pirqs.Keir Fraser2008-07-021-0/+7
| | | | | From: Haitao Shan <haitao.shan@intel.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* ioemu: limit xen-console bufferingKeir Fraser2008-07-011-2/+6
| | | | | | Set dom->buffer.max_capacity to xend configured limit. Signed-off-by: Pat Campbell <plc@novell.com>
* stubdom: add live migration support by having ioemu just notify theKeir Fraser2008-06-302-7/+17
| | | | | | | | | | hypervisor about memory changes. The impact on disk performance is typically making it from 71.5MBps down to 70.5Mbps during the live migration. The impact on network performance is actually even hard to measure. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* ioemu: Clean up after cset 17646:e3b13e1ecf6cKeir Fraser2008-06-271-2/+0
| | | | | | Remove redundant code. Signed-off-by: Markus Armbruster <armbru@redhat.com>
* ioemu: Fix usbdevice parameter to encode vbd type.Keir Fraser2008-06-183-4/+6
| | | | | | | | | usbdevice = "disk:<filename>" expect a raw device (as this probably is the most usual case) and usbdevice = "disk-qcow:<filename>" expect a COW image (autodetected, probably qcow2). Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* ioemu: generic PCI device config-space emulationKeir Fraser2008-06-186-0/+192
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is an extension for qemu-dm to enable emulation of generic PCI devices. The information for the PCI devices can be passed by command line parameter. The command line parameter is "-pciemulation" followed by the information which contains a label and hex value of the configuration registers separated by ":". The configuration registers for each PCI device are below. vendorid deviceid command status revision classcode headertype subvendorid subsystemid interruputline interruptpin This is an example of command line parameter. -pciemulation hba1:1240:0780:0002:0:0:010000:0:10b5:0777:05:1 Signed-off-by: Shinji Matsumoto <smatsumoto@marathontechnologies.com>