]> git.proxmox.com Git - mirror_qemu.git/log
mirror_qemu.git
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

5 years agohw/arm/iotkit-sysctl: Add SSE-200 registers
Peter Maydell [Thu, 28 Feb 2019 10:55:16 +0000 (10:55 +0000)]
hw/arm/iotkit-sysctl: Add SSE-200 registers

The SYSCTL block in the SSE-200 has some extra registers that
are not present in the IoTKit version. Add these registers
(as reads-as-written stubs), enabled by a new QOM property.

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

5 years agohw/misc/iotkit-sysctl: Correct typo in INITSVTOR0 register name
Peter Maydell [Thu, 28 Feb 2019 10:55:16 +0000 (10:55 +0000)]
hw/misc/iotkit-sysctl: Correct typo in INITSVTOR0 register name

The iotkit-sysctl device has a register it names INITSVRTOR0.
This is actually a typo present in the IoTKit documentation
and also in part of the SSE-200 documentation:  it should be
INITSVTOR0 because it is specifying the initial value of the
Secure VTOR register in the CPU. Correct the typo.

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

5 years agotarget/arm/arm-powerctl: Add new arm_set_cpu_on_and_reset()
Peter Maydell [Thu, 28 Feb 2019 10:55:16 +0000 (10:55 +0000)]
target/arm/arm-powerctl: Add new arm_set_cpu_on_and_reset()

Currently the Arm arm-powerctl.h APIs allow:
 * arm_set_cpu_on(), which powers on a CPU and sets its
   initial PC and other startup state
 * arm_reset_cpu(), which resets a CPU which is already on
   (and fails if the CPU is powered off)

but there is no way to say "power on a CPU as if it had
just come out of reset and don't do anything else to it".

Add a new function arm_set_cpu_on_and_reset(), which does this.

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

5 years agotarget/arm/cpu: Allow init-svtor property to be set after realize
Peter Maydell [Thu, 28 Feb 2019 10:55:15 +0000 (10:55 +0000)]
target/arm/cpu: Allow init-svtor property to be set after realize

Make the M-profile "init-svtor" property be settable after realize.
This matches the hardware, where this is a config signal which
is sampled on CPU reset and can thus be changed between one
reset and another. To do this we have to change the API we
use to add the property.

(We will need this capability for the SSE-200.)

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

5 years agohw/arm/armsse: Wire up the MHUs
Peter Maydell [Thu, 28 Feb 2019 10:55:15 +0000 (10:55 +0000)]
hw/arm/armsse: Wire up the MHUs

Create and connect the MHUs in the SSE-200.

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

5 years agohw/misc/armsse-mhu.c: Model the SSE-200 Message Handling Unit
Peter Maydell [Thu, 28 Feb 2019 10:55:15 +0000 (10:55 +0000)]
hw/misc/armsse-mhu.c: Model the SSE-200 Message Handling Unit

Implement a model of the Message Handling Unit (MHU) found in
the Arm SSE-200. This is a simple device which just contains
some registers which allow the two cores of the SSE-200
to raise interrupts on each other.

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

5 years agoMerge remote-tracking branch 'remotes/dgibson/tags/ppc-for-4.0-20190226' into staging
Peter Maydell [Thu, 28 Feb 2019 10:28:00 +0000 (10:28 +0000)]
Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-4.0-20190226' into staging

ppc patch queue 2019-02-26

Next set of patches for ppc and spapr.  There's a lot in this one:
 * Support "STOP light" states on POWER9
 * Add support for HVI interrupts on POWER9 (powernv machine)
 * CVE-2019-8934: Don't leak host model and serial information to the guest
 * Tests and cleanups for various hot unplug options
 * Hash and radix MMU implementation on POWER9 for powernv machine
 * PCI Host Bridge hotplug support for pseries machine
 * Allow larger kernels and initrds for powernv machine

Plus a handful of miscellaneous fixes and cleanups.

The cpu hotplug tests and cleanups from David Hildenbrand aren't
solely power related.  However the consensus amongst Michael Tsirkin,
David Hildenbrand, Cornelia Huck and myself was that it made most
sense to come in via my tree.

