Commit Graph

14157 Commits

Author SHA1 Message Date
Benjamin Poirier 18dabfd1e0 rtl8139: add vlan tag extraction
Add support to the emulated hardware to extract vlan tags in packets
going from the network to the guest.

Signed-off-by: Benjamin Poirier <benjamin.poirier@gmail.com>
Cc: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Cc: Jason Wang <jasowang@redhat.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Blue Swirl <blauwirbel@gmail.com>

--

AFAIK, extraction is optional to get vlans working. The driver
requests rx detagging but should not assume that it was done. Under
Linux, the mac layer will catch the vlan ethertype. I only added this
part for completeness (to emulate the hardware more truthfully...)
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-03-26 11:10:49 +00:00
Benjamin Poirier 2c406b8fc8 rtl8139: cleanup FCS calculation
clean out ifdef's around ethernet checksum calculation

Signed-off-by: Benjamin Poirier <benjamin.poirier@gmail.com>
Acked-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Cc: Jason Wang <jasowang@redhat.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
2011-03-26 11:10:34 +00:00
Ulrich Obergfell d6e58090fe severe memory leak caused by broken palette_destroy() function
The following commit breaks the code of the function palette_destroy().

http://git.kernel.org/?p=virt/kvm/qemu-kvm.git;a=commit;h=e31e3694afef58ba191cbcc6875ec243e5971268

The broken code causes a severe memory leak of 'VncPalette' structures
because it never frees anything:

     70 void palette_destroy(VncPalette *palette)
     71 {
     72     if (palette == NULL) {
     73         qemu_free(palette);
     74     }
     75 }

Version 2 of the patch calls qemu_free() unconditionally.

Signed-off-by: Ulrich Obergfell <uobergfe@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-03-25 07:28:24 -05:00
Peter Maydell 05175535a3 vl.c: Fix compilation failure if CONFIG_SDL isn't defined
Fix a compilation failure if CONFIG_SDL isn't defined (gcc complained
that the label 'invalid_display' wasn't used).

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-03-25 07:28:09 -05:00
Anthony Liguori 56d7a964a5 Merge remote branch 'amit/for-anthony' into staging 2011-03-24 08:11:58 -05:00
Peter Maydell 24e838b787 tcg/arm: Support host code being compiled for Thumb
Although the TCG generated code is always in ARM mode, it is possible
that the host code was compiled by gcc in Thumb mode (this is often the
default for Linux distributions targeting ARM v7 only). Handle this
by using BLX imm when doing a call from ARM into Thumb mode.
Since BLX imm is not a conditionalisable instruction, we make
tcg_out_call() no longer take a condition code; we were only ever
using it with COND_AL anyway.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
2011-03-24 03:27:22 +01:00
Anthony Liguori 4ac8e585c8 Revert "x86: Save/restore PAT MSR"
This reverts commit c995b495b9.

From Jan Kiszka:

 Ouch, indeed. Moreover, CPU_SAVE_VERSION was not updated (likely the
 reason for the breakage). Thanks for debugging this!

 Anthony (or whoever), please revert this unneeded commit in qemu.git.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-03-22 19:05:06 -05:00
