Commit Graph

44317 Commits

Author SHA1 Message Date
Peter Maydell 235ea1f5c8 target-arm: Give CPSR setting on 32-bit exception return its own helper
The rules for setting the CPSR on a 32-bit exception return are
subtly different from those for setting the CPSR via an instruction
like MSR or CPS. (In particular, in Hyp mode changing the mode bits
is not valid via MSR or CPS.) Split the exception-return case into
its own helper for setting CPSR, so we can eventually handle them
differently in the helper function.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Sergey Fedorov <serge.fdrv@gmail.com>
Message-id: 1455556977-3644-2-git-send-email-peter.maydell@linaro.org
2016-02-26 15:09:41 +00:00
Peter Maydell 4d1e324b22 MIPS patches 2016-02-26
Changes:
 * support for FPU and MSA in KVM guest
 * support for R6 Virtual Processors
 -----BEGIN PGP SIGNATURE-----
 
 iQEcBAABAgAGBQJW0DH5AAoJEFIRjjwLKdprloMH+QHAytLDPk+2R17Axkj3zcsc
 +bMZFPSCEpHxXRChP+oXFx8qsXMySVecWM1WQt4DKLuQux6kimhw99TECLNjkdCS
 VlkRt5wtkzGRxlci0CJ8kSjpx/4/7y+OP/Bu4ubSGn7NWm/nATbKwNcwFzTlcGIQ
 w8PwyrLxCKS2j9nz9Z8K31E+sQzCbg3W+5Az4EJzTKmTxZMzKPMA/Pd5mZGQZ4UP
 DjPdPyMjffCXlXnC2AjeIBAFECmyAxysRwAJStPzTpBnwSPBO53vnMG2IuGEIg6f
 NiBYDAb3nOFUF+nuiVT+lkK0iDYkpUZh2e7nI3xtlChgVkJmPsP8XaqvamSgpF8=
 =8Mll
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/lalrae/tags/mips-20160226' into staging

MIPS patches 2016-02-26

Changes:
* support for FPU and MSA in KVM guest
* support for R6 Virtual Processors

# gpg: Signature made Fri 26 Feb 2016 11:07:37 GMT using RSA key ID 0B29DA6B
# gpg: Good signature from "Leon Alrae <leon.alrae@imgtec.com>"

* remotes/lalrae/tags/mips-20160226:
  target-mips: implement R6 multi-threading
  mips/kvm: Support MSA in MIPS KVM guests
  mips/kvm: Support FPU in MIPS KVM guests
  mips/kvm: Support signed 64-bit KVM registers
  mips/kvm: Support unsigned KVM registers
  mips/kvm: Implement Config CP0 registers
  mips/kvm: Implement PRid CP0 register
  mips/kvm: Remove a couple of noisy DPRINTFs

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-02-26 12:54:22 +00:00
Peter Maydell a88a5cd2e8 Update OpenBIOS images
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQEcBAABAgAGBQJW0CywAAoJEFvCxW+uDzIfa6cH/j2moIM/DkqupY1MHGTyH+Hj
 oGASYSc96/NxnRERqbTMz9vHf3MJRfO/dEXQF/WFRlSkRkn38niwczRebunAZvli
 I27Ham1HX3aLQCikmZQBbHoa6kuXykQXWUXvatlq16bPnzc3tX7DShWuWRnBG0RM
 P7vNvNXYG741WT2h+Wk73KlGkSvEy/zAonTwVNlPuU+Y09wfqP0aFIAQaHYAXKvO
 mTFjzf/O6mEO6NA47v2K/GabszE6yItiRLewqIRGTviUe4AEWJM0clQ1vCSLGD1a
 FkY9sZeVlAaXZgo5wAQ8drLyKt4lBukAOV7BSkVbtsiEkIsSxQNTI1t4zt62MjM=
 =dzRb
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/mcayland/tags/qemu-openbios-signed' into staging

Update OpenBIOS images

# gpg: Signature made Fri 26 Feb 2016 10:45:04 GMT using RSA key ID AE0F321F
# gpg: Good signature from "Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>"

