]> git.proxmox.com Git - mirror_qemu.git/log
mirror_qemu.git
5 years agoui/cocoa: Use the pixman image directly in switchSurface
Peter Maydell [Mon, 25 Feb 2019 10:24:28 +0000 (10:24 +0000)]
ui/cocoa: Use the pixman image directly in switchSurface

Currently the switchSurface method takes a DisplaySurface. We want
to change our DisplayChangeListener's dpy_gfx_switch callback
to do this work asynchronously on a different thread. The caller
of the switch callback will free the old DisplaySurface
immediately the callback returns, so to ensure that the
other thread doesn't access freed data we need to switch
to using the underlying pixman image instead. The pixman
image is reference counted, so we will be able to take
a reference to it to avoid it vanishing too early.

In this commit we only change the switchSurface method
to take a pixman image, and keep the flow of control
synchronous for now.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Roman Bolshakov <r.bolshakov@yadro.com>
Tested-by: Roman Bolshakov <r.bolshakov@yadro.com>
Message-id: 20190225102433.22401-3-peter.maydell@linaro.org
Message-id: 20190214102816.3393-3-peter.maydell@linaro.org

5 years agoui/cocoa: Ensure we have the iothread lock when calling into QEMU
Peter Maydell [Mon, 25 Feb 2019 10:24:27 +0000 (10:24 +0000)]
ui/cocoa: Ensure we have the iothread lock when calling into QEMU

The Cocoa UI should run on the main thread; this is enforced
in OSX Mojave. In order to be able to run on the main thread,
we need to make sure we hold the iothread lock whenever we
call into various QEMU UI midlayer functions.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Roman Bolshakov <r.bolshakov@yadro.com>
Tested-by: Roman Bolshakov <r.bolshakov@yadro.com>
Message-id: 20190225102433.22401-2-peter.maydell@linaro.org
Message-id: 20190214102816.3393-2-peter.maydell@linaro.org

5 years agoMerge remote-tracking branch 'remotes/stefanberger/tags/pull-tpm-2019-02-25-1' into...
Peter Maydell [Mon, 4 Mar 2019 15:56:07 +0000 (15:56 +0000)]
Merge remote-tracking branch 'remotes/stefanberger/tags/pull-tpm-2019-02-25-1' into staging

Merge tpm 2029/02/25 v1

# gpg: Signature made Mon 25 Feb 2019 15:05:12 GMT
# gpg:                using RSA key 75AD65802A0B4211
# gpg: Good signature from "Stefan Berger <stefanb@linux.vnet.ibm.com>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: B818 B9CA DF90 89C2 D5CE  C66B 75AD 6580 2A0B 4211

* remotes/stefanberger/tags/pull-tpm-2019-02-25-1:
  tpm_tis: convert tpm_tis_show_buffer() to use trace event
  tpm_tis: fix loop that cancels any seizure by a lower locality

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agoMerge remote-tracking branch 'remotes/cohuck/tags/s390x-20190304' into staging
Peter Maydell [Mon, 4 Mar 2019 13:38:54 +0000 (13:38 +0000)]
Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20190304' into staging

s390x updates:
- tcg: support the floating-point extension facility
- vfio-ap: support hot(un)plug of vfio-ap device
- fixes + cleanups

# gpg: Signature made Mon 04 Mar 2019 11:55:39 GMT
# gpg:                using RSA key C3D0D66DC3624FF6A8C018CEDECF6B93C6F02FAF
# gpg:                issuer "cohuck@redhat.com"
# gpg: Good signature from "Cornelia Huck <conny@cornelia-huck.de>" [unknown]
# gpg:                 aka "Cornelia Huck <huckc@linux.vnet.ibm.com>" [full]
# gpg:                 aka "Cornelia Huck <cornelia.huck@de.ibm.com>" [full]
# gpg:                 aka "Cornelia Huck <cohuck@kernel.org>" [unknown]
# gpg:                 aka "Cornelia Huck <cohuck@redhat.com>" [unknown]
# Primary key fingerprint: C3D0 D66D C362 4FF6 A8C0  18CE DECF 6B93 C6F0 2FAF

* remotes/cohuck/tags/s390x-20190304: (27 commits)
  s390x: Add floating-point extension facility to "qemu" cpu model
  s390x/tcg: Handle all rounding modes overwritten by BFP instructions
  s390x/tcg: Implement rounding mode and XxC for LOAD ROUNDED
  s390x/tcg: Implement XxC and checks for most FP instructions
  s390x/tcg: Prepare for IEEE-inexact-exception control (XxC)
  s390x/tcg: Refactor saving/restoring the bfp rounding mode
  s390x/tcg: Check for exceptions in SET BFP ROUNDING MODE
  s390x/tcg: Handle SET FPC AND LOAD FPC 3-bit BFP rounding modes
  s390x/tcg: Fix simulated-IEEE exceptions
  s390x/tcg: Refactor SET FPC AND SIGNAL handling
  s390x/tcg: Hide IEEE underflows in some scenarios
  s390x/tcg: Fix parts of IEEE exception handling
  s390x/tcg: Factor out conversion of softfloat exceptions
  s390x/tcg: Fix rounding from float128 to uint64_t/uint32_t
  s390x/tcg: Fix TEST DATA CLASS instructions
  s390x/tcg: Implement LOAD COUNT TO BLOCK BOUNDARY
  s390x/tcg: Implement LOAD LENGTHENED short HFP to long HFP
  s390x/tcg: Factor out gen_addi_and_wrap_i64() from get_address()
  s390x/tcg: Factor out vec_full_reg_offset()
  s390x/tcg: Clarify terminology in vec_reg_offset()
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agoMerge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging
Peter Maydell [Mon, 4 Mar 2019 11:04:31 +0000 (11:04 +0000)]
Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging

pci, pc, virtio: fixes, cleanups, tests

Lots of work on tests: BiosTablesTest UEFI app,
vhost-user testing for non-Linux hosts.
Misc cleanups and fixes all over the place

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
# gpg: Signature made Fri 22 Feb 2019 15:51:40 GMT
# gpg:                using RSA key 281F0DB8D28D5469
# gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" [full]
# gpg:                 aka "Michael S. Tsirkin <mst@redhat.com>" [full]
# Primary key fingerprint: 0270 606B 6F3C DF3D 0B17  0970 C350 3912 AFBE 8E67
#      Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA  8A0D 281F 0DB8 D28D 5469

* remotes/mst/tags/for_upstream: (26 commits)
  pci: Sanity test minimum downstream LNKSTA
  hw/smbios: fix offset of type 3 sku field
  pci: Move NVIDIA vendor id to the rest of ids
  virtio-balloon: Safely handle BALLOON_PAGE_SIZE < host page size
  virtio-balloon: Use ram_block_discard_range() instead of raw madvise()
  virtio-balloon: Rework ballon_page() interface
  virtio-balloon: Corrections to address verification
  virtio-balloon: Remove unnecessary MADV_WILLNEED on deflate
  i386/kvm: ignore masked irqs when update msi routes
  contrib/vhost-user-blk: fix the compilation issue
  Revert "contrib/vhost-user-blk: fix the compilation issue"
  pc-dimm: use same mechanism for [get|set]_addr
  tests/data: introduce "uefi-boot-images" with the "bios-tables-test" ISOs
  tests/uefi-test-tools: add build scripts
  tests: introduce "uefi-test-tools" with the BiosTablesTest UEFI app
  roms: build the EfiRom utility from the roms/edk2 submodule
  roms: add the edk2 project as a git submodule
  vhost-user-test: create a temporary directory per TestServer
  vhost-user-test: small changes to init_hugepagefs
  vhost-user-test: create a main loop per TestServer
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agos390x: Add floating-point extension facility to "qemu" cpu model
David Hildenbrand [Mon, 18 Feb 2019 12:27:10 +0000 (13:27 +0100)]
s390x: Add floating-point extension facility to "qemu" cpu model

The floating-point extension facility implemented certain changes to
BFP, HFP and DFP instructions.

As we don't implement HFP/DFP, we can ignore those completely. Related
to BFP, the changes include
- SET BFP ROUNDING MODE (SRNMB) instruction
- BFP-rounding-mode field in the FPC register is changed to 3 bits
- CONVERT FROM LOGICAL instructions
- CONVERT TO LOGICAL instructions
- Changes (rounding mode + XxC) added to
-- CONVERT TO FIXED
-- CONVERT FROM FIXED
-- LOAD FP INTEGER
-- LOAD ROUNDED
-- DIVIDE TO INTEGER

