]> git.proxmox.com Git - mirror_qemu.git/log
mirror_qemu.git
5 years agoMerge remote-tracking branch 'remotes/ehabkost/tags/machine-next-pull-request' into...
Peter Maydell [Thu, 25 Oct 2018 19:17:12 +0000 (20:17 +0100)]
Merge remote-tracking branch 'remotes/ehabkost/tags/machine-next-pull-request' into staging

Machine queue, 2018-10-25

* sysbus init/realize cleanups
  (Cédric Le Goater, Philippe Mathieu-Daudé)
* memory-device refactoring (David Hildenbrand)
* -smp: deprecate incorrect CPUs topology (Igor Mammedov)
* -numa parsing cleanups (Markus Armbruster)
* Fix hostmem-file memory leak (Zhang Yi)
* Typo fix (Li Qiang)

# gpg: Signature made Thu 25 Oct 2018 14:31:46 BST
# gpg:                using RSA key 2807936F984DC5A6
# gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>"
# Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF  D1AA 2807 936F 984D C5A6

* remotes/ehabkost/tags/machine-next-pull-request: (43 commits)
  net: xgmac: convert SysBus init method to a realize method
  net: stellaris_enet: add a reset method
  net: stellaris_enet: convert SysBus init method to a realize method
  net: smc91c111: convert SysBus init method to a realize method
  net: opencores_eth: convert SysBus init method to a realize method
  net: mipsnet: convert SysBus init method to a realize method
  net: milkymist_minimac2: convert SysBus init method to a realize method
  net: lance: convert SysBus init method to a realize method
  net: lan9118: convert SysBus init method to a realize method
  net: etraxfs_eth: add a reset method
  net: etraxfs_eth: convert SysBus init method to a realize method
  memory-device: trace when pre_plugging/plugging/unplugging
  memory-device: complete factoring out unplug handling
  memory-device: complete factoring out plug handling
  memory-device: complete factoring out pre_plug handling
  memory-device: add device class function set_addr()
  memory-device: drop get_region_size()
  memory-device: factor out get_memory_region() from pc-dimm
  memory-device: add and use memory_device_get_region_size()
  memory-device: document MemoryDeviceClass
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agoMerge remote-tracking branch 'remotes/riscv/tags/riscv-for-master-3.1-sf0' into staging
Peter Maydell [Thu, 25 Oct 2018 16:41:03 +0000 (17:41 +0100)]
Merge remote-tracking branch 'remotes/riscv/tags/riscv-for-master-3.1-sf0' into staging

First RISC-V Patch Set for the 3.1 Soft Freeze

This pull request contains a handful of patches that have been floating
around various trees for a while but haven't made it upstream.  These
patches all appear quite safe.  They're all somewhat independent from
each other:

* One refactors our IRQ management function to allow multiple interrupts
  to be raised an once.  This patch has no functional difference.
* Cleaning up the op_helper/cpu_helper split.  This patch has no
  functional difference.
* Updates to various constants to keep them in sync with the latest ISA
  specification and to remove some non-standard bits that snuck in.
* A fix for a memory leak in the PLIC driver.
* A fix to our device tree handling to avoid provinging a NULL string.

I've given this my standard test: building the port, booting a Fedora
root filesytem on the latest Linux tag, and then shutting down that
image.  Essentially I'm just following the QEMU RISC-V wiki page's
instructions.  Everything looks fine here.

We have a lot more outstanding patches so I'll definately be submitting
another PR for the soft freeze.

# gpg: Signature made Wed 17 Oct 2018 21:17:52 BST
# gpg:                using RSA key EF4CA1502CCBAB41
# gpg: Good signature from "Palmer Dabbelt <palmer@dabbelt.com>"
# gpg:                 aka "Palmer Dabbelt <palmer@sifive.com>"
# 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: 00CE 76D1 8349 60DF CE88  6DF8 EF4C A150 2CCB AB41

* remotes/riscv/tags/riscv-for-master-3.1-sf0:
  RISC-V: Don't add NULL bootargs to device-tree
  RISC-V: Add missing free for plic_hart_config
  RISC-V: Update CSR and interrupt definitions
  RISC-V: Move non-ops from op_helper to cpu_helper
  RISC-V: Allow setting and clearing multiple irqs

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agoMerge remote-tracking branch 'remotes/berrange/tags/qcrypto-next-pull-request' into...
Peter Maydell [Wed, 24 Oct 2018 21:08:42 +0000 (22:08 +0100)]
Merge remote-tracking branch 'remotes/berrange/tags/qcrypto-next-pull-request' into staging

Improve performance of XTS cipher mode impl

The XTS cipher mode performance is approximately doubled and test
coverage is improved.

# gpg: Signature made Wed 24 Oct 2018 19:05:08 BST
# gpg:                using RSA key BE86EBB415104FDF
# gpg: Good signature from "Daniel P. Berrange <dan@berrange.com>"
# gpg:                 aka "Daniel P. Berrange <berrange@redhat.com>"
# Primary key fingerprint: DAF3 A6FD B26B 6291 2D0E  8E3F BE86 EBB4 1510 4FDF

* remotes/berrange/tags/qcrypto-next-pull-request:
  crypto: add testing for unaligned buffers with XTS cipher mode
  crypto: refactor XTS cipher mode test suite
  crypto: annotate xts_tweak_encdec as inlineable
  crypto: convert xts_mult_x to use xts_uint128 type
  crypto: convert xts_tweak_encdec to use xts_uint128 type
  crypto: introduce a xts_uint128 data type
  crypto: remove code duplication in tweak encrypt/decrypt
  crypto: expand algorithm coverage for cipher benchmark

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agocrypto: add testing for unaligned buffers with XTS cipher mode
Daniel P. Berrangé [Tue, 16 Oct 2018 09:17:12 +0000 (10:17 +0100)]
crypto: add testing for unaligned buffers with XTS cipher mode

Validate that the XTS cipher mode will correctly operate with plain
text, cipher text and IV buffers that are not 64-bit aligned.

Reviewed-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agocrypto: refactor XTS cipher mode test suite
Daniel P. Berrangé [Mon, 15 Oct 2018 17:03:41 +0000 (18:03 +0100)]
crypto: refactor XTS cipher mode test suite

The current XTS test overloads two different tests in a single function
making the code a little hard to follow. Split it into distinct test
cases.

Reviewed-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agocrypto: annotate xts_tweak_encdec as inlineable
Daniel P. Berrangé [Tue, 9 Oct 2018 09:50:43 +0000 (10:50 +0100)]
crypto: annotate xts_tweak_encdec as inlineable

