Commit Graph

29603 Commits (b6a3e690b4f396633c75e18a9c3e7b6771fb71ba)

Author SHA1 Message Date
Igor Mammedov 7f1bb742be pc: disable pci-info
The BIOS that we ship in 1.7 does not use pci info
from host and so far isn't going to use it.
Taking in account problems it caused see 9604f70fdf and
to avoid future incompatibility issues, it's safest to
disable that interface by default for all machine types
including 1.7 as it was never exposed/used by guest.
And properly remove/cleanup it during 1.8 development cycle.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-11-14 09:12:13 +02:00
Anthony Liguori 5c5432e7d6 Merge remote-tracking branch 'luiz/queue/qmp' into staging
# By Luiz Capitulino (1) and Richard Henderson (1)
# Via Luiz Capitulino
* luiz/queue/qmp:
  MAINTAINERS: add git tree info for HMP, QMP and QAPI
  Adjust qapi-visit for python-2.4.3

Message-id: 1384281985-11100-1-git-send-email-lcapitulino@redhat.com
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-13 11:49:27 -08:00
Anthony Liguori 29c5b77d3d pci, pc, virtio bug fixes
This reverts PCI master abort support - we'll want it
 eventually but it exposes too many core bugs to be safe for 1.7.
 This also reverts a recent exec.c change that was an
 attempt to work-around some of these core bugs.
 
 Also included are small fixes in pc and virtio,
 and a core loader fix for PPC bamboo.
 
 Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.15 (GNU/Linux)
 
 iQEcBAABAgAGBQJSf4ZyAAoJECgfDbjSjVRp9DIIAK7yEMa9ie5n3sInKH+xHT3R
 Sf4uErqx55WfT/54dnLJPrs7DTfXblW+Qjnq/7RuaoJ32Dfshgxz64mPF+Lm2s3+
 ghjdQrKo2YkdSbbxy+AnBNO4eHMSeUs/rM2yIfi7FZU0nwC7wNe1QpAN3UjM4yAF
 5vE18xZE0Rxz/prXgofLtPHa1czvGPFk1qbS7Vag6HCSkfEI4N1Jxf9otDRV6KZP
 9hX0kTvZyOKdbhccN05G4VCWwx5YUrpBsNSoph4Jx1aokEBoucr4sgE1FPDp0H9H
 bJqDaAM2G5HNrDtIiDov5WOzRNT/ly011Q4mcaQh3va0pqUXttKCHgE1KRgn76I=
 =iMNW
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'mst/tags/for_anthony' into staging

pci, pc, virtio bug fixes

This reverts PCI master abort support - we'll want it
eventually but it exposes too many core bugs to be safe for 1.7.
This also reverts a recent exec.c change that was an
attempt to work-around some of these core bugs.

Also included are small fixes in pc and virtio,
and a core loader fix for PPC bamboo.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

# gpg: Signature made Sun 10 Nov 2013 05:13:22 AM PST using RSA key ID D28D5469
# gpg: Can't check signature: public key not found

# By Michael S. Tsirkin (3) and others
# Via Michael S. Tsirkin
* mst/tags/for_anthony:
  Revert "exec: limit system memory size"
  Revert "hw/pci: partially handle pci master abort"
  loader: drop return value for rom_add_blob_fixed
  acpi-build: disable with -no-acpi
  virtio-net: only delete bh that existed
  Fix pc migration from qemu <= 1.5

Message-id: 1384159176-31662-1-git-send-email-mst@redhat.com
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-13 11:48:35 -08:00
Anthony Liguori b873a55cf4 Merge remote-tracking branch 'stefanha/net' into staging
# By Dmitry Fleytman (1) and others
# Via Stefan Hajnoczi
* stefanha/net:
  virtio-net: broken RX filtering logic fixed
  net: fix qemu_flush_queued_packets() in presence of a hub
  net: disallow to specify multicast MAC address

