]> git.proxmox.com Git - mirror_qemu.git/log
mirror_qemu.git
6 years agoblock/nvme: fix Coverity reports
Paolo Bonzini [Tue, 13 Feb 2018 01:52:40 +0000 (09:52 +0800)]
block/nvme: fix Coverity reports

1) string not null terminated in sysfs_find_group_file

2) NULL pointer dereference and dead local variable in nvme_init.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
Message-Id: <20180213015240.9352-1-famz@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
6 years agoMerge remote-tracking branch 'remotes/kraxel/tags/usb-20180227-pull-request' into...
Peter Maydell [Tue, 27 Feb 2018 17:50:46 +0000 (17:50 +0000)]
Merge remote-tracking branch 'remotes/kraxel/tags/usb-20180227-pull-request' into staging

usb: add mtp write support.

# gpg: Signature made Tue 27 Feb 2018 08:39:01 GMT
# gpg:                using RSA key 4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/usb-20180227-pull-request:
  usb-mtp: Advertise SendObjectInfo for write support
  usb-mtp: Introduce write support for MTP objects
  usb-mtp: Support delete of mtp objects
  usb-mtp: print parent path in IN_IGNORED trace fn
  usb-mtp: Add one more argument when building results

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agoMerge remote-tracking branch 'remotes/kraxel/tags/vga-20180227-pull-request' into...
Peter Maydell [Tue, 27 Feb 2018 14:01:19 +0000 (14:01 +0000)]
Merge remote-tracking branch 'remotes/kraxel/tags/vga-20180227-pull-request' into staging

virtio-gpu: add support for second capability set

# gpg: Signature made Tue 27 Feb 2018 07:30:31 GMT
# gpg:                using RSA key 4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/vga-20180227-pull-request:
  virtio-gpu-3d: add support for second capability set (v4)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agoMerge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-2.12-pull-request...
Peter Maydell [Tue, 27 Feb 2018 10:14:31 +0000 (10:14 +0000)]
Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-2.12-pull-request' into staging

# gpg: Signature made Sun 25 Feb 2018 17:54:21 GMT
# gpg:                using RSA key F30C38BD3F2FBE3C
# gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>"
# gpg:                 aka "Laurent Vivier <laurent@vivier.eu>"
# gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>"
# Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C

* remotes/vivier2/tags/linux-user-for-2.12-pull-request:
  linux-user: MIPS set cpu to r6 CPU if binary is R6
  linux-user, m68k: select CPU according to ELF header values
  linux-user: introduce functions to detect CPU type
  linux-user: Move CPU type name selection to a function

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agovirtio-gpu-3d: add support for second capability set (v4)
Dave Airlie [Fri, 23 Feb 2018 02:38:14 +0000 (12:38 +1000)]
virtio-gpu-3d: add support for second capability set (v4)

Due to a kernel bug we can never increase the size of capability
set 1, so introduce a new capability set in parallel, old userspace
will continue to use the old set, new userspace will start using
the new one when it detects a fixed kernel.

v2: don't use a define from virglrenderer, just probe it.
v3: fix compilation when virglrenderer disabled
v4: fix style warning, just use ?: op instead.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Message-id: 20180223023814.24459-1-airlied@gmail.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
6 years agousb-mtp: Advertise SendObjectInfo for write support
Bandan Das [Fri, 23 Feb 2018 16:48:29 +0000 (11:48 -0500)]
usb-mtp: Advertise SendObjectInfo for write support

This patch implements a dummy ObjectInfo structure so that
it's easy to typecast the incoming data. If the metadata is
valid, write_pending is set. Also, the incoming filename
is utf-16, so, instead of depending on external libraries, just
implement a simple function to get the filename

Signed-off-by: Bandan Das <bsd@redhat.com>
Message-id: 20180223164829.29683-6-bsd@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
6 years agousb-mtp: Introduce write support for MTP objects
Bandan Das [Fri, 23 Feb 2018 16:48:28 +0000 (11:48 -0500)]
usb-mtp: Introduce write support for MTP objects

Allow write operations on behalf of the initiator. The
precursor to write is the sending of the write metadata
that consists of the ObjectInfo dataset. This patch introduces
a flag that is set when the responder is ready to receive
write data based on a previous SendObjectInfo operation by
the initiator (The SendObjectInfo implementation is in a
later patch)

Signed-off-by: Bandan Das <bsd@redhat.com>
Message-id: 20180223164829.29683-5-bsd@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
6 years agousb-mtp: Support delete of mtp objects
Bandan Das [Fri, 23 Feb 2018 16:48:27 +0000 (11:48 -0500)]
usb-mtp: Support delete of mtp objects

Write of existing objects by the initiator is acheived by
making a temporary buffer with the new changes, deleting the
old file and then writing a new file with the same name.

Also, add a "readonly" property which needs to be set to false
for deletion to work.

Signed-off-by: Bandan Das <bsd@redhat.com>
Message-id: 20180223164829.29683-4-bsd@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
6 years agousb-mtp: print parent path in IN_IGNORED trace fn
Bandan Das [Fri, 23 Feb 2018 16:48:26 +0000 (11:48 -0500)]
usb-mtp: print parent path in IN_IGNORED trace fn

Fix a possible null dereference when deleting a folder and
its contents. An ignored event might be received for its contents
after the parent folder is deleted which will return a null object.

Signed-off-by: Bandan Das <bsd@redhat.com>
Message-id: 20180223164829.29683-3-bsd@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
6 years agousb-mtp: Add one more argument when building results
Bandan Das [Fri, 23 Feb 2018 16:48:25 +0000 (11:48 -0500)]
usb-mtp: Add one more argument when building results

The response to a SendObjectInfo consists of the storageid,
parent obejct handle and the handle reserved for the new
incoming object

Signed-off-by: Bandan Das <bsd@redhat.com>
Message-id: 20180223164829.29683-2-bsd@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
6 years agolinux-user: MIPS set cpu to r6 CPU if binary is R6
YunQiang Su [Tue, 20 Feb 2018 17:33:07 +0000 (18:33 +0100)]
linux-user: MIPS set cpu to r6 CPU if binary is R6