Encouraging the compiler to inline xts_tweak_encdec increases the
performance for xts-aes-128 when built with gcrypt:

  Encrypt: 545 MB/s -> 580 MB/s
  Decrypt: 568 MB/s -> 602 MB/s

Reviewed-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agocrypto: convert xts_mult_x to use xts_uint128 type
Daniel P. Berrangé [Tue, 9 Oct 2018 09:55:14 +0000 (10:55 +0100)]
crypto: convert xts_mult_x to use xts_uint128 type

Using 64-bit arithmetic increases the performance for xts-aes-128
when built with gcrypt:

  Encrypt: 355 MB/s -> 545 MB/s
  Decrypt: 362 MB/s -> 568 MB/s

Reviewed-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agocrypto: convert xts_tweak_encdec to use xts_uint128 type
Daniel P. Berrangé [Tue, 9 Oct 2018 09:50:43 +0000 (10:50 +0100)]
crypto: convert xts_tweak_encdec to use xts_uint128 type

Using 64-bit arithmetic increases the performance for xts-aes-128
when built with gcrypt:

  Encrypt: 272 MB/s -> 355 MB/s
  Decrypt: 275 MB/s -> 362 MB/s

Reviewed-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agocrypto: introduce a xts_uint128 data type
Daniel P. Berrangé [Tue, 9 Oct 2018 09:45:41 +0000 (10:45 +0100)]
crypto: introduce a xts_uint128 data type

The new type is designed to allow use of 64-bit arithmetic instead
of operating 1-byte at a time. The following patches will use this to
improve performance.

Reviewed-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agocrypto: remove code duplication in tweak encrypt/decrypt
Daniel P. Berrangé [Mon, 8 Oct 2018 13:13:28 +0000 (14:13 +0100)]
crypto: remove code duplication in tweak encrypt/decrypt

The tweak encrypt/decrypt functions are identical except for the
comments, so can be merged. Profiling data shows that the compiler is
in fact already merging the two merges in the object files.

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agocrypto: expand algorithm coverage for cipher benchmark
Daniel P. Berrangé [Mon, 8 Oct 2018 13:12:04 +0000 (14:12 +0100)]
crypto: expand algorithm coverage for cipher benchmark

Add testing coverage for AES with XTS, ECB and CTR modes

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoMerge remote-tracking branch 'remotes/amarkovic/tags/mips-queue-oct-2018-part-2-v2...
Peter Maydell [Wed, 24 Oct 2018 15:31:40 +0000 (16:31 +0100)]
Merge remote-tracking branch 'remotes/amarkovic/tags/mips-queue-oct-2018-part-2-v2' into staging

MIPS queue for October 2018 - part 2 - v2

# gpg: Signature made Wed 24 Oct 2018 14:22:54 BST
# gpg:                using RSA key D4972A8967F75A65
# gpg: Good signature from "Aleksandar Markovic <amarkovic@wavecomp.com>"
# 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-oct-2018-part-2-v2: (33 commits)
  target/mips: Fix decoding of ALIGN and DALIGN instructions
  target/mips: Fix the title of translate.c
  linux-user/mips: Recognize the R5900 CPU model
  target/mips: Define the R5900 CPU
  tests/tcg/mips: Add tests for R5900 DIVU1
  tests/tcg/mips: Add tests for R5900 DIV1
  tests/tcg/mips: Add tests for R5900 MTLO1 and MTHI1
  tests/tcg/mips: Add tests for R5900 MFLO1 and MFHI1
  tests/tcg/mips: Add tests for R5900 three-operand MULTU1
  tests/tcg/mips: Add tests for R5900 three-operand MULT1
  tests/tcg/mips: Add tests for R5900 three-operand MULTU
  tests/tcg/mips: Add tests for R5900 three-operand MULT
  target/mips: Make R5900 DMULT[U], DDIV[U], LL[D] and SC[D] user only
  target/mips: Support R5900 MOVN, MOVZ and PREF instructions from MIPS IV
  target/mips: Support R5900 DIV1 and DIVU1 instructions
  target/mips: Support R5900 MFLO1, MTLO1, MFHI1 and MTHI1 instructions
  target/mips: Support R5900 three-operand MULT1 and MULTU1 instructions
  target/mips: Support R5900 three-operand MULT and MULTU instructions
  target/mips: Add a placeholder for R5900 MMI3 instruction subclass
  target/mips: Add a placeholder for R5900 MMI2 instruction subclass
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agoMerge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2018-10-24' into...
Peter Maydell [Wed, 24 Oct 2018 15:01:05 +0000 (16:01 +0100)]
Merge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2018-10-24' into staging

- Disable migration-test with TCG on s390x (since there are known problems)
- Small Makefile improvements
- More modern shell scripting changes (use $() instead of ``)
- Add a configure option to disable AVX2

# gpg: Signature made Wed 24 Oct 2018 08:04:33 BST
# gpg:                using RSA key 2ED9D774FE702DB5
# gpg: Good signature from "Thomas Huth <th.huth@gmx.de>"
# gpg:                 aka "Thomas Huth <thuth@redhat.com>"
# gpg:                 aka "Thomas Huth <huth@tuxfamily.org>"
# gpg:                 aka "Thomas Huth <th.huth@posteo.de>"
# Primary key fingerprint: 27B8 8847 EEE0 2501 18F3  EAB9 2ED9 D774 FE70 2DB5

* remotes/huth-gitlab/tags/pull-request-2018-10-24:
  configure: Provide option to explicitly disable AVX2
  po/Makefile: Modern shell scripting (use $() instead of ``)
  debian-bootstrap.pre: Modern shell scripting (use $() instead of ``)
  configs: Add a CONFIG_SMC37C669 switch for the "smc37c669-superio" device
  hw/core: Move null-machine into the common-obj list
  tests/migration-test: Disable s390x test when running with TCG

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agotarget/mips: Fix decoding of ALIGN and DALIGN instructions
Aleksandar Markovic [Mon, 22 Oct 2018 11:19:25 +0000 (13:19 +0200)]
target/mips: Fix decoding of ALIGN and DALIGN instructions

Opcode for ALIGN and DALIGN must be in fact ranges of opcodes, to
allow paremeter 'bp' to occupy two and three bits, respectively.

Reviewed-by: Stefan Markovic <smarkovic@wavecomp.com>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotarget/mips: Fix the title of translate.c
Aleksandar Markovic [Mon, 22 Oct 2018 11:09:35 +0000 (13:09 +0200)]
target/mips: Fix the title of translate.c

Replace MIPS32 with MIPS, since the file covers all generations
of MIPS architectures.