For TCG, we don't implement DIVIDE TO INTEGER, and it is harder to
implement, so skip that. Also, as we don't implement PFPO, we can skip
changes to that as well. The other parts are now implemented, we can
indicate the facility.

z14 PoP mentions that "The floating-point extension facility is installed
in the z/Architecture architectural mode. When bit 37 is one, bit 42 is
also one.", meaning that the DFP (decimal-floating-point) facility also
has to be indicated. We can ignore that for now.

Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20190218122710.23639-16-david@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
5 years agos390x/tcg: Handle all rounding modes overwritten by BFP instructions
David Hildenbrand [Mon, 18 Feb 2019 12:27:09 +0000 (13:27 +0100)]
s390x/tcg: Handle all rounding modes overwritten by BFP instructions

"round to nearest with ties away from 0" maps to float_round_ties_away.
"round to prepare for shorter precision" maps to float_round_to_odd.

As all instructions properly check for valid rounding modes in translate.c
we can add an assert. Fix one missing empty line.

Cc: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20190218122710.23639-15-david@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
5 years agos390x/tcg: Implement rounding mode and XxC for LOAD ROUNDED
David Hildenbrand [Mon, 18 Feb 2019 12:27:08 +0000 (13:27 +0100)]
s390x/tcg: Implement rounding mode and XxC for LOAD ROUNDED

With the floating-point extension facility, LOAD ROUNDED has
a rounding mode specification and the inexact-exception control (XxC).

Handle them just like e.g. LOAD FP INTEGER.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20190218122710.23639-14-david@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
5 years agos390x/tcg: Implement XxC and checks for most FP instructions
David Hildenbrand [Mon, 18 Feb 2019 12:27:07 +0000 (13:27 +0100)]
s390x/tcg: Implement XxC and checks for most FP instructions

With the floating-point extension facility
- CONVERT FROM LOGICAL
- CONVERT TO LOGICAL
- CONVERT TO FIXED
- CONVERT FROM FIXED
- LOAD FP INTEGER
have both, a rounding mode specification and the inexact-exception control
(XxC). Other instructions will be handled separatly.

Check for valid rounding modes and forward also the XxC (via m4). To avoid
a lot of boilerplate code and changes to the helpers, combine both, the
m3 and m4 field in a combined 32 bit TCG variable. Perform checks at
a central place, taking in account if the m3 or m4 field was ignore
before the floating-point extension facility was introduced.

Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20190218122710.23639-13-david@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
5 years agos390x/tcg: Prepare for IEEE-inexact-exception control (XxC)
David Hildenbrand [Mon, 18 Feb 2019 12:27:06 +0000 (13:27 +0100)]
s390x/tcg: Prepare for IEEE-inexact-exception control (XxC)

Some instructions allow to suppress IEEE inexact exceptions.

z14 PoP, 9-23, "Suppression of Certain IEEE Exceptions"
    IEEE-inexact-exception control (XxC): Bit 1 of
    the M4 field is the XxC bit. If XxC is zero, recogni-
    tion of IEEE-inexact exception is not suppressed;
    if XxC is one, recognition of IEEE-inexact excep-
    tion is suppressed.

Especially, handling for overflow/unerflow remains as is, inexact is
reported along

z14 PoP, 9-23, "Suppression of Certain IEEE Exceptions"
    For example, the IEEE-inexact-exception control (XxC)
    has no effect on the DXC; that is, the DXC for IEEE-
    overflow or IEEE-underflow exceptions along with the
    detail for exact, inexact and truncated, or inexact and
    incremented, is reported according to the actual con-
    dition.

Follow up patches will wire it correctly up for the applicable
instructions.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20190218122710.23639-12-david@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
5 years agos390x/tcg: Refactor saving/restoring the bfp rounding mode
David Hildenbrand [Mon, 18 Feb 2019 12:27:05 +0000 (13:27 +0100)]
s390x/tcg: Refactor saving/restoring the bfp rounding mode

We want to reuse this in the context of vector instructions. So use
better matching names and introduce s390_restore_bfp_rounding_mode().

While at it, add proper newlines.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20190218122710.23639-11-david@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
5 years agos390x/tcg: Check for exceptions in SET BFP ROUNDING MODE
David Hildenbrand [Mon, 18 Feb 2019 12:27:04 +0000 (13:27 +0100)]
s390x/tcg: Check for exceptions in SET BFP ROUNDING MODE

Let's split handling of BFP/DFP rounding mode configuration. Also,
let's not reuse the sfpc handler, use a separate handler so we can
properly check for specification exceptions for SRNMB.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20190218122710.23639-10-david@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
5 years agos390x/tcg: Handle SET FPC AND LOAD FPC 3-bit BFP rounding modes
David Hildenbrand [Mon, 18 Feb 2019 12:27:03 +0000 (13:27 +0100)]
s390x/tcg: Handle SET FPC AND LOAD FPC 3-bit BFP rounding modes

We already forward the 3 bits correctly in the translation functions. We
also have to handle them properly and check for specification
exceptions.

Setting an invalid rounding mode (BFP only, all DFP rounding modes)
results in a specification exception. Setting unassigned bits in the
fpc, results in a specification exception.

This fixes LOAD FPC (AND SIGNAL), SET FPC (AND SIGNAL). Also for,
SET BFP ROUNDING MODE, 3-bit rounding mode is now explicitly checked.

Note: TCG_CALL_NO_WG is required for sfpc handler, as we now inject
exceptions.

We won't be modeling abscence of the "floating-point extension facility"
for now, not necessary as most take the facility for granted without
checking.

z14 PoP, 9-23, "LOAD FPC"
    When the floating-point extension facility is
    installed, bits 29-31 of the second operand must
    specify a valid BFP rounding mode and bits 6-7,
    14-15, 24, and 28 must be zero; otherwise, a
    specification exception is recognized.

Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20190218122710.23639-9-david@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
5 years agos390x/tcg: Fix simulated-IEEE exceptions
David Hildenbrand [Mon, 18 Feb 2019 12:27:02 +0000 (13:27 +0100)]
s390x/tcg: Fix simulated-IEEE exceptions

The trap is triggered based on priority of the enabled signaling flags.
Only overflow and underflow allow a concurrent inexact exception.

z14 PoP, 9-33, Figure 9-21

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20190218122710.23639-8-david@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
5 years agos390x/tcg: Refactor SET FPC AND SIGNAL handling
David Hildenbrand [Mon, 18 Feb 2019 12:27:01 +0000 (13:27 +0100)]
s390x/tcg: Refactor SET FPC AND SIGNAL handling

We can directly work on the uint64_t value, no need for a temporary
uint32_t value.

Also cleanup and shorten the comments.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20190218122710.23639-7-david@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
5 years agos390x/tcg: Hide IEEE underflows in some scenarios
David Hildenbrand [Mon, 18 Feb 2019 12:27:00 +0000 (13:27 +0100)]
s390x/tcg: Hide IEEE underflows in some scenarios

IEEE underflows are not reported when the mask bit is off and we don't
also have an inexact exception.

z14 PoP, 9-20, "IEEE Underflow":
    An IEEE-underflow exception is recognized for an
    IEEE target when the tininess condition exists and
    either: (1) the IEEE-underflow mask bit in the FPC
    register is zero and the result value is inexact, or (2)
    the IEEE-underflow mask bit in the FPC register is
    one.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20190218122710.23639-6-david@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
5 years agos390x/tcg: Fix parts of IEEE exception handling
David Hildenbrand [Mon, 18 Feb 2019 12:26:59 +0000 (13:26 +0100)]
s390x/tcg: Fix parts of IEEE exception handling

Many things are wrong and some parts cannot be fixed yet. Fix what we
can fix easily and add two FIXMEs:

The fpc flags are not updated in case an exception is actually injected.
Inexact exceptions have to be handled separately, as they are the only
exceptions that can coexist with underflows and overflows.

I reread the horribly complicated chapters in the PoP at least 5 times
and hope I got it right.

For references:
- z14 PoP, 9-18, "IEEE Exceptions"
- z14 PoP, 19-9, Figure 19-8

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20190218122710.23639-5-david@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
5 years agos390x/tcg: Factor out conversion of softfloat exceptions
David Hildenbrand [Mon, 18 Feb 2019 12:26:58 +0000 (13:26 +0100)]
s390x/tcg: Factor out conversion of softfloat exceptions

We want to reuse that function in vector instruction context. While at it,
cleanup the code, using defines for magic values and avoiding the
handcrafted bit conversion.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20190218122710.23639-4-david@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
5 years agos390x/tcg: Fix rounding from float128 to uint64_t/uint32_t
David Hildenbrand [Mon, 18 Feb 2019 12:26:57 +0000 (13:26 +0100)]
s390x/tcg: Fix rounding from float128 to uint64_t/uint32_t