So here we need to detect the version of binaries and set
cpu_model for it.

Signed-off-by: YunQiang Su <syq@debian.org>
[lv: original patch modified to move code into cpu_get_model()]
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20180220173307.25125-5-laurent@vivier.eu>

6 years agolinux-user, m68k: select CPU according to ELF header values
Laurent Vivier [Tue, 20 Feb 2018 17:33:06 +0000 (18:33 +0100)]
linux-user, m68k: select CPU according to ELF header values

M680x0 doesn't support the same set of instructions
as ColdFire, so we can't use "any" CPU type to execute
m68020 instructions.
We select CPU type ("m68040" or "any" for ColdFire)
according to the ELF header. If we can't, we
use by default the value used until now: "any".

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20180220173307.25125-4-laurent@vivier.eu>

6 years agolinux-user: introduce functions to detect CPU type
YunQiang Su [Tue, 20 Feb 2018 17:33:05 +0000 (18:33 +0100)]
linux-user: introduce functions to detect CPU type

Add a function to return ELF e_flags and use it
to select the CPU model.

Signed-off-by: YunQiang Su <syq@debian.org>
[lv: split the patch and some cleanup in get_elf_eflags()]
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20180220173307.25125-3-laurent@vivier.eu>

6 years agolinux-user: Move CPU type name selection to a function
Laurent Vivier [Tue, 20 Feb 2018 17:33:04 +0000 (18:33 +0100)]
linux-user: Move CPU type name selection to a function

Instead of a sequence of "#if ... #endif" move the
selection to a function in linux-user/*/target_elf.h

We can't add them in linux-user/*/target_cpu.h
because we will need to include "elf.h" to
use ELF flags with eflags, and including
"elf.h" in "target_cpu.h" introduces some
conflicts in elfload.c

Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20180220173307.25125-2-laurent@vivier.eu>

6 years agomaintainers: Add myself as a OpenBSD maintainer
Brad Smith [Fri, 16 Feb 2018 16:46:20 +0000 (11:46 -0500)]
maintainers: Add myself as a OpenBSD maintainer

Add myself as an OpenBSD maintainer and add OpenBSD as maintained.

Signed-off-by: Brad Smith <brad@comstyle.com>
Reviewed-by: Kamil Rytarowski <n54@gmx.com>
Message-id: 20180216164620.GA53727@humpty.home.comstyle.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agoMerge remote-tracking branch 'remotes/rth/tags/pull-decode-20180222' into staging
Peter Maydell [Fri, 23 Feb 2018 10:05:07 +0000 (10:05 +0000)]
Merge remote-tracking branch 'remotes/rth/tags/pull-decode-20180222' into staging

Add decodetree.py

# gpg: Signature made Thu 22 Feb 2018 23:44:43 GMT
# gpg:                using RSA key 64DF38E8AF7E215F
# gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>"
# Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A  05C0 64DF 38E8 AF7E 215F

* remotes/rth/tags/pull-decode-20180222:
  scripts: Add decodetree.py

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agoscripts: Add decodetree.py
Richard Henderson [Thu, 7 Dec 2017 20:44:09 +0000 (12:44 -0800)]
scripts: Add decodetree.py

To be used to decode ARM SVE, but could be used for any fixed-width ISA.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 years agoMerge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20180222' into...
Peter Maydell [Thu, 22 Feb 2018 15:41:24 +0000 (15:41 +0000)]
Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20180222' into staging

 * New "raspi3" machine emulating RaspberryPi 3
 * Fix bad register definitions for VMIDR and VMPIDR (which caused
   assertions for 64-bit guest CPUs with EL2 on big-endian hosts)
 * hw/char/stm32f2xx_usart: fix TXE/TC bit handling
 * Fix ast2500 protection register emulation
 * Lots of SD card emulation cleanups and bugfixes

# gpg: Signature made Thu 22 Feb 2018 15:18:53 GMT
# gpg:                using RSA key 3C2525ED14360CDE
# gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>"
# gpg:                 aka "Peter Maydell <pmaydell@gmail.com>"
# gpg:                 aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>"
# Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83  15CF 3C25 25ED 1436 0CDE

* remotes/pmaydell/tags/pull-target-arm-20180222: (32 commits)
  sdcard: simplify SD_SEND_OP_COND (ACMD41)
  sdcard: simplify SEND_IF_COND (CMD8)
  sdcard: warn if host uses an incorrect address for APP CMD (CMD55)
  sdcard: check the card is in correct state for APP CMD (CMD55)
  sdcard: handles more commands in SPI mode
  sdcard: use a more descriptive label 'unimplemented_spi_cmd'
  sdcard: handle the Security Specification commands
  sdcard: handle CMD54 (SDIO)
  sdcard: use the registerfields API for the CARD_STATUS register masks
  sdcard: use the correct masked OCR in the R3 reply
  sdcard: simplify using the ldst API
  sdcard: remove commands from unsupported old MMC specification
  sdcard: clean the SCR register and add few comments
  sdcard: fix the 'maximum data transfer rate' to 25MHz
  sdcard: update the CSD CRC register regardless the CSD structure version
  sdcard: Don't always set the high capacity bit
  sdcard: use the registerfields API to access the OCR register
  sdcard: use G_BYTE from cutils
  sdcard: define SDMMC_CMD_MAX instead of using the magic '64'
  sdcard: add more trace events
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agosdcard: simplify SD_SEND_OP_COND (ACMD41)
Philippe Mathieu-Daudé [Thu, 22 Feb 2018 15:12:54 +0000 (15:12 +0000)]
sdcard: simplify SD_SEND_OP_COND (ACMD41)

replace switch(single case) -> if()

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Message-id: 20180215221325.7611-17-f4bug@amsat.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agosdcard: simplify SEND_IF_COND (CMD8)
Philippe Mathieu-Daudé [Thu, 22 Feb 2018 15:12:54 +0000 (15:12 +0000)]
sdcard: simplify SEND_IF_COND (CMD8)

