]> git.proxmox.com Git - mirror_qemu.git/log
mirror_qemu.git
10 years agoMerge remote-tracking branch 'remotes/kraxel/tags/pull-gtk-7' into staging
Peter Maydell [Wed, 28 May 2014 10:18:58 +0000 (11:18 +0100)]
Merge remote-tracking branch 'remotes/kraxel/tags/pull-gtk-7' into staging

gtk: ui overhaul, multiwindow support.

# gpg: Signature made Mon 26 May 2014 08:54:55 BST using RSA key ID D3E87138
# gpg: Can't check signature: public key not found

* remotes/kraxel/tags/pull-gtk-7: (24 commits)
  gtk: workaround gtk2 vte resize issue
  gtk: window sizing overhaul
  gtk: zap unused global_state
  gtk: Add handling for the xfree86 keycodes
  gtk: enable untabify for gfx
  gtk: detached window pointer grabs
  gtk: update all windows on mouse mode changes
  gtk: fix grab checks
  gtk: update gd_update_caption
  gtk: skip keyboard grab when hover autograb is active
  gtk: keep track of grab owner
  gtk: add gd_grab trace event
  gtk: add tab to trace events
  gtk: allow moving tabs to windows and back.
  gtk: simplify resize
  gtk: use device type as label
  gtk: support multiple gfx displays
  gtk: move vga state into VirtualGfxConsole
  gtk: VirtualConsole restruction
  gtk: remove page numbering assumtions from the code
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/kraxel/tags/pull-input-9' into staging
Peter Maydell [Wed, 28 May 2014 09:33:05 +0000 (10:33 +0100)]
Merge remote-tracking branch 'remotes/kraxel/tags/pull-input-9' into staging

input: add event routing and multiseat support.
input: misc bugfixes and minor improvements.

# gpg: Signature made Mon 26 May 2014 07:44:29 BST using RSA key ID D3E87138
# gpg: Can't check signature: public key not found

* remotes/kraxel/tags/pull-input-9:
  docs: add multiseat.txt
  usb: add input routing support for tablet and keyboard
  sdl: pass key event source to input layer
  input: bind devices and input routing
  input: switch hid mouse and tablet to the new input layer api.
  input: switch hid keyboard to new input layer api.
  input: keymap: add meta keys
  input: add name to input_event_key_number
  input: add qemu_input_key_number_to_qcode
  input (curses): mask keycodes to remove modifier bits

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/mjt/tags/trivial-patches-2014-05-26' into staging
Peter Maydell [Tue, 27 May 2014 21:45:03 +0000 (22:45 +0100)]
Merge remote-tracking branch 'remotes/mjt/tags/trivial-patches-2014-05-26' into staging

trivial patches for 2014-05-26

# gpg: Signature made Mon 26 May 2014 08:17:08 BST using RSA key ID A4C3D7DB
# gpg: Can't check signature: public key not found

* remotes/mjt/tags/trivial-patches-2014-05-26: (23 commits)
  libcacard: remove useless initializers
  net: cadence_gem: Fix top comment
  bsd-user: replace fprintf(stderr, ...) with error_report()
  audio: replace fprintf(stderr, ...) with error_report() in audio
  libcacard: fix wrong array expansion logic
  libcacard/vcard_emul_nss: Drop a redundant conditional
  libcacard: Convert two leftover realloc() to GLib
  libcacard/vreader: Tighten assertion to clarify intent
  libcacard/vreader: Drop broken recovery from failed assertion
  libcacard: Plug memory leaks around vreader_get_reader_list()
  libcacard/vscclient: Bury some dead code
  vl: fix 'name' option to work with -readconfig
  configure: Put tempfiles in a subdir of the build directory
  dma-helpers: avoid calling dma_bdrv_unmap() twice
  arch_init: replace fprintf(stderr, ...) with error_report()
  pci: move dereferencing of root only after verifying valid root pointer
  jazz_led: Add missing break in switch case
  bswap.h: Rename ldl_p, stl_p, etc to ldl_he_p, stl_he_p, etc
  configure: Automatically select GTK+ 3.0 if GTK+ 2.0 is unavailable
  nbd: Miscellaneous typo fixes.
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/mwalle/tags/lm32-semihosting/20140524' into...
Peter Maydell [Tue, 27 May 2014 21:11:25 +0000 (22:11 +0100)]
Merge remote-tracking branch 'remotes/mwalle/tags/lm32-semihosting/20140524' into staging

* remotes/mwalle/tags/lm32-semihosting/20140524:
  lm32: remove lm32_sys
  test: lm32: use semihosting for testing
  target-lm32: add semihosting support
  test: lm32: make test cases independent

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/rth/tcg-mips' into staging
Peter Maydell [Tue, 27 May 2014 17:31:02 +0000 (18:31 +0100)]
Merge remote-tracking branch 'remotes/rth/tcg-mips' into staging