Message-id: 1383928804-28866-1-git-send-email-stefanha@redhat.com
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-13 11:48:03 -08:00
Anthony Liguori deb0f50065 Merge remote-tracking branch 'stefanha/block' into staging
# By Jeff Cody (26) and others
# Via Stefan Hajnoczi
* stefanha/block: (37 commits)
  block: Round up total_sectors
  block: vhdx qemu-iotest - log replay of data sector
  block: qemu-iotests for vhdx, add write test support
  block: vhdx - update _make_test_img() to filter out vhdx options
  block: vhdx - add .bdrv_create() support
  block: vhdx - fix comment typos in header, fix incorrect struct fields
  block: vhdx - break out code operations to functions
  block: vhdx - move more endian translations to vhdx-endian.c
  block: vhdx - remove BAT file offset bit shifting
  block: vhdx write support
  block: vhdx - add log write support
  block: vhdx - add region overlap detection for image files
  block: vhdx - log parsing, replay, and flush support
  block: vhdx code movement - move vhdx_close() above vhdx_open()
  block: vhdx - update log guid in header, and first write tracker
  block: vhdx - break endian translation functions out
  block: vhdx - log support struct and defines
  block: vhdx code movement - VHDXMetadataEntries and BDRVVHDXState to header.
  block: vhdx - add header update capability.
  block: vhdx - minor comments and typo correction.
  ...

Message-id: 1383905551-16411-1-git-send-email-stefanha@redhat.com
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-13 11:47:44 -08:00
Anthony Liguori 70c4c5b562 Two small fixes for 1.7:
- add missing debug feature to dc233c xtensa core;
 - fix qemu abort caused by gdb attempt to invalidate a breakpoint by
   virtual address for which there's no mapping.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.14 (GNU/Linux)
 
 iQIcBAABAgAGBQJSfHdjAAoJEFH5zJH4P6BEaVIP/1PQIpsbsESuc6LNebScQhi4
 FnjNxBAkDy3v0D3fi5ltG/MxMA9KEykr5iwuQB61ypD2J6b5jLbpSPWjgy2P4n4T
 R3z8ZYvhiJBT8DmBLrK/wwvvw1hXhKrCxiBbz3TWmYB1Iz2dCeYAwVPvdZYP6AB1
 5UUMebd8Wg2Fgy/CO92IraVrhZVEHxFbJpWMq1OaQf81s01EQUVgor1kUPaPXLdg
 I3SEvym9lEEtrAaleZjf2WbhLAytgim5x6fhRUQgR/JaU+gNHmjZEtGj97ufKRBw
 QWUbvKq1Dh9Ryz6+X7XwedR9YBxX6ww6TuPL3pQZbY1Sp5qXxNR107he5FAuoDn8
 Z/BCl95qoIfD49J2mofQbAG7r37E4RHHkF2QvECAPf61h7Rf6G6rZac49SWbYRqb
 LU5PuWd9vzaJ/J6lRHcbnlwweTQDEwXe1EsaeMmKGkSp8Z1Je9KoZwpxI0/OdTIX
 LmicmB6LvWxUWXa4tfNGPLhTFSNQKcbt0c3peULbl52+96AnYEIqDXi5c2hc3Hhr
 DQip7wzwngZx9i1TcF+VLf8sE6hU6lDYQFCvW/G5bx9e9fyqqPHiJbNKID8/f/hG
 sePWG6+WrdMIfQ/eqvlrtGeIPfH+HKJKvDL3rUwkSH3Mx6M6q+OqM/6Tra1TWrP6
 /0492SeVzPOPJmE+7S2a
 =6DLv
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'filippov/tags/20131108-xtensa' into staging

Two small fixes for 1.7:

- add missing debug feature to dc233c xtensa core;
- fix qemu abort caused by gdb attempt to invalidate a breakpoint by
  virtual address for which there's no mapping.

# gpg: Signature made Thu 07 Nov 2013 09:32:19 PM PST using RSA key ID F83FA044
# gpg: Can't check signature: public key not found

# By Max Filippov
# Via Max Filippov
* filippov/tags/20131108-xtensa:
  target-xtensa: add missing DEBUG section to dc233c config
  exec: fix breakpoint_invalidate when pc may not be translated

Message-id: 1383889643-21621-1-git-send-email-jcmvbkbc@gmail.com
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-13 11:47:06 -08:00
Anthony Liguori 9f43a3f541 Merge remote-tracking branch 'kraxel/audio.3' into staging
# By Gerd Hoffmann
# Via Gerd Hoffmann
* kraxel/audio.3:
  ossaudio: check for oss support in oss_audio_init
  Revert "ossaudio: do not enable by default"

Message-id: 1383823947-5132-1-git-send-email-kraxel@redhat.com
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-13 11:46:23 -08:00
Anthony Liguori 6bddfae306 Merge remote-tracking branch 'sweil/mingw' into staging
# By Stefan Weil
# Via Stefan Weil
* sweil/mingw:
  linux-user: Fix stat64 syscall for SPARC64
  configure: Add config.status to recreate the current configuration
  nsis: Improved support for parallel installation of 32 and 64 bit code