Anthony Liguori a0843a68c4 vnc: fix build error from VNC_DIRTY_WORDS
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-03-22 11:27:33 -05:00
Wen Congyang 6ed391bf90 fix vnc regression
This patch fix the following regression:
1. we should use bitmap_set() and bitmap_clear() to replace vnc_set_bits().

Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-03-22 08:39:12 -05:00
Jes Sorensen ff73edf514 qmp-commands.hx: Clean up mess of client_migrate_info
client_migrate_info was put into qmp-commands.hx in the middle of
migrate_set_speed, between the command and it's description. In
addition client_migrate_info put the description before the command
itself, which is the wrong order.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-03-22 08:39:12 -05:00
Jes Sorensen 821601ea5b Make VNC support optional
Per default VNC is enabled.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-03-22 08:39:12 -05:00
Jes Sorensen 47b053690e error message if user specifies curses on cmd line when curses is disabled
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-03-22 08:39:12 -05:00
Jes Sorensen 58fc096c76 error message if user specifies SDL cmd line option when SDL is disabled
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-03-22 08:39:12 -05:00
Jes Sorensen 3264ff120c Add support for -display vnc
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-03-22 08:39:11 -05:00
Jes Sorensen 4171d32e6e Introduce -display none
New option -display none. This option differs from -nographic by not
trying to take control of stdio etc. but instead behaves as if a
graphics display is enabled, except that it doesn't show one.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-03-22 08:39:11 -05:00
Jes Sorensen 1472a95bab Introduce -display argument
This patch introduces a -display argument which consolidates the
setting of the display mode. Valid options are:
sdl/curses/default

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-03-22 08:39:11 -05:00
Jes Sorensen ffe8b821a1 Consolidate DisplaySurface allocation in qemu_alloc_display()
This removes various code duplication from console.e and sdl.c

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-03-22 08:39:11 -05:00
Peter Maydell 6aae3df15d target-arm: use make_float32() to make constant floats for VRSQRTS
The preferred way to create a constant floating point value is to use
make_float32() rather than doing a runtime int32_to_float32().
Convert the code in the VRSQRTS helper to work this way.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-22 07:59:07 +01:00
Peter Maydell dda3ec490c target-arm: Fix VRECPS edge cases handling
Correct the handling of edge cases for the VRECPS instruction:
 * this is a Neon instruction so uses the "standard FPSCR value"
 * (zero, inf) is a special case which returns 2.0

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-22 07:59:06 +01:00
Peter Maydell 7d2aabe262 target-arm: Fix TCG temporary leaks for scalar VMULL
Fix a TCG temporary leak when translating 32-bit scalar VMULL.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-22 07:56:30 +01:00
Peter Maydell e1d177b922 target-arm: Set Q bit for overflow in SMUAD and SMLAD
SMUAD and SMLAD are supposed to set the Q bit if the addition of
the two 16x16 multiply products and optional accumulator overflows
considered as a signed value. However we were only doing this check
for the addition of the accumulator, not when adding the products,
with the effect that we were mishandling the edge case where
both inputs are 0x80008000.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-22 07:56:08 +01:00
Peter Maydell db6e2e65ad target-arm: Fix GE bits for v6media signed modulo arithmetic
Fix the signed modulo arithmetic helpers for the v6media
instructions (SADD8, SSUB8, SADD16, SSUB16, SASX, SSAX) to set
the GE bits correctly (based on the result of the add or subtract
before it is truncated to 16 bits, not after).

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-22 07:52:36 +01:00
Peter Maydell 2a0308c54f target-arm: Fix UNDEF cases in Thumb load/store
Decode of Thumb load/store was merging together the cases of 'bit 11==0'
(reg+reg LSL imm) and 'bit 11==1' (reg+imm). This happens to work for
valid instruction patterns but meant that we would not UNDEF for the
cases the architecture mandates that we must. Make the decode actually
look at bit 11 as well as [10..8] so that we UNDEF in the right places.