# gpg: Signature made Tue 26 Feb 2019 03:37:46 GMT
# gpg:                using RSA key 75F46586AE61A66CC44E87DC6C38CACA20D9B392
# gpg: Good signature from "David Gibson <david@gibson.dropbear.id.au>" [full]
# gpg:                 aka "David Gibson (Red Hat) <dgibson@redhat.com>" [full]
# gpg:                 aka "David Gibson (ozlabs.org) <dgibson@ozlabs.org>" [full]
# gpg:                 aka "David Gibson (kernel.org) <dwg@kernel.org>" [unknown]
# Primary key fingerprint: 75F4 6586 AE61 A66C C44E  87DC 6C38 CACA 20D9 B392

* remotes/dgibson/tags/ppc-for-4.0-20190226: (50 commits)
  ppc/pnv: use IEC binary prefixes to represent sizes
  ppc/pnv: add INITRD_MAX_SIZE constant
  ppc/pnv: increase kernel size limit to 256MiB
  hw/ppc: Use object_initialize_child for correct reference counting
  ppc/xive: xive does not have a POWER7 interrupt model
  tests/device-plug: Add PHB unplug request test for spapr
  spapr: enable PHB hotplug for default pseries machine type
  spapr: add hotplug hooks for PHB hotplug
  spapr_pci: add ibm, my-drc-index property for PHB hotplug
  spapr_pci: provide node start offset via spapr_populate_pci_dt()
  spapr_events: add support for phb hotplug events
  spapr: populate PHB DRC entries for root DT node
  spapr: create DR connectors for PHBs
  spapr_pci: add PHB unrealize
  spapr_irq: Expose the phandle of the interrupt controller
  spapr: Expose the name of the interrupt controller node
  xics: Write source state to KVM at claim time
  spapr/drc: Drop spapr_drc_attach() fdt argument
  spapr/pci: Generate FDT fragment at configure connector time
  spapr: Generate FDT fragment for CPUs at configure connector time
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agoaudio/sdlaudio: Simplify the sdl_callback function
Thomas Huth [Tue, 5 Feb 2019 03:08:21 +0000 (04:08 +0100)]
audio/sdlaudio: Simplify the sdl_callback function

At the end of the while-loop, either "samples" or "sdl->live" is zero, so
now that we've removed the semaphore code, the content of the while-loop
is always only executed once. Thus we can remove the while-loop now to
get rid of one indentation level here.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-id: 1549336101-17623-3-git-send-email-thuth@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agoaudio/sdlaudio: Remove the semaphore code
Thomas Huth [Tue, 5 Feb 2019 03:08:20 +0000 (04:08 +0100)]
audio/sdlaudio: Remove the semaphore code

The semaphore code was only working with SDL1.2 - with SDL2, it causes
a deadlock. Since we've removed support for SDL1.2 recently, we can
now completely remove the semaphore code from sdlaudio.c.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 1549336101-17623-2-git-send-email-thuth@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agoaudio: don't build alsa and sdl by default on linux
Gerd Hoffmann [Tue, 19 Feb 2019 12:42:57 +0000 (13:42 +0100)]
audio: don't build alsa and sdl by default on linux

In case no sound hardware is present both alsa and sdl drivers
initialize successfully and throw errors later on, i.e. effectively
the automatic probing doesn't work.  Drop them from the list of
default audio drivers for linux because of that.

Fixes: 6a48541873 audio: probe audio drivers by default
Buglink: https://bugs.launchpad.net/qemu/+bug/1816052
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Tested-by: David Hildenbrand <david@redhat.com>
Message-id: 20190219124257.3001-1-kraxel@redhat.com

5 years agoaudio: Do not check for audio_calloc failure
Frediano Ziglio [Mon, 25 Feb 2019 15:43:35 +0000 (15:43 +0000)]
audio: Do not check for audio_calloc failure

audio_calloc uses g_malloc0 which never returns in case of
memory failure.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Message-id: 20190225154335.11397-2-fziglio@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agoaudio: Use g_strdup_printf instead of manual building a string
Frediano Ziglio [Mon, 25 Feb 2019 15:43:34 +0000 (15:43 +0000)]
audio: Use g_strdup_printf instead of manual building a string