replace switch(single case) -> if()

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Message-id: 20180215221325.7611-16-f4bug@amsat.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agosdcard: warn if host uses an incorrect address for APP CMD (CMD55)
Philippe Mathieu-Daudé [Thu, 22 Feb 2018 15:12:54 +0000 (15:12 +0000)]
sdcard: warn if host uses an incorrect address for APP CMD (CMD55)

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Message-id: 20180215221325.7611-15-f4bug@amsat.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agosdcard: check the card is in correct state for APP CMD (CMD55)
Philippe Mathieu-Daudé [Thu, 22 Feb 2018 15:12:54 +0000 (15:12 +0000)]
sdcard: check the card is in correct state for APP CMD (CMD55)

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Message-id: 20180215221325.7611-14-f4bug@amsat.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agosdcard: handles more commands in SPI mode
Philippe Mathieu-Daudé [Thu, 22 Feb 2018 15:12:53 +0000 (15:12 +0000)]
sdcard: handles more commands in SPI mode

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Message-id: 20180215221325.7611-13-f4bug@amsat.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agosdcard: use a more descriptive label 'unimplemented_spi_cmd'
Philippe Mathieu-Daudé [Thu, 22 Feb 2018 15:12:53 +0000 (15:12 +0000)]
sdcard: use a more descriptive label 'unimplemented_spi_cmd'

Suggested-by: Alistair Francis <alistair.francis@xilinx.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Message-id: 20180215221325.7611-12-f4bug@amsat.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agosdcard: handle the Security Specification commands
Philippe Mathieu-Daudé [Thu, 22 Feb 2018 15:12:53 +0000 (15:12 +0000)]
sdcard: handle the Security Specification commands

returning sd_illegal, since they are not implemented.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Message-id: 20180215221325.7611-11-f4bug@amsat.org
[PMM: tweak multiline comment format]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agosdcard: handle CMD54 (SDIO)
Philippe Mathieu-Daudé [Thu, 22 Feb 2018 15:12:53 +0000 (15:12 +0000)]
sdcard: handle CMD54 (SDIO)

Linux uses it to poll the bus before polling for a card.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Message-id: 20180215221325.7611-10-f4bug@amsat.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agosdcard: use the registerfields API for the CARD_STATUS register masks
Philippe Mathieu-Daudé [Thu, 22 Feb 2018 15:12:53 +0000 (15:12 +0000)]
sdcard: use the registerfields API for the CARD_STATUS register masks

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Acked-by: Alistair Francis <alistair.francis@xilinx.com>
Message-id: 20180215221325.7611-9-f4bug@amsat.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agosdcard: use the correct masked OCR in the R3 reply
Philippe Mathieu-Daudé [Thu, 22 Feb 2018 15:12:53 +0000 (15:12 +0000)]
sdcard: use the correct masked OCR in the R3 reply

use the registerfields API to access the OCR register

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Message-id: 20180215221325.7611-8-f4bug@amsat.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agosdcard: simplify using the ldst API
Philippe Mathieu-Daudé [Thu, 22 Feb 2018 15:12:53 +0000 (15:12 +0000)]
sdcard: simplify using the ldst API

the code is easier to review/refactor.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Message-id: 20180215221325.7611-7-f4bug@amsat.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agosdcard: remove commands from unsupported old MMC specification
Philippe Mathieu-Daudé [Thu, 22 Feb 2018 15:12:53 +0000 (15:12 +0000)]
sdcard: remove commands from unsupported old MMC specification

This device does not model MMCA Specification previous to v4.2

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Message-id: 20180215221325.7611-6-f4bug@amsat.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agosdcard: clean the SCR register and add few comments
Philippe Mathieu-Daudé [Thu, 22 Feb 2018 15:12:53 +0000 (15:12 +0000)]
sdcard: clean the SCR register and add few comments

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Message-id: 20180215221325.7611-5-f4bug@amsat.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agosdcard: fix the 'maximum data transfer rate' to 25MHz
Philippe Mathieu-Daudé [Thu, 22 Feb 2018 15:12:53 +0000 (15:12 +0000)]
sdcard: fix the 'maximum data transfer rate' to 25MHz

To comply with Spec v1.10 (and 2.00, 3.01):

. TRAN_SPEED

for current SD Memory Cards that field must be always 0_0110_010b (032h) which is
equal to 25MHz - the mandatory maximum operating frequency of SD Memory Card.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Message-id: 20180215221325.7611-4-f4bug@amsat.org
[PMM: fixed comment indent]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agosdcard: update the CSD CRC register regardless the CSD structure version
Philippe Mathieu-Daudé [Thu, 22 Feb 2018 15:12:53 +0000 (15:12 +0000)]
sdcard: update the CSD CRC register regardless the CSD structure version

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Message-id: 20180215221325.7611-3-f4bug@amsat.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agosdcard: Don't always set the high capacity bit
Philippe Mathieu-Daudé [Thu, 22 Feb 2018 15:12:52 +0000 (15:12 +0000)]
sdcard: Don't always set the high capacity bit

Don't set the high capacity bit by default as it will be set if required
in the sd_set_csd() function.

[based on a patch from Alistair Francis <alistair.francis@xilinx.com>
 and Peter Ogden <ogden@xilinx.com> from qemu/xilinx tag xilinx-v2015.4]
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Message-id: 20180215221325.7611-2-f4bug@amsat.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agosdcard: use the registerfields API to access the OCR register
Philippe Mathieu-Daudé [Thu, 22 Feb 2018 15:12:52 +0000 (15:12 +0000)]
sdcard: use the registerfields API to access the OCR register

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Message-id: 20180215220540.6556-12-f4bug@amsat.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agosdcard: use G_BYTE from cutils
Philippe Mathieu-Daudé [Thu, 22 Feb 2018 15:12:52 +0000 (15:12 +0000)]
sdcard: use G_BYTE from cutils

