aboutsummaryrefslogtreecommitdiffstats
path: root/tools/ioemu/hw
Commit message (Collapse)AuthorAgeFilesLines
...
* ioemu: Fix the build.Keir Fraser2008-02-152-64/+58
| | | | 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-154-15/+695
| | | | | | | | | | | | | | | | | | | | | | | | | | | ** 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: 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-143-3/+8
| | | | Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* Add stubdomain support. See stubdom/README for usage details.Keir Fraser2008-02-123-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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-122-8/+8
| | | | | | | 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>
* ioemu: Dynamic VNC colour depth.Keir Fraser2008-02-111-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 stubdom: make TPM optionalKeir Fraser2008-02-111-0/+2
| | | | Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
* qemu: Queue mouse clicks.Keir Fraser2008-02-111-5/+63
| | | | | | | | | 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>
* Revert 16947:32b898768217027. Breaks HVM qcow-backed discs.Keir Fraser2008-02-041-2/+0
| | | | Sigend-off-by: Keir Fraser <keir.fraser@citrix.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-311-0/+2
| | | | | | | | | | | 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: 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>
* 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>
* hvm, ioemu: Fix the ide/cdrom emulation error on FC7 guest.Keir Fraser2008-01-221-1/+4
| | | | | | | | | | | | | | | | | | | | | | The new libata-eh in the Linux kernel is throwing a fit over the QEMU cdrom device for two reasons: 1) DRQ can be set with ERR_STAT set. This is a violation of the ATAPI state machine. 2) After a TEST_UNIT_READY ATAPI command is sent ERR_STAT is getting set which is correct. But, when the OS issues another ATAPI command ERR_STAT is still set. Which is bad since the next expected command from the OS is REQUEST_SENSE to find out why ERR_STAT is set. bug this fixes: https://bugzilla.novell.com/show_bug.cgi?id=3D291775 Signed-off-by: Brandon Philips <bphilips@suse.de> Porting this qemu fix to xen. Signed-off-by: Xu Dongxiao <dongxiao.xu@intel.com>
* hvm: Extboot support for XenKeir Fraser2008-01-171-0/+125
| | | | | | | | | This patch adds extboot to Xen. It should be pretty harmless as the moment because it's never enabled. extboot allows arbitrary block devices to be used to boot guests including SCSI and PV disks. I've tested it with both Windows and Linux guests in QEMU. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
* [qemu-dm] Fix debugging output in tpm tis modelKeir Fraser2007-12-201-5/+6
| | | | | | | | This fixes the debugging output. Also I am tweaking on the code trying to establish a connection with the external vTPM. Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
* hvm: Fix TPMD and QEMU connectionKeir Fraser2007-12-201-0/+5
| | | | | | | | | | | | In HVM domain, MA_Transmit function in tcgbios sometimes become an error (TCG_NO_RESPONSE). The cause of the error is not to make connection of QEMU and TPMD instance within a timeout of MA_Transmit function. Before the MA_Transmit function was called, the attached patch corrected so that connection of QEMU and TPMD might be completed. Signed-off-by: Kouichi YASAKI <yasaki.kouichi@jp.fujitsu.com>
* ioemu/qemu vga: save and restore vram buffer (take 2)Keir Fraser2007-12-121-2/+14
| | | | | | | | | | | The existing stdvga driver from xen-unstable tools/ioemu/hw/vga* does not save the emulated VGA memory contents. The symptoms include video malfunction after restore, including black screen (which can often be fixed by asking the guest to redraw) but also missing font setup etc. The attached patch fixes this by saving the entire VGA memory buffer, just like the Xen ioemu Cirrus emulator does. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* Revert 16579:0884e0a5ecc33afac8d60ea09652cf436d1a33ce.Keir Fraser2007-12-122-24/+9
|
* vt-d: Test device assignability in xend, but defer actual assignment to qemu-dm.Keir Fraser2007-12-121-1/+11
| | | | Signed-off-by: Weidong Han <weidong.han@intel.com>
* ioemu/qemu vga: save and restore vram bufferKeir Fraser2007-12-122-9/+24
| | | | | | | | | | | | | | | | | The existing stdvga driver from xen-unstable tools/ioemu/hw/vga* does not save the emulated VGA memory contents. The symptoms include video malfunction after restore, including black screen (which can often be fixed by asking the guest to redraw) but also missing font setup etc. The attached patch fixes this by saving the entire VGA memory buffer, just like the Xen ioemu Cirrus emulator does. I have reinterpreted the `is_vbe' byte, which is related to CONFIG_BOCHS_VBE, as a general flags word. This enables my code to allow old images to be restored (albeit with loss of VGA memory), by using another bit in that word to indicate whether the VGA memory dump is present. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* ioemu: Include mouse dz in xenfb event packetKeir Fraser2007-12-101-4/+7
| | | | | | Needed for mouse wheel support in a PV guest. Signed-off-by: Pat Campbell <plc@novell.com>
* qemu 16550 uart: Fast-drop bursts of transmitted characters to avoidKeir Fraser2007-12-081-6/+12
| | | | | stalling due to a disconnected pipe or pty. Signed-off-by: Trolle Selander <trolle.selander@gmail.com>
* ioemu: Include termios.h and sys/ioctl.h to get TIOCM_* definitions.Keir Fraser2007-12-071-7/+2
| | | | | | This is preferable to hard-coding them in the ioemu source file, or including a Linux-specific header. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* Fix ioemu compile: serial.c was including a Linux-specific header.Keir Fraser2007-12-071-1/+7
| | | | Signed-off-by: John Levon <john.levon@sun.com>
* qemu-dm: Limit transmit retries from virtual UART FIFO.Keir Fraser2007-12-061-6/+9
| | | | Signed-off-by: Trolle Selander <trolle.selander@gmail.com>
* [QEMU-DM] Upgrade emulated UART to 16550A.Keir Fraser2007-12-051-199/+276
| | | | | | | | | | | | | | | | | | | | This patch adds 16550 emulation to qemu-dm. I still consider it a work in progress, but from my testing, it consistently performs better than the old code already, sometimes considerably so (on my laptop, dumping out data over serial from a HVM DomU -> pty in Dom0 was up to 5.3 times faster than with the old 16450 code). I can consistenly reach full 115200 baud speeds over physical serial lines when the virtual device is backed by a phys port, which I never could with the old code. There are still some things to be done. I want to add proper error handling, so that overflow/framing & parity errors on the physical port get detected and reported by the virtual port. Also, now that FIFOs are in place, I believe performance could be improved significantly by putting some code into the hypervisor so that reads & writes from the FIFOs don't have to exit into qemu-dm at all. I'm also reading up on the specs for newer uarts with deeper FIFOs. Signed-off-by: Trolle Selander <trolle.selander@gmail.com>
* [QEMU-DM] Modem control line & msl/mcr register support.Keir Fraser2007-12-051-12/+130
| | | | | | | | | | | | | | | | | | | | | This patch enables handling of the modem/flow control lines of a serial port when the backend for the virtual port is a physical serial port. During initialization, it tries to load the msr with the detected status from the real port (this is consistent with physical uart, which starts with its msr values set according to the status of the modem status lines). If the ioctl returns -ENOTSUP, then the code assumes the backend is not a real serial port and will disable any further attempts to manipulate or read the physical port's line status. It's tries to be as "correct" as possible in its msr/msl handling, with the exception of modem line status change interrupts. A real 16550 uart apparently have a delay time of 250ns between when a modem status line changes and the IRQ line goes high. In this patch, an "idle" port is polled for line status changes only if the guest has enabled UART_IER_MSI is enabled, and only polled every 10 ms. Signed-off-by: Trolle Selander <trolle.selander@gmail.com>
* ioemu: Add e100 NIC support. Req'd for w2k3/IA64.Keir Fraser2007-11-212-0/+2466
| | | | Signed-off-by: Zhang Xin <xing.z.zhang@intel.com>
* hvm passthru: Uses of XC_PAGE_MASK should be XC_PAGE_SIZE-1.Keir Fraser2007-11-161-2/+2
| | | | Signed-off-by: Weidong Han <weidong.han@intel.com>
* pvfb: PVFB SDL backend chokes on bogus screen updatesKeir Fraser2007-11-161-3/+18
| | | | | | | Bogus screen update requests from buggy or malicous frontend make SDL crash. The VNC backend silently ignores them. Catch and log them. Signed-off-by: Markus Armbruster <armbru@redhat.com>
* [IA64] Fix breakage from upstream and remove duplicate codeAlex Williamson2007-11-071-23/+5
| | | | | | | | | | - Get rid of PAGE_SIZE usage in arch-ia64.h when building tools. - Now that more of xen_init_fv is identical to x86 code, share the code rather than duplicate it. - Change a few things that came over from the ia64 tree to use the XC_* macros as already done upstream. Signed-off-by: Alex Williamson <alex.williamson@hp.com>
* merge with xen-unstable.hg (staging)Alex Williamson2007-11-073-34/+28
|\
| * ioemu: Do not use PAGE_SHIFT/PAGE_SIZE/PAGE_MASK macros. Use the libxcKeir Fraser2007-11-072-40/+33
| | | | | | | | | | provided versions. Signed-off-by: Keir Fraser <keir@xensource.com>
| * HVM device passthru: Correct PCI_EXP_DEVCTL_FLRKeir Fraser2007-11-072-7/+8
| | | | | | | | | | | | | | | | | | This patch corrects PCI_EXP_DEVCTL_FLR so that function level reset will be really executed, and also replaces some magic numbers with macros. Signed-off-by: Anthony Xu <anthony.xu@intel.com> Signed-off-by: Weidong Han <weidong.han@intel.com>
* | [IA64] vti save-restore: ia64 qemu-dm boot clean up.Alex Williamson2007-11-071-15/+28
|/ | | | | | Use xc_get_hvm_param() Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
* ioemu: Clean up compile warnings.Keir Fraser2007-11-053-8/+12
| | | | | Signed-off-by: Atsushi SAKAI <sakaia@jp.fujitsu.com> Signed-off-by: Keir Fraser <keir@xensource.com>
* ioemu: Remove dependency on linux/input.hKeir Fraser2007-11-021-1/+4
| | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* Fix PVFB device initializationKeir Fraser2007-10-261-0/+49
| | | | | | | | | The final series of patches I sent out lost 2 hunks in the big refactoring patches I did thanks to a messed up rebase/rediff :-( This patch fixes the device nodename initialization so that watches work correctly. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* x86, hvm: Allow Cirrus VGA BIOS to clear framebuffer with minimal PIO writes.Keir Fraser2007-10-261-0/+12
| | | | | Signed-off-by: Ben Guthro <bguthro@virtualron.com> Signed-off-by: Gary Grebus <ggrebus@virtualiron.com>
* ia64, qemu-dm: Trivial build fix.Keir Fraser2007-10-251-0/+1
| | | | Signed-off-by: Alex Williamson <alex.williamson@hp.com>
* hvm: Improve and limit the messages for unexpected mmio accesses toKeir Fraser2007-10-251-2/+12
| | | | | | | the platform device. Signed-off-by: Ben Guthro <bguthro@virtualron.com> Signed-off-by: Gary Grebus <ggrebus@virtualiron.com>
* pv-qemu 8/10: Add pv console to QEMU paravirt machineKeir Fraser2007-10-253-0/+466
| | | | | | | | | | | | | | | | This patch adds a paravirt console driver to qemu-dm. This is used when the QEMU machine type is 'xenpv', connecting to the ring buffer provided by the guest kernel. The '-serial' command line flag controls how the guest console is exposed. For parity with xenconsoled the '-serial pty' arg can be used. For guests which are running a qemu-dm device model, the xenconsoled daemon is no longer needed for guest consoles. The code for the xen_console.c is based on the original code in tools/console/daemon/io.c, but simplified; since its only dealing with a single guest there's no state tracking to worry about. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* pv-qemu 7/10: Async negotiation with xenfb frontendKeir Fraser2007-10-253-308/+401
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch re-factors the paravirt console xenfb_attach_dom method. The original method blocks the caller until the front & backends have both switched to the connected state. This isn't an immediate problem, but patches which follow will extend qemu to also handle the text console so blocking on graphics console startup will block the text console processing. The new code is basically a state machine. It starts off with a watch waiting for the KBD backend to switch to 'initialized' mode, then does the same for the FB backend. Now it waits for KBD & FB frontend devices to initialize, reading & mapping the framebuffer & its config at the appropriate step. When the KBD frontend finally reaches the connected state it registers a graphical console with QEMU and sets up the various framebuffer, mouse & keyboard event handlers. If a client connects to the VNC server before this is completed, then they will merely see a text console (or perhaps the monitor if configured that way). The main difference from previous versions of this patch, is that at the suggestion of Markus Armbruster, I'vere-ordered the individual static functions so they are in order-of-call, rather than reversed. Although I now have to pre-declare them, it is much easier to read the code. I have also fixed the keycode -> keysym translations to match previous behaviour. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>