aboutsummaryrefslogtreecommitdiffstats
path: root/tools/ioemu
Commit message (Collapse)AuthorAgeFilesLines
...
| * stubdom: Disable PCI passthrough functionality for now.Keir Fraser2008-02-251-1/+1
| | | | | | | | Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
| * ioemu: Fix Solaris build.Keir Fraser2008-02-251-1/+1
| | | | | | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* | [IA64] Remove VL_LDFLAGS=ia64.ld from Makefile.targetAlex Williamson2008-02-251-4/+0
| | | | | | | | | | | | | | | | The ia64 custom linker script breaks cross compilation (see http://markmail.org/message/zowwwfs3mdipseiv) and seems to be unnecessary. Tested by building and running ia64 HVM domains. Signed-off-by: Aron Griffis <aron@hp.com>
* | [IA64] Fix qemu memory access on IA64Alex Williamson2008-02-222-6/+13
|/ | | | | | | | | | - Correct a parameter to xc_map_foreign_batch(). skipping vga hole. - sync_icache() might overrun a page boundary. qemu-dm will die. This re-enables HVM support after cset 99478ffd81ee8685e6376210a1bd654c3790bf8d in linux-2.6.18-xen.hg Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
* ioemu: Share framebuffer between VGA device model and VNC server.Keir Fraser2008-02-203-21/+46
| | | | | | | | | | | Now that the qemu WMVi patch is applied we can take full advantage of it sharing the video buffer between the vga driver and the qemu vnc server. This saves a lot of memcpy. It's worth mentioning again that when the guest colour depth is 24 bit we cannot share the buffer because 24 bpp is not supported by the vnc protocol, so we still have to do the translation 24 bpp -> 32 bpp. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* ioemu: Do proper block device extent checks.Keir Fraser2008-02-201-6/+35
| | | | Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* x86 hvm: Replace old MMIO emulator with x86_emulate()-based harness.Keir Fraser2008-02-201-106/+1
| | | | | Re-factor VMX real-mode emulation to use the same harness. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* ioemu: Fix the build.Keir Fraser2008-02-154-73/+64
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* Enable HVM guest VT-d device hotplug via a simple ACPI hotplug device model.Keir Fraser2008-02-158-25/+839
| | | | | | | | | | | | | | | | | | | | | | | | | | | ** Currently only 2 virtual hotplug pci slots(6~7) are created so more than 2 vtd dev can't be hotplugged, but we can easily extend it in future. Three new commands are added: "xm pci-list domid" show the current assigned vtd device, like: VSlt domain bus slot func 0x6 0x0 0x02 0x00 0x0 "xm pci-detach" hot remove the specified vtd device by the virtual slot, like: xm pci-detach EdwinHVMDomainVtd 6 "xm pci-attach DomainID dom bus dev func [vslot]" hot add a new vtd device in the vslot. If no vslot specified, a free slot will be picked up. e.g. to insert '0000:03:00.0': xm pci-attach EdwinHVMDomainVtd 0 3 0 0 ** guest pci hotplug linux: pls. use 2.6.X and enable ACPI PCI hotplug ( Bus options=> PCI hotplug => ACPI PCI hotplug driver ) windows: 2000/xp/2003/vista are all okay Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
* hvm acpi: Expose \_S4 ACPI object, allowing suspend-to-disk.Keir Fraser2008-02-151-6/+19
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* ioemu: Support the WMVi pseudoencoding in the vnc server.Keir Fraser2008-02-142-49/+66
| | | | | | | If the client implements it, it is supposed to be able to change colour depth when receiving a WMVi message. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* ioemu: Stub out direct-Linux-boot support for anything other than x86.Keir Fraser2008-02-141-0/+9
| | | | Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
* ioemu: backport upstream's qemu_memalign.Keir Fraser2008-02-146-5/+31
| | | | Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* stubdom: optimize block io completion polling by not polling all theKeir Fraser2008-02-141-3/+7
| | | | | | time; only when some requests have completed. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* Add stubdomain support. See stubdom/README for usage details.Keir Fraser2008-02-1213-25/+510
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Move PAGE_SIZE and STACK_SIZE into __PAGE_SIZE and __STACK_SIZE in arch_limits.h so as to permit getting them from there without pulling all the internal Mini-OS defines. - Setup a xen-elf cross-compilation environment in stubdom/cross-root - Add a POSIX layer on top of Mini-OS by linking against the newlib C library and lwIP, and implementing the Unixish part in mini-os/lib/sys.c - Cross-compile zlib and libpci too. - Add an xs.h-compatible layer on top of Mini-OS' xenbus. - Cross-compile libxc with an additional xc_minios.c and a few things disabled. - Cross-compile ioemu with an additional block-vbd, but without sound, tpm and other details. A few hacks are needed: - Align ide and scsi buffers at least on sector size to permit direct transmission to the block backend. While we are at it, just page-align it to possibly save a segment. Also, limit the scsi buffer size because of limitations of the block paravirtualization protocol. - Allocate big tables dynamically rather that letting them go to bss: when Mini-OS gets installed in memory, bss is not lazily allocated, and doing so during Mini-OS is unnecessarily trick while we can simply use malloc. - Had to change the Mini-OS compilation somehow, so as to export Mini-OS compilation flags to the Makefiles of libxc and ioemu. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* libxenctrl headers should not pollute macro namespace withKeir Fraser2008-02-123-11/+11
| | | | | | | mb/rmb/wmb. Instead add a xen_ prefix. Modify Xen's public headers to expect the prefixed names instead of bare mb/rmb/wmb, but gate this expectation on a bump of __XEN_INTERFACE_VERSION__. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* device-dm: Use SIGHUP before SIGKILLKeir Fraser2008-02-121-2/+4
| | | | | | | | | Make qemu unblock SIGHUP and make sure the default handler is in place. Have the domain killer send SIGHUP to the device-model script, allow the script 10s to clean up, and if still not dead, send SIGKILL. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* ioemu: Dynamic VNC colour depth.Keir Fraser2008-02-117-80/+207
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The qemu vnc server changes its internal colour depth based on the client request. This way just one colour conversion is done: the one in vga_template.h, from the guest colour depth and the vnc server internal colour depth. This patch is meant to remove this colour conversion to improve performances. It accomplishes the goal making the qemu internal colour depth always the same as the guest colour depth. The basic idea is that the vnc client is the one that should do the colour conversion, if necessary. In general it should accept the pixel format suggested by the server during the initial negotiation. This behaviour can be set in most vnc clients (vncviewer included). If the guest changes colour depth, the qemu vnc server changes colour depth too and notifies the client. The problem is that the vnc protocol doesn't provide a message from the server to the client to ask for a colour depth change. So what I am doing is either: 1) quietly starting to do the conversion on vnc server (not gaining any performance here); 2) closing the vnc connection with the client, so the client can reconnect and choose the new pixel format. By default I am doing 1), however the second choice can be enabled passing the -vnc-switch-bpp command line option. In order to do the colour conversion on the vnc server I had to improve the colour conversion code already in place because it only supported conversions from 32 bpp. The patch adds colour conversion code that support conversions from any resolution to any resolution. A last note: to get most out of this patch it is best to set Windows to 16 bit colour depth, because the 24 bit mode is 24 bit depth and 24 bpp, meaning no alpha channel. The vnc protocol doesn't support 24 bpp, only 32 bpp, so this conversion is unavoidable. From: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* ioemu: save 3MB of ioport tables (on 64bit machines)Keir Fraser2008-02-111-20/+40
| | | | | | by keeping then initialized to NULL and check for it in the handlers. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* ioemu: cope with partial reads/writes when using the read()/write()Keir Fraser2008-02-111-6/+19
| | | | | syscall interfaces. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* ioemu stubdom: make daemonize optionalKeir Fraser2008-02-111-2/+13
| | | | Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* ioemu: some ifndef NO_UNIX_SOCKETS were missingKeir Fraser2008-02-112-8/+8
| | | | Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* ioemu: make AIO optional (already done upstream)Keir Fraser2008-02-111-0/+8
| | | | Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* ioemu: fix compilation without softfloatKeir Fraser2008-02-112-0/+14
| | | | Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* ioemu stubdom: make TPM optionalKeir Fraser2008-02-112-0/+3
| | | | Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* qemu: Queue mouse clicks.Keir Fraser2008-02-112-15/+82
| | | | | | | | | qemu doesn't enqueue mouse events, just records the latest mouse state. This can cause some lost mouse double clicks if the events are not processed fast enought. This patch implements a simple queue for left mouse click events. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
* ioemu: use POSIX int type.Keir Fraser2008-02-071-1/+1
| | | | Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* ioemu: Fix build after LIST->QEMU_LIST changes.Keir Fraser2008-02-072-8/+8
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* ioemu: avoid name clashes due to LIST_* macrosKeir Fraser2008-02-075-48/+48
| | | | | | | | | | | | | | | | | | | | | Here is what I wrote in my submission to qemu upstream: qemu's audio subdirectory contains a copy of BSD's sys-queue.h, which defines a bunch of LIST_ macros. This makes it difficult to build a program made partly out of qemu and partly out of the Linux kernel[1], since Linux has a different set of LIST_ macros. It might also cause trouble when mixing with BSD-derived code. Under the circumstances it's probably best to rename the versions in qemu. The attached patch does this. [1] You might well ask why anyone would want to do this. In Xen we are moving our emulation of IO devices from processes which run on the host into a dedicated VM (one per actual VM) which we call a `stub domain'. This dedicated VM runs a very cut-down `operating system' which uses some code from Linux. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* ioemu: config cleanup re AF_UNIX sockets on non-WindowsKeir Fraser2008-02-073-2/+9
| | | | | | | | | | | | Here is what I wrote in my submission to qemu upstream: The patch below makes it possible to disable AF_UNIX (unix-domain) sockets in host environments which do not define _WIN32, by adding -DNO_UNIX_SOCKETS to the compiler flags. This is useful in the effectively-embedded qemu host which are going to be using for device emulation in Xen. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* Revert 16947:32b898768217027. Breaks HVM qcow-backed discs.Keir Fraser2008-02-044-11/+7
| | | | Sigend-off-by: Keir Fraser <keir.fraser@citrix.com>
* Revert 16963:d29d74d4eeac and 16750:2ac0fd9fd4b4.Keir Fraser2008-02-031-27/+4
| | | | | | Continue to SIGKILL qemu-dm so that 'xm destroy' should always work rather than hang if qemu-dm is in a bad state. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* hvm: Fix 'xm save' bug in qhich qemu-dm ignores SIGTERM.Keir Fraser2008-02-011-2/+19
| | | | | | | | | | | | | | | | When saving a guest in early ChangeSet (Before 16750), Xend will send "SIGKILL" signal to kill qemu process. But in ChangeSet 16750, the signal is modified to "SIGTERM". However, "SIGTERM" handler has been registered by SDL in qemu. So when qemu process receives a "SIGTERM", SDL will catch it and it will push out a "SDL_QUIT" even to qemu. If qemu can receive that event, it will be successfully terminated. While we do "xm save", qemu can't go out from the dead loop "while (suspend_requested) {...}" in main_loop() to handle the SQL_QUIT event. So it is unable to poll that "SDL_QUIT" event. This makes xm save command hang. This fix enables qemu to poll the "SDL_QUIT" event while doing save. Signed-off-by: Xu Dongxiao <dongxiao.xu@intel.com>
* Direct Linux boot: Support booting non-relocatable Linux kernels.Keir Fraser2008-02-011-2/+93
| | | | | | | | | | | | | | | | | | | | | This patch introduces a hack to make non-relocatable kernels bootable too. Non-relocatable kernels absolutely want to run at 0x100000 and are not at all happy about being at 0x200000. Fortunately, thanks to crazy programs like LOADLIN, Linux has a couple of hooks in its boot process which can be used to play games. The 'code32_switch' hook is executed immediately following the switch to protected mode. So, this patch installs a hook at 0x200000+kernel_size. The hook is hand crafted assembly which sets up all the segments as needed, then essentially does memmove(0x100000,0x200000,kernel_size) and finally does an unconditional jmp to 0x100000. Amazingly this actually really does work. It has been successfully tested with RHEL-2.1 and Fedora Core 6 install kernels on i386, and Fedora Core 6 and 7 kernels on x86_64. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Direct Linux boot: Support booting relocatable Linux kernels.Keir Fraser2008-02-011-88/+266
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces the basic infrastructure for direct kernel boot in the ioemu copy of QEMU. The current #ifdef disabled code is actually obsolete wrt to upstream QEMU code. So this is removed entirely. In its place I have imported the latest upstream QEMU code. The QEMU code assumes that the guest RAM is directly mapped into the QEMU process, so there were some changes neccessary. Instead of strcpy/memcpy'ing the args and kernel header into guest RAM, cpu_physical_memory_rw is used. Intead of fread() the initrd and kernel into guest RAM a helper function is used fread2guest which reads into a small buffer and then uses cpu_physical_memory_rw. NB in reading the following, Documentation/i386/boot.txt is a useful reference for what's going on. Next, instead of loading the kernel at 0x100000, this code loads it at 0x200000. This is far enough away that there's no risk of it overlapping with the HVM firmware image. If the Linux kernel boot protocol is 0x205 or later, and the flag at offset 0x234 in the kernel header is 1, then the guest kernel was built with CONFIG_RELOCATABLE=y. In this scenario we merely need to tell the kernel what address it has been relocated to by writing 0x200000 into the kernel header at offset 0x214. When switching from real mode into protected mode the kernel will immediately start executing at 0x200000 and be happy with life. This should work for 2.6.20 or later on i386, and 2.6.22 or later on x86_64. This has been verified with Fedora 7 and Fedora 8 bare metal kernels on i386 and x86_64 from the $TREE/images/pxeboot of the install trees. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* ioemu: Stop PV guest from parsing xenstore and opening block devices.Keir Fraser2008-01-314-7/+11
| | | | | | | | | | | PV guests are now using QEMU for a vncserver. During initialization of QEMU xenstore_parse_config() is being called causing PV guests to open block devices. This patch makes a new function, xenstore_daemon_open(), so that the vnc password functions have an open xenstore handle and moves xenstore_parse_config() into the FV machine specific init function. Signed-off-by: Pat Campbell <plc@novell.com>
* ioemu: Fix xenstore access changes.Keir Fraser2008-01-301-8/+3
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* ioemu: strip tap subtype prefix from image nameKeir Fraser2008-01-301-3/+26
| | | | | | | | | | | | | | | Currently I am not able to mount or boot from an HVM CDROM when it is configured for 'tap:aio' instead of 'file'. disk=[ 'tap:aio:/var/lib/xen/images/sles10-sp2-fv/disk0,hda,w', ' tap:aio:/home/iso/sles/SLES10.iso,hdc:cdrom,r', ] With this patch I am able to boot from the CDROM and or mount it. Patch changes xenstore.c:xenstore_process_event() to strip the tap subtype prefix from the image name. Signed-off-by: Pat Campbell <plc@novell.com>
* ioemu: use standard uint8_t instead of uint8 in new e100 s/r codeKeir Fraser2008-01-301-2/+2
| | | | Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* ioemu: Better fix for SB16 infinite looping.Keir Fraser2008-01-302-4/+18
| | | | | | | | | | Qemu upstream solves "Fix an infinite loop in the emulated SB16 device" issue differently as stated in [2] [1] http://xenbits.xensource.com/xen-3.1-testing.hg?rev/4b22d472bda6 [2] http://lists.gnu.org/archive/html/qemu-devel/2008-01/msg00709.html Signed-off-by: S. Caglar Onur <caglar@pardus.org.tr>
* ioemu: Add support for e100 nic save/restore.Keir Fraser2008-01-291-3/+144
| | | | Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
* Move generation of public header hierarchy into the tools.Keir Fraser2008-01-261-0/+1
| | | | | | | This patch merges the two versions of public header generation currently used in the build into one. Signed-off-by: Bastian Blank <waldi@debian.org>
* vt-d: Do FLR of assigned devices with VT-dKeir Fraser2008-01-241-54/+1
| | | | | | | | | | | | | Currently there is a pdev_flr() function to do FLR before device assignment in qemu, but most of devices don't have FLR capability. What's more, should do FLR before assignment and deassignment for keeping correct device status. If the device doesn't have FLR capablility, this patch implemented to enter D3hot and return to D0 to do FLR. And exposed pdev_flr() in VT-d utils, then it can be invoked by assignment and deassignment functions. Signed-off-by: Weidong Han <weidong.han@intel.com> Signed-off-by: Anthony Xu <anthony.xu@intel.com>
* ioemu: 'lib64' is Linux-specificKeir Fraser2008-01-241-1/+1
| | | | | | Only use libdir == 'lib64' on Linux. Signed-off-by: John Levon <john.levon@sun.com>
* ioemu: Improve xenstore_read_vncpasswd().Keir Fraser2008-01-241-10/+15
| | | | | From: Peter Johnston <peter.johnston@citrix.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* ioemu: handle empty vnc passwdKeir Fraser2008-01-233-18/+12
| | | | | | | | | | | | Have xenstore_read_vncpasswd return -1 when it is unable to read the passwd from XenStore (and store an empty password). However, don't exit in such case since it may just mean that the use didn't set a passwd. If he really did, xend would have given the passwd flag in the -vnc option, and the empty passwd would make the vnc authentication reject any password anyway. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com> Acked-by: Daniel P. Berrange <berrange@redhat.com>
* ioemu: Use asprintf instead of PATH_MAX, which POSIX says to be facultative.Keir Fraser2008-01-231-3/+3
| | | | Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* ioemu: fix xc_handle declarationKeir Fraser2008-01-231-1/+1
| | | | Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* ioemu: fix phys_ram_addr parameter usageKeir Fraser2008-01-231-1/+1
| | | | Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* ioemu: cache the BlockDriverState pointerKeir Fraser2008-01-231-4/+5
| | | | | | This actually fixes a bug in the scsi case. Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>