code is now easier to read.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Message-id: 20180215220540.6556-11-f4bug@amsat.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agosdcard: define SDMMC_CMD_MAX instead of using the magic '64'
Philippe Mathieu-Daudé [Thu, 22 Feb 2018 15:12:52 +0000 (15:12 +0000)]
sdcard: define SDMMC_CMD_MAX instead of using the magic '64'

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Message-id: 20180215220540.6556-8-f4bug@amsat.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agosdcard: add more trace events
Philippe Mathieu-Daudé [Thu, 22 Feb 2018 15:12:52 +0000 (15:12 +0000)]
sdcard: add more trace events

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Acked-by: Alistair Francis <alistair.francis@xilinx.com>
Message-id: 20180215220540.6556-6-f4bug@amsat.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agosdcard: replace fprintf() by qemu_hexdump()
Philippe Mathieu-Daudé [Thu, 22 Feb 2018 15:12:52 +0000 (15:12 +0000)]
sdcard: replace fprintf() by qemu_hexdump()

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Message-id: 20180215220540.6556-5-f4bug@amsat.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agosdcard: add a trace event for command responses
Philippe Mathieu-Daudé [Thu, 22 Feb 2018 15:12:52 +0000 (15:12 +0000)]
sdcard: add a trace event for command responses

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20180215220540.6556-4-f4bug@amsat.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agosdcard: replace DPRINTF() by trace events
Philippe Mathieu-Daudé [Thu, 22 Feb 2018 15:12:52 +0000 (15:12 +0000)]
sdcard: replace DPRINTF() by trace events

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Message-id: 20180215220540.6556-3-f4bug@amsat.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agosdcard: reorder SDState struct members
Philippe Mathieu-Daudé [Thu, 22 Feb 2018 15:12:52 +0000 (15:12 +0000)]
sdcard: reorder SDState struct members

place card registers first, this will ease further code movements.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Message-id: 20180215220540.6556-2-f4bug@amsat.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agohw/sd/ssi-sd: use the SDBus API, connect the SDCard to the bus
Philippe Mathieu-Daudé [Thu, 22 Feb 2018 15:12:52 +0000 (15:12 +0000)]
hw/sd/ssi-sd: use the SDBus API, connect the SDCard to the bus

On reset the bus will reset the card,
we can now drop the device_reset() call.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Message-id: 20180216022933.10945-5-f4bug@amsat.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agohw/sd/milkymist-memcard: expose a SDBus and connect the SDCard to it
Philippe Mathieu-Daudé [Thu, 22 Feb 2018 15:12:52 +0000 (15:12 +0000)]
hw/sd/milkymist-memcard: expose a SDBus and connect the SDCard to it

using the sdbus_*() API.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Acked-by: Michael Walle <michael@walle.cc>
Message-id: 20180216022933.10945-4-f4bug@amsat.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agohw/sd/milkymist-memcard: split realize() out of SysBusDevice init()
Philippe Mathieu-Daudé [Thu, 22 Feb 2018 15:12:51 +0000 (15:12 +0000)]
hw/sd/milkymist-memcard: split realize() out of SysBusDevice init()

Create the SDCard in the realize() function.

Suggested-by: Michael Walle <michael@walle.cc>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Acked-by: Michael Walle <michael@walle.cc>
Message-id: 20180216022933.10945-3-f4bug@amsat.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agohw/sd/milkymist-memcard: use qemu_log_mask()
Philippe Mathieu-Daudé [Thu, 22 Feb 2018 15:12:51 +0000 (15:12 +0000)]
hw/sd/milkymist-memcard: use qemu_log_mask()

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Acked-by: Michael Walle <michael@walle.cc>
Message-id: 20180216022933.10945-2-f4bug@amsat.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agoFix ast2500 protection register emulation
Hugo Landau [Thu, 22 Feb 2018 15:12:51 +0000 (15:12 +0000)]
Fix ast2500 protection register emulation

Some register blocks of the ast2500 are protected by protection key
registers which require the right magic value to be written to those
registers to allow those registers to be mutated.

Register manuals indicate that writing the correct magic value to these
registers should cause subsequent reads from those values to return 1,
and writing any other value should cause subsequent reads to return 0.

Previously, qemu implemented these registers incorrectly: the registers
were handled as simple memory, meaning that writing some value x to a
protection key register would result in subsequent reads from that
register returning the same value x. The protection was implemented by
ensuring that the current value of that register equaled the magic
value.

This modifies qemu to have the correct behaviour: attempts to write to a
ast2500 protection register results in a transition to 1 or 0 depending
on whether the written value is the correct magic. The protection logic
is updated to ensure that the value of the register is nonzero.

This bug caused deadlocks with u-boot HEAD: when u-boot is done with a
protectable register block, it attempts to lock it by writing the
bitwise inverse of the correct magic value, and then spinning forever
until the register reads as zero. Since qemu implemented writes to these
registers as ordinary memory writes, writing the inverse of the magic
value resulted in subsequent reads returning that value, leading to
u-boot spinning forever.

Signed-off-by: Hugo Landau <hlandau@devever.net>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Acked-by: Andrew Jeffery <andrew@aj.id.au>
Message-id: 20180220132627.4163-1-hlandau@devever.net
[PMM: fixed incorrect code indentation]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agohw/char/stm32f2xx_usart: fix TXE/TC bit handling
Richard Braun [Thu, 22 Feb 2018 15:12:51 +0000 (15:12 +0000)]
hw/char/stm32f2xx_usart: fix TXE/TC bit handling

I/O currently being synchronous, there is no reason to ever clear the
SR_TXE bit. However the SR_TC bit may be cleared by software writing
to the SR register, so set it on each write.

In addition, fix the reset value of the USART status register.

Signed-off-by: Richard Braun <rbraun@sceen.net>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
[PMM: removed XXX tag from comment, since it isn't something
 we need to come back and fix in QEMU]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agoraspi: Add "raspi3" machine type
Pekka Enberg [Thu, 22 Feb 2018 15:12:51 +0000 (15:12 +0000)]
raspi: Add "raspi3" machine type

This patch adds a "raspi3" machine type, which can now be selected as
the machine to run on by users via the "-M" command line option to QEMU.