Reviewed-by: Stefan Markovic <smarkovic@wavecomp.com>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agolinux-user/mips: Recognize the R5900 CPU model
Fredrik Noring [Sun, 21 Oct 2018 15:44:58 +0000 (17:44 +0200)]
linux-user/mips: Recognize the R5900 CPU model

This kind of ELF for the R5900 relies on an IEEE 754-1985 compliant FPU.
The R5900 FPU hardware is noncompliant and it is therefore emulated in
software by the Linux kernel. QEMU emulates a compliant FPU accordingly.

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Fredrik Noring <noring@nocrew.org>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotarget/mips: Define the R5900 CPU
Fredrik Noring [Sun, 21 Oct 2018 15:44:46 +0000 (17:44 +0200)]
target/mips: Define the R5900 CPU

The primary purpose of this change is to support programs compiled by
GCC for the R5900 target and thereby run R5900 Linux distributions, for
example Gentoo.

GCC in version 7.3, by itself, by inspection of the GCC source code
and inspection of the generated machine code, for the R5900 target,
only emits two instructions that are specific to the R5900: the three-
operand MULT and MULTU. GCC and libc also emit certain MIPS III
instructions that are not part of the R5900 ISA. They are normally
trapped and emulated by the Linux kernel, and therefore need to be
treated accordingly by QEMU.

A program compiled by GCC is taken to mean source code compiled by GCC
under the restrictions above. One can, with the apparent limitations,
with a bit of effort obtain a fully functioning operating system such
as R5900 Gentoo. Strictly speaking, programs need not be compiled by
GCC to make use of this change.

Instructions and other facilities of the R5900 not implemented by this
change are intended to signal provisional exceptions. One such example
is the FPU that is not compliant with IEEE 754-1985 in system mode. It
is therefore provisionally disabled. In user space the FPU is trapped
and emulated by IEEE 754-1985 compliant software in the kernel, and
this is handled accordingly by QEMU. Another example is the 93
multimedia instructions specific to the R5900 that generate provisional
reserved instruction exception signals.

One of the benefits of running a Linux distribution under QEMU is that
programs can be compiled with a native compiler, where the host and
target are the same, as opposed to a cross-compiler, where they are
not the same. This is especially important in cases where the target
hardware does not have the resources to run a native compiler.

Problems with cross-compilation are often related to host and target
differences in integer sizes, pointer sizes, endianness, machine code,
ABI, etc. Sometimes cross-compilation is not even supported by the
build script for a given package. One effective way to avoid those
problems is to replace the cross-compiler with a native compiler. This
change of compilation methods does not resolve the inherent problems
with cross-compilation.

The native compiler naturally replaces the cross-compiler, because one
typically uses one or the other, and preferably the native compiler
when the circumstances admit this. The native compiler is also a good
test case for the R5900 QEMU user mode. Additionally, Gentoo is well-
known for compiling and installing its packages from sources.

This change has been tested with Gentoo compiled for R5900, including
native compilation of several packages under QEMU.

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Fredrik Noring <noring@nocrew.org>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotests/tcg/mips: Add tests for R5900 DIVU1
Fredrik Noring [Sun, 21 Oct 2018 15:42:19 +0000 (17:42 +0200)]
tests/tcg/mips: Add tests for R5900 DIVU1

Add a test for DIVU1.

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Fredrik Noring <noring@nocrew.org>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotests/tcg/mips: Add tests for R5900 DIV1
Fredrik Noring [Sun, 21 Oct 2018 15:42:08 +0000 (17:42 +0200)]
tests/tcg/mips: Add tests for R5900 DIV1

Add a test for DIV1.

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Fredrik Noring <noring@nocrew.org>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotests/tcg/mips: Add tests for R5900 MTLO1 and MTHI1
Fredrik Noring [Sun, 21 Oct 2018 15:41:58 +0000 (17:41 +0200)]
tests/tcg/mips: Add tests for R5900 MTLO1 and MTHI1

Add a test for MTLO1 and MTHI1.

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Fredrik Noring <noring@nocrew.org>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotests/tcg/mips: Add tests for R5900 MFLO1 and MFHI1
Fredrik Noring [Sun, 21 Oct 2018 15:41:47 +0000 (17:41 +0200)]
tests/tcg/mips: Add tests for R5900 MFLO1 and MFHI1

Add a test for MFLO1 and MFHI1.

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Fredrik Noring <noring@nocrew.org>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotests/tcg/mips: Add tests for R5900 three-operand MULTU1
Fredrik Noring [Sun, 21 Oct 2018 15:41:32 +0000 (17:41 +0200)]
tests/tcg/mips: Add tests for R5900 three-operand MULTU1

Add a test for MULTU1.

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Fredrik Noring <noring@nocrew.org>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotests/tcg/mips: Add tests for R5900 three-operand MULT1
Fredrik Noring [Sun, 21 Oct 2018 15:41:21 +0000 (17:41 +0200)]
tests/tcg/mips: Add tests for R5900 three-operand MULT1

Add a test for MULT1.

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Fredrik Noring <noring@nocrew.org>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotests/tcg/mips: Add tests for R5900 three-operand MULTU
Fredrik Noring [Sun, 21 Oct 2018 15:41:13 +0000 (17:41 +0200)]
tests/tcg/mips: Add tests for R5900 three-operand MULTU

Add a test for MULTU.

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Fredrik Noring <noring@nocrew.org>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotests/tcg/mips: Add tests for R5900 three-operand MULT
Fredrik Noring [Sun, 21 Oct 2018 15:41:01 +0000 (17:41 +0200)]
tests/tcg/mips: Add tests for R5900 three-operand MULT

Add a test for MULT.

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Fredrik Noring <noring@nocrew.org>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotarget/mips: Make R5900 DMULT[U], DDIV[U], LL[D] and SC[D] user only
Fredrik Noring [Sun, 21 Oct 2018 15:40:18 +0000 (17:40 +0200)]
target/mips: Make R5900 DMULT[U], DDIV[U], LL[D] and SC[D] user only

The Linux kernel traps certain reserved instruction exceptions to
emulate the corresponding instructions. QEMU plays the role of the
kernel in user mode, so those traps are emulated by accepting the
instructions.

This change adds the function check_insn_opc_user_only to signal a
reserved instruction exception for flagged CPUs in QEMU system mode.

The MIPS III instructions DMULT[U], DDIV[U], LL[D] and SC[D] are not
implemented in R5900 hardware. They are trapped and emulated by the
Linux kernel and, accordingly, therefore QEMU user only instructions.

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Fredrik Noring <noring@nocrew.org>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotarget/mips: Support R5900 MOVN, MOVZ and PREF instructions from MIPS IV
Fredrik Noring [Sun, 21 Oct 2018 15:39:17 +0000 (17:39 +0200)]
target/mips: Support R5900 MOVN, MOVZ and PREF instructions from MIPS IV