Let's use the proper conversion functions now that we have them.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20190218122710.23639-3-david@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
5 years agos390x/tcg: Fix TEST DATA CLASS instructions
David Hildenbrand [Mon, 18 Feb 2019 12:26:56 +0000 (13:26 +0100)]
s390x/tcg: Fix TEST DATA CLASS instructions

Let's detect normal and denormal ("subnormal") numbers reliably. Also
test for quiet NaN's. As only one class is possible, test common cases
first.

While at it, use a better check to test for the mask bits in the data
class mask. The data class mask has 12 bits, whereby bit 0 is the
leftmost bit and bit 11 the rightmost bit. In the PoP an easy to read
table with the numbers is provided for the VECTOR FP TEST DATA CLASS
IMMEDIATE instruction, the table for TEST DATA CLASS is more confusing
as it is based on 64 bit values.

Factor the checks out into separate functions, as they will also be
needed for floating point vector instructions. We can use a makro to
generate the functions.

Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20190218122710.23639-2-david@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
5 years agos390x/tcg: Implement LOAD COUNT TO BLOCK BOUNDARY
David Hildenbrand [Mon, 25 Feb 2019 20:03:18 +0000 (21:03 +0100)]
s390x/tcg: Implement LOAD COUNT TO BLOCK BOUNDARY

Use a new CC helper to calculate the CC lazily if needed. While the
PoP mentions that "A 32-bit unsigned binary integer" is placed into the
first operand, there is no word telling that the other 32 bits (high
part) are left untouched. Maybe the other 32-bit are unpredictable.
So store 64 bit for now.

Bit magic courtesy of Richard.

Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20190225200318.16102-8-david@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
5 years agos390x/tcg: Implement LOAD LENGTHENED short HFP to long HFP
David Hildenbrand [Mon, 25 Feb 2019 20:03:17 +0000 (21:03 +0100)]
s390x/tcg: Implement LOAD LENGTHENED short HFP to long HFP

Nice trick to load a 32 bit value into vector element 0 (32 bit element
size) from memory, zeroing out element1. The short HFP to long HFP
conversion really only is a shift.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20190225200318.16102-7-david@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
5 years agos390x/tcg: Factor out gen_addi_and_wrap_i64() from get_address()
David Hildenbrand [Mon, 25 Feb 2019 20:03:16 +0000 (21:03 +0100)]
s390x/tcg: Factor out gen_addi_and_wrap_i64() from get_address()

Also properly wrap in 24bit mode. While at it, convert the comment (and
drop the comment about fundamental TCG optimizations).

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20190225200318.16102-6-david@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
5 years agos390x/tcg: Factor out vec_full_reg_offset()
David Hildenbrand [Mon, 25 Feb 2019 20:03:15 +0000 (21:03 +0100)]
s390x/tcg: Factor out vec_full_reg_offset()

We'll use that a lot along with gvec helpers, to calculate the start
address of a vector.

Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20190225200318.16102-5-david@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
5 years agos390x/tcg: Clarify terminology in vec_reg_offset()
David Hildenbrand [Mon, 25 Feb 2019 20:03:14 +0000 (21:03 +0100)]
s390x/tcg: Clarify terminology in vec_reg_offset()

We will use s390x speak "Element Size" (es) for MO_8 == 0, MO_16 == 1
... Simple rename of variables.

Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20190225200318.16102-4-david@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
5 years agos390x/tcg: Simplify disassembler operands initialization
David Hildenbrand [Mon, 25 Feb 2019 20:03:13 +0000 (21:03 +0100)]
s390x/tcg: Simplify disassembler operands initialization

Let's simplify initialization to 0.

Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20190225200318.16102-3-david@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
5 years agos390x/tcg: RXE has an optional M3 field
David Hildenbrand [Mon, 25 Feb 2019 20:03:12 +0000 (21:03 +0100)]
s390x/tcg: RXE has an optional M3 field

Will be needed, so add it to the format description.

Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20190225200318.16102-2-david@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
5 years agos390x/vfio-ap: document hot plug/unplug of vfio-ap device
Tony Krowiak [Mon, 18 Feb 2019 19:49:57 +0000 (14:49 -0500)]
s390x/vfio-ap: document hot plug/unplug of vfio-ap device

Let's update the vfio-ap.txt document to include the hot plug/unplug
support.

Signed-off-by: Tony Krowiak <akrowiak@linux.ibm.com>
Message-Id: <1550519397-25359-3-git-send-email-akrowiak@linux.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
5 years agos390x/vfio-ap: Implement hot plug/unplug of vfio-ap device
Tony Krowiak [Mon, 18 Feb 2019 19:49:56 +0000 (14:49 -0500)]
s390x/vfio-ap: Implement hot plug/unplug of vfio-ap device

Introduces hot plug/unplug support for the vfio-ap device.

To hot plug a vfio-ap device using the QEMU device_add command:

(qemu) device_add vfio-ap,sysfsdev=$path-to-mdev

Where $path-to-mdev is the absolute path to the mediated matrix device
to which AP resources to be used by the guest have been assigned.

A vfio-ap device can be hot plugged only if:

1. A vfio-ap device has not been attached to the virtual machine's ap-bus
   via the QEMU command line or a prior hot plug action.

2. The guest was started with the CPU model feature for AP enabled
   (e.g., -cpu host,ap=on)

To hot unplug a vfio-ap device using the QEMU device_del command:

(qemu) device_del vfio-ap,sysfsdev=$path-to-mdev

Where $path-to-mdev is the absolute path to the mediated matrix device
specified when the vfio-ap device was attached to the virtual machine's
ap-bus.

A vfio-ap device can be hot unplugged only if:

1. A vfio-ap device has been attached to the virtual machine's ap-bus
   via the QEMU command line or a prior hot plug action.

2. The guest was started with the CPU model feature for AP enabled
   (e.g., -cpu host,ap=on)

Please note that a hot plug handler is not necessary for the vfio-ap device
because the AP matrix configuration for the guest is performed by the
kernel device driver when the vfio-ap device is realized. The vfio-ap device
represents a VFIO mediated device created in the host sysfs for use by a guest.
The mdev device is configured with an AP matrix (i.e., adapters and domains) via
its sysfs attribute interfaces prior to starting the guest or plugging a vfio-ap
device in. When the device is realized, a file descriptor is opened on the mdev
device which results in a callback to the vfio_ap kernel device driver. The
device driver then configures the AP matrix in the guest's SIE state description
from the AP matrix assigned via the mdev device's sysfs interfaces. The AP
devices will be created for the guest when the AP bus running on the guest
subsequently performs its periodic scan for AP devices.

The qdev_simple_device_unplug_cb() callback function is used for the same
reaons; namely, the vfio_ap kernel device driver will perform the AP resource
de-configuration for the guest when the vfio-ap device is unplugged. When the
vfio-ap device is unrealized, the mdev device file descriptor is closed which
results in a callback to the vfio_ap kernel device driver. The device driver
then clears the AP matrix configuration in the guest's SIE state description
and resets all of the affected queues. The AP devices created for the guest
will be removed when the AP bus running on the guest subsequently performs
its periodic scan and finds there are no longer any AP resources assigned to the
guest.

Signed-off-by: Tony Krowiak <akrowiak@linux.ibm.com>
Reviewed-by: Pierre Morel <pmorel@linux.ibm.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Halil Pasic <pasic@linux.ibm.com>
Tested-by: Pierre Morel <pmorel@linux.ibm.com>
Message-Id: <1550519397-25359-2-git-send-email-akrowiak@linux.ibm.com>
[CH: adapt to changed qbus_set_hotplug_handler() signature]
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
5 years agos390x/tcg: Save vregs to extended mchk save area
David Hildenbrand [Fri, 22 Feb 2019 08:11:53 +0000 (09:11 +0100)]
s390x/tcg: Save vregs to extended mchk save area

If we have vector registers and the designation is not zero, we have
to try to write the vector registers. If the designation is zero or
if storing fails, we must not indicate validity. s390_build_validity_mcic()
automatically already sets validity if the vector instruction facility
is installed.

As long as we don't support the guarded-storage facility, the alignment
and size of the area is always 1024 bytes.

Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20190222081153.14206-4-david@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
5 years agos390x: use a QEMU-style typedef + name for SIGP save area struct
David Hildenbrand [Fri, 22 Feb 2019 08:11:52 +0000 (09:11 +0100)]
s390x: use a QEMU-style typedef + name for SIGP save area struct