* remotes/mcayland/tags/qemu-openbios-signed:
  Update OpenBIOS images

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-02-26 12:24:03 +00:00
Mark Cave-Ayland 2d4846bd7b Update OpenBIOS images
Update OpenBIOS images to SVN r1391 built from submodule.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2016-02-26 10:44:40 +00:00
Yongbok Kim 01bc435b44 target-mips: implement R6 multi-threading
MIPS Release 6 provides multi-threading features which replace
pre-R6 MT Module. CP0.Config3.MT is always 0 in R6, instead there is new
CP0.Config5.VP (Virtual Processor) bit which indicates presence of
multi-threading support which includes CP0.GlobalNumber register and
DVP/EVP instructions.

Signed-off-by: Yongbok Kim <yongbok.kim@imgtec.com>
Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
2016-02-26 08:59:17 +00:00
James Hogan bee62662a3 mips/kvm: Support MSA in MIPS KVM guests
Support the new KVM_CAP_MIPS_MSA capability, which allows MIPS SIMD
Architecture (MSA) to be exposed to the KVM guest.

The capability is enabled if the guest core has MSA according to its
Config3 register. Various config bits are now writeable so that KVM is
aware of the configuration (Config3.MSAP) and so that QEMU can
save/restore the guest modifiable bits (Config5.MSAEn). The MSACSR/MSAIR
registers and the MSA vector registers are now saved/restored. Since the
FP registers are a subset of the vector registers, they are omitted if
the guest has MSA.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Leon Alrae <leon.alrae@imgtec.com>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
2016-02-26 08:59:17 +00:00
James Hogan 152db36ae6 mips/kvm: Support FPU in MIPS KVM guests
Support the new KVM_CAP_MIPS_FPU capability, which allows the host's FPU
to be exposed to the KVM guest.

The capability is enabled if the guest core has an FPU according to its
Config1 register. Various config bits are now writeable so that KVM is
aware of the configuration (Config1.FP) and so that QEMU can
save/restore the guest modifiable bits (Config5.FRE, Config5.UFR,
Config5.UFE). The FCSR/FIR registers and the floating point registers
are now saved/restored (depending on the FR mode bit).

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Leon Alrae <leon.alrae@imgtec.com>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
2016-02-26 08:59:17 +00:00
James Hogan d319f83fe9 mips/kvm: Support signed 64-bit KVM registers
Rename kvm_mips_{get,put}_one_reg64() to kvm_mips_{get,put}_one_ureg64()
since they take an int64_t pointer, and add separate signed 64-bit
accessors. These will be used for double precision floating point
registers.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Leon Alrae <leon.alrae@imgtec.com>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
2016-02-26 08:59:17 +00:00
James Hogan 0759487b56 mips/kvm: Support unsigned KVM registers
Add KVM register access functions for the uint32_t type. This is
required for FP and MSA control registers, which are represented as
unsigned 32-bit integers.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Leon Alrae <leon.alrae@imgtec.com>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
2016-02-26 08:59:17 +00:00
James Hogan 03cbfd7b5c mips/kvm: Implement Config CP0 registers
Implement saving and restoring to KVM state of the Config CP0 registers
(namely Config, Config1, Config2, Config3, Config4, and Config5). These
control the features available to a guest, and a few of the fields will
soon be writeable by a guest so QEMU needs to know about them so as not
to clobber them on migration/savevm.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Leon Alrae <leon.alrae@imgtec.com>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
2016-02-26 08:59:17 +00:00
James Hogan 461a1582f0 mips/kvm: Implement PRid CP0 register
Implement saving and restoring to KVM state of the Processor ID (PRid)
CP0 register. This allows QEMU to control the PRid exposed to the guest
instead of using the default set by KVM.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Reviewed-by: Leon Alrae <leon.alrae@imgtec.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
2016-02-26 08:59:17 +00:00
James Hogan c489e5591f mips/kvm: Remove a couple of noisy DPRINTFs
The DPRINTFs in cpu_mips_io_interrupts_pending() and kvm_arch_pre_run()
are particularly noisy during normal execution, and also not
particularly helpful. Remove them so that more important debug messages
can be more easily seen.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Reviewed-by: Leon Alrae <leon.alrae@imgtec.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
2016-02-26 08:59:17 +00:00
Peter Maydell 67ef811ed1 qemu-ga patch queue for 2.6
* fix w32 build breakage when VSS enabled
 * fix up wchar handling in guest-set-user-password
 * fix re-install handling for w32 MSI installer
 * add w32 support for guest-get-vcpus
 * add support for enums in guest-file-seek SEEK params
   instead of relying on platform-specific integer values
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJWzzLhAAoJEDNTyc7xCLWE6gIH/2INKPuMEjKea5EFY5K7L7ux
 xbBfW9eDX1yhoBTUzEMT7Wuh0j59tlGlmubEJ+SwoHCC6otHMCbIjFI3/x+FubbY
 yNBLca2gEbIe+ojujTJRHLp5Zr6AwjuD5AH08Po29zWBeTUUVZb5SvmqIMk5Awr9
 wyLMKErC1XOQz3PAOn0ifZCWflzqZOhBd/XnDmOu0Yi9dOlvsOUjo3ZXQqNwItu6
 ta0CEumxkE8rV6xLq7R+iaj0jjZdIK54VKp2FgPsSSwnV+zcnkx5yfHpmwvIQ6DD
 OT11hDldcPd6/Kj6oSQVh7Z2Qfzw3E9vCkKR0Vu9/2nq4lcZ7oyVwllKqX5TfDg=
 =1xjV
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/mdroth/tags/qga-pull-2016-02-25-tag' into staging