* remotes/rth/tcg-mips: (24 commits)
  tcg-mips: Enable direct chaining of TBs
  tcg-mips: Simplify movcond
  tcg-mips: Simplify brcond2
  tcg-mips: Improve setcond eq/ne vs zeros
  tcg-mips: Simplify setcond2
  tcg-mips: Simplify brcond
  tcg-mips: Simplify setcond
  tcg-mips: Commonize opcode implementations
  tcg-mips: Improve add2/sub2
  tcg-mips: Hoist args loads
  tcg-mips: Fix subtract immediate range
  tcg-mips: Name the opcode enumeration
  tcg-mips: Use EXT for AND on mips32r2
  tcg-mips: Use T9 for TCG_TMP1
  tcg-mips: Introduce TCG_TMP0, TCG_TMP1
  tcg-mips: Rearrange register allocation
  tcg-mips: Convert to new_ldst
  tcg-mips: Convert to new qemu_l/st helpers
  tcg-mips: Move softmmu slow path out of line
  tcg-mips: Split large ldst offsets
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/rth/fix-tci' into staging
Peter Maydell [Tue, 27 May 2014 13:44:03 +0000 (14:44 +0100)]
Merge remote-tracking branch 'remotes/rth/fix-tci' into staging

* remotes/rth/fix-tci:
  tci: Fix tcg_out_call

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agotarget-arm: Fix segfault on startup when KVM enabled
Christoffer Dall [Tue, 27 May 2014 12:37:43 +0000 (14:37 +0200)]
target-arm: Fix segfault on startup when KVM enabled

Commit 50a2c6e55fa introduced a bug where QEMU would segfault on startup
when using KVM on ARM hosts, because kvm_arm_reset_cpu() accesses
cpu->cpreg_reset_values, which is not allocated before
kvm_arch_init_vcpu(). Fix this by not calling cpu_reset() until after
qemu_init_vcpu().

Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Andreas Faerber <afaerber@suse.de>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Message-id: 1401194263-13010-1-git-send-email-christoffer.dall@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agodocs: add multiseat.txt
Gerd Hoffmann [Tue, 20 May 2014 07:17:01 +0000 (09:17 +0200)]
docs: add multiseat.txt

Howto on setting up multiseat for guests.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agousb: add input routing support for tablet and keyboard
Gerd Hoffmann [Mon, 19 May 2014 13:26:51 +0000 (15:26 +0200)]
usb: add input routing support for tablet and keyboard

Add display property to the keyboard.
Add display and head properties to the tablet.

If properties are set bind device to the display specified to
setup input routing.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agosdl: pass key event source to input layer
Gerd Hoffmann [Tue, 20 May 2014 06:11:25 +0000 (08:11 +0200)]
sdl: pass key event source to input layer

So the input layer knows where the input is coming from
and input routing works correctly.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoinput: bind devices and input routing
Gerd Hoffmann [Mon, 19 May 2014 13:18:37 +0000 (15:18 +0200)]
input: bind devices and input routing

Add function to bind input devices to display devices.  Implementing
input routing on top of this:  Events coming from the display device in
question are routed to the input device bound to it (if there is one).

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoinput: switch hid mouse and tablet to the new input layer api.
Gerd Hoffmann [Mon, 19 May 2014 13:02:21 +0000 (15:02 +0200)]
input: switch hid mouse and tablet to the new input layer api.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoinput: switch hid keyboard to new input layer api.
Gerd Hoffmann [Tue, 11 Mar 2014 12:52:27 +0000 (13:52 +0100)]
input: switch hid keyboard to new input layer api.

Minimal patch to get the switchover done.  We continue processing ps/2
scancodes for now as they are part of the live migration stream.  Fixing
that, then mapping directly from QKeyValue to HID keycodes is left as
excercise for another day.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoinput: keymap: add meta keys
Gerd Hoffmann [Wed, 21 May 2014 11:54:32 +0000 (13:54 +0200)]
input: keymap: add meta keys

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoinput: add name to input_event_key_number
Gerd Hoffmann [Wed, 21 May 2014 11:49:59 +0000 (13:49 +0200)]
input: add name to input_event_key_number

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoinput: add qemu_input_key_number_to_qcode
Gerd Hoffmann [Wed, 21 May 2014 11:28:32 +0000 (13:28 +0200)]
input: add qemu_input_key_number_to_qcode

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agoinput (curses): mask keycodes to remove modifier bits
Andrew Oates [Sat, 24 May 2014 00:16:09 +0000 (20:16 -0400)]
input (curses): mask keycodes to remove modifier bits

Without the mask, control bits are passed on in the keycode, generating
incorrect PS/2 sequences when SHIFT, ALT, etc are held down.

Cc: qemu-stable@nongnu.org
Signed-off-by: Andrew Oates <andrew@aoates.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agolibcacard: remove useless initializers
Michael Tokarev [Thu, 8 May 2014 17:17:38 +0000 (21:17 +0400)]
libcacard: remove useless initializers

libcacard has many functions which initializes local variables
at declaration time, which are always assigned some values later
(often right after declaration).  Clean up these initializers.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agonet: cadence_gem: Fix top comment
Peter Crosthwaite [Wed, 7 May 2014 09:17:31 +0000 (02:17 -0700)]
net: cadence_gem: Fix top comment

To indicate Cadence GEM not Xilinx.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agobsd-user: replace fprintf(stderr, ...) with error_report()
Le Tan [Fri, 9 May 2014 23:55:22 +0000 (07:55 +0800)]
bsd-user: replace fprintf(stderr, ...) with error_report()