Message-id: 1383804909-376-1-git-send-email-sw@weilnetz.de
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
2013-11-13 11:45:58 -08:00
Stefan Weil 3325a83627 console: Remove unused debug code
The local function console_print_text_attributes is no longer used since
commit 7d6ba01c37.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-11-13 16:02:28 +04:00
Stefan Weil ba1c293109 qga: Fix compilation for old versions of MinGW
While MinGW-w64 can compile the qga code, MinGW from Debian lenny
(gcc-mingw32 4.4.2-3) shows these errors:

In file included from qga/vss-win32.c:17:
qga/vss-win32/requester.h:31:
 error: expected »=«, »,«, »;«, »asm« or »__attribute__« before »requester_init«
qga/vss-win32/requester.h:32:
 error: expected »=«, »,«, »;«, »asm« or »__attribute__« before »requester_deinit«

The macro STDAPI is unknown, so add the missing include file which
defines it.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-11-13 15:59:06 +04:00
Alex Bennée fe863ab985 .travis.yml: basic compile and check recipes
This adds a build matrix definition for travis-ci.org continuous
integration service. It is usable on any public repository hosted on
GitHub. Once you have created an account signed into Travis you can
enable it on selected projects via travis-ci.org/profile. Alternatively
you can configure the service hooks on GitHub via the repository
Settings tab,then Service Hooks and selecting Travis.

Once setup Travis will automatically test every push as well as any pull
requests submitted to that repository.

The build matrix is currently split by target architecture (see TARGETS
environment variable) because a full build of QEMU can take some time.
This way you get quick feedback for any obvious errors. The additional
environment variables exist to allow additional builds to tweak the
environment. These are:

EXTRA_CONFIG - extra terms passed to configure
EXTRA_PKGS - extra dev packages to install
TEST_CMD - default "make check", can be overridden

I've confined the additional stuff to x86/x86_64 for convenience.

As Travis supports clang the main builds are done twice (once for gcc
and once for clang). However clang is disabled for the debug/trace
builds for the purposes of brevity.

Other wrinkles:

 * The lttng user-space tracing back-end is disabled
   (it is currently horribly broken)
 * The ftrace back-end doesn't run "make check"
   (it requires a mounted debugfs to work)
 * There are two debug enabled build (with and without TCG interpreter)

Signed-off-by: Alex Bennée <alex@bennee.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-11-13 15:48:38 +04:00
Cole Robinson 25a666d2ec pci-assign: Fix error_report of pci-stub message
Using multiple calls to error_report here means every line is
prefaced with the (potentially long) pci-assign command line
arguments.

Use a single error_printf to preserve the intended formatting.
Since this code path is always preceded by an error_report call,
we don't lose the command line reporting.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-11-13 15:48:38 +04:00
Fam Zheng 669aa3f6bd qapi: Fix comment for create-type to match code.
Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-11-13 15:48:38 +04:00
Antony Pavlov 8111d02878 vl: fix build when configured with no graphic support
The following error occurs when building with no graphic output support:

  vl.c: In function ‘main’:
  vl.c:2829:19: error: variable ‘ds’ set but not used [-Werror=unused-but-set-variable]
       DisplayState *ds;
                     ^
  cc1: all warnings being treated as errors

To reproduce this issue, just run:

  $ ./configure \
      --disable-curses \
      --disable-sdl \
      --disable-cocoa \
      --disable-gtk \
      --disable-vnc \
      --enable-werror
  $ make vl.o

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-11-13 15:48:38 +04:00
Stefan Hajnoczi d9570cadd5 usb: drop unused USBNetState.inpkt field
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-11-13 15:48:38 +04:00
Jan Krupa 4c6968c7a0 qemu-char: add missing characters used in keymaps
This patch adds all missing characters used in regional keymap
files which already exist in QEMU. I checked for the missing
characters by going through all of the keymaps and matching that
with records in vnc_keysym.h. If the key wasn't found I looked
it up in libxkbcommon library [1]. If I understood it correctly
this is also the same place where most of the keymaps were
exported from according to the comment on the first line in those
files. I was able to find all symbols except "quotebl" used
in Netherland keymap.