The R5900 is taken to be MIPS III with certain modifications. From
MIPS IV it implements the instructions MOVN, MOVZ and PREF.

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Fredrik Noring <noring@nocrew.org>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotarget/mips: Support R5900 DIV1 and DIVU1 instructions
Fredrik Noring [Sun, 21 Oct 2018 15:39:03 +0000 (17:39 +0200)]
target/mips: Support R5900 DIV1 and DIVU1 instructions

Add support for DIV1 and DIVU1 instructions.

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Fredrik Noring <noring@nocrew.org>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotarget/mips: Support R5900 MFLO1, MTLO1, MFHI1 and MTHI1 instructions
Fredrik Noring [Sun, 21 Oct 2018 15:38:49 +0000 (17:38 +0200)]
target/mips: Support R5900 MFLO1, MTLO1, MFHI1 and MTHI1 instructions

Add support for MFLO1, MTLO1, MFHI1 and MTHI1 instructions.

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Fredrik Noring <noring@nocrew.org>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotarget/mips: Support R5900 three-operand MULT1 and MULTU1 instructions
Fredrik Noring [Sun, 21 Oct 2018 15:38:36 +0000 (17:38 +0200)]
target/mips: Support R5900 three-operand MULT1 and MULTU1 instructions

Add support for MULT1 and MULTU1 instructions.

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Fredrik Noring <noring@nocrew.org>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotarget/mips: Support R5900 three-operand MULT and MULTU instructions
Fredrik Noring [Sun, 21 Oct 2018 15:38:21 +0000 (17:38 +0200)]
target/mips: Support R5900 three-operand MULT and MULTU instructions

The three-operand MULT and MULTU are the only R5900-specific
instructions emitted by GCC 7.3. The R5900 also implements the three-
operand MADD and MADDU instructions, but they are omitted in QEMU for
now since they are absent in programs compiled by current GCC versions.

Likewise, the R5900-specific pipeline 1 instruction variants MULT1,
MULTU1, DIV1, DIVU1, MADD1, MADDU1, MFHI1, MFLO1, MTHI1 and MTLO1
are omitted here as well.

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Fredrik Noring <noring@nocrew.org>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotarget/mips: Add a placeholder for R5900 MMI3 instruction subclass
Fredrik Noring [Sun, 21 Oct 2018 15:37:18 +0000 (17:37 +0200)]
target/mips: Add a placeholder for R5900 MMI3 instruction subclass

Add a placeholder for MMI3 subclass.

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Fredrik Noring <noring@nocrew.org>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotarget/mips: Add a placeholder for R5900 MMI2 instruction subclass
Fredrik Noring [Sun, 21 Oct 2018 15:37:06 +0000 (17:37 +0200)]
target/mips: Add a placeholder for R5900 MMI2 instruction subclass

Add a placeholder for MMI2 subclass.

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Fredrik Noring <noring@nocrew.org>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotarget/mips: Add a placeholder for R5900 MMI1 instruction subclass
Fredrik Noring [Sun, 21 Oct 2018 15:36:54 +0000 (17:36 +0200)]
target/mips: Add a placeholder for R5900 MMI1 instruction subclass

Add a placeholder for MM1 subclass.

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Fredrik Noring <noring@nocrew.org>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotarget/mips: Add a placeholder for R5900 MMI0 instruction subclass
Fredrik Noring [Sun, 21 Oct 2018 15:36:41 +0000 (17:36 +0200)]
target/mips: Add a placeholder for R5900 MMI0 instruction subclass

Add a placeholder for MMI0 subclass.

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Fredrik Noring <noring@nocrew.org>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotarget/mips: Add a placeholder for R5900 MMI instruction class
Fredrik Noring [Sun, 21 Oct 2018 15:36:23 +0000 (17:36 +0200)]
target/mips: Add a placeholder for R5900 MMI instruction class

Add a placeholder for MMI class. This is the main palceholder for
MMI ASE.

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Fredrik Noring <noring@nocrew.org>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotarget/mips: Add a placeholder for R5900 LQ
Fredrik Noring [Sun, 21 Oct 2018 15:35:56 +0000 (17:35 +0200)]
target/mips: Add a placeholder for R5900 LQ

Add a placeholder for LQ instruction.

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Fredrik Noring <noring@nocrew.org>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotarget/mips: Add a placeholder for R5900 SQ, handle user mode RDHWR
Fredrik Noring [Sun, 21 Oct 2018 15:35:41 +0000 (17:35 +0200)]
target/mips: Add a placeholder for R5900 SQ, handle user mode RDHWR

Add placeholder for SQ instruction, handle RDHWR.

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Fredrik Noring <noring@nocrew.org>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotarget/mips: Define R5900 MMI3 opcode constants
Fredrik Noring [Sun, 21 Oct 2018 15:34:46 +0000 (17:34 +0200)]
target/mips: Define R5900 MMI3 opcode constants

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Fredrik Noring <noring@nocrew.org>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotarget/mips: Define R5900 MMI2 opcode constants
Fredrik Noring [Sun, 21 Oct 2018 15:34:21 +0000 (17:34 +0200)]
target/mips: Define R5900 MMI2 opcode constants

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Fredrik Noring <noring@nocrew.org>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotarget/mips: Define R5900 MMI1 opcode constants
Fredrik Noring [Sun, 21 Oct 2018 15:34:11 +0000 (17:34 +0200)]
target/mips: Define R5900 MMI1 opcode constants

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Fredrik Noring <noring@nocrew.org>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotarget/mips: Define R5900 MMI0 opcode constants
Fredrik Noring [Sun, 21 Oct 2018 15:34:04 +0000 (17:34 +0200)]
target/mips: Define R5900 MMI0 opcode constants

Add definition of MI0 opcodes.

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Fredrik Noring <noring@nocrew.org>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotarget/mips: Define R5900 MMI<0|1|2|3> subclasses and opcode constants
Fredrik Noring [Sun, 21 Oct 2018 15:33:32 +0000 (17:33 +0200)]
target/mips: Define R5900 MMI<0|1|2|3> subclasses and opcode constants

Define MMI0, MMI1, MMI2, MMI3 subclass opcodes, and other opcodes of
instructions in MMI class.

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Fredrik Noring <noring@nocrew.org>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotarget/mips: Define R5900 MMI class, and LQ and SQ opcode constants
Fredrik Noring [Sun, 21 Oct 2018 15:33:20 +0000 (17:33 +0200)]
target/mips: Define R5900 MMI class, and LQ and SQ opcode constants