Replace fprintf(stderr,...) with error_report() in files bsd-user/*.
The trailing "\n"s of the @fmt argument have been removed
because @fmt of error_report() should not contain newline.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agoaudio: replace fprintf(stderr, ...) with error_report() in audio
Le Tan [Fri, 9 May 2014 23:55:20 +0000 (07:55 +0800)]
audio: replace fprintf(stderr, ...) with error_report() in audio

Replace fprintf(stderr,...) with error_report() in files audio/*.
The trailing "\n"s of the @fmt argument have been removed
because @fmt of error_report() should not contain newline.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agogtk: workaround gtk2 vte resize issue
Gerd Hoffmann [Fri, 16 May 2014 13:34:31 +0000 (15:34 +0200)]
gtk: workaround gtk2 vte resize issue

Hack isn't pretty, but gets the job done.
See source code comment for details.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agogtk: window sizing overhaul
Gerd Hoffmann [Fri, 16 May 2014 10:26:12 +0000 (12:26 +0200)]
gtk: window sizing overhaul

Major overhaul for window size handling.  This basically switches qemu
over to use geometry hints for the window manager instead of trying to
get the job done with widget resize requests.  This allows to specify
better what we need and also avoids window resizes.

FIXME: on gtk2 someone overwrites the geometry hints :(

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agogtk: zap unused global_state
Gerd Hoffmann [Tue, 6 May 2014 11:39:11 +0000 (13:39 +0200)]
gtk: zap unused global_state

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agogtk: Add handling for the xfree86 keycodes
Bruce Rogers [Thu, 1 May 2014 02:29:42 +0000 (20:29 -0600)]
gtk: Add handling for the xfree86 keycodes

Currently only evdev keycodes are handled by the gtk-ui. SDL has
code to handle both. This patch adds similar processing so that
both keycode types will be handled via the gtk-ui.

Signed-off-by: Bruce Rogers <brogers@suse.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agogtk: enable untabify for gfx
Gerd Hoffmann [Tue, 6 May 2014 08:20:53 +0000 (10:20 +0200)]
gtk: enable untabify for gfx

Now we have all grab fixes in place, so we can allow detaching
graphic display tabs too.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agogtk: detached window pointer grabs
Gerd Hoffmann [Tue, 6 May 2014 10:51:00 +0000 (12:51 +0200)]
gtk: detached window pointer grabs

Make ungrab hotkey work with detached windows.
Enable pointer grabs for detached windows.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agogtk: update all windows on mouse mode changes
Gerd Hoffmann [Tue, 6 May 2014 09:48:28 +0000 (11:48 +0200)]
gtk: update all windows on mouse mode changes

We might have multiple graphic displays now which all need a cursor update.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agogtk: fix grab checks
Gerd Hoffmann [Tue, 6 May 2014 09:45:30 +0000 (11:45 +0200)]
gtk: fix grab checks

Make it handle multiple windows case correctly.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agogtk: update gd_update_caption
Gerd Hoffmann [Tue, 6 May 2014 09:20:17 +0000 (11:20 +0200)]
gtk: update gd_update_caption

Adapt to recent changes, handle multiple windows.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agogtk: skip keyboard grab when hover autograb is active
Gerd Hoffmann [Tue, 6 May 2014 09:04:57 +0000 (11:04 +0200)]
gtk: skip keyboard grab when hover autograb is active

It's pointless.  With grab on hover enabled the keyboard grab
is already active when you press Ctrl-Alt-G ;)

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agogtk: keep track of grab owner
Gerd Hoffmann [Tue, 6 May 2014 09:01:31 +0000 (11:01 +0200)]
gtk: keep track of grab owner

Simplifies grab state tracking and makes ungrab more reliable.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agogtk: add gd_grab trace event
Gerd Hoffmann [Tue, 6 May 2014 08:43:52 +0000 (10:43 +0200)]
gtk: add gd_grab trace event

Input grab code is tricky, add some debug & trouble shooting aid.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agogtk: add tab to trace events
Gerd Hoffmann [Tue, 6 May 2014 08:27:54 +0000 (10:27 +0200)]
gtk: add tab to trace events

So you can see which of multiple displays (if present) was resized ;)

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agogtk: allow moving tabs to windows and back.
Gerd Hoffmann [Mon, 5 May 2014 14:23:33 +0000 (16:23 +0200)]
gtk: allow moving tabs to windows and back.

"View->Detach tab" will move to tab to a new window.
Simply closing the window will move it back into a notebook tab.
The label will be permamently stored in VirtualConsole->label,
so it can easily be reused to (re-)label tabs and windows.

Works for vte tabs only for now. pointer/kbd grab code needs
adaptions before we can enable it for gfx tabs too.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agogtk: simplify resize
Gerd Hoffmann [Mon, 5 May 2014 12:55:18 +0000 (14:55 +0200)]
gtk: simplify resize

Simply ask for a small window size.  When the widgets don't fit in gtk
will automatically make the window large enougth to make things fit, no
need to try (and fail) duplicate that logic in qemu.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agogtk: use device type as label
Gerd Hoffmann [Mon, 5 May 2014 12:36:56 +0000 (14:36 +0200)]
gtk: use device type as label

IMO useful than showing VGA for any graphic device
even in case it is something completely different.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agogtk: support multiple gfx displays
Gerd Hoffmann [Wed, 30 Apr 2014 14:39:18 +0000 (16:39 +0200)]
gtk: support multiple gfx displays

Each display gets its own tab.  Tab switching continues to work like it
did, just the hotkeys of the vte consoles changes in case a secondary
display is present as it will get ctrl-alt-2 assigned and the vtes are
shifted by one.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agogtk: move vga state into VirtualGfxConsole
Gerd Hoffmann [Wed, 30 Apr 2014 14:30:07 +0000 (16:30 +0200)]
gtk: move vga state into VirtualGfxConsole

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agogtk: VirtualConsole restruction
Gerd Hoffmann [Wed, 30 Apr 2014 11:53:16 +0000 (13:53 +0200)]
gtk: VirtualConsole restruction

Move all vte-related items into VirtualVteConsole substruct.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agogtk: remove page numbering assumtions from the code
Gerd Hoffmann [Wed, 30 Apr 2014 10:56:53 +0000 (12:56 +0200)]
gtk: remove page numbering assumtions from the code

Lookup page numbers using gtk_notebook_page_num() instead.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agogtk: Add a scrollbar for text consoles
Cole Robinson [Tue, 29 Apr 2014 19:24:32 +0000 (15:24 -0400)]
gtk: Add a scrollbar for text consoles

Only show the scrollbar if the content doesn't fit on the visible space.

[ kraxel: fix box packing ]

Signed-off-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agogtk: cleanup CONFIG_VTE ifdef a bit.
Gerd Hoffmann [Tue, 29 Apr 2014 13:39:37 +0000 (15:39 +0200)]
gtk: cleanup CONFIG_VTE ifdef a bit.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agogtk: zap vte size requests
Gerd Hoffmann [Tue, 29 Apr 2014 13:21:46 +0000 (15:21 +0200)]
gtk: zap vte size requests

The vte tabs simply get the size of the vga tab then, with whatever
cols and lines are fitting in.  I find this bahavior more useful than
resizing the qemu window all day long.

YMMV.  Comments are welcome.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agogtk: zap scrolled_window
Gerd Hoffmann [Tue, 29 Apr 2014 13:08:56 +0000 (15:08 +0200)]
gtk: zap scrolled_window

The vte widget implements the scrollable interface, placing it into
a scrolled window is pointless and creates a bunch of strange effects.
Zap it.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
10 years agolibcacard: fix wrong array expansion logic
Michael Tokarev [Fri, 23 May 2014 20:47:39 +0000 (00:47 +0400)]
libcacard: fix wrong array expansion logic

The currrent code in libcacard/vcard_emul_nss.c:vcard_emul_options()
has a weird bug in variable usage around expanding opts->vreader
array.

There's a helper variable, vreaderOpt, which is first needlessly
initialized to NULL, next, conditionally, only we have to expand
opts->vreader, receives array expansion from g_renew(), and next,
even if we don't actually perform expansion, the value of this
variable is assigned to the actual array, opts->vreader, which
was supposed to be expanded.

So, since we expand the array by READER_STEP increments, only
once in READER_STEP (=4) the code will work, in other 3/4 times
it will fail badly.

Fix this by not using this temp variable when expanding the
array, and by dropping the useless =NULL initializer too -
if it wasn't in place initially, compiler would have warned
us about this problem at the beginning.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
10 years agolm32: remove lm32_sys
Michael Walle [Tue, 22 Apr 2014 18:18:44 +0000 (20:18 +0200)]
lm32: remove lm32_sys

Since we have now semihosting on the lm32 target, this device is no longer
needed. Remove it.

Signed-off-by: Michael Walle <michael@walle.cc>
10 years agotest: lm32: use semihosting for testing
Michael Walle [Tue, 22 Apr 2014 18:18:43 +0000 (20:18 +0200)]
test: lm32: use semihosting for testing

Instead of the lm32-sys device, use semihosting to print to the host
console and exit the test.

Signed-off-by: Michael Walle <michael@walle.cc>
10 years agotarget-lm32: add semihosting support
Michael Walle [Tue, 22 Apr 2014 18:18:42 +0000 (20:18 +0200)]
target-lm32: add semihosting support

Intercept certain system calls if semihosting is enabled. This should
behave like the GDB simulator.

Signed-off-by: Michael Walle <michael@walle.cc>
10 years agotest: lm32: make test cases independent
Michael Walle [Tue, 22 Apr 2014 18:18:41 +0000 (20:18 +0200)]
test: lm32: make test cases independent

Make test cases independent from from each other. Eg. if a test case needs
a specific value in register A, don't rely on the fact that it is already
set by the preceding test case.

Signed-off-by: Michael Walle <michael@walle.cc>
10 years agotcg-mips: Enable direct chaining of TBs
Richard Henderson [Thu, 24 Apr 2014 19:39:20 +0000 (19:39 +0000)]
tcg-mips: Enable direct chaining of TBs

Now that the code_gen_buffer is constrained to not cross 256mb
regions, we are assured that we can use J to reach another TB.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-mips: Simplify movcond
Richard Henderson [Wed, 16 Apr 2014 05:53:12 +0000 (22:53 -0700)]
tcg-mips: Simplify movcond

Use the same table to fold comparisons as with setcond.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-mips: Simplify brcond2
Richard Henderson [Wed, 16 Apr 2014 05:47:22 +0000 (22:47 -0700)]
tcg-mips: Simplify brcond2

Emitting a single branch instead of (up to) 3, using setcond2
to generate the composite compare.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-mips: Improve setcond eq/ne vs zeros
Richard Henderson [Wed, 16 Apr 2014 05:41:46 +0000 (22:41 -0700)]
tcg-mips: Improve setcond eq/ne vs zeros

The original code results in one too many insns per zero
present in the input.  And since comparing 64-bit numbers
vs zero is common...

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-mips: Simplify setcond2
Richard Henderson [Wed, 16 Apr 2014 05:34:30 +0000 (22:34 -0700)]
tcg-mips: Simplify setcond2

Using tcg_unsigned_cond and tcg_high_cond.
Also, move the function up in the file for future cleanups.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-mips: Simplify brcond
Richard Henderson [Wed, 16 Apr 2014 05:20:57 +0000 (22:20 -0700)]
tcg-mips: Simplify brcond

Use the same table to fold comparisons as with setcond.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-mips: Simplify setcond
Richard Henderson [Wed, 16 Apr 2014 05:10:09 +0000 (22:10 -0700)]
tcg-mips: Simplify setcond

Use a table to fold comparisons to less-than.
Also, move the function up in the file for futher simplifications.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-mips: Commonize opcode implementations
Richard Henderson [Wed, 16 Apr 2014 03:30:46 +0000 (20:30 -0700)]
tcg-mips: Commonize opcode implementations

Most opcodes fall in to one of a couple of patterns.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-mips: Improve add2/sub2
Richard Henderson [Thu, 24 Apr 2014 02:56:44 +0000 (02:56 +0000)]
tcg-mips: Improve add2/sub2

Reduce insn count from 5 to either 3 or 4.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-mips: Hoist args loads
Richard Henderson [Wed, 16 Apr 2014 02:05:52 +0000 (19:05 -0700)]
tcg-mips: Hoist args loads

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-mips: Fix subtract immediate range
Richard Henderson [Wed, 16 Apr 2014 01:54:07 +0000 (18:54 -0700)]
tcg-mips: Fix subtract immediate range

Since we must use ADDUI, we would generate incorrect code for -32768.
Leaving off subtract of +32768 makes things easier for a follow-on patch.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-mips: Name the opcode enumeration
Richard Henderson [Tue, 15 Apr 2014 16:30:47 +0000 (09:30 -0700)]
tcg-mips: Name the opcode enumeration

And use it in the opcode emission functions.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-mips: Use EXT for AND on mips32r2
Richard Henderson [Tue, 15 Apr 2014 16:27:40 +0000 (09:27 -0700)]
tcg-mips: Use EXT for AND on mips32r2

At the same time, tidy deposit by introducing tcg_out_opc_bf.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-mips: Use T9 for TCG_TMP1
Richard Henderson [Tue, 15 Apr 2014 16:10:16 +0000 (09:10 -0700)]
tcg-mips: Use T9 for TCG_TMP1

T0 is an argument register for the n32 and n64 abis.  T9 is the call
address register for the abis, and is more directly under the control
of the backend.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-mips: Introduce TCG_TMP0, TCG_TMP1
Richard Henderson [Tue, 15 Apr 2014 16:07:52 +0000 (09:07 -0700)]
tcg-mips: Introduce TCG_TMP0, TCG_TMP1

Use these instead of hard-coding the registers to use for temporaries.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-mips: Rearrange register allocation
Richard Henderson [Tue, 15 Apr 2014 16:03:59 +0000 (09:03 -0700)]
tcg-mips: Rearrange register allocation

Use FP (also known as S8) as a normal call-saved register.

Include T0 in the allocation order and call-clobbered list
even though it's currently used as a TCG temporary.

Put the argument registers at the end of the allocation order.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-mips: Convert to new_ldst
Richard Henderson [Mon, 14 Apr 2014 18:10:11 +0000 (18:10 +0000)]
tcg-mips: Convert to new_ldst

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-mips: Convert to new qemu_l/st helpers
Richard Henderson [Mon, 14 Apr 2014 16:59:41 +0000 (16:59 +0000)]
tcg-mips: Convert to new qemu_l/st helpers

In addition, fill delay slots calling the helpers and tail
call to the store helpers.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-mips: Move softmmu slow path out of line
Richard Henderson [Fri, 2 May 2014 22:01:31 +0000 (15:01 -0700)]
tcg-mips: Move softmmu slow path out of line

At the same time, tidy up the call helpers, avoiding a memory reference.
Split out several subroutines.  Use TCGMemOp constants.  Make endianness
selectable at runtime.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-mips: Split large ldst offsets
Richard Henderson [Sun, 23 Mar 2014 17:45:23 +0000 (17:45 +0000)]
tcg-mips: Split large ldst offsets

Use this to reduce goto_tb by one insn.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-mips: Fill the exit_tb delay slot
Richard Henderson [Sun, 23 Mar 2014 17:15:21 +0000 (17:15 +0000)]
tcg-mips: Fill the exit_tb delay slot

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-mips: Use J and JAL opcodes
Richard Henderson [Sun, 23 Mar 2014 16:57:18 +0000 (16:57 +0000)]
tcg-mips: Use J and JAL opcodes

For userland builds calls will normally be in range,
and for the exit_tb opcode the branch to the epilogue.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-mips: Constrain the code_gen_buffer to be within one 256mb segment
Richard Henderson [Thu, 24 Apr 2014 16:16:07 +0000 (09:16 -0700)]
tcg-mips: Constrain the code_gen_buffer to be within one 256mb segment

This assures us use of J for exit_tb and goto_tb, and JAL for calling
into the generated bswap helpers.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agotcg-mips: Layout executable and code_gen_buffer
Richard Henderson [Thu, 24 Apr 2014 15:25:03 +0000 (08:25 -0700)]
tcg-mips: Layout executable and code_gen_buffer

Choosing good addresses for them means we can use JAL for helper calls.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agolibcacard/vcard_emul_nss: Drop a redundant conditional
Markus Armbruster [Fri, 23 May 2014 11:24:39 +0000 (13:24 +0200)]
libcacard/vcard_emul_nss: Drop a redundant conditional

Bailing out when PK11_FindGenericObjects() returns null ensures the
loop that follows it executes at least once.  The "loop did not
execute" test right after it is useless.  Drop it.

Spotted by Coverity.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agolibcacard: Convert two leftover realloc() to GLib
Markus Armbruster [Fri, 23 May 2014 11:24:37 +0000 (13:24 +0200)]
libcacard: Convert two leftover realloc() to GLib

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agolibcacard/vreader: Tighten assertion to clarify intent
Markus Armbruster [Fri, 23 May 2014 11:24:36 +0000 (13:24 +0200)]
libcacard/vreader: Tighten assertion to clarify intent

Bonus: hushes up Coverity.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agolibcacard/vreader: Drop broken recovery from failed assertion
Markus Armbruster [Fri, 23 May 2014 11:24:35 +0000 (13:24 +0200)]
libcacard/vreader: Drop broken recovery from failed assertion

We suppress some code when we got unexpected status and assertion
checking is off:

     assert(card_status == VCARD_DONE);
     if (card_status == VCARD_DONE) {
         int size = MIN(*receive_buf_len, response->b_total_len);
         memcpy(receive_buf, response->b_data, size);
         *receive_buf_len = size;
    }

Such "recovery" is of dubious value even when it works.  This one
doesn't: it fails to assign to receive_buf[] and *receive_buf_len,
which the callers expect.

Make the code unconditional.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agolibcacard: Plug memory leaks around vreader_get_reader_list()
Markus Armbruster [Fri, 23 May 2014 11:24:34 +0000 (13:24 +0200)]
libcacard: Plug memory leaks around vreader_get_reader_list()

Spotted by Coverity.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agolibcacard/vscclient: Bury some dead code
Markus Armbruster [Fri, 23 May 2014 11:24:33 +0000 (13:24 +0200)]
libcacard/vscclient: Bury some dead code

Spotted by Coverity.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agovl: fix 'name' option to work with -readconfig
Dr. David Alan Gilbert [Tue, 6 May 2014 11:15:55 +0000 (12:15 +0100)]
vl: fix 'name' option to work with -readconfig

The 'name' option silently failed when used in config files
( http://lists.gnu.org/archive/html/qemu-devel/2014-04/msg00378.html )

-readconfig stores the configuration read in QemuOpts.  Command line
option parsing should do the same, and no more.  In particular it should
not act upon the option.  That needs to be done separately, where both
command line and -readconfig settings are visible in QemuOpts.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reported-by: William Dauchy <william@gandi.net>
Tested-by: William Dauchy <william@gandi.net>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
(mjt: added commit message by ambru@ and subject prefix)

10 years agoconfigure: Put tempfiles in a subdir of the build directory
Peter Maydell [Fri, 23 May 2014 16:07:24 +0000 (17:07 +0100)]
configure: Put tempfiles in a subdir of the build directory

When libtool support was added to configure, the new temporary files
were left out of the list of files cleaned up on exit; this results
in a lot of stale .lo files being left around in /tmp. Worse, libtool
creates a /tmp/.libs directory which we can't easily clean up.

Put all our temporary files in a single temporary directory created
as a subdirectory of the build directory, so we can easily clean it up,
and don't need fragile or complicated code for creation to avoid it
clashing with temporary directories from other instances of QEMU
configure or being subject to attack from adversaries who can write
to /tmp.

Since the temporaries now live in the build tree, we have no
need to jump through hoops with a trap handler to try to remove
them when configure exits; this fixes some weird bugs where hitting
^C during a configure run wouldn't actually make it stop, because
we would run the trap handler but then not stop. (It is possible
to get the trap handler semantics right but it is convoluted largely
because of bugs in dash, so it is simpler to just avoid it.)

Note that "temporary files go in the build directory, not /tmp" is
the way autoconf behaves.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agodma-helpers: avoid calling dma_bdrv_unmap() twice
Jules Wang [Fri, 23 May 2014 03:44:05 +0000 (11:44 +0800)]
dma-helpers: avoid calling dma_bdrv_unmap() twice

Calling dma_bdrv_unmap() twice is not necessary and may cause
potential problems if some code changes.

Signed-off-by: Jules Wang <junqing.wang@cs2c.com.cn>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agoarch_init: replace fprintf(stderr, ...) with error_report()
Le Tan [Wed, 21 May 2014 00:10:38 +0000 (08:10 +0800)]
arch_init: replace fprintf(stderr, ...) with error_report()

Replace fprintf(stderr,...) with error_report() in the file
arch_init.c. The trailing "\n"s of the @fmt argument have been removed
because @fmt of error_report() should not contain newline.

Signed-off-by: Le Tan <tamlokveer@gmail.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agopci: move dereferencing of root only after verifying valid root pointer
Saravanakumar [Thu, 22 May 2014 11:33:50 +0000 (17:03 +0530)]
pci: move dereferencing of root only after verifying valid root pointer

Signed-off-by: Saravanakumar <saravanakumar.punith@gmail.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agojazz_led: Add missing break in switch case
Saravanakumar [Wed, 21 May 2014 10:41:40 +0000 (16:11 +0530)]
jazz_led: Add missing break in switch case

Signed-off-by: Saravanakumar <saravanakumar.punith@gmail.com>
Reviewed-by: Paolo Bonizni <pbonzini@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agobswap.h: Rename ldl_p, stl_p, etc to ldl_he_p, stl_he_p, etc
Peter Maydell [Fri, 2 May 2014 17:32:38 +0000 (18:32 +0100)]
bswap.h: Rename ldl_p, stl_p, etc to ldl_he_p, stl_he_p, etc

We have an unfortunate naming clash between the functions
ldl_p, stl_p, etc defined in bswap.h (which have semantics
"load/store in host endianness") and the #defines of the same
name in cpu-all.h (which have the semantics "load/store in
target endianness").

Fortunately it turns out that the only users of the bswap.h
functions are all within bswap.h itself, so we can simply
rename them to include a _he_ infix for "host endianness".

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agoconfigure: Automatically select GTK+ 3.0 if GTK+ 2.0 is unavailable
Stefan Weil [Sat, 17 May 2014 14:29:18 +0000 (16:29 +0200)]
configure: Automatically select GTK+ 3.0 if GTK+ 2.0 is unavailable

The configure option --with-gtkabi=3.0 is still supported, but no longer
needed when GTK+-2.0 is missing. When no GTK+ ABI is selected by the
user, configure first tries 2.0, then 3.0.

For some platforms (e.g. Windows) newer binaries of GTK+ are only
available for GTK+ 3.0. Now building on these platforms is a little bit
easier.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agonbd: Miscellaneous typo fixes.
Hani Benhabiles [Mon, 12 May 2014 23:35:16 +0000 (00:35 +0100)]
nbd: Miscellaneous typo fixes.

Signed-off-by: Hani Benhabiles <hani@linux.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agonbd: Close socket on negotiation failure.
Hani Benhabiles [Mon, 12 May 2014 23:35:15 +0000 (00:35 +0100)]
nbd: Close socket on negotiation failure.

Otherwise, the nbd client may hang waiting for the server response.

Signed-off-by: Hani Benhabiles <hani@linux.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agoiohandler.c: Properly initialize sigaction struct
Peter Maydell [Fri, 16 May 2014 13:00:03 +0000 (14:00 +0100)]
iohandler.c: Properly initialize sigaction struct

The code in qemu_init_child_watch() wasn't clearing the 'struct
sigaction' before passing it to sigaction(); this meant that we
would block a random set of signals while executing the SIGCHLD
handler. Initialize properly by using memset() on the struct,
as we do in similar cases elsewhere.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
10 years agolibcacard: g_malloc cleanups
Michael Tokarev [Thu, 8 May 2014 15:51:01 +0000 (19:51 +0400)]
libcacard: g_malloc cleanups

This patch replaces g_malloc() in libcacard into g_new()
or g_new0() where appropriate (removing some init-to-zero
surrounding code), g_malloc+memcpy into g_memdup() and the
like.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Alon Levy <alevy@redhat.com>
10 years agotci: Fix tcg_out_call
Richard Henderson [Thu, 22 May 2014 20:25:34 +0000 (13:25 -0700)]
tci: Fix tcg_out_call

Broken since dddbb2e1e3f8137d7e3f1faf9758c66cca0c94ea.
Do all the rest of the things that tcg_out_op did before
and after the big switch statement.

Signed-off-by: Richard Henderson <rth@twiddle.net>
10 years agoMerge remote-tracking branch 'remotes/qmp-unstable/queue/qmp' into staging
Peter Maydell [Thu, 22 May 2014 18:04:48 +0000 (19:04 +0100)]
Merge remote-tracking branch 'remotes/qmp-unstable/queue/qmp' into staging

* remotes/qmp-unstable/queue/qmp:
  qapi: zero-initialize all QMP command parameters
  scripts/qapi.py: Avoid syntax not supported by Python 2.4
  doc: add "setup" to list of migration states

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/kraxel/tags/pull-chardev-2' into staging
Peter Maydell [Thu, 22 May 2014 17:14:01 +0000 (18:14 +0100)]
Merge remote-tracking branch 'remotes/kraxel/tags/pull-chardev-2' into staging

purge error_is_set()

# gpg: Signature made Wed 21 May 2014 11:43:44 BST using RSA key ID D3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"

* remotes/kraxel/tags/pull-chardev-2:
  error: error_is_set() is finally unused; remove
  char: Explain qmp_chardev_add()'s unusual error handling
  char: Clean up fragile use of error_is_set()
  char: Use return values instead of error_is_set(errp)
  qemu-socket: Clean up inet_connect_opts()

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/kraxel/tags/pull-audio-5' into staging
Peter Maydell [Thu, 22 May 2014 16:05:36 +0000 (17:05 +0100)]
Merge remote-tracking branch 'remotes/kraxel/tags/pull-audio-5' into staging

audio: two intel-hda fixes.

# gpg: Signature made Wed 21 May 2014 09:49:39 BST using RSA key ID D3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"

* remotes/kraxel/tags/pull-audio-5:
  hw/audio/intel-hda: Avoid shift into sign bit
  audio/intel-hda: support FIFORDY

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/cohuck/tags/s390x-20140520' into staging
Peter Maydell [Thu, 22 May 2014 15:14:01 +0000 (16:14 +0100)]
Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20140520' into staging

some s390 patches:

- Enable irqfds on s390 via the new adapter interrupt routing type.
  As a prereq, fix the kvm enable_cap helpers for some compilers and
  split the s390 flic into kvm and non-kvm parts.
- Enable software and hardware debugging support on s390. This needs a
  kernel headers update.

# gpg: Signature made Tue 20 May 2014 12:30:54 BST using RSA key ID C6F02FAF
# gpg: Can't check signature: public key not found

* remotes/cohuck/tags/s390x-20140520:
  s390x/kvm: hw debugging support via guest PER facility
  s390x/kvm: software breakpoint support
  s390x: remove duplicate definitions of DIAG 501
  linux-headers: update
  s390x/virtio-ccw: wire up irq routing and irqfds
  s390x/virtio-ccw: reference-counted indicators
  s390x: add I/O adapter registration
  s390x: split flic into kvm and non-kvm parts
  kvm: Fix enable_cap helpers on older gcc

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoMerge remote-tracking branch 'remotes/bonzini/scsi-next' into staging
Peter Maydell [Thu, 22 May 2014 14:27:46 +0000 (15:27 +0100)]
Merge remote-tracking branch 'remotes/bonzini/scsi-next' into staging

* remotes/bonzini/scsi-next:
  megasas: remove buildtime strings
  block: iscsi build fix if LIBISCSI_FEATURE_IOVECTOR is not defined
  virtio-scsi: Plug memory leak on virtio_scsi_push_event() error path
  scsi: Document intentional fall through in scsi_req_length()

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
10 years agoqapi: zero-initialize all QMP command parameters
Michael Roth [Tue, 20 May 2014 17:20:39 +0000 (12:20 -0500)]
qapi: zero-initialize all QMP command parameters

In general QMP command parameter values are specified by consumers of the
QMP/HMP interface, but in the case of optional parameters these values may
be left uninitialized.

It is considered a bug for code to make use of optional parameters that have
not been flagged as being present by the marshalling code (via corresponding
has_<parameter> parameter), however our marshalling code will still pass
these uninitialized values on to the corresponding QMP function (to then
be ignored). Some compilers (clang in particular) consider this unsafe
however, and generate warnings as a result. As reported by Peter Maydell:

  This is something clang's -fsanitize=undefined spotted. The
  code generated by qapi-commands.py in qmp-marshal.c for
  qmp_marshal_* functions where there are some optional
  arguments looks like this:

      bool has_force = false;
      bool force;

      mi = qmp_input_visitor_new_strict(QOBJECT(args));
      v = qmp_input_get_visitor(mi);
      visit_type_str(v, &device, "device", errp);
      visit_start_optional(v, &has_force, "force", errp);
      if (has_force) {
          visit_type_bool(v, &force, "force", errp);
      }
      visit_end_optional(v, errp);
      qmp_input_visitor_cleanup(mi);

      if (error_is_set(errp)) {
          goto out;
      }
      qmp_eject(device, has_force, force, errp);

  In the case where has_force is false, we never initialize
  force, but then we use it by passing it to qmp_eject.
  I imagine we don't then actually use the value, but clang
  complains in particular for 'bool' variables because the value
  that ends up being loaded from memory for 'force' is not either
  0 or 1 (being uninitialized stack contents).

Fix this by initializing all QMP command parameters to {0} in the
marshalling code prior to passing them on to the QMP functions.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
10 years agoscripts/qapi.py: Avoid syntax not supported by Python 2.4
Luiz Capitulino [Tue, 20 May 2014 17:50:19 +0000 (13:50 -0400)]
scripts/qapi.py: Avoid syntax not supported by Python 2.4

The Python "except Foo as x" syntax was only introduced in
Python 2.6, but we aim to support Python 2.4 and later.
Use the old-style "except Foo, x" syntax instead, thus
fixing configure/compile on systems with older Python.

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Tested-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>