Convert this to QEMU style.

Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20190222081153.14206-3-david@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
5 years agos390x: Use cpu_to_be64 in SIGP STORE ADDITIONAL STATUS
David Hildenbrand [Fri, 22 Feb 2019 08:11:51 +0000 (09:11 +0100)]
s390x: Use cpu_to_be64 in SIGP STORE ADDITIONAL STATUS

As we will support vector instructions soon, and vector registers are
stored in 64bit host chunks, let's use cpu_to_be64. Same applies to the
guarded storage control block.

Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20190222081153.14206-2-david@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
5 years agoMerge remote-tracking branch 'remotes/cminyard/tags/i2c-for-release-20190228' into...
Peter Maydell [Fri, 1 Mar 2019 11:20:49 +0000 (11:20 +0000)]
Merge remote-tracking branch 'remotes/cminyard/tags/i2c-for-release-20190228' into staging

This has been out there long enough, I need to get this in.

This was changed a little bit since my post on Feb 20 (to which
there were no comments) due to changes I had to work around:

Change b296b664abc73253 "smbus: Add a helper to generate SPD EEPROM
data" added a function to include/hw/i2c/smbus.h, which I had to move to
include/hw/smbus_eeprom.h.

There were some changes to hw/i2c/Makefile.objs that I had to fix up.

Beyond that, no changes.

Thanks,

-corey

# gpg: Signature made Thu 28 Feb 2019 18:05:49 GMT
# gpg:                using RSA key FD0D5CE67CE0F59A6688268661F38C90919BFF81
# gpg: Good signature from "Corey Minyard <cminyard@mvista.com>" [unknown]
# gpg:                 aka "Corey Minyard <minyard@acm.org>" [unknown]
# gpg:                 aka "Corey Minyard <corey@minyard.net>" [unknown]
# gpg:                 aka "Corey Minyard <minyard@mvista.com>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: FD0D 5CE6 7CE0 F59A 6688  2686 61F3 8C90 919B FF81

* remotes/cminyard/tags/i2c-for-release-20190228:
  i2c: Verify that the count passed in to smbus_eeprom_init() is valid
  i2c:smbus_eeprom: Add a reset function to smbus_eeprom
  i2c:smbus_eeprom: Add vmstate handling to the smbus eeprom
  i2c:smbus_eeprom: Add a size constant for the smbus_eeprom size
  i2c:smbus_eeprom: Add normal type name and cast to smbus_eeprom.c
  i2c:smbus_slave: Add an SMBus vmstate structure
  i2c:pm_smbus: Fix state transfer
  migration: Add a VMSTATE_BOOL_TEST() macro
  i2c:pm_smbus: Fix pm_smbus handling of I2C block read
  boards.h: Ignore migration for SMBus devices on older machines
  i2c:smbus: Make white space in switch statements consistent
  i2c:smbus_eeprom: Get rid of the quick command
  i2c:smbus: Simplify read handling
  i2c:smbus: Simplify write operation
  i2c:smbus: Correct the working of quick commands
  i2c: Don't check return value from i2c_recv()
  arm:i2c: Don't mask return from i2c_recv()
  i2c: have I2C receive operation return uint8_t
  i2c: Split smbus into parts

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agoMerge remote-tracking branch 'remotes/aperard/tags/pull-xen-20190228' into staging
Peter Maydell [Fri, 1 Mar 2019 10:38:06 +0000 (10:38 +0000)]
Merge remote-tracking branch 'remotes/aperard/tags/pull-xen-20190228' into staging

Xen queue

* xen-block fixes

# gpg: Signature made Thu 28 Feb 2019 17:31:05 GMT
# gpg:                using RSA key F80C006308E22CFD8A92E7980CF5572FD7FB55AF
# gpg:                issuer "anthony.perard@citrix.com"
# gpg: Good signature from "Anthony PERARD <anthony.perard@gmail.com>" [marginal]
# gpg:                 aka "Anthony PERARD <anthony.perard@citrix.com>" [marginal]
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg:          It is not certain that the signature belongs to the owner.
# Primary key fingerprint: 5379 2F71 024C 600F 778A  7161 D8D5 7199 DF83 42C8
#      Subkey fingerprint: F80C 0063 08E2 2CFD 8A92  E798 0CF5 572F D7FB 55AF

* remotes/aperard/tags/pull-xen-20190228:
  xen-block: stop leaking memory in xen_block_drive_create()
  xen-block: report error condition from vbd_name_to_disk()
  xen-block: remove redundant assignment
  dataplane/xen-block: remove dead code

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agoMerge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2019-02-28' into...
Peter Maydell [Fri, 1 Mar 2019 09:52:42 +0000 (09:52 +0000)]
Merge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2019-02-28' into staging

- Updates to MAINTAINERS file
- Re-enable the guest-agent test
- Add the possibility to load a bios image on the mcf5208evb machine

# gpg: Signature made Thu 28 Feb 2019 12:23:25 GMT
# gpg:                using RSA key 2ED9D774FE702DB5
# gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full]
# gpg:                 aka "Thomas Huth <thuth@redhat.com>" [full]
# gpg:                 aka "Thomas Huth <huth@tuxfamily.org>" [full]
# gpg:                 aka "Thomas Huth <th.huth@posteo.de>" [unknown]
# Primary key fingerprint: 27B8 8847 EEE0 2501 18F3  EAB9 2ED9 D774 FE70 2DB5

* remotes/huth-gitlab/tags/pull-request-2019-02-28:
  hw/m68k/mcf5208: Support loading of bios images
  tests/test-qga: Reenable guest-agent qtest
  MAINTAINERS: Clean up the RISC-V TCG backend section
  MAINTAINERS: Add some missing entries for the sun4m machine
  MAINTAINERS: Add maintainer to the TCG/i386 subsystem
  MAINTAINERS: Add maintainers to the Linux subsystem
  MAINTAINERS: Orphanize the 'GDB stub' subsystem
  MAINTAINERS: Add maintainer to the POSIX subsystem
  MAINTAINERS: Add an entry for the Dino machine
  MAINTAINERS: Add missing test entries to the Cryptography section
  MAINTAINERS: Add missing entries for the QObject section
  MAINTAINERS: Add missing entries for the PC machines
  MAINTAINERS: Add missing entries for the sun4u machines

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agoMerge remote-tracking branch 'remotes/xtensa/tags/20190228-xtensa' into staging
Peter Maydell [Thu, 28 Feb 2019 19:04:16 +0000 (19:04 +0000)]
Merge remote-tracking branch 'remotes/xtensa/tags/20190228-xtensa' into staging

target/xtensa: FLIX support, various fixes and test improvements

- add FLIX (flexible length instructions extension) support;
- make testsuite runnable on wider range of xtensa cores;
- add floating point opcode tests;
- don't add duplicate 'static' in import_core.sh script;
- fix undefined opcodes detection in test_mmuhifi_c3 overlay.

# gpg: Signature made Thu 28 Feb 2019 12:53:23 GMT
# gpg:                using RSA key 2B67854B98E5327DCDEB17D851F9CC91F83FA044
# gpg:                issuer "jcmvbkbc@gmail.com"
# gpg: Good signature from "Max Filippov <filippov@cadence.com>" [unknown]
# gpg:                 aka "Max Filippov <max.filippov@cogentembedded.com>" [full]
# gpg:                 aka "Max Filippov <jcmvbkbc@gmail.com>" [full]
# Primary key fingerprint: 2B67 854B 98E5 327D CDEB  17D8 51F9 CC91 F83F A044

* remotes/xtensa/tags/20190228-xtensa: (40 commits)
  tests/tcg/xtensa: add FPU2000 coprocessor tests
  tests/tcg/xtensa: add FP1 group tests
  tests/tcg/xtensa: add FP0 group conversion tests
  tests/tcg/xtensa: add FP0 group arithmetic tests
  tests/tcg/xtensa: add LSCI/LSCX group tests
  tests/tcg/xtensa: add test for FLIX
  tests/tcg/xtensa: conditionalize MMU-related tests
  tests/tcg/xtensa: conditionalize windowed register tests
  tests/tcg/xtensa: conditionalize and fix s32c1i tests
  tests/tcg/xtensa: fix SR tests for big endian configs
  tests/tcg/xtensa: conditionalize and expand SR tests
  tests/tcg/xtensa: conditionalize timer/CCOUNT tests
  tests/tcg/xtensa: conditionalize interrupt tests
  tests/tcg/xtensa: add straightforward conditionals
  tests/tcg/xtensa: conditionalize cache option tests
  tests/tcg/xtensa: conditionalize debug option tests
  tests/tcg/xtensa: enable boolean tests
  tests/tcg/xtensa: fix endianness issues in test_b
  tests/tcg/xtensa: don't use optional opcodes in generic code
  tests/tcg/xtensa: support configs with LITBASE
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agoMerge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20190228-1' into...
Peter Maydell [Thu, 28 Feb 2019 17:35:42 +0000 (17:35 +0000)]
Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20190228-1' into staging