Define MMI class, LQ, and SQ R5900 opdoces.

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Fredrik Noring <noring@nocrew.org>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotarget/mips: Add R5900 Multimedia Instruction overview note
Fredrik Noring [Sun, 21 Oct 2018 15:32:36 +0000 (17:32 +0200)]
target/mips: Add R5900 Multimedia Instruction overview note

Add a comment on R5900 MMI ASE (short overview).

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Fredrik Noring <noring@nocrew.org>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agotarget/mips: Define R5900 ISA, MMI ASE, and R5900 CPU preprocessor constants
Fredrik Noring [Sun, 21 Oct 2018 15:31:26 +0000 (17:31 +0200)]
target/mips: Define R5900 ISA, MMI ASE, and R5900 CPU preprocessor constants

The R5900 implements the 64-bit MIPS III instruction set except
DMULT, DMULTU, DDIV, DDIVU, LL, SC, LLD and SCD. The MIPS IV
instructions MOVN, MOVZ and PREF are implemented. It has the
R5900-specific three-operand instructions MADD, MADDU, MULT and
MULTU as well as pipeline 1 versions MULT1, MULTU1, DIV1, DIVU1,
MADD1, MADDU1, MFHI1, MFLO1, MTHI1 and MTLO1. A set of 93 128-bit
multimedia instructions specific to the R5900 is also implemented.

The Toshiba TX System RISC TX79 Core Architecture manual:

https://wiki.qemu.org/File:C790.pdf

describes the C790 processor that is a follow-up to the R5900. There
are a few notable differences in that the R5900 FPU

- is not IEEE 754-1985 compliant,
- does not implement double format, and
- its machine code is nonstandard.

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Fredrik Noring <noring@nocrew.org>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
5 years agoMerge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20181024' into...
Peter Maydell [Wed, 24 Oct 2018 09:49:14 +0000 (10:49 +0100)]
Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20181024' into staging

target-arm queue:
 * ssi-sd: Make devices picking up backends unavailable with -device
 * Add support for VCPU event states
 * Move towards making ID registers the source of truth for
   whether a guest CPU implements a feature, rather than having
   parallel ID registers and feature bit flags
 * Implement various HCR hypervisor trap/config bits
 * Get IL bit correct for v7 syndrome values
 * Report correct syndrome for FP/SIMD traps to Hyp mode
 * hw/arm/boot: Increase compliance with kernel arm64 boot protocol
 * Refactor A32 Neon to use generic vector infrastructure
 * Fix a bug in A32 VLD2 "(multiple 2-element structures)" insn
 * net: cadence_gem: Report features correctly in ID register
 * Avoid some unnecessary TLB flushes on TTBR register writes

# gpg: Signature made Wed 24 Oct 2018 10:46:01 BST
# 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-20181024: (44 commits)
  target/arm: Only flush tlb if ASID changes
  target/arm: Remove writefn from TTBR0_EL3
  net: cadence_gem: Announce 64bit addressing support
  net: cadence_gem: Announce availability of priority queues
  target/arm: Reorg NEON VLD/VST single element to one lane
  target/arm: Promote consecutive memory ops for aa32
  target/arm: Reorg NEON VLD/VST all elements
  target/arm: Use gvec for NEON VLD all lanes
  target/arm: Use gvec for NEON_3R_VTST_VCEQ, NEON_3R_VCGT, NEON_3R_VCGE
  target/arm: Use gvec for NEON_3R_VML
  target/arm: Use gvec for VSRI, VSLI
  target/arm: Use gvec for VSRA
  target/arm: Use gvec for VSHR, VSHL
  target/arm: Use gvec for NEON_3R_VMUL
  target/arm: Use gvec for NEON_2RM_VMN, NEON_2RM_VNEG
  target/arm: Use gvec for NEON_3R_VADD_VSUB insns
  target/arm: Use gvec for NEON_3R_LOGIC insns
  target/arm: Use gvec for NEON VMOV, VMVN, VBIC & VORR (immediate)
  target/arm: Use gvec for NEON VDUP
  target/arm: Mark some arrays const
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agonet: xgmac: convert SysBus init method to a realize method
Cédric Le Goater [Mon, 1 Oct 2018 06:38:03 +0000 (08:38 +0200)]
net: xgmac: convert SysBus init method to a realize method

Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-arm@nongnu.org
Cc: Rob Herring <robh@kernel.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20181001063803.22330-12-clg@kaod.org>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agonet: stellaris_enet: add a reset method
Cédric Le Goater [Mon, 1 Oct 2018 06:38:02 +0000 (08:38 +0200)]
net: stellaris_enet: add a reset method

Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-arm@nongnu.org
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20181001063803.22330-11-clg@kaod.org>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agonet: stellaris_enet: convert SysBus init method to a realize method
Cédric Le Goater [Mon, 1 Oct 2018 06:38:01 +0000 (08:38 +0200)]
net: stellaris_enet: convert SysBus init method to a realize method

Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-arm@nongnu.org
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20181001063803.22330-10-clg@kaod.org>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agonet: smc91c111: convert SysBus init method to a realize method
Cédric Le Goater [Mon, 1 Oct 2018 06:38:00 +0000 (08:38 +0200)]
net: smc91c111: convert SysBus init method to a realize method

Signed-off-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20181001063803.22330-9-clg@kaod.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agonet: opencores_eth: convert SysBus init method to a realize method
Cédric Le Goater [Mon, 1 Oct 2018 06:37:59 +0000 (08:37 +0200)]
net: opencores_eth: convert SysBus init method to a realize method

Cc: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20181001063803.22330-8-clg@kaod.org>
Acked-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agonet: mipsnet: convert SysBus init method to a realize method
Cédric Le Goater [Mon, 1 Oct 2018 06:37:58 +0000 (08:37 +0200)]
net: mipsnet: convert SysBus init method to a realize method

Cc: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20181001063803.22330-7-clg@kaod.org>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agonet: milkymist_minimac2: convert SysBus init method to a realize method
Cédric Le Goater [Mon, 1 Oct 2018 06:37:57 +0000 (08:37 +0200)]
net: milkymist_minimac2: convert SysBus init method to a realize method

Cc: Michael Walle <michael@walle.cc>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20181001063803.22330-6-clg@kaod.org>
Acked-by: Michael Walle <michael@walle.cc>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agonet: lance: convert SysBus init method to a realize method
Cédric Le Goater [Mon, 1 Oct 2018 06:37:56 +0000 (08:37 +0200)]
net: lance: convert SysBus init method to a realize method

Signed-off-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20181001063803.22330-5-clg@kaod.org>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agonet: lan9118: convert SysBus init method to a realize method
Cédric Le Goater [Mon, 1 Oct 2018 06:37:55 +0000 (08:37 +0200)]
net: lan9118: convert SysBus init method to a realize method