I tested this update with Czech keyboard by myself. I also asked
Matej Serc to test Slovenian keyboard layout - he reported problems
with it few days ago on this mailing list. Both layouts seems
to work fine. I wasn't able to test the remaining layouts but
since this change doesn't modify any existing symbols, just adds
new ones, I don't expect any sideeffects.

[1] http://cgit.freedesktop.org/xorg/lib/libxkbcommon

Signed-off-by: Jan Krupa <jkrupa@suse.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-11-13 15:48:38 +04:00
Jan Krupa 8280715924 qemu-char: add support for U-prefixed symbols
This patch adds support for Unicode symbols in keymap files. This
feature was already used in some keyboard layouts in QEMU generated
from XKB (e.g. Arabic) but it wasn't implemented in QEMU source code.

There is no need for check of validity of the hex string after U character
because strtol returns 0 in case the conversion was unsuccessful.

Signed-off-by: Jan Krupa <jkrupa@suse.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-11-13 15:48:38 +04:00
Jan Krupa 3751e72246 qemu-char: add Czech keymap file
This patch adds Czech keyboard layout to available keymap files
and Makefile.

Signed-off-by: Jan Krupa <jkrupa@suse.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-11-13 15:48:38 +04:00
Jan Krupa 018715f96c qemu-char: add Czech characters to VNC keysyms
This patch adds missing Czech characters to the VNC keysym table.

Signed-off-by: Jan Krupa <jkrupa@suse.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2013-11-13 15:48:38 +04:00
Luiz Capitulino dce07e0b2b MAINTAINERS: add git tree info for HMP, QMP and QAPI
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2013-11-11 10:02:21 -05:00
Richard Henderson 7b75d9d61b Adjust qapi-visit for python-2.4.3
We say we support python 2.4, but python 2.4.3 does not
support the "expr if test else expr" syntax used here.

This allows QEMU to compile on RHEL 5.3, the last release for ia64.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2013-11-11 10:02:21 -05:00
Michael S. Tsirkin ef9e455d64 Revert "exec: limit system memory size"
This reverts commit 818f86b883.

This was a work-around for bugs elsewhere in the system,
exposed by commit a53ae8e934cd54686875b5bcfc2f434244ee55d6:
    "hw/pci: partially handle pci master abort"
since that's reverted now, the work-around is not required for 1.7
anymore.
The proper fix is supporting full 64 bit addresses in the radix tree.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Marcel Apfelbaum <marcel.a@redhat.com>
2013-11-10 15:11:01 +02:00
Marcel Apfelbaum 0fbf50b6ec Revert "hw/pci: partially handle pci master abort"
This reverts commit a53ae8e934.

The patch being reverted introduced a low-priority memory region
covering all 64 bit pci address space.  This exposed the following bugs
elsewhere in the code:
 1. Some memory regions have INT64_MAX size, where the
    intent was all 64 bit address space.
    This results in a sub-page region, should be UINT64_MAX.
 2. page table rendering in exec.c ignores physical address bits
    above TARGET_PHYS_ADDR_SPACE_BITS.
    Access outside this range (e.g. from device DMA, or gdb stub)
    ends up with a wrong region.  Registering a region outside this
    range leads to page table corruption.
 3. Some regions overlap PCI hole and have same priority.
    This only works as long as no device uses the overlapping address.

It doesn't look like we can resolve all issues in time for 1.7.
Let's fix the bugs first and apply afterwards for 1.8.

Signed-off-by: Marcel Apfelbaum <marcel.a@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-11-10 14:30:00 +02:00
Michael S. Tsirkin fe1479aa25 loader: drop return value for rom_add_blob_fixed
rom_add_blob never fails, and neither does rom_add_blob_fixed,
so there's no need to return value from it.

In fact, rom_add_blob_fixed was erroneously returning -1 unconditionally
which made the only system that checked the return value -M bamboo fail
to start.

Drop the return value and drop checks from ppc440_bamboo to
fix this failure.

Reported-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-11-10 12:08:38 +02:00
Michael S. Tsirkin 81adc51315 acpi-build: disable with -no-acpi
QEMU will currently crash if started with -no-acpi flag
since acpi build code probes the PM device which isn't present
in this configuration.

To fix, don't expose ACPI tables to guest when acpi has been
disabled from command line.

Fixes LP# 1248854
https://bugs.launchpad.net/qemu/+bug/1248854

