summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* hpet: Add MSI supportJan Kiszka2010-06-132-5/+37
| | | | | | | | | | | | | This implements the HPET capability of routing IRQs to the front-side bus, aka MSI support. This feature can be enabled via the qdev property "msi" and is off by default. Note that switching it on can cause guests (at least Linux) to use the HPET as timer instead of the LAPIC. KVM users should recall that only the latter is currently available as fast in-kernel model. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* hpet: Make number of timers configurableJan Kiszka2010-06-132-14/+45
| | | | | | | | | | One HPET block supports up to 32 timers. Allow to instantiate more than the recommended and implemented minimum of 3. The number is configured via the qdev property "timers". It is also saved/restored so that it need not match between migration peers. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* vmstate: Add VMSTATE_STRUCT_VARRAY_UINT8Jan Kiszka2010-06-131-0/+10
| | | | | | | Required for hpet. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* hpet: Add support for level-triggered interruptsJan Kiszka2010-06-131-10/+22
| | | | | | | | By implementing this feature we can also remove a nasty way to kill qemu (by trying to enable level-triggered hpet interrupts). Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* hpet: Drop static stateJan Kiszka2010-06-131-21/+17
| | | | | | | | | Instead of keeping a static reference around, pass the state to hpet_enabled and hpet_get_ticks. All callers now have it at hand. Will once allow to instantiate the HPET more than a single time. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* hpet/rtc: Rework RTC IRQ replacement by HPETJan Kiszka2010-06-139-56/+51
| | | | | | | | | | | | | | | | Allow the intercept the RTC IRQ for the HPET legacy mode. Then push routing to IRQ8 completely into the HPET. This allows to turn hpet_in_legacy_mode() into a private function. Furthermore, this stops the RTC from clearing IRQ8 even if the HPET is in control. This patch comes with a side effect: The RTC timers will no longer be stoppend when there is no IRQ consumer, possibly causing a minor performance degration. But as the guest may want to redirect the RTC to the SCI in that mode, it should normally disable unused IRQ source anyway. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* hpet: Start/stop timer when HPET_TN_ENABLE is modifiedJan Kiszka2010-06-131-0/+5
| | | | | | | | We have to update the qemu timer when the per-timer enable bit is toggled, just like for HPET_CFG_ENABLE changes. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* hpet: Convert to qdevJan Kiszka2010-06-133-15/+38
| | | | | | | | | | Register the HPET as a sysbus device and create it that way. As it can route its IRQs to any ISA IRQ, we need to connect it to all 24 of them. Once converted to qdev, we can move reset handler and vmstate registration into its hands as well. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* hpet: Move static timer field initializationJan Kiszka2010-06-131-2/+2
| | | | | | | | Properly initialize HPETTimer::tn and HPETTimer::state once during hpet_init instead of (re-)writing them on every reset. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* hpet: Silence warning on write to running main counterJan Kiszka2010-06-131-2/+2
| | | | | | | | | Setting the main counter while the HPET is enabled may not be a good idea of the guest, but it is supported and should, thus, not spam the host console with warnings. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* hpet: Coding style cleanups and some refactoringsJan Kiszka2010-06-132-218/+226
| | | | | | | | | | This moves the private HPET structures into the C module, simplifies some helper functions and fixes most coding style issues (biggest chunk was improper switch-case indention). No functional changes. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* hpet: Catch out-of-bounds timer accessJan Kiszka2010-06-131-1/+5
| | | | | | | | Also prevent out-of-bounds write access to the timers but don't spam the host console if it triggers. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* configure: Fix evaluation of config-host.mak in create_configJan Kiszka2010-06-131-1/+1
| | | | | | | | | Only match on true dir variable assignments, avoid generating garbage due to the "# Configured with: ..." line which may contain "*dir=" as well. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* tcg-s390: correctly detect s390 with a 64-bit kernelAurelien Jarno2010-06-131-0/+6
| | | | Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* Compile OS specific files only once for all targetsBlue Swirl2010-06-121-2/+2
| | | | | | | OS specific files are not target dependent, so they can be compiled once for all targets. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Move set_proc_name() to OS specific files.Jes Sorensen2010-06-124-18/+27
| | | | | | | | | | | Move handling to change process name to POSIX specific files plus add a better error message to cover the case where the feature isn't supported. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Acked-by: Juan Quintela <quintela@redhat.com> Acked-by: Richard Henderson <rth@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Move line-buffering setup to OS specific files.Jes Sorensen2010-06-124-4/+9
| | | | | | | | | Move line-buffering setup to OS specific files. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Acked-by: Juan Quintela <quintela@redhat.com> Acked-by: Richard Henderson <rth@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Make os_change_process_uid and os_change_root os-posix.c localJes Sorensen2010-06-123-8/+4
| | | | | | | | | | os_change_process_uid() and os_change_root() are now only called from os-posix.c, so no need to keep win32 stubs for them. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Acked-by: Juan Quintela <quintela@redhat.com> Acked-by: Richard Henderson <rth@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Move daemonize handling to OS specific filesJes Sorensen2010-06-126-103/+115
| | | | | | | | | | Move daemonize handling from vl.c to OS specific files. Provide dummy stubs for Win32. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Acked-by: Juan Quintela <quintela@redhat.com> Acked-by: Richard Henderson <rth@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Move chroot handling to OS specific files.Jes Sorensen2010-06-124-17/+22
| | | | | | | | | Move chroot handling to OS specific files. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Acked-by: Juan Quintela <quintela@redhat.com> Acked-by: Richard Henderson <rth@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Move runas handling from vl.c to OS specific files.Jes Sorensen2010-06-124-28/+31
| | | | | | | | | | Move code to handle runas, ie. change of user id of QEMU process to OS specific files and provide dummy stub for Win32. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Acked-by: Juan Quintela <quintela@redhat.com> Acked-by: Richard Henderson <rth@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Introduce OS specific cmdline argument handling and move SMB arg to os-posix.cJes Sorensen2010-06-126-16/+76
| | | | | | | | | | | | | | Introduce OS specific cmdline argument handling by calling os_parse_cmd_args() at the end of switch() statement. Move option enum to qemu-options.h and have it included from os-posix.c and os-win32.c in addition to vl.c. In addition move SMB argument to os-posix.c Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Acked-by: Juan Quintela <quintela@redhat.com> Acked-by: Richard Henderson <rth@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Rename qemu-options.h to qemu-options.defJes Sorensen2010-06-122-5/+5
| | | | | | | | | | Rename qemu-options.h to qemu-options.def as it is not a header file for general use and this leaves space for a proper qemu-options.h Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Acked-by: Juan Quintela <quintela@redhat.com> Acked-by: Richard Henderson <rth@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Move find_datadir to OS specific files.Jes Sorensen2010-06-124-90/+90
| | | | | | | | | | This moves the win32 and POSIX versions of find_datadir() to OS specific files, and removes some #ifdef clutter from vl.c Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Acked-by: Juan Quintela <quintela@redhat.com> Acked-by: Richard Henderson <rth@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Move main signal handler setup to os specificfiles.Jes Sorensen2010-06-124-32/+33
| | | | | | | | | Move main signal handler setup to os specific files. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Acked-by: Juan Quintela <quintela@redhat.com> Acked-by: Richard Henderson <rth@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Rename os_setup_signal_handling() to os_setup_early_signal_handling()Jes Sorensen2010-06-124-4/+4
| | | | | | | | | Rename os_setup_signal_handling() to os_setup_early_signal_handling() Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Acked-by: Juan Quintela <quintela@redhat.com> Acked-by: Richard Henderson <rth@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Move win32 early signal handling setup to os_setup_signal_handling()Jes Sorensen2010-06-124-32/+31
| | | | | | | | | Move win32 early signal handling setup to os_setup_signal_handling() Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Acked-by: Juan Quintela <quintela@redhat.com> Acked-by: Richard Henderson <rth@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Introduce os-posix.c and create os_setup_signal_handling()Jes Sorensen2010-06-124-7/+45
| | | | | | | | | | Introcuce os-posix.c and move posix specific signal handling there. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Acked-by: Juan Quintela <quintela@redhat.com> Acked-by: Richard Henderson <rth@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* vl.c: Move host_main_loop_wait() to OS specific files.Jes Sorensen2010-06-125-51/+82
| | | | | | | | | | Move host_main_loop_wait() to OS specific files. Create qemu-os-posix.h and provide empty inline for the POSIX case. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Acked-by: Juan Quintela <quintela@redhat.com> Acked-by: Richard Henderson <rth@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Introduce os-win32.c and move polling functions from vl.cJes Sorensen2010-06-123-80/+112
| | | | | | | | | | | | | This introduces os-win32.c. It is meant to carry win32 specific functions thata are not relevant for all of QEMU as well as win32 versions of various pieces like signal handling etc. Move win32 polling handler helper functions from vl.c to os-win32.c Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Acked-by: Juan Quintela <quintela@redhat.com> Acked-by: Richard Henderson <rth@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Create qemu-os-win32.h and move WIN32 specific declarations thereJes Sorensen2010-06-122-16/+44
| | | | | | | | | | Create qemu-os-win32.h for WIN32 specific declarations. Move polling handling declaration into this file from sysemu.h Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Acked-by: Juan Quintela <quintela@redhat.com> Acked-by: Richard Henderson <rth@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* vl.c: Remove double include of netinet/in.h for SolarisJes Sorensen2010-06-121-1/+0
| | | | | | | | | | vl.c: netinet/in.h is already included once above for the Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Acked-by: Andreas Faerber <afaerber@opensolaris.org> Acked-by: Juan Quintela <quintela@redhat.com> Acked-by: Richard Henderson <rth@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* NEON vldN optimizationPaul Brook2010-06-111-2/+4
| | | | | | | | When combining multiple values as part of a NEON array load, do explcit shift/or rather than using gen_bfi. This voids redundant mask operations. Signed-off-by: Paul Brook <paul@codesourcery.com>
* tcg: fix DEF macro after commit c61aaf7a388c4ad95d8b546fdb9267dc01183317Aurelien Jarno2010-06-111-1/+1
| | | | Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* tcg-s390: Adjust compilation flags.Richard Henderson2010-06-111-1/+6
| | | | | | | | | | | Force -m31/-m64 based on s390/s390x target. Force -march=z990. The TCG backend will always require the long-displacement facility, so the compiler may as well make use of that as well. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* tcg-s390: Compute is_write in cpu_signal_handler.Richard Henderson2010-06-111-3/+39
| | | | | Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* s390x: Don't use a linker script for user-only.Richard Henderson2010-06-111-0/+3
| | | | | | | | The default placement of the application at 0x80000000 is fine, and will avoid the default placement for most other guests. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* s390x: Avoid _llseek.Richard Henderson2010-06-111-2/+2
| | | | | | | | There's no _llseek on s390x either. Replace the existing test for __x86_64__ with a functional test for __NR_llseek. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* tcg-s390: Allocate the code_gen_buffer near the main program.Richard Henderson2010-06-111-0/+7
| | | | | | | | This allows the use of direct calls to the helpers, and a direct branch back to the epilogue. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* tcg-s390: Icache flush is a no-op.Richard Henderson2010-06-111-5/+0
| | | | | | | | Before gcc 4.2, __builtin___clear_cache doesn't exist, and afterward the gcc s390 backend implements it as nothing. Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* tcg-i386: fix andi r, r, 0xffAurelien Jarno2010-06-101-1/+1
| | | | Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* tcg-i386: remove use of _Bool that slipped code reviewAurelien Jarno2010-06-101-1/+1
| | | | Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
* esp: lower IRQ on soft resetBlue Swirl2010-06-101-5/+14
| | | | | | | | | | 42f1ced228c9b616cfa2b69846025271618e4ef5 removed irq lowering during reset. However, for chip reset command and DMA reset signal, its actually the correct thing to do. Lower IRQ on soft reset only. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* qbus: fix memory leak in qbus_free()Isaku Yamahata2010-06-101-0/+1
| | | | | | | | BusState::name is allocated in qbus_create_inplace(). So it should be freed by qbus_free(). Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* multiboot: compilation fix with DEBUG_MULTIBOOT enabled.Isaku Yamahata2010-06-101-4/+5
| | | | | | | | | | | | | | | | | | | | This patch fixes the following compilation errors in multiboot.c when DEBUG_MULTIBOOT is defined. Use TARGET_FMT_plx instead of %x for target_phys_addr_t. CC i386-softmmu/multiboot.o cc1: warnings being treated as errors qemu/hw/multiboot.c: In function 'mb_add_mod': qemu/hw/multiboot.c:121: error: format '%08x' expects type 'unsigned int', but argument 4 has type 'target_phys_addr_t' qemu/hw/multiboot.c:121: error: format '%08x' expects type 'unsigned int', but argument 5 has type 'target_phys_addr_t' qemu/hw/multiboot.c: In function 'load_multiboot': qemu/hw/multiboot.c:279: error: format '%#x' expects type 'unsigned int', but argument 5 has type 'target_phys_addr_t' qemu/hw/multiboot.c:307: error: format '%x' expects type 'unsigned int', but argument 3 has type 'target_phys_addr_t' qemu/hw/multiboot.c:308: error: format '%x' expects type 'unsigned int', but argument 3 has type 'target_phys_addr_t' make[1]: *** [multiboot.o] Error 1 Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* vga-isa-mm: remove one #ifdef CONFIG_BOCHS_VBE.Isaku Yamahata2010-06-101-5/+1
| | | | | | | | remove one #ifdef CONFIG_BOCHS_VBE. Call vga_init_vbe() instead. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* main: allocate gui_timer only once.Isaku Yamahata2010-06-101-0/+1
| | | | | | | | fix memory leak. there is no need to allocate more than one gui_timer. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
* Merge remote branch 'mst/for_anthony' into stagingAnthony Liguori2010-06-102-14/+19
|\
| * net: Fix hotplug with pci_addAmit Shah2010-06-091-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The correct model type wasn't getting added when hotplugging nics with pci_add. Testcase: start VM with default nic type. In the qemu_monitor: (qemu) pci_add auto nic model=virtio This results in a nic hot-plug of the same nic type as the default. This was broken in 5294e2c774f120e10b44652ac143abda356f44eb Also changes the behaviour where no .init is defined for a net_client_type. Previously, 0 was returned, which indicated the init was successful and that 0 was the index into the nd_tables[] array. Return -1, indicating unsuccessful init, in such a case. Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
| * virtio-net: truncating packetMichael S. Tsirkin2010-06-071-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | virtio net attempts to peek into virtio queue to determine that we have enough space for the complete packet to fit. However, it fails to account for space consumed by virtio net header when it does this, under stress this results in a failure with the message 'truncating packet'. redhat bz 591494. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
OpenPOWER on IntegriCloud