Signed-off-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20181001063803.22330-4-clg@kaod.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agonet: etraxfs_eth: add a reset method
Cédric Le Goater [Mon, 1 Oct 2018 06:37:54 +0000 (08:37 +0200)]
net: etraxfs_eth: add a reset method

Cc: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20181001063803.22330-3-clg@kaod.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agonet: etraxfs_eth: convert SysBus init method to a realize method
Cédric Le Goater [Mon, 1 Oct 2018 06:37:53 +0000 (08:37 +0200)]
net: etraxfs_eth: convert SysBus init method to a realize method

Cc: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20181001063803.22330-2-clg@kaod.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agomemory-device: trace when pre_plugging/plugging/unplugging
David Hildenbrand [Fri, 5 Oct 2018 09:20:24 +0000 (11:20 +0200)]
memory-device: trace when pre_plugging/plugging/unplugging

Let's trace the address and the id of a memory device when
pre_plugging/plugging/unplugging succeeded.

Trace it when pre_plugging as well as when plugging, so we really know
when a specific address is actually used.

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20181005092024.14344-17-david@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agomemory-device: complete factoring out unplug handling
David Hildenbrand [Fri, 5 Oct 2018 09:20:23 +0000 (11:20 +0200)]
memory-device: complete factoring out unplug handling

With the new memory device functions in place, we can factor out
unplugging of memory devices completely.

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20181005092024.14344-16-david@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agomemory-device: complete factoring out plug handling
David Hildenbrand [Fri, 5 Oct 2018 09:20:22 +0000 (11:20 +0200)]
memory-device: complete factoring out plug handling

With the new memory device functions in place, we can factor out
plugging of memory devices completely.

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20181005092024.14344-15-david@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agomemory-device: complete factoring out pre_plug handling
David Hildenbrand [Fri, 5 Oct 2018 09:20:21 +0000 (11:20 +0200)]
memory-device: complete factoring out pre_plug handling

With all required memory device class functions in place, we can factor
out pre_plug handling of memory devices. Take proper care of errors. We
still have to carry along legacy_align required for pc compatibility
handling.

We will factor out tracing of the address separately in a follow-up
patch.

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20181005092024.14344-14-david@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agomemory-device: add device class function set_addr()
David Hildenbrand [Fri, 5 Oct 2018 09:20:20 +0000 (11:20 +0200)]
memory-device: add device class function set_addr()

To be able to factor out address assignment of memory devices, we will
have to read (get_addr()) and write (set_addr()) the address.

We can't use properties for this purpose, as properties are device
specific. E.g. while the address property for a DIMM is called "addr", it
might be called differently (e.g. "memaddr") for other devices.

Especially virtio based memory devices cannot use "addr" as that is already
reserved and used for the address on the bus (for the proxy device).

Also, it might be possible to have memory devices without address
properties (e.g. internal DIMM-like thingies).

In contrast to get_addr(), we expect that set_addr() can fail.

Keep it simple for now for pc-dimm and simply set the static property, that
will fail once realized.

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20181005092024.14344-13-david@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agomemory-device: drop get_region_size()
David Hildenbrand [Fri, 5 Oct 2018 09:20:19 +0000 (11:20 +0200)]
memory-device: drop get_region_size()

There are no remaining users of get_region_size() except
memory_device_get_region_size() itself. We can make
memory_device_get_region_size() work directly on get_memory_region()
instead and drop get_region_size().

In addition, we can now use memory_device_get_region_size() in pc-dimm
code to implement get_plugged_size()"

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20181005092024.14344-12-david@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agomemory-device: factor out get_memory_region() from pc-dimm
David Hildenbrand [Fri, 5 Oct 2018 09:20:18 +0000 (11:20 +0200)]
memory-device: factor out get_memory_region() from pc-dimm

The memory region is necessary for plugging/unplugging a memory device.
The region size (via get_region_size()) is no longer sufficient, as
besides the alignment, also the region itself is required in order to
add it to the device memory region of the machine via
- memory_region_add_subregion
- memory_region_del_subregion

So, to factor out plugging/unplugging of memory devices from pc-dimm
code, we have to factor out access to the memory region first.

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20181005092024.14344-11-david@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agomemory-device: add and use memory_device_get_region_size()
David Hildenbrand [Fri, 5 Oct 2018 09:20:17 +0000 (11:20 +0200)]
memory-device: add and use memory_device_get_region_size()

We will factor out get_memory_region() from pc-dimm to memory device code
soon. Once that is done, get_region_size() can be implemented
generically and essentially be replaced by
memory_device_get_region_size (and work only on get_memory_region()).

We have some users of get_memory_region() (spapr and pc-dimm code) that are
only interested in the size. So let's rework them to use
memory_device_get_region_size() first, then we can factor out
get_memory_region() and eventually remove get_region_size() without
touching the same code multiple times.

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20181005092024.14344-10-david@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agomemory-device: document MemoryDeviceClass
David Hildenbrand [Fri, 5 Oct 2018 09:20:16 +0000 (11:20 +0200)]
memory-device: document MemoryDeviceClass

Document the functions. Don't document get_region_size(), as we will be
dropping/replacing that one soon.

Use same documentation style as in include/exec/memory.h, but don't
document the parameters, as they are self-explanatory.

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20181005092024.14344-9-david@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agomemory-device: forward errors in get_region_size()/get_plugged_size()
David Hildenbrand [Fri, 5 Oct 2018 09:20:15 +0000 (11:20 +0200)]
memory-device: forward errors in get_region_size()/get_plugged_size()

Let's properly forward the errors, so errors from get_region_size() /
get_plugged_size() can be handled.

Users right now call both functions after the device has been realized,
which is will never fail, so it is fine to continue using error_abort.

While at it, remove a leftover error check (suggested by Igor).

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20181005092024.14344-8-david@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agomemory-device: introduce separate config option
David Hildenbrand [Fri, 5 Oct 2018 09:20:14 +0000 (11:20 +0200)]
memory-device: introduce separate config option

Some architectures might support memory devices, while they don't
support DIMM/NVDIMM. So let's
- Rename CONFIG_MEM_HOTPLUG to CONFIG_MEM_DEVICE
- Introduce CONFIG_DIMM and use it similarly to CONFIG NVDIMM

CONFIG_DIMM and CONFIG_NVDIMM require CONFIG_MEM_DEVICE.

Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20181005092024.14344-7-david@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agomemory-device: use memory device terminology in error messages
David Hildenbrand [Fri, 5 Oct 2018 09:20:13 +0000 (11:20 +0200)]
memory-device: use memory device terminology in error messages