Reported-by: chao zhou <chao.zhou@intel.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
2013-11-10 12:08:38 +02:00
Jason Wang 6b9b8758c1 virtio-net: only delete bh that existed
We delete without check whether it existed during exit. This will lead NULL
pointer deference since it was created conditionally depends on guest driver
status and features. So add a check of existence before trying to delete it.

Cc: qemu-stable@nongnu.org
Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-11-10 12:08:38 +02:00
Cole Robinson 04c7d8b8de Fix pc migration from qemu <= 1.5
The following commit introduced a migration incompatibility:

commit 568f0690fd
Author: David Gibson <david@gibson.dropbear.id.au>
Date:   Thu Jun 6 18:48:49 2013 +1000

    pci: Replace pci_find_domain() with more general pci_root_bus_path()

The issue is that i440fx savevm idstr went from 0000:00:00.0/I440FX to
0000:00.0/I440FX. Unfortunately we are stuck with the breakage for
1.6 machine types.

Add a compat property to maintain the busted idstr for the 1.6 machine
types, but revert to the old style format for 1.7+, and <= 1.5.

Tested with migration from qemu 1.5, qemu 1.6, and qemu.git.

Cc: qemu-stable@nongnu.org
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-11-10 12:08:37 +02:00
Dmitry Fleytman cc386e9672 virtio-net: broken RX filtering logic fixed
Upon processing of VIRTIO_NET_CTRL_MAC_TABLE_SET command
multicast list overwrites unicast list in mac_table.
This leads to broken logic for both unicast and multicast RX filtering.

Signed-off-by: Dmitry Fleytman <dfleytma@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-08 17:32:34 +01:00
Sergey Fedorov 1597591cca net: fix qemu_flush_queued_packets() in presence of a hub
Do not return after net_hub_flush(). Always flush callee network client
incoming queue.

Signed-off-by: Sergey Fedorov <s.fedorov@samsung.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-08 17:32:34 +01:00
Dmitry Krivenok d60b20cf2a net: disallow to specify multicast MAC address
[Assigning a multicast MAC address to a NIC leads to confusing behavior.
Reject multicast MAC addresses so users are alerted to their error
straight away.

The "net/eth.h" in6_addr rename prevents a name collision with
<netinet/in.h> on Linux.
-- Stefan]

Signed-off-by: Dmitry V. Krivenok <krivenok.dmitry@gmail.com>
Reviewed-by: Amos Kong <kongjianjun@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-08 17:32:34 +01:00
Fam Zheng 7e382003f1 block: Round up total_sectors
Since b94a2610, bdrv_getlength() is omitted when probing image. VMDK
monolithicFlat is broken by that because a file < 512 bytes can't be
read with its total_sectors truncated to 0. This patch round up the size
to BDRV_SECTOR_SIZE, when a image size is not sector aligned.

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-08 10:44:24 +01:00
Max Filippov ebbfd5a094 target-xtensa: add missing DEBUG section to dc233c config
This fixes missing debug feature opcodes of dc233c core variant.