target-arm queue:
 * add MHU and dual-core support to Musca boards
 * refactor some VFP insns to be gated by ID registers
 * Revert "arm: Allow system registers for KVM guests to be changed by QEMU code"
 * Implement ARMv8.2-FHM extension
 * Advertise JSCVT via HWCAP for linux-user

# gpg: Signature made Thu 28 Feb 2019 11:06:55 GMT
# gpg:                using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE
# gpg:                issuer "peter.maydell@linaro.org"
# gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" [ultimate]
# gpg:                 aka "Peter Maydell <pmaydell@gmail.com>" [ultimate]
# gpg:                 aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" [ultimate]
# Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83  15CF 3C25 25ED 1436 0CDE

* remotes/pmaydell/tags/pull-target-arm-20190228-1:
  linux-user: Enable HWCAP_ASIMDFHM, HWCAP_JSCVT
  target/arm: Enable ARMv8.2-FHM for -cpu max
  target/arm: Implement VFMAL and VFMSL for aarch32
  target/arm: Implement FMLAL and FMLSL for aarch64
  target/arm: Add helpers for FMLAL
  Revert "arm: Allow system registers for KVM guests to be changed by QEMU code"
  target/arm: Gate "miscellaneous FP" insns by ID register field
  target/arm: Use MVFR1 feature bits to gate A32/T32 FP16 instructions
  hw/arm/armsse: Unify init-svtor and cpuwait handling
  hw/arm/iotkit-sysctl: Implement CPUWAIT and INITSVTOR*
  hw/arm/iotkit-sysctl: Add SSE-200 registers
  hw/misc/iotkit-sysctl: Correct typo in INITSVTOR0 register name
  target/arm/arm-powerctl: Add new arm_set_cpu_on_and_reset()
  target/arm/cpu: Allow init-svtor property to be set after realize
  hw/arm/armsse: Wire up the MHUs
  hw/misc/armsse-mhu.c: Model the SSE-200 Message Handling Unit

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agoxen-block: stop leaking memory in xen_block_drive_create()
Paul Durrant [Tue, 19 Feb 2019 16:34:40 +0000 (16:34 +0000)]
xen-block: stop leaking memory in xen_block_drive_create()

The locally allocated QDict-s need to be freed. ('file_layer' will be
freed implicitly since it is added as an object to 'driver_layer').

Spotted by Coverity: CID 1398649

While in the neighbourhood free 'driver' and 'filename' as soon as they are
added to the QDicts. Freeing after the 'done' label doesn't make that much
sense as, if the error path jumps to that label, the values would be NULL
anyway.

This patch also makes that more obvious by taking the error path if
'params' is NULL and then asserting that both driver and filename are
non-NULL in the normal path.

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Message-Id: <20190219163440.15702-1-paul.durrant@citrix.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
5 years agoxen-block: report error condition from vbd_name_to_disk()
Paul Durrant [Fri, 15 Feb 2019 16:25:33 +0000 (16:25 +0000)]
xen-block: report error condition from vbd_name_to_disk()

The function needs to make sure it is passed a valid disk name. This is
easily done by making sure that the parsing loop results in a non-zero
value.

Spotted by Coverity: CID 1398640

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
Message-Id: <20190215162533.19475-4-paul.durrant@citrix.com>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
5 years agoxen-block: remove redundant assignment
Paul Durrant [Fri, 15 Feb 2019 16:25:32 +0000 (16:25 +0000)]
xen-block: remove redundant assignment

The assignment to 'p' is unnecessary as the code will either goto 'invalid'
or p will get overwritten.

Spotted by Coverity: CID 1398638

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
Message-Id: <20190215162533.19475-3-paul.durrant@citrix.com>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
5 years agodataplane/xen-block: remove dead code
Paul Durrant [Fri, 15 Feb 2019 16:25:31 +0000 (16:25 +0000)]
dataplane/xen-block: remove dead code

The if() statement is clearly bogus (dead code which should have been
cleaned up when grant mapping was removed).

Spotted by Coverity: CID 1398635

While in the neighbourhood, add a missing 'fall through' annotation.

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
Message-Id: <20190215162533.19475-2-paul.durrant@citrix.com>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
5 years agoMerge remote-tracking branch 'remotes/kraxel/tags/audio-20190228-pull-request' into...
Peter Maydell [Thu, 28 Feb 2019 16:11:18 +0000 (16:11 +0000)]
Merge remote-tracking branch 'remotes/kraxel/tags/audio-20190228-pull-request' into staging

audio: fixes and cleanups.

# gpg: Signature made Thu 28 Feb 2019 10:08:44 GMT
# gpg:                using RSA key 4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full]
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>" [full]
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full]
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/audio-20190228-pull-request:
  audio/sdlaudio: Simplify the sdl_callback function
  audio/sdlaudio: Remove the semaphore code
  audio: don't build alsa and sdl by default on linux
  audio: Do not check for audio_calloc failure
  audio: Use g_strdup_printf instead of manual building a string

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agoMerge remote-tracking branch 'remotes/amarkovic/tags/mips-queue-feb-27-2019' into...
Peter Maydell [Thu, 28 Feb 2019 12:59:49 +0000 (12:59 +0000)]
Merge remote-tracking branch 'remotes/amarkovic/tags/mips-queue-feb-27-2019' into staging

MIPS queue for February 27th, 2019

# gpg: Signature made Wed 27 Feb 2019 13:27:36 GMT
# gpg:                using RSA key D4972A8967F75A65
# gpg: Good signature from "Aleksandar Markovic <amarkovic@wavecomp.com>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 8526 FBF1 5DA3 811F 4A01  DD75 D497 2A89 67F7 5A65

* remotes/amarkovic/tags/mips-queue-feb-27-2019:
  target/mips: Preparing for adding MMI instructions
  tests/tcg: target/mips: Add tests for MSA integer max/min instructions
  tests/tcg: target/mips: Add wrappers for MSA integer max/min instructions
  qemu-doc: Add section on MIPS' Boston board
  qemu-doc: Add section on MIPS' Fulong 2E board
  qemu-doc: Move section on MIPS' mipssim pseudo board
  disas: nanoMIPS: Fix a function misnomer
  tests/tcg: target/mips: Add tests for MSA integer compare instructions

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agotests/tcg/xtensa: add FPU2000 coprocessor tests
Max Filippov [Sat, 1 Sep 2018 01:35:13 +0000 (18:35 -0700)]
tests/tcg/xtensa: add FPU2000 coprocessor tests

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
5 years agotests/tcg/xtensa: add FP1 group tests
Max Filippov [Sun, 9 Sep 2012 00:03:49 +0000 (04:03 +0400)]
tests/tcg/xtensa: add FP1 group tests

Test comparisons and conditional move operations.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
5 years agotests/tcg/xtensa: add FP0 group conversion tests
Max Filippov [Sat, 8 Sep 2012 02:42:06 +0000 (06:42 +0400)]
tests/tcg/xtensa: add FP0 group conversion tests

Test conversions for normal, NaN and Inf arguments.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
5 years agotests/tcg/xtensa: add FP0 group arithmetic tests
Max Filippov [Thu, 6 Sep 2012 00:23:44 +0000 (04:23 +0400)]
tests/tcg/xtensa: add FP0 group arithmetic tests

Test arithmetic operations for normal, NaN and Inf arguments.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
5 years agotests/tcg/xtensa: add LSCI/LSCX group tests
Max Filippov [Wed, 7 Mar 2012 23:00:31 +0000 (03:00 +0400)]
tests/tcg/xtensa: add LSCI/LSCX group tests

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
5 years agotests/tcg/xtensa: add test for FLIX
Max Filippov [Wed, 3 Oct 2018 19:43:54 +0000 (12:43 -0700)]
tests/tcg/xtensa: add test for FLIX

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
5 years agotests/tcg/xtensa: conditionalize MMU-related tests
Max Filippov [Mon, 18 Feb 2019 15:19:02 +0000 (07:19 -0800)]
tests/tcg/xtensa: conditionalize MMU-related tests