This change also removes what was a spurious unreachable 'case 8',
and correctly frees TCG temporaries on the illegal-insn codepaths.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-22 07:52:35 +01:00
Peter Maydell 30cb4cdec7 linux-user: Fix unlock_user() call in return from poll()
Correct the broken attempt to calculate the third argument
to unlock_user() in the code path which unlocked the pollfd
array on return from poll() and ppoll() emulation. (This
only caused a problem if unlock_user() wasn't a no-op, eg
if DEBUG_REMAP is defined.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-22 07:46:21 +01:00
Jan Kiszka ff90d50393 vmmouse: Register vmstate via qdev
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-22 07:44:15 +01:00
Jan Kiszka 43f2019671 vmmouse: Fix initialization
Latest refactorings left vmmouse nonfunctional behind. Fix it by adding
the required device initialization.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-22 07:44:15 +01:00
Jan Kiszka 663dc4e7bb vmmouse: Fix typo preventing x86-64 build
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-22 07:44:14 +01:00
René Rebe 7f90fa77b8 fix applesmc REV key
Fix applesmc REV key string literal hex encoding.

Signed-off-by: René Rebe <rene@exactcode.de>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-22 07:42:08 +01:00
René Rebe adf82011ef enable kvm for ppc(32) on ppc64
ppc64 is backward compatible, likewise.

Signed-off-by: René Rebe <rene@exactcode.de>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-22 07:33:12 +01:00
Fabien Chouteau a0e1390007 target-ppc: add support for 6 SPE instructions
Add support for 6 SPE instructions: evmra, evmwsmi{a{a}}, evmwumi{a{a}}

Signed-off-by: Fabien Chouteau <chouteau@adacore.com>
Reviewed-by: Nathan Froyd <froydnj@codesourcery.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-22 07:17:16 +01:00
Aurelien Jarno 59c9d9cf3f pc-bios: update linuxboot.bin and multiboot.bin
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-22 07:03:15 +01:00
Gleb Natapov 75b9f69057 fix linuxboot.bin and multiboot.bin to not hijack int19
Currently linuxboot.bin and multiboot.bin option roms override int19
vector to intercept boot process. No sane option rom should do that.
Provide bev entry instead that will be called by BIOS if option rom
is selected for booting.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-22 07:00:58 +01:00
Anthony Liguori 31b7c261a2 Merge remote branch 'qemu-kvm/uq/master' into staging 2011-03-21 17:42:20 -05:00
Anthony Liguori 8b06c62ae4 seabios: update to latest git
- cc97564 Add config option to permit running option roms with bad checksums.
 - 424f217 Add config option to disable MTRR initialization.
 - fb2f10d Prep version for next release.
 - f18b09b Update version to 0.6.2
 - 20fcf9b lets pretend that RTC can be used to wakeup from S4
 - 1efb10b Expand user configurable parameters in Kconfig.
 - 3dba4c2 Support non-local build directory - allow "make OUT=abc/" to work.
 - 42d9771 The vgabios build must depend on autoconf.h.
 - 32aa9f3 fix parallel compilation of SeaBIOS
 - 713be89 Start using Kconfig to configure SeaBIOS settings.
 - b623e7c Change kconfig to emit disabled symbols in autoconf.h.
 - 0da7bfd Build changes for Linux kconfig code to work in seabios dir structure.
 - a4c5daf Initial commit of Kconfig build tool.
 - 4d0c592 Minor boot fixes.
 - 812478e Minor comment / code layout improvement to romlayout.S.
 - 6fc7cf1 Fix to prevent infinite loop in build_pci_path().
 - f5154e2 support T13 EDD3.0 spec
 - d08eb9c Add ability to track PCI paths and add to build_pci_path().
 - 89a1efd Move the CBFS payload setup to later in the boot.
 - 9e881a3 Extract space trimming code from ATA and use in USB and bootorder code.
 - 3c241ed seabios: acpi: add _RMV control method for PCI devices
 - c2002a1 Add support for finding the boot priority of USB drives.
 - a5f2b91 Extend 'usb_pipe' to track the controller and ports of each device.
 - 8bf5503 Add functions for boot device path parsing.
 - c4bd3b9 Use bootprio_find_named_rom() for ramdisk and cbfs payload priorities.
 - ca2bc1c Remove drive->desc field.
 - f13a180 Minor reorganization of some of the boot_xxx code in boot.c.
 - 3da2c1c Move IPL.fw_bootorder to static variables in boot.c.
 - 7bb1584 Move IPL.bev to static variables in boot.c
 - baaadb6 Move IPL.checkfloppysig to a global (CheckFloppySig) in boot.c.
 - a0842f8 Remove Drives global struct in favor of independent global variables.
 - ecbcf77 Don't access drive_g->desc from boot_cdrom().
 - 551caa2 Simplify keyboard reading code in the interactive boot menu.
 - 697e63c Call setup_translation() from map_hd_drive().
 - 3c5e0e1 Rename add_ordered_drive() to add_drive() and use in map_hd_drive().
 - 031ef55 Add stubs to permit devices to specify their boot priority.
 - 72eee3e Simplify boot ordering by building an inclusive boot list.
 - ce24be5 Populate drive_g->desc prior to calling add_bcv_internal().
 - 74fd942 pciinit: fix off-by-one
 - 311f887 Minor build fixes.
 - bca3a87 Track the source of each optionrom deployed.
 - c6629e0 Support qemu based romfile wrappers called out of order.
 - d1a1746 Breakup boot_setup() bootorder code into its own function.
 - f9b0930 Add romfile_loadfile() helper function.
 - b9a7591 Read bootorder file into memory.
 - 2e109a6 Add strchr() function.
 - 1703ea2 Add romfile_name() function.
 - b674152 Add BAID for ahci cdrom.
 - f77e179 Provide full EDD 3.0 info for virtio disk
 - 67863be Enhance layoutrom.py to work around a binutils quirk.
 - 4c90a20 Create separate IPL entry for each CD/DVD
 - 0e6f636 ahci: set controller id
 - 1e924bb ahci: fix off-by-one in port count
 - 7eb0222 ahci: enable io/mem/dma
 - c19fc71 ahci: set dma feature flag
 - 80c2b6e Check if capability enabled in XXX_cmd_data functions.
 - f3fe3aa Require a "_cfuncXX_" symbol prefix for inter-mode c function references.
 - d52fdf6 add ahci support
 - 54fa8ec ata: make helpers available
 - 0a80608 util: add memset_fl()
 - f1f18eb pci: add helper functions for mmio bar access from real mode.
 - af9629b Enhance call32() to pass a parameter to called function.
 - 4057f98 Don't pass return address to transition(32,16,16big) on stack.
 - e2623fc pciinit: use pci_region functions.
 - 58a38e8 pci: introduce pci_region to manage pci io/memory/prefmemory regions.
 - 6d5a217 mark irq9 active high in DSDT
 - 9433098 Report meaningful error if pyserial not present in tools/readserial.py
 - 94dc9c4 Show size of non-relocatable runtime code during build.
 - 4d96edc Cleanup - it's no longer necessary to manually reset global variables.
 - a899945 Allow rom to grow to 256K.
 - 4a446d7 Fix typo preventing relocated space from being used for option roms.
 - 0f67397 fix virtio-blk failure after reboot
 - d4bded4 Add a debug method to AML code.
 - 2f96800 Warn that ohci bulk is not supported.
 - e826465 Enable optionroms to use freed space due to CONFIG_RELOCATE_INIT.
 - 7f55fd3 Move the 32bit init code to high memory at runtime.
 - 025cabd Move init code from _start() to post().
 - 12fa24a Add memalign_tmp() helper function.
 - 244caf8 Try to hard-reboot on rerun of post even on emulators.
 - 5bd01de Don't do shadow copying of optionroms when CONFIG_OPTIONROMS_DEPLOYED.
 - adaf373 Try to hard-reboot processor on rerun of post under coreboot.
 - 402fd9c Enhance build to emit relocation information.
 - d1b4f96 Separate out init code from the rest of the 32bit flat code.
 - 1a4885e Modify tools/layoutrom.py to use classes instead of tuples.
 - 6c2e781 Use str.startswith() in python scripts.
 - d9c916e Prep version for next release.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-03-21 17:41:52 -05:00
Juan Quintela b784421ce4 Fix migration uint8 arrys handled
commit 82fa39b751

only contains half of the fix.  It forgots the save state fix for
UINT8 indexes.

Anthony, please apply, without this migration using hpet is broken.
(only current user).

Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
2011-03-21 17:41:52 -05:00
Andreas Färber bb98fe42c5 softfloat: Drop [s]bits{8, 16, 32, 64} types in favor of [u]int{8, 16, 32, 64}_t
They are defined with the same semantics as the POSIX types,
so prefer those for consistency. Suggested by Peter Maydell.

Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-21 21:46:14 +01:00
Andreas Färber 87b8cc3cf3 softfloat: Resolve type mismatches between declaration and implementation
The original SoftFloat 2.0b library avoided the use of custom integer types
in its public headers. This requires the definitions of int{8,16,32,64} to
match the assumptions in the declarations. This breaks on BeOS R5 and Haiku/x86,
where int32 is defined in {be,os}/support/SupportDefs.h in terms of a long
rather than an int. Spotted by Michael Lotz.

Since QEMU already breaks this distinction by defining those types just above,
do use them for consistency and to allow #ifndef'ing them out as done for
[u]int16 on AIX.

Cc: Michael Lotz <mmlr@mlotz.ch>
Cc: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-21 21:46:10 +01:00
Andreas Färber 8d725fac63 softfloat: Prepend QEMU-style header with derivation notice
The SoftFloat license requires "prominent notice that the work
is derivative". Having added features like improved 16-bit support
for arm already, add such a notice to the sources.

softfloat-native.[ch] are not under the SoftFloat license
and thus are not changed.

Cc: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-21 21:46:05 +01:00
Stefan Hajnoczi 735e77ecb1 e1000: Fix multi-descriptor packet checksum offload
The PCI/PCI-X Family of Gigabit Ethernet Controllers Software
Developer’s Manual states the following about the POPTS field:

  Provides a number of options which control the handling of this
  packet.  This field is ignored except on the first data descriptor of
  a packet.

The current implementation always loads the field and its checksum
offload flags.  This patch uses only the first descriptor's POPTS field
in order to comply with the specification.

When Solaris sends multi-descriptor packets it fills in POPTS for the
first descriptor only.  Therefore this patch is necessary in order to
perform checksum offload correctly for multi-descriptor packets.

Reported-by: Daniel Pecka <dpecka@techniservit.cz>
Reported-by: Gabriele A. Trombetti <gabriele.trombetti@itb.cnr.it>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-21 21:43:24 +01:00
Aurelien Jarno aa315f95b7 Merge branch 'for-anthony' of git://github.com/bonzini/qemu
* 'for-anthony' of git://github.com/bonzini/qemu:
  remove qemu_get_clock
  add a generic scaling mechanism for timers
  change all other clock references to use nanosecond resolution accessors
  change all rt_clock references to use millisecond resolution accessors
  add more helper functions with explicit milli/nanosecond resolution
2011-03-21 21:28:38 +01:00
Aurelien Jarno 3246572762 Merge branch 'for-anthony' of git://repo.or.cz/qemu/kevin
* 'for-anthony' of git://repo.or.cz/qemu/kevin:
  Add qcow2 documentation
  hw/xen_disk: aio_inflight not released in handling ioreq when nr_segments==0
  Improve error handling in do_snapshot_blkdev()
  Fix ATA SMART and CHECK POWER MODE
  Don't allow multiwrites against a block device without underlying medium
  tools: Use real async.c instead of stubs
  Add error message for loading snapshot without VM state
  block/qcow: Don't ignore immediate read/write and other failures
  block/vdi: Don't ignore immediate read/write failures
2011-03-21 21:28:19 +01:00
Aurelien Jarno cc4e8741cc rbd: don't link with -lcrypto
rbd support tries to both link with -lrados and -lcrypto. While the
first one is of course necessary, the second is not necessary (only
librados ifself needs to link with libcrypto).

This fixes a licensing issue: qemu as a whole is GPL v2, and thus can't
be linked with OpenSSL without an exception in the license, which seems
difficult to get given the number of persons involved.

Cc: Christian Brunner <chb@muc.de>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-21 21:27:54 +01:00
Peter Maydell 34933c8c94 hw/arm_sysctl.c: Add the Versatile Express system registers
Add support for the Versatile Express SYS_CFG registers, which provide
a generic means of reading or writing configuration information from
various parts of the board. We only implement shutdown and reset.

Also make the RESETCTL register RAZ/WI on Versatile Express rather
than reset the board. Other system registers are generally the same
as Versatile and Realview.

This includes a VMState version number bump for arm_sysctl,
since we have new register state to preserve. It also adds
sys_mci to the VMState while we're bumping the version number
(an accidental omission from commit b50ff6f5).

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2011-03-21 21:04:46 +01:00
Amit Shah 2d6c1ef40f char: Prevent multiple devices opening same chardev
Prevent:

-chardev socket,path=/tmp/foo,server,nowait,id=c0 \
-device virtserialport,chardev=c0,id=vs0 \
-device virtserialport,chardev=c0,id=vs1

Reported-by: Mike Cao <bcao@redhat.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
2011-03-21 16:57:13 +05:30
Amit Shah f9a90f189c virtio-console: Keep chardev open for other users after hot-unplug
After a hot-unplug operation, the previous behaviour was to close the
chardev.  That meant the chardev couldn't be re-used.  Also, since
chardev hot-plug isn't possible so far, this means virtio-console
hot-plug isn't feasible as well.

With this change, the chardev is kept around.  A new virtio-console
channel can then be hot-plugged with the same chardev and things will
continue to work.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
2011-03-21 16:56:55 +05:30
Amit Shah fee063c07f virtio-serial: Don't clear ->have_data() pointer after unplug
After a port unplug operation, the port->info->have_data() pointer was
set to NULL.  The problem is, the ->info struct is shared by all ports,
effectively disabling writes to other ports.

Reported-by: juzhang <juzhang@redhat.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
2011-03-21 16:55:12 +05:30
Amit Shah e9b382b017 virtio-serial-bus: Simplify handle_output() function
There's no code change, just re-arrangement to simplify the function
after recent modifications.

Reported-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
2011-03-21 16:55:12 +05:30
Amit Shah 32059220d0 virtio-serial: Enable ioeventfd
Enable ioeventfd for virtio-serial devices by default.  Commit
25db9ebe15 lists the benefits of using
ioeventfd.

Copying a file from guest to host over a virtio-serial channel didn't
show much difference in time or io_exit rate.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
2011-03-21 16:55:12 +05:30
Amit Shah 0b8b716d6c virtio-serial: Disallow generic ports at id 0
Port 0 is reserved for virtconsole devices for backward compatibility
with the old -virtioconsole (from qemu 0.12) device type.

libvirt prior to commit 8e28c5d40200b4c5d483bd585d237b9d870372e5 used
port 0 for generic ports.  libvirt will no longer do that, but disallow
instantiating generic ports at id 0 from qemu as well.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
2011-03-21 16:55:11 +05:30
Amit Shah 6b331efb73 virtio-serial: Use a struct to pass config information from proxy
Instead of using a single variable to pass to the virtio_serial_init
function, use a struct so that expanding the number of variables to be
passed on later is easier.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
2011-03-21 16:55:11 +05:30