While we rephrased most error messages, we missed these.

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20181005092024.14344-6-david@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agopc-dimm: pass PCDIMMDevice to pc_dimm_.*plug
David Hildenbrand [Fri, 5 Oct 2018 09:20:12 +0000 (11:20 +0200)]
pc-dimm: pass PCDIMMDevice to pc_dimm_.*plug

We're plugging/unplugging a PCDIMMDevice, so directly pass this type
instead of a more generic DeviceState.

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20181005092024.14344-5-david@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agomemory-device: improve "range conflicts" error message
David Hildenbrand [Fri, 5 Oct 2018 09:20:11 +0000 (11:20 +0200)]
memory-device: improve "range conflicts" error message

Handle id==NULL better and indicate that we are dealing with memory
devices.

Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20181005092024.14344-4-david@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agomemory-device: fix error message when hinted address is too small
David Hildenbrand [Fri, 5 Oct 2018 09:20:10 +0000 (11:20 +0200)]
memory-device: fix error message when hinted address is too small

The "at" should actually be a "before".
    if (new_addr < address_space_start)
     -> "can't add memory ... before... $address_space_start"

So it looks similar to the other check
    } else if ((new_addr + size) > address_space_end)
     -> "can't add memory ... beyond..."

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20181005092024.14344-3-david@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agomemory-device: fix alignment error message
David Hildenbrand [Fri, 5 Oct 2018 09:20:09 +0000 (11:20 +0200)]
memory-device: fix alignment error message

We're missing "x" after the leading 0.

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20181005092024.14344-2-david@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agomachine: fix a typo
Li Qiang [Wed, 10 Oct 2018 16:10:25 +0000 (09:10 -0700)]
machine: fix a typo

Cc: qemu-trivial@nongnu.org
Signed-off-by: Li Qiang <liq3ea@163.com>
Message-Id: <20181010161025.34796-1-liq3ea@163.com>
Reviewed-by: Stefano Garzarella <stefanogarzarella@gmail.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agohw/mips/malta: Remove unuseful code
Philippe Mathieu-Daudé [Tue, 2 Oct 2018 21:25:21 +0000 (23:25 +0200)]
hw/mips/malta: Remove unuseful code

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20181002212522.23303-13-f4bug@amsat.org>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agohw/hppa/dino: Remove unuseful code
Philippe Mathieu-Daudé [Tue, 2 Oct 2018 21:25:20 +0000 (23:25 +0200)]
hw/hppa/dino: Remove unuseful code

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20181002212522.23303-12-f4bug@amsat.org>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agohw/alpha/typhoon: Remove unuseful code
Philippe Mathieu-Daudé [Tue, 2 Oct 2018 21:25:19 +0000 (23:25 +0200)]
hw/alpha/typhoon: Remove unuseful code

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20181002212522.23303-11-f4bug@amsat.org>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agohw/sparc64/niagara: Model the I/O Bridge with the 'unimplemented_device'
Philippe Mathieu-Daudé [Tue, 2 Oct 2018 21:25:18 +0000 (23:25 +0200)]
hw/sparc64/niagara: Model the I/O Bridge with the 'unimplemented_device'

Since the I/O Bridge device is not implemented,  Use the
TYPE_UNIMPLEMENTED_DEVICE which suits better: if the user
asks for 'unimp' warnings via the -d option then all accesses
will generate logging.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Artyom Tarasenko <atar4qemu@gmail.com>
Message-Id: <20181002212522.23303-10-f4bug@amsat.org>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agohw/mips/gt64xxx_pci: Mark as bridge device
Philippe Mathieu-Daudé [Tue, 2 Oct 2018 21:25:17 +0000 (23:25 +0200)]
hw/mips/gt64xxx_pci: Mark as bridge device

The gt64120 is currently listed as uncategorized device.
Mark it as bridge device.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20181002212522.23303-9-f4bug@amsat.org>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agohw/mips/gt64xxx_pci: Convert gt64120_reset() function into Device reset method
Philippe Mathieu-Daudé [Tue, 2 Oct 2018 21:25:16 +0000 (23:25 +0200)]
hw/mips/gt64xxx_pci: Convert gt64120_reset() function into Device reset method

Convert the gt64120_reset() function into a proper Device reset method.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20181002212522.23303-8-f4bug@amsat.org>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agohw/pci-host/bonito: Use DeviceState::realize rather than SysBusDevice::init
Philippe Mathieu-Daudé [Tue, 2 Oct 2018 21:25:15 +0000 (23:25 +0200)]
hw/pci-host/bonito: Use DeviceState::realize rather than SysBusDevice::init

Move from the legacy SysBusDevice::init method to using DeviceState::realize.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20181002212522.23303-7-f4bug@amsat.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agohw/sh4/sh_pci: Use DeviceState::realize rather than SysBusDevice::init
Philippe Mathieu-Daudé [Tue, 2 Oct 2018 21:25:14 +0000 (23:25 +0200)]
hw/sh4/sh_pci: Use DeviceState::realize rather than SysBusDevice::init

Move from the legacy SysBusDevice::init method to using DeviceState::realize.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20181002212522.23303-6-f4bug@amsat.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agohw/ssi/xilinx_spi: Use DeviceState::realize rather than SysBusDevice::init
Philippe Mathieu-Daudé [Tue, 2 Oct 2018 21:25:13 +0000 (23:25 +0200)]
hw/ssi/xilinx_spi: Use DeviceState::realize rather than SysBusDevice::init

Move from the legacy SysBusDevice::init method to using DeviceState::realize.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20181002212522.23303-5-f4bug@amsat.org>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agohw/timer/sun4v-rtc: Use DeviceState::realize rather than SysBusDevice::init
Philippe Mathieu-Daudé [Tue, 2 Oct 2018 21:25:12 +0000 (23:25 +0200)]
hw/timer/sun4v-rtc: Use DeviceState::realize rather than SysBusDevice::init

Move from the legacy SysBusDevice::init method to using DeviceState::realize.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20181002212522.23303-4-f4bug@amsat.org>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agohw/timer/sun4v-rtc: Convert from DPRINTF() macro to trace events
Philippe Mathieu-Daudé [Tue, 2 Oct 2018 21:25:11 +0000 (23:25 +0200)]
hw/timer/sun4v-rtc: Convert from DPRINTF() macro to trace events

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Artyom Tarasenko <atar4qemu@gmail.com>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20181002212522.23303-3-f4bug@amsat.org>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agotrace-events: Fix copy/paste typo
Philippe Mathieu-Daudé [Tue, 2 Oct 2018 21:25:10 +0000 (23:25 +0200)]
trace-events: Fix copy/paste typo