qemu-ga patch queue for 2.6

* fix w32 build breakage when VSS enabled
* fix up wchar handling in guest-set-user-password
* fix re-install handling for w32 MSI installer
* add w32 support for guest-get-vcpus
* add support for enums in guest-file-seek SEEK params
  instead of relying on platform-specific integer values

# gpg: Signature made Thu 25 Feb 2016 16:59:13 GMT using RSA key ID F108B584
# gpg: Good signature from "Michael Roth <flukshun@gmail.com>"
# gpg:                 aka "Michael Roth <mdroth@utexas.edu>"
# gpg:                 aka "Michael Roth <mdroth@linux.vnet.ibm.com>"

* remotes/mdroth/tags/qga-pull-2016-02-25-tag:
  qga: fix w32 breakage due to missing osdep.h includes
  qga: check utf8-to-utf16 conversion
  qga: fix off-by-one length check
  qga: use wide-chars constants for wchar_t comparisons
  qga: use size_t for wcslen() return value
  qga: use more idiomatic qemu-style eol operators
  qga: implement the guest-get-vcpus for windows
  qemu-ga: Fixed minor version switch issue
  qga: Support enum names in guest-file-seek

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-02-25 17:33:19 +00:00
Michael Roth e55eb806db qga: fix w32 breakage due to missing osdep.h includes
requester.h relied on qemu/compiler.h definitions to
handle GCC_FMT_ATTR() stub, but this include was removed as part
of scripted clean-ups via 30456d5:

  all: Clean up includes

under the assumption that all C files would have included it via
qemu/osdep.h at that point. requester.cpp was likely missed
due to C++ files requiring manual/special handling as well as
VSS build options needing to be enabled to trigger build failures.

Fix this by including qemu/osdep.h. That in turn pulls in a
macro from qapi/error.h that conflicts with a struct field name
in requester.h, so fix that as well by renaming the field.

While we're at it, fix up provider.cpp/install.cpp to include
osdep.h as well.