Make MMU-related tests conditional on the presence of MMUv2 option.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
5 years agotests/tcg/xtensa: conditionalize windowed register tests
Max Filippov [Mon, 18 Feb 2019 15:16:55 +0000 (07:16 -0800)]
tests/tcg/xtensa: conditionalize windowed register tests

Make windowed register tests conditional on the presence of this option.
Fix tests to work correctly for both 32 and 64 physical registers.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
5 years agotests/tcg/xtensa: conditionalize and fix s32c1i tests
Max Filippov [Mon, 18 Feb 2019 15:15:10 +0000 (07:15 -0800)]
tests/tcg/xtensa: conditionalize and fix s32c1i tests

Make s32c1i tests conditional on the presence of this option. Initialize
ATOMCTL SR when it's present to allow RCW transactions on uncached
memory.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
5 years agotests/tcg/xtensa: fix SR tests for big endian configs
Max Filippov [Mon, 18 Feb 2019 15:12:37 +0000 (07:12 -0800)]
tests/tcg/xtensa: fix SR tests for big endian configs

SR tests generate instructions that the assembler does not recognize and
thus must take care about configuration endianness.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
5 years agotests/tcg/xtensa: conditionalize and expand SR tests
Max Filippov [Mon, 18 Feb 2019 14:58:23 +0000 (06:58 -0800)]
tests/tcg/xtensa: conditionalize and expand SR tests

Make tests for specific special registers conditional on the presence of
the options that add these registers and test that the registers are not
accessible otherwise.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
5 years agotests/tcg/xtensa: conditionalize timer/CCOUNT tests
Max Filippov [Mon, 18 Feb 2019 14:55:15 +0000 (06:55 -0800)]
tests/tcg/xtensa: conditionalize timer/CCOUNT tests

Make timer/CCOUNT tests conditional on the presence of timer option and
number of configured timers. Don't use hard coded interrupt levels for
timers, use configured values.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
5 years agotests/tcg/xtensa: conditionalize interrupt tests
Max Filippov [Mon, 18 Feb 2019 14:50:10 +0000 (06:50 -0800)]
tests/tcg/xtensa: conditionalize interrupt tests

Make interrupt tests conditional on the presence of interrupt option and
on the presence of level-1 and high level software interrupts. Don't use
hard-coded interrupt level for the high level interrupt tests, choose
high level software IRQ and use its configured level.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
5 years agotests/tcg/xtensa: add straightforward conditionals
Max Filippov [Mon, 18 Feb 2019 14:40:38 +0000 (06:40 -0800)]
tests/tcg/xtensa: add straightforward conditionals

Make tests for optional instruction groups conditional on the presence
of corresponding options in the config.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
5 years agotests/tcg/xtensa: conditionalize cache option tests
Max Filippov [Mon, 18 Feb 2019 14:32:45 +0000 (06:32 -0800)]
tests/tcg/xtensa: conditionalize cache option tests

Make data/instruction tests conditional on the presence of
data/instruction cache, whether they're lockable and whether data cache
is writeback.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
5 years agotests/tcg/xtensa: conditionalize debug option tests
Max Filippov [Mon, 18 Feb 2019 14:24:38 +0000 (06:24 -0800)]
tests/tcg/xtensa: conditionalize debug option tests

Make debug tests conditional on the presence of the debug option in the
config and tests that depend on the presence/number of instruction or
data breakpoint registers on the corresponding definitions. Use
configured debug interrupt level instead of the hardcoded value to set
up IRQ handler and access debug EPC register.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
5 years agotests/tcg/xtensa: enable boolean tests
Max Filippov [Mon, 18 Feb 2019 14:22:41 +0000 (06:22 -0800)]
tests/tcg/xtensa: enable boolean tests

Uncomment test_boolean in the test makefile. Make actual tests code
conditional on the presence of boolean option in the config.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
5 years agotests/tcg/xtensa: fix endianness issues in test_b
Max Filippov [Mon, 18 Feb 2019 14:18:13 +0000 (06:18 -0800)]
tests/tcg/xtensa: fix endianness issues in test_b

Use bbci.l/bbsi.l instead of bbci/bbsi, as they are assembly macros that
accept little-endian bit number and produce correct immediate for both
little and big endian configurations. Choose value loaded into register
for bbc/bbs opcodes based on configuration endianness.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
5 years agotests/tcg/xtensa: don't use optional opcodes in generic code
Max Filippov [Mon, 18 Feb 2019 14:16:08 +0000 (06:16 -0800)]
tests/tcg/xtensa: don't use optional opcodes in generic code

Don't use 'loop' opcode in generic testsuite completion code, only use
core opcodes to make it work with any configuration.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
5 years agotests/tcg/xtensa: support configs with LITBASE
Max Filippov [Mon, 18 Feb 2019 16:20:35 +0000 (08:20 -0800)]
tests/tcg/xtensa: support configs with LITBASE

Configurations with LITBASE register may use absolute literals by
default. Pass --no-absolute-literals option to assembler to use
PC-relative literals instead.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
5 years agotests/tcg/xtensa: support configurations w/o vecbase
Max Filippov [Mon, 18 Feb 2019 14:04:51 +0000 (06:04 -0800)]
tests/tcg/xtensa: support configurations w/o vecbase

Configurations w/o vecbase may have vectors not grouped together and not
in fixed order. They may not always be grouped into single output
sections by assigning next offset to dot, as it may sometimes move dot
backwards and sometimes they may even belong to different memory region.
Don't group vectors into single output section. Instead put each vector
into its own section ant put it at its default virtual address.
Reserve 4KBytes from the default vectors base and put rest of the code
and data starting from there. Mark vectors sections as executable,
otherwise their contents is discarded. There may be as little as 16
bytes reserved for some vectors, load handler address into a0 and use
ret.n to jump there to make vector code fit into this 16 byte space.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
5 years agotests/tcg/xtensa: indicate failed tests
Max Filippov [Mon, 18 Feb 2019 09:42:15 +0000 (01:42 -0800)]
tests/tcg/xtensa: indicate failed tests

When test suite with multiple tests fails it's not obvious which test
failed. Pring "failed" in every invocation of test_fail. Do printing
when DEBUG preprocessor macro is defined.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
5 years agotarget/xtensa: implement PREFCTL SR
Max Filippov [Mon, 18 Feb 2019 11:11:40 +0000 (03:11 -0800)]
target/xtensa: implement PREFCTL SR

Cache prefetch option adds an unprivileged SR PREFCTL. Add trivial
implementation for this SR.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
5 years agotarget/xtensa: prioritize load/store in FLIX bundles
Max Filippov [Thu, 14 Feb 2019 01:36:30 +0000 (17:36 -0800)]
target/xtensa: prioritize load/store in FLIX bundles

Load/store opcodes may raise MMU exceptions. Normally exceptions should
be checked in priority order before any actual operations, but since MMU
exceptions are tightly coupled with actual memory access, there's
currently no way to do it.

Approximate this behavior by executing all load, then all store, and
then all other opcodes in the FLIX bundles. Use opcode dependency
mechanism to express ordering. Mark load/store opcodes with
XTENSA_OP_{LOAD,STORE} flags. Newer libisa has classifier functions that
can tell whether opcode is a load or store, but this information is not
available in the existing overlays.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
5 years agotarget/xtensa: break circular register dependencies
Max Filippov [Wed, 13 Feb 2019 03:10:24 +0000 (19:10 -0800)]
target/xtensa: break circular register dependencies

Currently topologic opcode sorting stops at the first detected
dependency loop. Introduce struct opcode_arg_copy that describes
temporary register copy. Scan remaining opcodes searching for
dependencies that can be broken, break them by introducing temporary
register copies and record them in an array. In case of success
create local temporaries and initialize them with current register
values. Share single temporary copy between all register users. Delete
temporaries after translation.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
5 years agotarget/xtensa: reorganize access to boolean registers
Max Filippov [Thu, 14 Feb 2019 21:27:50 +0000 (13:27 -0800)]
target/xtensa: reorganize access to boolean registers

libisa represents boolean registers b0..b16 as a BR register file and as
BR4 and BR8 register groups. Add these register files and use
OpcodeArg::{in,out} parameters to access boolean registers in
translators.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
5 years agotarget/xtensa: reorganize access to MAC16 registers
Max Filippov [Tue, 12 Feb 2019 03:16:14 +0000 (19:16 -0800)]
target/xtensa: reorganize access to MAC16 registers