The machine type does *not* ignore memory transaction failures so we
likely need to add some dummy devices later when people run something
more complicated than what I'm using for testing.

Signed-off-by: Pekka Enberg <penberg@iki.fi>
[PMM: added #ifdef TARGET_AARCH64 so we don't provide the 64-bit
 board in the 32-bit only arm-softmmu build.]
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agotarget/arm: Fix register definitions for VMIDR and VMPIDR
Peter Maydell [Thu, 22 Feb 2018 15:12:51 +0000 (15:12 +0000)]
target/arm: Fix register definitions for VMIDR and VMPIDR

The register definitions for VMIDR and VMPIDR have separate
reginfo structs for the AArch32 and AArch64 registers. However
the 32-bit versions are wrong:
 * they use offsetof instead of offsetoflow32 to mark where
   the 32-bit value lives in the uint64_t CPU state field
 * they don't mark themselves as ARM_CP_ALIAS

In particular this means that if you try to use an Arm guest CPU
which enables EL2 on a big-endian host it will assert at reset:
 target/arm/cpu.c:114: cp_reg_check_reset: Assertion `oldvalue == newvalue' failed.

because the reset of the 32-bit register writes to the top
half of the uint64_t.

Correct the errors in the structures.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
This is necessary for 'make check' to pass on big endian
systems with the 'raspi3' board enabled, which is the
first board which has an EL2-enabled-by-default CPU.

6 years agoMerge remote-tracking branch 'remotes/kraxel/tags/ui-20180222-pull-request' into...
Peter Maydell [Thu, 22 Feb 2018 14:44:42 +0000 (14:44 +0000)]
Merge remote-tracking branch 'remotes/kraxel/tags/ui-20180222-pull-request' into staging

ui: reverse keymap improvements.
sdl2: hotkey fix.
opengl: dmabuf fixes.

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

* remotes/kraxel/tags/ui-20180222-pull-request:
  keymap: consider modifier state when picking a mapping
  keymap: record multiple keysym -> keycode mappings
  keymap: numpad keysyms and keycodes are fixed
  keymap: use glib hash for kbd_layout_t
  keymap: make struct kbd_layout_t private to ui/keymaps.c
  egl-helpers: add alpha channel to texture format
  egl-headless: cursor_dmabuf: handle NULL cursor
  console/opengl: split up dpy_gl_cursor ops
  sdl2: fix hotkey keyup

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agoMerge remote-tracking branch 'remotes/mcayland/tags/qemu-openbios-signed' into staging
Peter Maydell [Thu, 22 Feb 2018 11:37:05 +0000 (11:37 +0000)]
Merge remote-tracking branch 'remotes/mcayland/tags/qemu-openbios-signed' into staging

Update OpenBIOS images

# gpg: Signature made Thu 22 Feb 2018 08:12:01 GMT
# gpg:                using RSA key 5BC2C56FAE0F321F
# gpg: Good signature from "Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>"
# Primary key fingerprint: CC62 1AB9 8E82 200D 915C  C9C4 5BC2 C56F AE0F 321F

* remotes/mcayland/tags/qemu-openbios-signed:
  Update OpenBIOS images to 54d959d9 built from submodule.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agoMerge remote-tracking branch 'remotes/stsquad/tags/pull-softfloat-refactor-210218...
Peter Maydell [Thu, 22 Feb 2018 10:01:23 +0000 (10:01 +0000)]
Merge remote-tracking branch 'remotes/stsquad/tags/pull-softfloat-refactor-210218-1' into staging

This is the re-factor of softfloat:

  - shared common code path float16/32/64
  - well commented and easy to follow code
  - added a bunch of float16 support

While some operations are slower the key ones exercised by the
floating point dbt-bench are the same: https://i.imgur.com/oXNJNql.png

# gpg: Signature made Wed 21 Feb 2018 10:44:14 GMT
# gpg:                using RSA key FBD0DB095A9E2A44
# gpg: Good signature from "Alex Bennée (Master Work Key) <alex.bennee@linaro.org>"
# Primary key fingerprint: 6685 AE99 E751 67BC AFC8  DF35 FBD0 DB09 5A9E 2A44

* remotes/stsquad/tags/pull-softfloat-refactor-210218-1: (22 commits)
  fpu/softfloat: re-factor sqrt
  fpu/softfloat: re-factor compare
  fpu/softfloat: re-factor minmax
  fpu/softfloat: re-factor scalbn
  fpu/softfloat: re-factor int/uint to float
  fpu/softfloat: re-factor float to int/uint
  fpu/softfloat: re-factor round_to_int
  fpu/softfloat: re-factor muladd
  fpu/softfloat: re-factor div
  fpu/softfloat: re-factor mul
  fpu/softfloat: re-factor add/sub
  fpu/softfloat: define decompose structures
  fpu/softfloat: move the extract functions to the top of the file
  fpu/softfloat: improve comments on ARM NaN propagation
  include/fpu/softfloat: add some float16 constants
  include/fpu/softfloat: implement float16_set_sign helper
  include/fpu/softfloat: implement float16_chs helper
  include/fpu/softfloat: implement float16_abs helper
  target/*/cpu.h: remove softfloat.h
  fpu/softfloat-types: new header to prevent excessive re-builds
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agokeymap: consider modifier state when picking a mapping
Gerd Hoffmann [Thu, 22 Feb 2018 07:05:13 +0000 (08:05 +0100)]
keymap: consider modifier state when picking a mapping

Pass the modifier state to the keymap lookup function.  In case multiple
keysym -> keycode mappings exist look at the modifier state and prefer
the mapping where the modifier state matches.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-id: 20180222070513.8740-6-kraxel@redhat.com

6 years agokeymap: record multiple keysym -> keycode mappings
Gerd Hoffmann [Thu, 22 Feb 2018 07:05:12 +0000 (08:05 +0100)]
keymap: record multiple keysym -> keycode mappings

Sometimes the same keysym can be created using different key
combinations.  Record them all in the reverse keymap, not only
the first one.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-id: 20180222070513.8740-5-kraxel@redhat.com

6 years agokeymap: numpad keysyms and keycodes are fixed
Gerd Hoffmann [Thu, 22 Feb 2018 07:05:11 +0000 (08:05 +0100)]
keymap: numpad keysyms and keycodes are fixed

No need to figure them at runtime from the keymap.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-id: 20180222070513.8740-4-kraxel@redhat.com

6 years agokeymap: use glib hash for kbd_layout_t
Gerd Hoffmann [Thu, 22 Feb 2018 07:05:10 +0000 (08:05 +0100)]
keymap: use glib hash for kbd_layout_t

Drop home-grown lookup code, which is a strange mix of a lookup table
and a list.  Use standard glib hash instead.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-id: 20180222070513.8740-3-kraxel@redhat.com

6 years agokeymap: make struct kbd_layout_t private to ui/keymaps.c
Gerd Hoffmann [Thu, 22 Feb 2018 07:05:09 +0000 (08:05 +0100)]
keymap: make struct kbd_layout_t private to ui/keymaps.c

Also use kbd_layout_t pointers instead of void pointers.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-id: 20180222070513.8740-2-kraxel@redhat.com

6 years agoegl-helpers: add alpha channel to texture format
Gerd Hoffmann [Tue, 20 Feb 2018 11:04:33 +0000 (12:04 +0100)]
egl-helpers: add alpha channel to texture format

Needed when rendering cursers which (unlike framebuffers)
actually are transparent.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20180220110433.20353-4-kraxel@redhat.com

6 years agoegl-headless: cursor_dmabuf: handle NULL cursor
Gerd Hoffmann [Tue, 20 Feb 2018 11:04:32 +0000 (12:04 +0100)]
egl-headless: cursor_dmabuf: handle NULL cursor

The cursor dmabuf can be NULL, in case no cursor defined by the guest.
Happens for example when linux guests show the framebuffer console.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20180220110433.20353-3-kraxel@redhat.com

6 years agoconsole/opengl: split up dpy_gl_cursor ops
Gerd Hoffmann [Tue, 20 Feb 2018 11:04:31 +0000 (12:04 +0100)]
console/opengl: split up dpy_gl_cursor ops

Split the cursor callback into two, one for setting the dmabuf,
one for setting the position.  Also add hotspot information.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20180220110433.20353-2-kraxel@redhat.com

6 years agosdl2: fix hotkey keyup
Gerd Hoffmann [Tue, 20 Feb 2018 15:04:44 +0000 (16:04 +0100)]
sdl2: fix hotkey keyup

After some hotkey was pressed sdl2 doesn't forward the first modifier
keyup event to the guest, resulting in stuck modifier keys.

Fix the logic in handle_keyup().  Also gui_key_modifier_pressed doesn't
need to be a global variable.

Reported-by: Howard Spoelstra <hsp.cat7@gmail.com>
Tested-by: Howard Spoelstra <hsp.cat7@gmail.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-id: 20180220150444.784-1-kraxel@redhat.com

6 years agoUpdate OpenBIOS images to 54d959d9 built from submodule.
Mark Cave-Ayland [Thu, 22 Feb 2018 07:55:01 +0000 (07:55 +0000)]
Update OpenBIOS images to 54d959d9 built from submodule.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
6 years agofpu/softfloat: re-factor sqrt
Alex Bennée [Fri, 12 Jan 2018 11:24:02 +0000 (11:24 +0000)]
fpu/softfloat: re-factor sqrt

This is a little bit of a departure from softfloat's original approach
as we skip the estimate step in favour of a straight iteration. There
is a minor optimisation to avoid calculating more bits of precision
than we need however this still brings a performance drop, especially
for float64 operations.

Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
6 years agofpu/softfloat: re-factor compare
Alex Bennée [Tue, 5 Dec 2017 17:14:42 +0000 (17:14 +0000)]
fpu/softfloat: re-factor compare

The compare function was already expanded from a macro. I keep the
macro expansion but move most of the logic into a compare_decomposed.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
6 years agofpu/softfloat: re-factor minmax
Alex Bennée [Tue, 5 Dec 2017 12:36:01 +0000 (12:36 +0000)]
fpu/softfloat: re-factor minmax

Let's do the same re-factor treatment for minmax functions. I still
use the MACRO trick to expand but now all the checking code is common.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
6 years agofpu/softfloat: re-factor scalbn
Alex Bennée [Thu, 30 Nov 2017 11:31:40 +0000 (11:31 +0000)]
fpu/softfloat: re-factor scalbn

This is one of the simpler manipulations you could make to a floating
point number.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
6 years agofpu/softfloat: re-factor int/uint to float
Alex Bennée [Thu, 30 Nov 2017 10:57:08 +0000 (10:57 +0000)]
fpu/softfloat: re-factor int/uint to float

These are considerably simpler as the lower order integers can just
use the higher order conversion function. As the decomposed fractional
part is a full 64 bit rounding and inexact handling comes from the
pack functions.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
6 years agofpu/softfloat: re-factor float to int/uint
Alex Bennée [Wed, 29 Nov 2017 10:56:06 +0000 (10:56 +0000)]
fpu/softfloat: re-factor float to int/uint

We share the common int64/uint64_pack_decomposed function across all
the helpers and simply limit the final result depending on the final
size.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
6 years agofpu/softfloat: re-factor round_to_int
Alex Bennée [Wed, 29 Nov 2017 10:21:25 +0000 (10:21 +0000)]
fpu/softfloat: re-factor round_to_int

We can now add float16_round_to_int and use the common round_decomposed and
canonicalize functions to have a single implementation for
float16/32/64 round_to_int functions.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
6 years agofpu/softfloat: re-factor muladd
Alex Bennée [Tue, 28 Nov 2017 17:04:44 +0000 (17:04 +0000)]
fpu/softfloat: re-factor muladd

We can now add float16_muladd and use the common decompose and
canonicalize functions to have a single implementation for
float16/32/64 muladd functions.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
6 years agofpu/softfloat: re-factor div
Alex Bennée [Mon, 27 Nov 2017 16:13:36 +0000 (16:13 +0000)]
fpu/softfloat: re-factor div

We can now add float16_div and use the common decompose and
canonicalize functions to have a single implementation for
float16/32/64 versions.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
6 years agofpu/softfloat: re-factor mul
Alex Bennée [Thu, 7 Dec 2017 18:56:50 +0000 (18:56 +0000)]
fpu/softfloat: re-factor mul

We can now add float16_mul and use the common decompose and
canonicalize functions to have a single implementation for
float16/32/64 versions.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
6 years agofpu/softfloat: re-factor add/sub
Alex Bennée [Mon, 27 Nov 2017 14:15:17 +0000 (14:15 +0000)]
fpu/softfloat: re-factor add/sub

We can now add float16_add/sub and use the common decompose and
canonicalize functions to have a single implementation for
float16/32/64 add and sub functions.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
6 years agofpu/softfloat: define decompose structures
Alex Bennée [Mon, 27 Nov 2017 14:02:26 +0000 (14:02 +0000)]
fpu/softfloat: define decompose structures

These structures pave the way for generic softfloat helper routines
that will operate on fully decomposed numbers.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
6 years agofpu/softfloat: move the extract functions to the top of the file
Alex Bennée [Mon, 27 Nov 2017 13:58:23 +0000 (13:58 +0000)]
fpu/softfloat: move the extract functions to the top of the file

This is pure code-motion during re-factoring as the helpers will be
needed earlier.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
6 years agofpu/softfloat: improve comments on ARM NaN propagation
Alex Bennée [Wed, 19 Jul 2017 10:49:42 +0000 (11:49 +0100)]
fpu/softfloat: improve comments on ARM NaN propagation

Mention the pseudo-code fragment from which this is based.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
6 years agoinclude/fpu/softfloat: add some float16 constants
Alex Bennée [Fri, 8 Dec 2017 17:13:19 +0000 (17:13 +0000)]
include/fpu/softfloat: add some float16 constants

This defines the same set of common constants for float 16 as defined
for 32 and 64 bit floats. These are often used by target helper
functions. I've also removed constants that are not used by anybody.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
6 years agoinclude/fpu/softfloat: implement float16_set_sign helper
Alex Bennée [Fri, 8 Dec 2017 17:03:13 +0000 (17:03 +0000)]
include/fpu/softfloat: implement float16_set_sign helper

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
6 years agoinclude/fpu/softfloat: implement float16_chs helper
Alex Bennée [Thu, 7 Dec 2017 19:09:24 +0000 (19:09 +0000)]
include/fpu/softfloat: implement float16_chs helper

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
6 years agoinclude/fpu/softfloat: implement float16_abs helper
Alex Bennée [Mon, 3 Jul 2017 13:33:08 +0000 (14:33 +0100)]
include/fpu/softfloat: implement float16_abs helper

This will be required when expanding the MINMAX() macro for 16
bit/half-precision operations.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
6 years agotarget/*/cpu.h: remove softfloat.h
Alex Bennée [Fri, 19 Jan 2018 18:24:22 +0000 (18:24 +0000)]
target/*/cpu.h: remove softfloat.h

As cpu.h is another typically widely included file which doesn't need
full access to the softfloat API we can remove the includes from here
as well. Where they do need types it's typically for float_status and
the rounding modes so we move that to softfloat-types.h as well.

As a result of not having softfloat in every cpu.h call we now need to
add it to various helpers that do need the full softfloat.h
definitions.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
[For PPC parts]
Acked-by: David Gibson <david@gibson.dropbear.id.au>
6 years agofpu/softfloat-types: new header to prevent excessive re-builds
Alex Bennée [Fri, 19 Jan 2018 16:36:40 +0000 (16:36 +0000)]
fpu/softfloat-types: new header to prevent excessive re-builds

The main culprit here is bswap.h which pulled in softfloat.h so it
could use the types in its CPU_Float* and ldfl/stfql functions. As
bswap.h is very widely included this added a compile dependency every
time we touch softfloat.h. Move the typedefs for each float type into
their own file so we don't re-build the world every time we tweak the
main softfloat.h header.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
6 years agoinclude/fpu/softfloat: remove USE_SOFTFLOAT_STRUCT_TYPES
Alex Bennée [Fri, 5 Jan 2018 20:18:55 +0000 (20:18 +0000)]
include/fpu/softfloat: remove USE_SOFTFLOAT_STRUCT_TYPES

It's not actively built and when enabled things fail to compile. I'm
not sure the type-checking is really helping here. Seeing as we "own"
our softfloat now lets remove the cruft.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
6 years agofpu/softfloat: implement float16_squash_input_denormal
Alex Bennée [Mon, 3 Jul 2017 13:30:06 +0000 (14:30 +0100)]
fpu/softfloat: implement float16_squash_input_denormal

This will be required when expanding the MINMAX() macro for 16
bit/half-precision operations.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
6 years agoMerge remote-tracking branch 'remotes/kraxel/tags/ui-20180220-pull-request' into...
Peter Maydell [Tue, 20 Feb 2018 14:05:00 +0000 (14:05 +0000)]
Merge remote-tracking branch 'remotes/kraxel/tags/ui-20180220-pull-request' into staging

ui: reorganize and cleanup display command line parsing.
gtk: fix gtk3 warnings.

# gpg: Signature made Tue 20 Feb 2018 13:46:53 GMT
# gpg:                using RSA key 4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/ui-20180220-pull-request:
  ui: Reorder vte terminal packing to avoid gtk3 warnings
  vl: drop display_type variable
  vl: drop request_opengl variable
  vl: drop full_screen variable
  cocoa: use DisplayOptions
  curses: use DisplayOptions
  egl-headless: use DisplayOptions
  vl: drop no_quit variable
  sdl: use DisplayOptions
  gtk: add and use DisplayOptions + DisplayGTK
  vl: rename DisplayType to LegacyDisplayType
  vl: deprecate -no-frame

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agoMerge remote-tracking branch 'remotes/gkurz/tags/for-upstream' into staging
Peter Maydell [Tue, 20 Feb 2018 11:52:24 +0000 (11:52 +0000)]
Merge remote-tracking branch 'remotes/gkurz/tags/for-upstream' into staging

Fix memory leak in synth backend.

# gpg: Signature made Mon 19 Feb 2018 17:29:49 GMT
# gpg:                using RSA key 71D4D5E5822F73D6
# gpg: Good signature from "Greg Kurz <groug@kaod.org>"
# gpg:                 aka "Gregory Kurz <gregory.kurz@free.fr>"
# gpg:                 aka "[jpeg image of size 3330]"
# Primary key fingerprint: B482 8BAF 9431 40CE F2A3  4910 71D4 D5E5 822F 73D6

* remotes/gkurz/tags/for-upstream:
  9p: fix leak in synth_name_to_path()
  9p: v9fs_path_copy() readability

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agoui: Reorder vte terminal packing to avoid gtk3 warnings
Jan Kiszka [Sat, 17 Feb 2018 11:26:49 +0000 (12:26 +0100)]
ui: Reorder vte terminal packing to avoid gtk3 warnings

Fill the terminal box from right to left to avoid

Gtk-WARNING **: Allocating size to GtkScrollbar 0x55f6d54b0200 without
    calling gtk_widget_get_preferred_width/height(). How does the code
    know the size to allocate?

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Message-id: 902aaef8-d20e-0530-dea2-cdfe3db33ff3@web.de
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
6 years agovl: drop display_type variable
Gerd Hoffmann [Fri, 2 Feb 2018 11:10:22 +0000 (12:10 +0100)]
vl: drop display_type variable

Switch over all leftover users to qapi DisplayType.
Then delete the unused display_type variable.

Add 'default' DisplayType, which isn't an actual display type but
a placeholder for "user didn't specify a display".  It will be replaced
by the DisplayType actually used, which in turn depends on the
DisplayTypes availabel in the particular build.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 20180202111022.19269-13-kraxel@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
6 years agovl: drop request_opengl variable
Gerd Hoffmann [Fri, 2 Feb 2018 11:10:21 +0000 (12:10 +0100)]
vl: drop request_opengl variable

Switch over the one leftover user to qapi DisplayType.
The delete the unused request_opengl variable.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 20180202111022.19269-12-kraxel@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
6 years agovl: drop full_screen variable
Gerd Hoffmann [Fri, 2 Feb 2018 11:10:20 +0000 (12:10 +0100)]
vl: drop full_screen variable

Not used any more, delete it.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 20180202111022.19269-11-kraxel@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
6 years agococoa: use DisplayOptions
Gerd Hoffmann [Fri, 2 Feb 2018 11:10:19 +0000 (12:10 +0100)]
cocoa: use DisplayOptions

Switch cocoa ui to use qapi DisplayOptions for configuration.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 20180202111022.19269-10-kraxel@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
6 years agocurses: use DisplayOptions
Gerd Hoffmann [Fri, 2 Feb 2018 11:10:18 +0000 (12:10 +0100)]
curses: use DisplayOptions

Switch curses ui to use qapi DisplayOptions for configuration.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 20180202111022.19269-9-kraxel@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
6 years agoegl-headless: use DisplayOptions
Gerd Hoffmann [Fri, 2 Feb 2018 11:10:17 +0000 (12:10 +0100)]
egl-headless: use DisplayOptions

Switch egl-headless ui to use qapi DisplayOptions for configuration.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 20180202111022.19269-8-kraxel@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
6 years agovl: drop no_quit variable
Gerd Hoffmann [Fri, 2 Feb 2018 11:10:16 +0000 (12:10 +0100)]
vl: drop no_quit variable

Not used any more, delete it.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20180202111022.19269-7-kraxel@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
6 years agosdl: use DisplayOptions
Gerd Hoffmann [Fri, 2 Feb 2018 11:10:15 +0000 (12:10 +0100)]
sdl: use DisplayOptions

Switch sdl ui to use qapi DisplayOptions for configuration.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 20180202111022.19269-6-kraxel@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
6 years agogtk: add and use DisplayOptions + DisplayGTK
Gerd Hoffmann [Fri, 2 Feb 2018 11:10:14 +0000 (12:10 +0100)]
gtk: add and use DisplayOptions + DisplayGTK

Add QAPI DisplayType enum, DisplayOptions union and DisplayGTK struct.
Switch gtk configuration to use the qapi type.

Some bookkeeping (fullscreen for example) is done twice now, this is
temporary until more/all UIs are switched over to qapi configuration.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 20180202111022.19269-5-kraxel@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
6 years agovl: rename DisplayType to LegacyDisplayType
Gerd Hoffmann [Fri, 2 Feb 2018 11:10:13 +0000 (12:10 +0100)]
vl: rename DisplayType to LegacyDisplayType

qapi DisplayType will replace the current enum.  For the transition both
will coexist though, so rename it so we don't have a name clash.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 20180202111022.19269-4-kraxel@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
6 years agovl: deprecate -no-frame
Gerd Hoffmann [Fri, 2 Feb 2018 11:10:11 +0000 (12:10 +0100)]
vl: deprecate -no-frame

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20180202111022.19269-2-kraxel@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
6 years agoMerge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-2.12-pull-request...
Peter Maydell [Tue, 20 Feb 2018 09:40:51 +0000 (09:40 +0000)]
Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-2.12-pull-request' into staging

# gpg: Signature made Tue 20 Feb 2018 09:16:18 GMT
# gpg:                using RSA key F30C38BD3F2FBE3C
# gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>"
# gpg:                 aka "Laurent Vivier <laurent@vivier.eu>"
# gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>"
# Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C

* remotes/vivier2/tags/linux-user-for-2.12-pull-request:
  linux-user: Remove THREAD macro
  linux-user: Fix sched_getaffinity mask size
  linux-user: Fix register used for 6th and 7th syscall argument on aarch64
  linux-user: Implement ioctl cmd TIOCGPTPEER

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>