Cc: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
2016-02-25 10:54:32 -06:00
Lluís Vilanova 0c6940d086 build: [bsd-user] Rename "syscall.h" to "target_syscall.h" in target directories
This fixes double-definitions in bsd-user builds when using the UST
tracing backend (which indirectly includes the system's "syscall.h").

Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-02-25 16:41:08 +00:00
Marc-André Lureau 8021de1013 qga: check utf8-to-utf16 conversion
UTF8 to UTF16 conversion can fail for genuine reasons, let's check errors.

Reported-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2016-02-25 09:48:52 -06:00
Marc-André Lureau 25d943b957 qga: fix off-by-one length check
Laszlo Ersek said: "The length check is off by one (in the safe direction); it
should be (nchars >= 2). The processing should be active for the wide string
L"\r\n" -- resulting in the empty wide string --, I believe."

Reported-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2016-02-25 09:48:51 -06:00
Marc-André Lureau 6c6916dac8 qga: use wide-chars constants for wchar_t comparisons
Reported-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2016-02-25 09:48:51 -06:00
Marc-André Lureau 6771197dff qga: use size_t for wcslen() return value
Reported-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2016-02-25 09:48:51 -06:00
Marc-André Lureau 02506e2d54 qga: use more idiomatic qemu-style eol operators
Reported-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2016-02-25 09:48:51 -06:00
Gal Hammer a7a173624e qga: implement the guest-get-vcpus for windows
Signed-off-by: Gal Hammer <ghammer@redhat.com>
Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
* report rather than assert when VCPU count == 0
* fix up subject: s/set-vcpus/get-vcpus/
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2016-02-25 09:48:51 -06:00
Leonid Bloch 01fdadde80 qemu-ga: Fixed minor version switch issue
With automatically generated GUID, on minor version changes, an error
occurred, stating that there is a problem with the installer.
Now, a notification is shown, warning the user that another version of
this product is already installed, and that configuration or removal of
the existing version is possible through Add/Remove Programs on the
Control Panel (expected behavior).

Signed-off-by: Leonid Bloch <leonid@daynix.com>
Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2016-02-25 09:48:51 -06:00
Eric Blake 0b4b49387c qga: Support enum names in guest-file-seek
Magic constants are a pain to use, especially when we run the
risk that our choice of '1' for QGA_SEEK_CUR might differ from
the host or guest's choice of SEEK_CUR.  Better is to use an
enum value, via a qapi alternate type for back-compatibility.

With this,
 {"command":"guest-file-seek", "arguments":{"handle":1,
  "offset":0, "whence":"cur"}}
becomes a synonym for the older
 {"command":"guest-file-seek", "arguments":{"handle":1,
  "offset":0, "whence":1}}

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2016-02-25 09:48:50 -06:00
Peter Maydell 586fc27e6a * Asynchronous dump-guest-memory from Peter
* improved logging with -D -daemonize from Dimitris
 * more address_space_* optimization from Gonglei
 * TCG xsave/xrstor thinko fix
 * chardev bugfix and documentation patch
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQEcBAABCAAGBQJWzxnbAAoJEL/70l94x66DlfkIAJyo9kOareVLOnAE8ccayghk
 0SbU1ZR9etgdeH4vZIUKzFzSg86pnqqub/w9yxgNG35PsiXVOnzgYSv6W1qsXdVE
 v32u6c+vWHvHc3cCOFI5+6nURftf2+p/vB2VFXiI23VUbhs22UAjXsUdfbp321X5
 Krme2fxk0kmwPHoKiyek0qiXa8nt0fiuFzU7DN7gTQMoDFaDEqvcULlNJHUFnep+
 M1yQfhSzrD97bafPwmIDU0LejJxrzR6phuzWedugU1tay6y3pD85wQqHdFI7fn/o
 dC4F+vg41Lc/5jKUgRMpe5FmX4VM+DvRdYgZZsp9/SkBM7DuL7crhVWVwvQj82Y=
 =8BvG
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging

* Asynchronous dump-guest-memory from Peter
* improved logging with -D -daemonize from Dimitris
* more address_space_* optimization from Gonglei
* TCG xsave/xrstor thinko fix
* chardev bugfix and documentation patch

# gpg: Signature made Thu 25 Feb 2016 15:12:27 GMT using RSA key ID 78C7AE83
# gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>"
# gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>"

* remotes/bonzini/tags/for-upstream:
  target-i386: fix confusion in xcr0 bit position vs. mask
  chardev: Properly initialize ChardevCommon components
  memory: Remove unreachable return statement
  memory: optimize qemu_get_ram_ptr and qemu_ram_ptr_length
  exec: store RAMBlock pointer into memory region
  log: Redirect stderr to logfile if deamonized
  dump-guest-memory: add qmp event DUMP_COMPLETED
  Dump: add hmp command "info dump"
  Dump: add qmp command "query-dump"
  DumpState: adding total_size and written_size fields
  dump-guest-memory: add "detach" support
  dump-guest-memory: disable dump when in INMIGRATE state
  dump-guest-memory: introduce dump_process() helper function.
  dump-guest-memory: add dump_in_progress() helper function
  dump-guest-memory: using static DumpState, add DumpStatus
  dump-guest-memory: add "detach" flag for QMP/HMP interfaces.
  dump-guest-memory: cleanup: removing dump_{error|cleanup}().
  scripts/kvm/kvm_stat: Fix missing right parantheses and ".format(...)"
  qemu-options.hx: Improve documentation of chardev multiplexing mode

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-02-25 15:30:57 +00:00
Paolo Bonzini cfc3b074de target-i386: fix confusion in xcr0 bit position vs. mask
The xsave and xrstor helpers are accessing the x86_ext_save_areas array
using a bit mask instead of a bit position.  Provide two sets of XSTATE_*
definitions and use XSTATE_*_BIT when a bit position is requested.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Acked-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-02-25 16:11:29 +01:00
Eric Blake 21a933ea33 chardev: Properly initialize ChardevCommon components
Commit d0d7708b forgot to parse logging for spice chardevs and
virtual consoles. This requires making qemu_chr_parse_common()
non-static. While at it, use a temporary variable to make the
code shorter, as well as reduce the churn when a later patch
alters the layout of simple unions.

Signed-off-by: Eric Blake <eblake@redhat.com>
CC: Daniel P. Berrange <berrange@redhat.com>
Message-Id: <1455927587-28033-2-git-send-email-eblake@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-02-25 16:11:29 +01:00
Gonglei d61524486c memory: Remove unreachable return statement
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Message-Id: <1455935721-8804-4-git-send-email-arei.gonglei@huawei.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-02-25 16:11:29 +01:00
Gonglei 3655cb9c73 memory: optimize qemu_get_ram_ptr and qemu_ram_ptr_length
these two functions consume too much cpu overhead to
find the RAMBlock by ram address.

After this patch, we can pass the RAMBlock pointer
to them so that they don't need to find the RAMBlock
anymore most of the time. We can get better performance
in address translation processing.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Message-Id: <1455935721-8804-3-git-send-email-arei.gonglei@huawei.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-02-25 16:11:29 +01:00
Gonglei 58eaa2174e exec: store RAMBlock pointer into memory region
Each RAM memory region has a unique corresponding RAMBlock.
In the current realization, the memory region only stored
the ram_addr which means the offset of RAM address space,
We need to qurey the global ram.list to find the ram block
by ram_addr if we want to get the ram block, which is very
expensive.

Now, we store the RAMBlock pointer into memory region
structure. So, if we know the mr, we can easily get the
RAMBlock.

Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Message-Id: <1456130097-4208-2-git-send-email-arei.gonglei@huawei.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-02-25 16:11:26 +01:00
Peter Maydell 774ae4254d TriCore bugfixes and synchronous trap implementation
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABCgAGBQJWzuw1AAoJEArSxjlracoUJ/UP/0g8jF2XGXuw+FBAEZLC9RGn
 ZYmUrToQtsIWxUsQzKyF/q9Y5c1yAXbuO8rwrTEbX1YKF/eO2gdL0aHfgzXOajwZ
 o6MORUSNPY9Ml2QcsmcML/9SIANlUpGVGnfot5J10ogTf2G9aA90YH6zkwTUb2F9
 c9fYGQcxhoScnTJwr+YOnRzChU1Xk7OqQzkc6U+kt6oJdfahE03ViZC/1KS5kZWK
 PFsH83FLBl1Jc70TY7tr44jL7EKzfq3Rc1Zw/45K3NiHFxOw7zA67Jfo9ClcHLdh
 kVTE1qSwUNFh9jpp5VjRFTBvNDV2C7k1iVDNPDbyU9iSdm/nFy9h9xKOVCOnPwBU
 jRKIXM765TzMpp/Yv648ecPuoO9Top98Cb9zc73/sZw+CjcMFpapFFdY2D+jEWYz
 YBRx7EsGIQV/KcmMM4bxMPB98bLkVoBgQ5effERq6zPKqmLczqWEwcLrVNfL4Cx/
 q0NgsR3a9oaRga8kvrl77gCOxxjM/bzGNSXHfzHq3fXnYvnz/M7C6anWJlIULW3W
 kIDtQjlkwLGYwbPpp2JLTKHQwvTt8ZywryHb+0L3aenTqPUh0nbRQFCslHVlHFal
 DsJFWQEVkrfMDXNSeIz8PDuSynVs72pBSyJORngh5sfUZ/5IoE3/CuuBOL0mge3P
 VhZ3hsL18DNZzp+KY++9
 =SOM3
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/bkoppelmann/tags/pull-tricore-20160225' into staging

TriCore bugfixes and synchronous trap implementation

# gpg: Signature made Thu 25 Feb 2016 11:57:41 GMT using RSA key ID 6B69CA14
# gpg: Good signature from "Bastian Koppelmann <kbastian@mail.uni-paderborn.de>"

* remotes/bkoppelmann/tags/pull-tricore-20160225:
  target-tricore: add opd trap generation
  target-tricore: add illegal opcode trap generation
  target-tricore: add context managment trap generation
  target-tricore: Add trap handling & SOVF/OVF traps
  target-tricore: Fix wrong precedences on psw_write
  target-tricore: fix save_context_upper using env->PSW

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-02-25 12:57:22 +00:00
Peter Maydell df215b59d9 vhost, virtio, pci, pc
Fixes all over the place.
 virtio dataplane migration support.
 Old q35 machine types removed.
 
 Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJWzuKeAAoJECgfDbjSjVRpGzIH/1Tz6CoEq1rowiyVJ9B80oQU
 gDI2YWnJDSwJllmAF0rmoPRBQR8op3ZETZiCAcADHoZ7kdBNWGbyQeaDrrEPH7Q/
 rCDVt8Q3g80vs89aWKG0nQ16J2MW5TbkuiQw7pjQSdc9AbUdWpUqSiWnpZ+sPAql
 6DuVpjQ4/rN2alucXoa1Sir8KDDV7kBuY8U6/KoY890qzh842dv2523qvuCza9yR
 KX8Imj3oQAFjFSv5t1aOD3yYvWFd73EsReHPLGb1JtsVr/6wjs0sFUyA3JicBgnT
 +kWoSObWikfDY69HnqTkJpkun6woMM3zW5h2SkUBf9QP3yqLfGIp9uSriNN84Ak=
 =KXyh
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging

vhost, virtio, pci, pc

Fixes all over the place.
virtio dataplane migration support.
Old q35 machine types removed.

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

# gpg: Signature made Thu 25 Feb 2016 11:16:46 GMT using RSA key ID D28D5469
# gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>"
# gpg:                 aka "Michael S. Tsirkin <mst@redhat.com>"

* remotes/mst/tags/for_upstream: (21 commits)
  q35: No need to check gigabyte_align
  q35: Remove unused q35-acpi-dsdt.aml file
  ich9: Remove enable_tco arguments from init functions
  machine: Remove no_tco field
  q35: Remove old machine versions
  tests/vhost-user-bridge: fix build on 32 bit systems
  vring: remove
  virtio-scsi: do not use vring in dataplane
  virtio-blk: do not use vring in dataplane
  virtio-blk: fix "disabled data plane" mode
  virtio: export vring_notify as virtio_should_notify
  virtio: add AioContext-specific function for host notifiers
  vring: make vring_enable_notification return void
  block-migration: acquire AioContext as necessary
  pci core: function pci_bus_init() cleanup
  pci core: function pci_host_bus_register() cleanup
  balloon: Use only 'pc-dimm' type dimm for ballooning
  virtio-balloon: rewrite get_current_ram_size()
  move get_current_ram_size to virtio-balloon.c
  vhost-user: don't merge regions with different fds
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-02-25 12:13:49 +00:00
Bastian Koppelmann 828066c78a target-tricore: add opd trap generation
If an instruction uses a 64 bit register which consists of an even-odd pair
of 32 bit registers and if the register specifier in the instruction is
odd an opd trap is raised.

Reviewed-by: Richard Henderson  <rth@twiddle.net>
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Message-Id: <1455889426-1923-5-git-send-email-kbastian@mail.uni-paderborn.de>
2016-02-25 12:54:50 +01:00
Bastian Koppelmann f678f671ba target-tricore: add illegal opcode trap generation
Reviewed-by: Richard Henderson  <rth@twiddle.net>
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Message-Id: <1455889426-1923-4-git-send-email-kbastian@mail.uni-paderborn.de>
2016-02-25 12:54:47 +01:00
Bastian Koppelmann 3292b4477f target-tricore: add context managment trap generation
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Message-Id: <1455889426-1923-3-git-send-email-kbastian@mail.uni-paderborn.de>
2016-02-25 12:54:45 +01:00
Bastian Koppelmann 518d7fd2a0 target-tricore: Add trap handling & SOVF/OVF traps
Add the infrastructure needed to generate and handle traps and
implement the generation of SOVF and OVF traps.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Message-Id: <1455889426-1923-2-git-send-email-kbastian@mail.uni-paderborn.de>
2016-02-25 12:54:42 +01:00
Bastian Koppelmann 5dc1fbae70 target-tricore: Fix wrong precedences on psw_write
Wrong braces on the restore of the cached TCGv SV and V bit could lead to
a wrong PSW. While at this it removes unnecessary braces for the restore
of the cached TCGv AV and SAV bits.

Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
2016-02-25 12:51:31 +01:00
Bastian Koppelmann 723733575b target-tricore: fix save_context_upper using env->PSW
If the cached bits for C, V, SV, AV, or SAV were set, they would
not be saved during the context save since env->PSW was stored instead
of properly reading them using psw_read().

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
2016-02-25 12:51:27 +01:00
Peter Maydell 8283f6f821 Second pull req with getrandom fix
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIVAwUAVs7eJrRIkN7ePJvAAQjjyhAAs7UiSZFxFf65DDUaGJz4E5bMiP65QrPb
 TSYYLeNkiyI6eBLFFc1ypiMJOAMF5ZMs81hiNAMgIZVJvyr0gMYU5ImngHhOX4lv
 +ZM6ODuYFVRv1cXF5gAK6s6EBEMBGvP5yKBXVEh0OlsPOtY0tUcPRsvW1I2fO9Hq
 LOZ0TmcYAgTJ3cY4+kM5yWtpfOBZV5m2noOoWCmXBWZhmbTxar3YGraTpgfDABDe
 hoiSpP1r09uQwoPURgK71xlojX8ZU4iqyUqVo2s1jKnV3zyRz5JzOZoJjWBrjA4d
 xqgQ/A8nW7k5A6CHEZ9R8O75iwZn4oZ7rp6aTnu+CwwY90xWc/1TFfcZCnvPtdMf
 M3lR2C3hYxGCRTTYBGDsfLuvSjHZvm+xrujxijejLCTAczeyEFPFC0FJ8hLe7fra
 AgA8KbD3r+QD9VtFRnjGsnJn/JDppu1CZBbWOALey4W7jEVq5h6pSoqPboHwhKEH
 FccGo/sR3fY2TyvheRTQcGJuFw/NNXdrTQNmQgoi+BWaz1OZ11xsYSg5eYcnbHZ8
 vURWhI0tXdYWqSmL7EclX2/eWz0j1Lrnd1VsiRN3w2MxBobqswIX2IyPMmsgl0Kd
 hy00IgcbpuYxAnC3na6IacnQKuzVwQC3tJudJ6B4V0/kHILX0U0yDSR9gHkrkhRL
 Vzi8BuX1X/c=
 =UhaS
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/riku/tags/pull-linux-user-20160225' into staging

Second pull req with getrandom fix

# gpg: Signature made Thu 25 Feb 2016 10:57:42 GMT using RSA key ID DE3C9BC0
# gpg: Good signature from "Riku Voipio <riku.voipio@iki.fi>"
# gpg:                 aka "Riku Voipio <riku.voipio@linaro.org>"

* remotes/riku/tags/pull-linux-user-20160225:
  linux-user: add getrandom() syscall
  linux-user: correct timerfd_create syscall numbers
  linux-user: remove unavailable syscalls from aarch64
  linux-user: sync syscall numbers with kernel
  linux-user: Don't assert if guest tries shmdt(0)
  linux-user: set ppc64/ppc64le default CPU to POWER8
  build: [linux-user] Rename "syscall.h" to "target_syscall.h" in target directories
  linux-user: fix realloc size of target_fd_trans.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2016-02-25 11:46:53 +00:00
Eduardo Habkost 533e8bbb55 q35: No need to check gigabyte_align
gigabyte_align is always true on q35, so we don't need the
!gigabyte_align compat code anymore.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
2016-02-25 13:14:19 +02:00
Eduardo Habkost 75fb3d286e q35: Remove unused q35-acpi-dsdt.aml file
The file was used only by older machine-types, and it is not
needed anymore.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
2016-02-25 13:14:19 +02:00
Eduardo Habkost 18d6abae3e ich9: Remove enable_tco arguments from init functions
The enable_tco arguments are always true, so they are not needed
anymore.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
2016-02-25 13:14:19 +02:00
Eduardo Habkost d6b304ba92 machine: Remove no_tco field
The field is always set to zero, so it is not necessary anymore.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
2016-02-25 13:14:19 +02:00
Eduardo Habkost 86165b499e q35: Remove old machine versions
Migration with q35 was not possible before commit
04329029a8, because q35
unconditionally creates an ich9-ahci device, that was marked as
unmigratable. So all q35 machine classes before pc-q35-2.4 were
not migratable, so there's no point in keeping compatibility code
for them.

Remove all old pc-q35 machine classes and keep only pc-q35-2.4
and newer.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
2016-02-25 13:14:19 +02:00
Michael S. Tsirkin 5602b39ff3 tests/vhost-user-bridge: fix build on 32 bit systems
Mainly casts between void * and uint64_t, and wrong
format for size_t.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2016-02-25 13:14:19 +02:00
Paolo Bonzini fee089e4e2 vring: remove
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
2016-02-25 13:14:19 +02:00
Paolo Bonzini e24a47c5b7 virtio-scsi: do not use vring in dataplane
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
2016-02-25 13:14:19 +02:00
Paolo Bonzini 03de2f5274 virtio-blk: do not use vring in dataplane
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
2016-02-25 13:14:18 +02:00
Paolo Bonzini 2906cddfec virtio-blk: fix "disabled data plane" mode
In disabled mode, virtio-blk dataplane seems to be enabled, but flow
actually goes through the normal virtio path.  This patch simplifies a bit
the handling of disabled mode.  In disabled mode, virtio_blk_handle_output
might be called even if s->dataplane is not NULL.

This is a bit tricky, because the current check for s->dataplane will
always trigger, causing a continuous stream of calls to
virtio_blk_data_plane_start.  Unfortunately, these calls will not
do anything.  To fix this, set the "started" flag even in disabled
mode, and skip virtio_blk_data_plane_start if the started flag is true.
The resulting changes also prepare the code for the next patch, were
virtio-blk dataplane will reuse the same virtio_blk_handle_output function
as "regular" virtio-blk.

Because struct VirtIOBlockDataPlane is opaque in virtio-blk.c, we have
to move s->dataplane->started inside struct VirtIOBlock.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
2016-02-25 13:14:18 +02:00
Paolo Bonzini adb3feda8d virtio: export vring_notify as virtio_should_notify
Virtio dataplane needs to trigger the irq manually through the
guest notifier.  Export virtio_should_notify so that it can be
used around event_notifier_set.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
2016-02-25 13:14:18 +02:00
Paolo Bonzini a1afb6062e virtio: add AioContext-specific function for host notifiers
This is used to register ioeventfd with a dataplane thread.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
2016-02-25 13:14:18 +02:00