libisa represents MAC16 registers m0..m3 as an MR register file. Add
this register file and reference its registers directly from the
translate_mac16. Drop translator parameter that indicates whether opcode
argument is in ar or in mr.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
5 years agotarget/xtensa: reorganize register handling in translators
Max Filippov [Tue, 12 Feb 2019 02:53:19 +0000 (18:53 -0800)]
target/xtensa: reorganize register handling in translators

To support circular register dependencies in FLIX bundles opcode inputs
and outputs must be separate and adjustable. Circular dependencies can
be broken by making temporary copies of opcode inputs and substituting
them into the arguments array instead of the original registers.

E.g. the circular register dependency in the following bundle:

  { mov a2, a3 ; mov a3, a2 }

can be resolved by making copy a2' = a2 and substituting it as input
argument of the second opcode:

  { mov a2, a3 ; mov a3, a2' }

Change opcode translator prototype to accept OpcodeArg array as
argument. For each register argument initialize OpcodeArg::{in,out} with
TCGv_* of the respective register. Don't explicitly use cpu_R in the
opcode translators, use OpcodeArg::{in,out} instead.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
5 years agotarget/xtensa: only rotate window in the retw helper
Max Filippov [Mon, 11 Feb 2019 20:22:29 +0000 (12:22 -0800)]
target/xtensa: only rotate window in the retw helper

Move return address calculation and WINDOW_START adjustment out of the
retw helper to simplify logic a bit and avoid using registers directly.
Pass a0 as a parameter to the helper.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
5 years agotarget/xtensa: move WINDOW_BASE SR update to postprocessing
Max Filippov [Wed, 30 Jan 2019 22:56:29 +0000 (14:56 -0800)]
target/xtensa: move WINDOW_BASE SR update to postprocessing

Opcodes that modify WINDOW_BASE SR don't have dependency on opcodes that
use windowed registers. If such opcodes are combined in a single
instruction they may not be correctly ordered. Instead of adding said
dependency use temporary register to store changed WINDOW_BASE value and
do actual register window rotation as a postprocessing step.
Not all opcodes that change WINDOW_BASE need this: retw, rfwo and rfwu
are also jump opcodes, so they are guaranteed to be translated last and
thus will not affect other opcodes in the same instruction.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
5 years agotarget/xtensa: add generic instruction post-processing
Max Filippov [Wed, 30 Jan 2019 22:48:22 +0000 (14:48 -0800)]
target/xtensa: add generic instruction post-processing

Some opcodes may need additional actions at every exit from the
translated instruction or may need to amend TB exit slots available to
jumps generated for the instruction. Add gen_postprocess function and
call it from the gen_jump_slot and from the disas_xtensa_insn.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
5 years agotarget/xtensa: sort FLIX instruction opcodes
Max Filippov [Wed, 30 Jan 2019 03:21:10 +0000 (19:21 -0800)]
target/xtensa: sort FLIX instruction opcodes

Opcodes in different slots may read and write same resources (registers,
states). In the absence of resource dependency loops it must be possible
to sort opcodes to avoid interference.

Record resources used by each opcode in the bundle. Build opcode
dependency graph and use topological sort to order its nodes. In case of
success translate opcodes in sort order. In case of failure report and
raise invalid opcode exception.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
5 years agoMerge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2019-02-25-v2' into staging
Peter Maydell [Thu, 28 Feb 2019 12:02:07 +0000 (12:02 +0000)]
Merge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2019-02-25-v2' into staging

nbd patches for 2019-02-25

- iotest failure fixes for tests related to NBD

# gpg: Signature made Tue 26 Feb 2019 16:46:15 GMT
# gpg:                using RSA key A7A16B4A2527436A
# gpg: Good signature from "Eric Blake <eblake@redhat.com>" [full]
# gpg:                 aka "Eric Blake (Free Software Programmer) <ebb9@byu.net>" [full]
# gpg:                 aka "[jpeg image of size 6874]" [full]
# Primary key fingerprint: 71C2 CC22 B1C4 6029 27D2  F3AA A7A1 6B4A 2527 436A

* remotes/ericb/tags/pull-nbd-2019-02-25-v2:
  iotests: avoid broken pipe with certtool
  iotests: ensure we print nbd server log on error
  iotests: handle TypeError for Python 3 in test 242

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agohw/m68k/mcf5208: Support loading of bios images
Thomas Huth [Fri, 8 Feb 2019 18:33:07 +0000 (19:33 +0100)]
hw/m68k/mcf5208: Support loading of bios images

The MCF5208EVB supports 2 MiB of flash at address 0. Add support
for this memory region and some code to load the file that can
be specified with the "-bios" command line option.
This can be used for example to load U-Boot images for the
MCF5208EVB (we still lack some features in the CPU emulation for
this firmware, though, so it can not be run successfully yet).

Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Thomas Huth <huth@tuxfamily.org>
5 years agotests/test-qga: Reenable guest-agent qtest
Philippe Mathieu-Daudé [Tue, 29 Jan 2019 08:38:07 +0000 (09:38 +0100)]
tests/test-qga: Reenable guest-agent qtest

Due to a misuse of rules.mak logical functions, commit f386df17448
disabled the guest-agent test.
Enable it back.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
5 years agoMAINTAINERS: Clean up the RISC-V TCG backend section
Thomas Huth [Tue, 19 Feb 2019 08:12:39 +0000 (09:12 +0100)]
MAINTAINERS: Clean up the RISC-V TCG backend section

The e-mail address mjc@sifive.com of Michael is not valid anymore.
Commit 7d04ac38959f8115f2a02 removed the entry already from the main
RISC-V section, but apparently forgot to remove it from the TCG
backend section, too.

Fixes: 7d04ac38959f8115f2a029d81db1c8aac179aa95
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
5 years agoMAINTAINERS: Add some missing entries for the sun4m machine
Thomas Huth [Fri, 15 Feb 2019 12:39:24 +0000 (13:39 +0100)]
MAINTAINERS: Add some missing entries for the sun4m machine

These files / devices are only used by SPARC machines, so we can sort
them into the corresponding category in the MAINTAINERS file.

Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
5 years agoMAINTAINERS: Add maintainer to the TCG/i386 subsystem
Philippe Mathieu-Daudé [Tue, 18 Dec 2018 11:56:15 +0000 (12:56 +0100)]
MAINTAINERS: Add maintainer to the TCG/i386 subsystem

Richard obviously maintains this subdirectory, make this official :)

Remove the qemu-devel@nongnu.org entry because the list is always
selected by the 'All patches CC here' section.

Cc: Richard Henderson <rth@twiddle.net>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
5 years agoMAINTAINERS: Add maintainers to the Linux subsystem
Philippe Mathieu-Daudé [Tue, 18 Dec 2018 11:56:11 +0000 (12:56 +0100)]
MAINTAINERS: Add maintainers to the Linux subsystem

Add Michael, Cornelia and Paolo as maintainers of the Linux subsystem.

Remove the qemu-devel@nongnu.org entry because the list is always
selected by the 'All patches CC here' section.

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Acked-by: Cornelia Huck <cohuck@redhat.com>
[thuth: Add update-linux-headers.sh, too]
Signed-off-by: Thomas Huth <thuth@redhat.com>
5 years agoMAINTAINERS: Orphanize the 'GDB stub' subsystem
Philippe Mathieu-Daudé [Tue, 18 Dec 2018 11:56:14 +0000 (12:56 +0100)]
MAINTAINERS: Orphanize the 'GDB stub' subsystem

Nobody is looking at those files, downgrade this subsystem as orphan.

Remove the qemu-devel@nongnu.org entry because the list is always
selected by the 'All patches CC here' section.

Suggested-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
5 years agoMAINTAINERS: Add maintainer to the POSIX subsystem
Philippe Mathieu-Daudé [Tue, 18 Dec 2018 11:56:12 +0000 (12:56 +0100)]
MAINTAINERS: Add maintainer to the POSIX subsystem

Add Paolo as maintainer of the POSIX subsystem.

Remove the qemu-devel@nongnu.org entry because the list is always
selected by the 'All patches CC here' section.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Suggested-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
5 years agoMAINTAINERS: Add an entry for the Dino machine
Philippe Mathieu-Daudé [Tue, 18 Dec 2018 11:56:10 +0000 (12:56 +0100)]
MAINTAINERS: Add an entry for the Dino machine

Add Richard as maintainer, and Helge as reviewer.

Cc: Richard Henderson <rth@twiddle.net>
Cc: Helge Deller <deller@gmx.de>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
[thuth: Add the machine entry alphabetically]
Signed-off-by: Thomas Huth <thuth@redhat.com>
5 years agoMAINTAINERS: Add missing test entries to the Cryptography section
Philippe Mathieu-Daudé [Tue, 18 Dec 2018 11:56:09 +0000 (12:56 +0100)]
MAINTAINERS: Add missing test entries to the Cryptography section