Instead of using lot of low level function and manually allocate
the temporary string in audio_process_options use more high
level GLib function. The function is not used in hot path but to
read some initial setting.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Message-id: 20190225154335.11397-1-fziglio@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agoi2c: Verify that the count passed in to smbus_eeprom_init() is valid
Corey Minyard [Mon, 28 Jan 2019 17:48:19 +0000 (11:48 -0600)]
i2c: Verify that the count passed in to smbus_eeprom_init() is valid

Keep someone from passing in a bogus number

Signed-off-by: Corey Minyard <cminyard@mvista.com>
5 years agoi2c:smbus_eeprom: Add a reset function to smbus_eeprom
Corey Minyard [Thu, 15 Nov 2018 14:31:11 +0000 (08:31 -0600)]
i2c:smbus_eeprom: Add a reset function to smbus_eeprom

Reset the contents to init data and reset the offset on a machine
reset.

Signed-off-by: Corey Minyard <cminyard@mvista.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
5 years agoi2c:smbus_eeprom: Add vmstate handling to the smbus eeprom
Corey Minyard [Thu, 7 Dec 2017 21:40:53 +0000 (15:40 -0600)]
i2c:smbus_eeprom: Add vmstate handling to the smbus eeprom

Transfer the state of the EEPROM on a migration.  This way the
data remains consistent on migration.

This required moving the actual data to a separate array and
using the data provided in the init function as a separate
initialization array, since a pointer property has to be a
void * and the array needs to be uint8_t[].

Signed-off-by: Corey Minyard <cminyard@mvista.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
5 years agoi2c:smbus_eeprom: Add a size constant for the smbus_eeprom size
Corey Minyard [Thu, 8 Nov 2018 17:54:15 +0000 (11:54 -0600)]
i2c:smbus_eeprom: Add a size constant for the smbus_eeprom size

It was hard-coded to 256 in a number of places, create a constant
for that.

Signed-off-by: Corey Minyard <cminyard@mvista.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
5 years agoi2c:smbus_eeprom: Add normal type name and cast to smbus_eeprom.c
Corey Minyard [Thu, 8 Nov 2018 17:31:31 +0000 (11:31 -0600)]
i2c:smbus_eeprom: Add normal type name and cast to smbus_eeprom.c

Create a type name and a cast macro and use those through the
code.

Signed-off-by: Corey Minyard <cminyard@mvista.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
5 years agoi2c:smbus_slave: Add an SMBus vmstate structure
Corey Minyard [Thu, 7 Dec 2017 15:34:59 +0000 (09:34 -0600)]
i2c:smbus_slave: Add an SMBus vmstate structure

There is no vmstate handling for SMBus, so no device sitting on SMBus
can have a state transfer that works reliably.  So add it.

Signed-off-by: Corey Minyard <cminyard@mvista.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
5 years agoi2c:pm_smbus: Fix state transfer
Corey Minyard [Thu, 22 Dec 2016 18:28:23 +0000 (12:28 -0600)]
i2c:pm_smbus: Fix state transfer

Transfer the state information for the SMBus registers and
internal data so it will work on a VM transfer.

Signed-off-by: Corey Minyard <cminyard@mvista.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
5 years agomigration: Add a VMSTATE_BOOL_TEST() macro
Corey Minyard [Mon, 26 Nov 2018 18:54:45 +0000 (12:54 -0600)]
migration: Add a VMSTATE_BOOL_TEST() macro

This will be needed by coming I2C changes.

Signed-off-by: Corey Minyard <cminyard@mvista.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
5 years agoi2c:pm_smbus: Fix pm_smbus handling of I2C block read
Corey Minyard [Wed, 14 Nov 2018 20:41:01 +0000 (14:41 -0600)]
i2c:pm_smbus: Fix pm_smbus handling of I2C block read

The I2C block read function of pm_smbus was completely broken.  It
required doing some direct I2C handling because it didn't have a
defined size, the OS code just reads bytes until it marks the
transaction finished.

This also required adjusting how the AMIBIOS workaround code worked,
the I2C block mode was setting STS_HOST_BUSY during a transaction,
so that bit could no longer be used to inform the host status read
code to start the transaction.  Create a explicit bool for that
operation.

Also, don't read the next byte from the device in byte-by-byte
mode unless the OS is actually clearing the byte done bit.  Just
assuming that's what the OS is doing is a bad idea.

Signed-off-by: Corey Minyard <cminyard@mvista.com>