Missed while reviewing 5dd85b4b486.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20181002212522.23303-2-f4bug@amsat.org>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agovl:c: make sure that sockets are calculated correctly in '-smp X' case
Igor Mammedov [Thu, 13 Sep 2018 11:06:02 +0000 (13:06 +0200)]
vl:c: make sure that sockets are calculated correctly in '-smp X' case

commit
  (5cdc9b76e3 vl.c: Remove dead assignment)
removed sockets calculation when 'sockets' weren't provided on CLI
since there wasn't any users for it back then. Exiting checks
are neither reachable
   } else if (sockets * cores * threads < cpus) {
or nor triggerable
   if (sockets * cores * threads > max_cpus)
so we weren't noticing wrong topology since then, since users
recalculate sockets adhoc on their own.

However with deprecation check it becomes noticable, for example
  -smp 2
will start printing warning:
  "warning: Invalid CPU topology deprecated: sockets (1) * cores (1) * threads (1) != maxcpus (2)"
calculating sockets if they weren't specified.

Fix it by returning back sockets calculation if it's omitted on CLI.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Message-Id: <1536836762-273036-3-git-send-email-imammedo@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agovl.c deprecate incorrect CPUs topology
Igor Mammedov [Thu, 13 Sep 2018 11:06:01 +0000 (13:06 +0200)]
vl.c deprecate incorrect CPUs topology

-smp [cpus],sockets/cores/threads[,maxcpus] should describe topology
so that total number of logical CPUs [sockets * cores * threads]
would be equal to [maxcpus], however historically we didn't have
such check in QEMU and it is possible to start VM with an invalid
topology.
Deprecate invalid options combination so we can make sure that
the topology VM started with is always correct in the future.
Users with an invalid sockets/cores/threads/maxcpus values should
fix their CLI to make sure that
   [sockets * cores * threads] == [maxcpus]

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Message-Id: <1536836762-273036-2-git-send-email-imammedo@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[ehabkost: squashed unit test fix]
Message-Id: <20181019215345.521d58d7@igors-macbook-pro.local>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agohostmem-file: fixed the memory leak while get pmem path.
Zhang Yi [Tue, 28 Aug 2018 16:14:22 +0000 (00:14 +0800)]
hostmem-file: fixed the memory leak while get pmem path.

object_get_canonical_path_component() returns a string which
must be freed using g_free().

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Zhang Yi <yi.z.zhang@linux.intel.com>
Message-Id: <7328fb16c394eaf5d65437d11c2a9343647b6d3d.1535471899.git.yi.z.zhang@linux.intel.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
5 years agotarget/arm: Only flush tlb if ASID changes
Richard Henderson [Wed, 24 Oct 2018 06:50:20 +0000 (07:50 +0100)]
target/arm: Only flush tlb if ASID changes

Since QEMU does not implement ASIDs, changes to the ASID must flush the
tlb.  However, if the ASID does not change there is no reason to flush.

In testing a boot of the Ubuntu installer to the first menu, this reduces
the number of flushes by 30%, or nearly 600k instances.

Reviewed-by: Aaron Lindsay <aaron@os.amperecomputing.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20181019015617.22583-3-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agotarget/arm: Remove writefn from TTBR0_EL3
Richard Henderson [Wed, 24 Oct 2018 06:50:20 +0000 (07:50 +0100)]
target/arm: Remove writefn from TTBR0_EL3

The EL3 version of this register does not include an ASID,
and so the tlb_flush performed by vmsa_ttbr_write is not needed.

Reviewed-by: Aaron Lindsay <aaron@os.amperecomputing.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20181019015617.22583-2-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agonet: cadence_gem: Announce 64bit addressing support
Edgar E. Iglesias [Wed, 24 Oct 2018 06:50:20 +0000 (07:50 +0100)]
net: cadence_gem: Announce 64bit addressing support

Announce 64bit addressing support.

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Message-id: 20181017213932.19973-3-edgar.iglesias@gmail.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agonet: cadence_gem: Announce availability of priority queues
Edgar E. Iglesias [Wed, 24 Oct 2018 06:50:20 +0000 (07:50 +0100)]
net: cadence_gem: Announce availability of priority queues

Announce the availability of the various priority queues.
This fixes an issue where guest kernels would miss to
configure secondary queues due to inproper feature bits.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Message-id: 20181017213932.19973-2-edgar.iglesias@gmail.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agotarget/arm: Reorg NEON VLD/VST single element to one lane
Richard Henderson [Wed, 24 Oct 2018 06:50:20 +0000 (07:50 +0100)]
target/arm: Reorg NEON VLD/VST single element to one lane

Instead of shifts and masks, use direct loads and stores from
the neon register file.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20181011205206.3552-21-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: Promote consecutive memory ops for aa32
Richard Henderson [Wed, 24 Oct 2018 06:50:20 +0000 (07:50 +0100)]
target/arm: Promote consecutive memory ops for aa32

For a sequence of loads or stores from a single register,
little-endian operations can be promoted to an 8-byte op.
This can reduce the number of operations by a factor of 8.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20181011205206.3552-20-richard.henderson@linaro.org
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agotarget/arm: Reorg NEON VLD/VST all elements
Richard Henderson [Wed, 24 Oct 2018 06:50:20 +0000 (07:50 +0100)]
target/arm: Reorg NEON VLD/VST all elements

Instead of shifts and masks, use direct loads and stores from the neon
register file.  Mirror the iteration structure of the ARM pseudocode
more closely.  Correct the parameters of the VLD2 A2 insn.

Note that this includes a bugfix for handling of the insn
"VLD2 (multiple 2-element structures)" -- we were using an
incorrect stride value.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20181011205206.3552-19-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: Use gvec for NEON VLD all lanes
Richard Henderson [Wed, 24 Oct 2018 06:50:20 +0000 (07:50 +0100)]
target/arm: Use gvec for NEON VLD all lanes

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20181011205206.3552-18-richard.henderson@linaro.org
[PMM: added parens in ?: expression]
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agotarget/arm: Use gvec for NEON_3R_VTST_VCEQ, NEON_3R_VCGT, NEON_3R_VCGE
Richard Henderson [Wed, 24 Oct 2018 06:50:20 +0000 (07:50 +0100)]
target/arm: Use gvec for NEON_3R_VTST_VCEQ, NEON_3R_VCGT, NEON_3R_VCGE

Move cmtst_op expanders from translate-a64.c.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20181011205206.3552-17-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: Use gvec for NEON_3R_VML
Richard Henderson [Wed, 24 Oct 2018 06:50:19 +0000 (07:50 +0100)]
target/arm: Use gvec for NEON_3R_VML

Move mla_op and mls_op expanders from translate-a64.c.

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