Acked-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
5 years agoMAINTAINERS: Add missing entries for the QObject section
Philippe Mathieu-Daudé [Tue, 18 Dec 2018 11:56:08 +0000 (12:56 +0100)]
MAINTAINERS: Add missing entries for the QObject section

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
5 years agoMAINTAINERS: Add missing entries for the PC machines
Philippe Mathieu-Daudé [Tue, 18 Dec 2018 11:56:06 +0000 (12:56 +0100)]
MAINTAINERS: Add missing entries for the PC machines

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
5 years agoMAINTAINERS: Add missing entries for the sun4u machines
Philippe Mathieu-Daudé [Tue, 18 Dec 2018 11:56:05 +0000 (12:56 +0100)]
MAINTAINERS: Add missing entries for the sun4u machines

Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
5 years agoMerge remote-tracking branch 'remotes/stsquad/tags/pull-fpu-next-260219-1' into staging
Peter Maydell [Thu, 28 Feb 2019 11:13:32 +0000 (11:13 +0000)]
Merge remote-tracking branch 'remotes/stsquad/tags/pull-fpu-next-260219-1' into staging

Softloat updates, mostly in preparation for s390x usage

# gpg: Signature made Tue 26 Feb 2019 14:09:34 GMT
# gpg:                using RSA key 6685AE99E75167BCAFC8DF35FBD0DB095A9E2A44
# gpg: Good signature from "Alex Bennée (Master Work Key) <alex.bennee@linaro.org>" [full]
# Primary key fingerprint: 6685 AE99 E751 67BC AFC8  DF35 FBD0 DB09 5A9E 2A44

* remotes/stsquad/tags/pull-fpu-next-260219-1:
  tests/Makefile.include: test all rounding modes of softfloat
  softfloat: Support float_round_to_odd more places
  tests/fp: enable f128_to_ui[32/64] tests in float-to-uint
  tests/fp: add wrapping for f128_to_ui32
  softfloat: Implement float128_to_uint32
  softfloat: add float128_is_{normal,denormal}
  tests: Ignore fp test outputs

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agolinux-user: Enable HWCAP_ASIMDFHM, HWCAP_JSCVT
Richard Henderson [Thu, 28 Feb 2019 10:55:17 +0000 (10:55 +0000)]
linux-user: Enable HWCAP_ASIMDFHM, HWCAP_JSCVT

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190219222952.22183-6-richard.henderson@linaro.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agotarget/arm: Enable ARMv8.2-FHM for -cpu max
Richard Henderson [Thu, 28 Feb 2019 10:55:17 +0000 (10:55 +0000)]
target/arm: Enable ARMv8.2-FHM for -cpu max

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190219222952.22183-5-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agotarget/arm: Implement VFMAL and VFMSL for aarch32
Richard Henderson [Thu, 28 Feb 2019 10:55:17 +0000 (10:55 +0000)]
target/arm: Implement VFMAL and VFMSL for aarch32

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190219222952.22183-4-richard.henderson@linaro.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agotarget/arm: Implement FMLAL and FMLSL for aarch64
Richard Henderson [Thu, 28 Feb 2019 10:55:17 +0000 (10:55 +0000)]
target/arm: Implement FMLAL and FMLSL for aarch64

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190219222952.22183-3-richard.henderson@linaro.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agotarget/arm: Add helpers for FMLAL
Richard Henderson [Thu, 28 Feb 2019 10:55:16 +0000 (10:55 +0000)]
target/arm: Add helpers for FMLAL

Note that float16_to_float32 rightly squashes SNaN to QNaN.
But of course pickNaNMulAdd, for ARM, selects SNaNs first.
So we have to preserve SNaN long enough for the correct NaN
to be selected.  Thus float16_to_float32_by_bits.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190219222952.22183-2-richard.henderson@linaro.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agoRevert "arm: Allow system registers for KVM guests to be changed by QEMU code"
Peter Maydell [Thu, 28 Feb 2019 10:55:16 +0000 (10:55 +0000)]
Revert "arm: Allow system registers for KVM guests to be changed by QEMU code"

This reverts commit 823e1b3818f9b10b824ddcd756983b6e2fa68730,
which introduces a regression running EDK2 guest firmware
under KVM:

error: kvm run failed Function not implemented
 PC=000000013f5a6208 X00=00000000404003c4 X01=000000000000003a
X02=0000000000000000 X03=00000000404003c4 X04=0000000000000000
X05=0000000096000046 X06=000000013d2ef270 X07=000000013e3d1710
X08=09010755ffaf8ba8 X09=ffaf8b9cfeeb5468 X10=feeb546409010756
X11=09010757ffaf8b90 X12=feeb50680903068b X13=090306a1ffaf8bc0
X14=0000000000000000 X15=0000000000000000 X16=000000013f872da0
X17=00000000ffffa6ab X18=0000000000000000 X19=000000013f5a92d0
X20=000000013f5a7a78 X21=000000000000003a X22=000000013f5a7ab2
X23=000000013f5a92e8 X24=000000013f631090 X25=0000000000000010
X26=0000000000000100 X27=000000013f89501b X28=000000013e3d14e0
X29=000000013e3d12a0 X30=000000013f5a2518  SP=000000013b7be0b0
PSTATE=404003c4 -Z-- EL1t

with
[ 3507.926571] kvm [35042]: load/store instruction decoding not implemented
in the host dmesg.

Revert the change for the moment until we can investigate the
cause of the regression.

Reported-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agotarget/arm: Gate "miscellaneous FP" insns by ID register field
Peter Maydell [Thu, 28 Feb 2019 10:55:16 +0000 (10:55 +0000)]
target/arm: Gate "miscellaneous FP" insns by ID register field

There is a set of VFP instructions which we implement in
disas_vfp_v8_insn() and gate on the ARM_FEATURE_V8 bit.
These were all first introduced in v8 for A-profile, but in
M-profile they appeared in v7M. Gate them on the MVFR2
FPMisc field instead, and rename the function appropriately.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190222170936.13268-3-peter.maydell@linaro.org

5 years agotarget/arm: Use MVFR1 feature bits to gate A32/T32 FP16 instructions
Peter Maydell [Thu, 28 Feb 2019 10:55:16 +0000 (10:55 +0000)]
target/arm: Use MVFR1 feature bits to gate A32/T32 FP16 instructions

Instead of gating the A32/T32 FP16 conversion instructions on
the ARM_FEATURE_VFP_FP16 flag, switch to our new approach of
looking at ID register bits. In this case MVFR1 fields FPHP
and SIMDHP indicate the presence of these insns.

This change doesn't alter behaviour for any of our CPUs.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190222170936.13268-2-peter.maydell@linaro.org

5 years agohw/arm/armsse: Unify init-svtor and cpuwait handling
Peter Maydell [Thu, 28 Feb 2019 10:55:16 +0000 (10:55 +0000)]
hw/arm/armsse: Unify init-svtor and cpuwait handling

At the moment the handling of init-svtor and cpuwait initial
values is split between armsse.c and iotkit-sysctl.c:
the code in armsse.c sets the initial state of the CPU
object by setting the init-svtor and start-powered-off
properties, but the iotkit-sysctl.c code has its own
code setting the reset values of its registers (which are
then used when updating the CPU when the guest makes
runtime changes).

Clean this up by making the armsse.c code set properties on the
iotkit-sysctl object to define the initial values of the
registers, so they always match the initial CPU state,
and update the comments in armsse.c accordingly.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190219125808.25174-9-peter.maydell@linaro.org

5 years agohw/arm/iotkit-sysctl: Implement CPUWAIT and INITSVTOR*
Peter Maydell [Thu, 28 Feb 2019 10:55:16 +0000 (10:55 +0000)]
hw/arm/iotkit-sysctl: Implement CPUWAIT and INITSVTOR*

The CPUWAIT register acts as a sort of power-control: if a bit
in it is 1 then the CPU will have been forced into waiting
when the system was reset (which in QEMU we model as the
CPU starting powered off). Writing a 0 to the register will
allow the CPU to boot (for QEMU, we model this as powering
it on). Note that writing 0 to the register does not power
off a CPU.

For this to work correctly we need to also honour the
INITSVTOR* registers, which let the guest control where the
CPU will load its SP and PC from when it comes out of reset.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190219125808.25174-8-peter.maydell@linaro.org