Cc: qemu-stable@nongnu.org
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2013-11-08 09:26:07 +04:00
Max Filippov e8262a1b5b exec: fix breakpoint_invalidate when pc may not be translated
This fixes qemu abort with the following message:

    include/qemu/int128.h:22: int128_get64: Assertion `!a.hi' failed.

which happens due to attempt to invalidate breakpoint by virtual address
for which get_phys_page_debug couldn't find mapping.

For more details see
http://lists.nongnu.org/archive/html/qemu-devel/2013-09/msg04582.html

Cc: qemu-stable@nongnu.org
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
2013-11-08 09:25:22 +04:00
Alexey Kardashevskiy 9d0e1dac10 pseries: Update SLOF firmware image
SLOF git commit is e2e8ac901e617573ea383f9cffd136146d0675a4

The main changes are:
* fixed bug with not passing arguments from -append
* client-architecture-support hypercall
* netboot
* USB stack fixes

The full list of changes:
  > client-architecture-support: fix wrong version read
  > client-architecture-support: fix redundant stack drop
  > Update device tree returned by CAS hypercall
  > fdt: introduce fdt-init
  > Add ibm,client-architecture-support method
  > Kernel parameter passed from qemu commandline ignored
  > Allow more than one client to open net devices simultaneously
  > ci: add missing close in else condition
  > Add GPT support
  > pci: fix interrupt-map for bridges
  > usb-ohci: preserve the toggleCarry bit in ED
  > usb-ohci: done_head processing fixes
  > usb-ohci: update init and rationalize timings
  > usb-msc: handle stall and other fixes
  > scsi: make probe more error resilient
  > usb-core: Add CLEAR FEATURE api
  > Implement range allocator
  > Remove bcm57xx network driver as module
  > Remove e1000 network driver as module
  > Remove virtio-net network driver as module
  > Remove veth network driver as module
  > Add missing close-dev in ping
  > Remove lodable network driver modules and related functions
  > Add bcm57xx network driver in libbcm
  > Add e1000 network driver in libe1k
  > Add virtio-net driver in libvirtio
  > Add veth driver in libveth
  > Get MAC address for client interface module
  > Add SLOF usleep wrapper
  > Add SLOF pci wrapper functions
  > Fix 'canon' client interface

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Alexander Graf <agraf@suse.de>
2013-11-08 04:33:19 +01:00
Alexey Kardashevskiy 29fdedfed5 spapr: add vio-bus devices to categories
In order to get devices appear in output of
"./qemu-system-ppc64 -device ?",
they must be assigned to one of DEVICE_CATEGORY_XXXX.

This puts VIO devices classes to corresponding categories.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Alexander Graf <agraf@suse.de>
2013-11-08 04:33:18 +01:00
Jeff Cody e78835b722 block: vhdx qemu-iotest - log replay of data sector
This tests the replay of a data sector in a VHDX image file.

The image file is a 10G dynamic image, with 4MB block size.  The
image was created with qemu-img, and the log left unplayed by
modification of the vhdx image format driver.

It was verified under both QEMU and Hyper-V that the image file,
post log replay, matched.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07 13:58:59 +01:00
Jeff Cody 751aec24cd block: qemu-iotests for vhdx, add write test support
This removes the IMGFMT_GENERIC blocker for read-only, so existing
iotests run read/write tests for vhdx images created by qemu-img (e.g.
tests 001, 002, 003).

In addition, this updates the sample image test for the Hyper-V
created image, to verify we can write it as well.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07 13:58:59 +01:00
Jeff Cody 228b234dd7 block: vhdx - update _make_test_img() to filter out vhdx options
The non-global option output is suppresed in _make_test_img() for
output verification in the 0?? tests.  This adds suppression for
the vhdx-unique options as well.  This allows check -vhdx to run
successfully.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07 13:58:59 +01:00
Jeff Cody 3412f7b1bd block: vhdx - add .bdrv_create() support
This adds support for VHDX image creation, for images of type "Fixed"
and "Dynamic".  "Differencing" types (i.e., VHDX images with backing
files) are currently not supported.

Options for image creation include:
    * log size:
        The size of the journaling log for VHDX.  Minimum is 1MB,
        and it must be a multiple of 1MB. Invalid log sizes will be
        silently fixed by rounding up to the nearest MB.

        Default is 1MB.

    * block size:
        This is the size of a payload block.  The range is 1MB to 256MB,
        inclusive, and must be a multiple of 1MB as well.  Invalid sizes
        and multiples will be silently fixed.  If '0' is passed, then
        a sane size is chosen (depending on virtual image size).

        Default is 0 (Auto-select).

    * subformat:
        - "dynamic"
            An image without data pre-allocated.
        - "fixed"
            An image with data pre-allocated.

        Default is "dynamic"

When creating the image file, the lettered sections are created:

-----------------------------------------------------------------.
|   (A)    |   (B)    |    (C)    |     (D)       |     (E)
|  File ID |  Header1 |  Header 2 |  Region Tbl 1 |  Region Tbl 2
|          |          |           |               |
.-----------------------------------------------------------------.
0         64KB      128KB       192KB           256KB          320KB

.---- ~ ----------- ~ ------------ ~ ---------------- ~ -----------.
|     (F)     |     (G)       |    (H)    |
| Journal Log |  BAT / Bitmap |  Metadata |  .... data ......
|             |               |           |
.---- ~ ----------- ~ ------------ ~ ---------------- ~ -----------.
1MB         (var.)          (var.)      (var.)

Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07 13:58:59 +01:00
Jeff Cody 61c02e5687 block: vhdx - fix comment typos in header, fix incorrect struct fields
VHDXPage83Data and VHDXParentLocatorHeader both incorrectly had their
MSGUID fields set as arrays of 16.  This is incorrect (it stems from
an early version where those fields were uint_8 arrays).  Those fields
were, up to this patch, unused.

Also, there were a couple of typos and incorrect wording in comments,
and those have been fixed up as well.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07 13:58:59 +01:00
Jeff Cody 1e74a971cb block: vhdx - break out code operations to functions
This is preperation for vhdx_create().  The ability to write headers,
and calculate the number of BAT entries will be needed within the
create() functions, so move this relevant code into helper functions.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07 13:58:59 +01:00
Jeff Cody c325ee1de8 block: vhdx - move more endian translations to vhdx-endian.c
In preparation for vhdx_create(), move more endian translation
functions out to vhdx-endian.c.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07 13:58:59 +01:00
Jeff Cody 0b7da092b4 block: vhdx - remove BAT file offset bit shifting
Bit shifting can be fun, but in this case it was unnecessary.  The
upper 44 bits of the 64-bit BAT entry is specifies the File Offset,
so we shifted the bits to get access to the value.

However, per the spec the value is in MB.  So we dutifully shifted back
to the left by 20 bits, to convert to a true uint64_t file offset.

This replaces those steps with just a bit mask, to get rid of the lower
20 bits instead.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07 13:58:59 +01:00
Jeff Cody d92aa8833c block: vhdx write support
This adds support for writing to VHDX image files, using coroutines.
Writes into the BAT table goes through the VHDX log.  Currently, BAT
table writes occur when expanding a dynamic VHDX file, and allocating a
new BAT entry.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07 13:58:59 +01:00
Jeff Cody 8adc52336d block: vhdx - add log write support
This adds support for writing to the VHDX log.

For spec details, see VHDX Specification Format v1.00:
https://www.microsoft.com/en-us/download/details.aspx?id=34750

There are a few limitations to this log support:
1.) There is no caching yet
2.) The log is flushed after each entry

The primary write interface, vhdx_log_write_and_flush(), performs a log
write followed by an immediate flush of the log.

As each log entry sector is a minimum of 4KB, partial sector writes are
filled in with data from the disk write destination.

If the current file log GUID is 0, a new GUID is generated and updated
in the header.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07 13:58:59 +01:00
Jeff Cody 1a848fd451 block: vhdx - add region overlap detection for image files
Regions in the image file cannot overlap - the log, region tables,
and metdata must all be unique and non-overlapping.

This adds region checking by means of a QLIST; there can be a variable
number of regions and metadata (there may be metadata or region tables
that we do not recognize / know about, but are not required).

This adds the capability to register a region for later checking, and
to check against registered regions for any overlap.

Also, if neither the BAT or Metadata region tables are found, return
error.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07 13:58:59 +01:00
Jeff Cody 0a43a1b5d7 block: vhdx - log parsing, replay, and flush support
This adds support for VHDX v0 logs, as specified in Microsoft's
VHDX Specification Format v1.00:
https://www.microsoft.com/en-us/download/details.aspx?id=34750

The following support is added:

* Log parsing, and validation - validate that an existing log
  is correct.

* Log search - search through an existing log, to find any valid
  sequence of entries.

* Log replay and flush - replay an existing log, and flush/clear
  the log when complete.

The VHDX log is a circular buffer, with elements (sectors) of 4KB.

A log entry is a variably-length number of sectors, that is
comprised of a header and 'descriptors', that describe each sector.

A log may contain multiple entries, know as a log sequence.  In a log
sequence, each log entry immediately follows the previous entry, with an
incrementing sequence number.  There can only ever be one active and
valid sequence in the log.

Each log entry must match the file log GUID in order to be valid (along
with other criteria).  Once we have flushed all valid log entries, we
marked the file log GUID to be zero, which indicates a buffer with no
valid entries.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07 13:58:58 +01:00
Jeff Cody c46415afc2 block: vhdx code movement - move vhdx_close() above vhdx_open()
Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07 13:58:58 +01:00
Jeff Cody c3906c5e82 block: vhdx - update log guid in header, and first write tracker
Allow tracking of first file write in the VHDX image, as well as
the ability to update the GUID in the header.  This is in preparation
for log support.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07 13:58:58 +01:00
Jeff Cody 0f48e8f097 block: vhdx - break endian translation functions out
This moves the endian translation functions out from the vhdx.c source,
into a separate source file. In addition to the previously defined
endian functions, new endian translation functions for log support are
added as well.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2013-11-07 13:58:58 +01:00