aboutsummaryrefslogtreecommitdiffstats
path: root/tools/ioemu/hw
Commit message (Collapse)AuthorAgeFilesLines
* Remove internal tools/ioemu tree.Keir Fraser2008-09-18122-70611/+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-011-5/+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-274-166/+220
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-082-10/+10
| | | | | | 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: 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>
* 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>
* 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: 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>
* 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>
* ioemu: Support more Capability Structures (including MSI/MSI-X)Keir Fraser2008-07-045-638/+2474
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-021-0/+1
| | | | 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>
* ioemu: Fix usbdevice parameter to encode vbd type.Keir Fraser2008-06-182-3/+3
| | | | | | | | | 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-183-0/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* ioemu: move xenfb frontend (used by stubdom) to its own file, since itKeir Fraser2008-06-172-315/+4
| | | | | | does not really belong to hw/, but to /, like sdl.c and vnc.c. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* ioemu: simplyfing vga_draw_text codeKeir Fraser2008-06-092-10/+6
| | | | Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* stubdom: simplify xenfb resize handlerKeir Fraser2008-06-091-29/+9
| | | | Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* stubdom: make non-VNC + stdvga workKeir Fraser2008-06-091-0/+5
| | | | Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* ioemu: cleaning DisplayState->dpy_resize interfaceKeir Fraser2008-06-094-78/+101
| | | | | | | | | | | Bring the DisplayState dpy_resize interface back to how it is in qemu mainstream, thus making the code easier to merge. In order to support sharing the framebuffer, I am adding a new resize interface called dpy_resize_shared that also has a depth and a pixels parameters. As a consequence I could remove the dpy_colourdepth callback and make the code cleaner and easier to read. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* ioemu: drop unused shared_vram variableKeir Fraser2008-05-221-2/+0
| | | | Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* ioemu: HVM virtual S3Keir Fraser2008-05-202-0/+19
| | | | | | | | | | | | | | - add S3 suspend logic in PM1A control register. when guest write specific value to this register, QEMU will trigger S3 sleep by * reset all qemu device * set CMOS shutdown status as S3 resume, so that rombios will do S3 resume later * request Xen to S3-suspend the guest Signed-off-by: Yu Ke <ke.yu@intel.com> Signed-off-by: Liping Ke <liping.ke@intel.com? Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* ioemu: Fix interpretation of missing or zero vfb videoramKeir Fraser2008-05-201-1/+1
| | | | | | | | | | Changeset 17289:d97e61001d81: introduced vfb configuration parameter videoram, defaulting to zero. Value zero was interpreted as unlimited. Changeset 17630:53195719f762 accidentally dropped the special case for zero, which broke guests that don't specify videoram, or specify videoram=0. Restore the old behavior. Signed-off-by: Markus Armbruster <armbru@redhat.com>
* ioemu: Fix load of PCI-device IRQ state after save/restore.Keir Fraser2008-05-191-1/+1
| | | | | From: Ian Jackson <Ian.Jackson@eu.citrix.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>