]> git.proxmox.com Git - mirror_qemu.git/log
mirror_qemu.git
4 years agom68k: Add NeXTcube keyboard device
Thomas Huth [Sat, 30 Jun 2018 05:50:23 +0000 (07:50 +0200)]
m68k: Add NeXTcube keyboard device

It is likely still quite incomplete (e.g. mouse and interrupts are not
implemented yet), but it is good enough for keyboard input at the firmware
monitor.
This code has been taken from Bryce Lanham's GSoC 2011 NeXT branch at

 https://github.com/blanham/qemu-NeXT/blob/next-cube/hw/next-kbd.c

and altered to fit the latest interface of the current QEMU (e.g. to use
memory_region_init_io() instead of cpu_register_physical_memory()).

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20190831074519.32613-3-huth@tuxfamily.org>
Signed-off-by: Thomas Huth <huth@tuxfamily.org>
4 years agom68k: Add NeXTcube framebuffer device emulation
Thomas Huth [Sat, 30 Jun 2018 05:19:42 +0000 (07:19 +0200)]
m68k: Add NeXTcube framebuffer device emulation

The NeXTcube uses a linear framebuffer with 4 greyscale colors and
a fixed resolution of 1120 * 832.
This code has been taken from Bryce Lanham's GSoC 2011 NeXT branch at

 https://github.com/blanham/qemu-NeXT/blob/next-cube/hw/next-fb.c

and altered to fit the latest interface of the current QEMU (e.g.
the device has been "qdev"-ified etc.).

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20190831074519.32613-2-huth@tuxfamily.org>
Signed-off-by: Thomas Huth <huth@tuxfamily.org>
4 years agoMerge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2019-09-05-v2...
Peter Maydell [Thu, 5 Sep 2019 16:09:13 +0000 (17:09 +0100)]
Merge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2019-09-05-v2' into staging

- Make the core libqtest library independent from global_qtest
- Clean up docs from hard-coded qemu-system-* names
- Install libattr-dev and libcap-dev in gitlab-ci to test virtio-9p

# gpg: Signature made Thu 05 Sep 2019 15:52:30 BST
# gpg:                using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5
# gpg:                issuer "thuth@redhat.com"
# gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full]
# gpg:                 aka "Thomas Huth <thuth@redhat.com>" [full]
# gpg:                 aka "Thomas Huth <huth@tuxfamily.org>" [full]
# gpg:                 aka "Thomas Huth <th.huth@posteo.de>" [unknown]
# Primary key fingerprint: 27B8 8847 EEE0 2501 18F3  EAB9 2ED9 D774 FE70 2DB5

* remotes/huth-gitlab/tags/pull-request-2019-09-05-v2:
  gitlab-ci.yml: Install libattr-devel and libcap-devel to test virtio-9p
  qemu-doc: Do not hard-code the name of the QEMU binary
  tests/vm: Take the J=x setting into account for the vm-boot-ssh targets, too
  tests/libqtest: Use libqtest-single.h in tests that require global_qtest
  tests/libqtest: Move global_test wrapper function into a separate header
  tests: Remove unnecessary global_qtest references
  tests/libqos: Replace clock_step with qtest_clock_step in virtio code
  tests/libqos/e1000e: Make e1000e libqos functions independent from global_qtest
  tests/migration: Do not use functions anymore that rely on global_qtest

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agoMerge remote-tracking branch 'remotes/berrange/tags/docs-pull-request' into staging
Peter Maydell [Thu, 5 Sep 2019 15:33:39 +0000 (16:33 +0100)]
Merge remote-tracking branch 'remotes/berrange/tags/docs-pull-request' into staging

docs: add docs about use of automatic cleanup functions

This is ostensibly about adding docs for the g_autofree/g_autoptr
macros. As part of doing that, however, the existing HACKING doc
is merged into the CODING_STYLE doc and the text is converted to
rst with a table of contents.

# gpg: Signature made Thu 05 Sep 2019 14:43:44 BST
# gpg:                using RSA key DAF3A6FDB26B62912D0E8E3FBE86EBB415104FDF
# gpg: Good signature from "Daniel P. Berrange <dan@berrange.com>" [full]
# gpg:                 aka "Daniel P. Berrange <berrange@redhat.com>" [full]
# Primary key fingerprint: DAF3 A6FD B26B 6291 2D0E  8E3F BE86 EBB4 1510 4FDF

* remotes/berrange/tags/docs-pull-request:
  docs: split the CODING_STYLE doc into distinct groups
  docs: document use of automatic cleanup functions in glib
  docs: merge HACKING.rst contents into CODING_STYLE.rst
  docs: convert README, CODING_STYLE and HACKING to RST syntax

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agogitlab-ci.yml: Install libattr-devel and libcap-devel to test virtio-9p
Thomas Huth [Thu, 5 Sep 2019 10:36:50 +0000 (12:36 +0200)]
gitlab-ci.yml: Install libattr-devel and libcap-devel to test virtio-9p

So far the gitlab-ci was not testing virtio-9p yet, since we did not
install libattr-devel and libcap-devel in any of the pipelines. Do
it now to get some more test coverage.

Message-Id: <20190905111729.1197-1-thuth@redhat.com>
Acked-by: Greg Kurz <groug@kaod.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
4 years agodocs: split the CODING_STYLE doc into distinct groups
Daniel P. Berrangé [Thu, 29 Aug 2019 16:04:32 +0000 (17:04 +0100)]
docs: split the CODING_STYLE doc into distinct groups

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agodocs: document use of automatic cleanup functions in glib
Daniel P. Berrangé [Fri, 23 Aug 2019 16:31:35 +0000 (17:31 +0100)]
docs: document use of automatic cleanup functions in glib

Document the use of g_autofree and g_autoptr in glib for automatic
freeing of memory.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agodocs: merge HACKING.rst contents into CODING_STYLE.rst
Daniel P. Berrangé [Fri, 23 Aug 2019 16:12:05 +0000 (17:12 +0100)]
docs: merge HACKING.rst contents into CODING_STYLE.rst

The split of information between the two docs is rather arbitary and
unclear. It is simpler for contributors if all the information is in
one file.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agodocs: convert README, CODING_STYLE and HACKING to RST syntax
Daniel P. Berrangé [Fri, 23 Aug 2019 16:09:24 +0000 (17:09 +0100)]
docs: convert README, CODING_STYLE and HACKING to RST syntax

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agotarget/arm: Inline gen_bx_im into callers
Richard Henderson [Wed, 4 Sep 2019 19:30:59 +0000 (12:30 -0700)]
target/arm: Inline gen_bx_im into callers

There are only two remaining uses of gen_bx_im.  In each case, we
know the destination mode -- not changing in the case of gen_jmp
or changing in the case of trans_BLX_i.  Use this to simplify the
surrounding code.

For trans_BLX_i, use gen_jmp for the actual branch.  For gen_jmp,
use gen_set_pc_im to set up the single-step.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-70-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Clean up disas_thumb_insn
Richard Henderson [Wed, 4 Sep 2019 19:30:58 +0000 (12:30 -0700)]
target/arm: Clean up disas_thumb_insn

Now that everything is converted, remove the rest of
the legacy decode.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-69-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert T16, long branches
Richard Henderson [Wed, 4 Sep 2019 19:30:57 +0000 (12:30 -0700)]
target/arm: Convert T16, long branches

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-68-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert T16, Unconditional branch
Richard Henderson [Wed, 4 Sep 2019 19:30:56 +0000 (12:30 -0700)]
target/arm: Convert T16, Unconditional branch

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-67-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert T16, load (literal)
Richard Henderson [Wed, 4 Sep 2019 19:30:55 +0000 (12:30 -0700)]
target/arm: Convert T16, load (literal)

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-66-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert T16, shift immediate
Richard Henderson [Wed, 4 Sep 2019 19:30:54 +0000 (12:30 -0700)]
target/arm: Convert T16, shift immediate

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-65-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert T16, Miscellaneous 16-bit instructions
Richard Henderson [Wed, 4 Sep 2019 19:30:53 +0000 (12:30 -0700)]
target/arm: Convert T16, Miscellaneous 16-bit instructions

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-64-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert T16, Conditional branches, Supervisor call
Richard Henderson [Wed, 4 Sep 2019 19:30:52 +0000 (12:30 -0700)]
target/arm: Convert T16, Conditional branches, Supervisor call

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-63-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert T16, push and pop
Richard Henderson [Wed, 4 Sep 2019 19:30:51 +0000 (12:30 -0700)]
target/arm: Convert T16, push and pop

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-62-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Split gen_nop_hint
Richard Henderson [Wed, 4 Sep 2019 19:30:50 +0000 (12:30 -0700)]
target/arm: Split gen_nop_hint

Now that all callers pass a constant value, split the switch
statement into the individual trans_* functions.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20190904193059.26202-61-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert T16, nop hints
Richard Henderson [Wed, 4 Sep 2019 19:30:49 +0000 (12:30 -0700)]
target/arm: Convert T16, nop hints

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20190904193059.26202-60-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert T16, Reverse bytes
Richard Henderson [Wed, 4 Sep 2019 19:30:48 +0000 (12:30 -0700)]
target/arm: Convert T16, Reverse bytes

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-59-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert T16, Change processor state
Richard Henderson [Wed, 4 Sep 2019 19:30:47 +0000 (12:30 -0700)]
target/arm: Convert T16, Change processor state

Add a check for ARMv6 in trans_CPS.  We had this correct in
the T16 path, but had previously forgotten the check on the
A32 and T32 paths.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-58-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert T16, extract
Richard Henderson [Wed, 4 Sep 2019 19:30:46 +0000 (12:30 -0700)]
target/arm: Convert T16, extract

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-57-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert T16 adjust sp (immediate)
Richard Henderson [Wed, 4 Sep 2019 19:30:45 +0000 (12:30 -0700)]
target/arm: Convert T16 adjust sp (immediate)

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-56-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert T16 add, compare, move (two high registers)
Richard Henderson [Wed, 4 Sep 2019 19:30:44 +0000 (12:30 -0700)]
target/arm: Convert T16 add, compare, move (two high registers)

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-55-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert T16 branch and exchange
Richard Henderson [Wed, 4 Sep 2019 19:30:43 +0000 (12:30 -0700)]
target/arm: Convert T16 branch and exchange

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-54-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert T16 one low register and immediate
Richard Henderson [Wed, 4 Sep 2019 19:30:42 +0000 (12:30 -0700)]
target/arm: Convert T16 one low register and immediate

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-53-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert T16 add/sub (3 low, 2 low and imm)
Richard Henderson [Wed, 4 Sep 2019 19:30:41 +0000 (12:30 -0700)]
target/arm: Convert T16 add/sub (3 low, 2 low and imm)

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-52-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert T16 load/store multiple
Richard Henderson [Wed, 4 Sep 2019 19:30:40 +0000 (12:30 -0700)]
target/arm: Convert T16 load/store multiple

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-51-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert T16 add pc/sp (immediate)
Richard Henderson [Wed, 4 Sep 2019 19:30:39 +0000 (12:30 -0700)]
target/arm: Convert T16 add pc/sp (immediate)

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-50-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert T16 load/store (immediate offset)
Richard Henderson [Wed, 4 Sep 2019 19:30:38 +0000 (12:30 -0700)]
target/arm: Convert T16 load/store (immediate offset)

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-49-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert T16 load/store (register offset)
Richard Henderson [Wed, 4 Sep 2019 19:30:37 +0000 (12:30 -0700)]
target/arm: Convert T16 load/store (register offset)

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-48-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert T16 data-processing (two low regs)
Richard Henderson [Wed, 4 Sep 2019 19:30:36 +0000 (12:30 -0700)]
target/arm: Convert T16 data-processing (two low regs)

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-47-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Add skeleton for T16 decodetree
Richard Henderson [Wed, 4 Sep 2019 19:30:35 +0000 (12:30 -0700)]
target/arm: Add skeleton for T16 decodetree

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-46-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Simplify disas_arm_insn
Richard Henderson [Wed, 4 Sep 2019 19:30:34 +0000 (12:30 -0700)]
target/arm: Simplify disas_arm_insn

Fold away all of the cases that now just goto illegal_op,
because all of their internal bits are now in decodetree.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-45-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Simplify disas_thumb2_insn
Richard Henderson [Wed, 4 Sep 2019 19:30:33 +0000 (12:30 -0700)]
target/arm: Simplify disas_thumb2_insn

Fold away all of the cases that now just goto illegal_op,
because all of their internal bits are now in decodetree.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-44-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert TT
Richard Henderson [Wed, 4 Sep 2019 19:30:32 +0000 (12:30 -0700)]
target/arm: Convert TT

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-43-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert SG
Richard Henderson [Wed, 4 Sep 2019 19:30:31 +0000 (12:30 -0700)]
target/arm: Convert SG

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-42-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert Table Branch
Richard Henderson [Wed, 4 Sep 2019 19:30:30 +0000 (12:30 -0700)]
target/arm: Convert Table Branch

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-41-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert Unallocated memory hint
Richard Henderson [Wed, 4 Sep 2019 19:30:29 +0000 (12:30 -0700)]
target/arm: Convert Unallocated memory hint

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-40-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert PLI, PLD, PLDW
Richard Henderson [Wed, 4 Sep 2019 19:30:28 +0000 (12:30 -0700)]
target/arm: Convert PLI, PLD, PLDW

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-39-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert SETEND
Richard Henderson [Wed, 4 Sep 2019 19:30:27 +0000 (12:30 -0700)]
target/arm: Convert SETEND

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-38-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert CPS (privileged)
Richard Henderson [Wed, 4 Sep 2019 19:30:26 +0000 (12:30 -0700)]
target/arm: Convert CPS (privileged)

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-37-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert Clear-Exclusive, Barriers
Richard Henderson [Wed, 4 Sep 2019 19:30:25 +0000 (12:30 -0700)]
target/arm: Convert Clear-Exclusive, Barriers

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-36-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert RFE and SRS
Richard Henderson [Wed, 4 Sep 2019 19:30:24 +0000 (12:30 -0700)]
target/arm: Convert RFE and SRS

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-35-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert SVC
Richard Henderson [Wed, 4 Sep 2019 19:30:23 +0000 (12:30 -0700)]
target/arm: Convert SVC

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-34-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert B, BL, BLX (immediate)
Richard Henderson [Wed, 4 Sep 2019 19:30:22 +0000 (12:30 -0700)]
target/arm: Convert B, BL, BLX (immediate)

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-33-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Diagnose base == pc for LDM/STM
Richard Henderson [Wed, 4 Sep 2019 19:30:21 +0000 (12:30 -0700)]
target/arm: Diagnose base == pc for LDM/STM

We have been using store_reg and not store_reg_for_load when writing
back a loaded value into the base register.  At first glance this is
incorrect when base == pc, however that case is UNPREDICTABLE.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-32-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Diagnose too few registers in list for LDM/STM
Richard Henderson [Wed, 4 Sep 2019 19:30:20 +0000 (12:30 -0700)]
target/arm: Diagnose too few registers in list for LDM/STM

This has been a TODO item for quite a while.  The minimum bit
count for A32 and T16 is 1, and for T32 is 2.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-31-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Diagnose writeback register in list for LDM for v7
Richard Henderson [Wed, 4 Sep 2019 19:30:19 +0000 (12:30 -0700)]
target/arm: Diagnose writeback register in list for LDM for v7

Prior to v7, for the A32 encoding, this operation wrote an UNKNOWN
value back to the base register.  Starting in v7 this is UNPREDICTABLE.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-30-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert LDM, STM
Richard Henderson [Wed, 4 Sep 2019 19:30:18 +0000 (12:30 -0700)]
target/arm: Convert LDM, STM

This includes a minor bug fix to LDM (user), which requires
bit 21 to be 0, which means no writeback.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-29-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert MOVW, MOVT
Richard Henderson [Wed, 4 Sep 2019 19:30:17 +0000 (12:30 -0700)]
target/arm: Convert MOVW, MOVT

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-28-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert Signed multiply, signed and unsigned divide
Richard Henderson [Wed, 4 Sep 2019 19:30:16 +0000 (12:30 -0700)]
target/arm: Convert Signed multiply, signed and unsigned divide

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-27-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert packing, unpacking, saturation, and reversal
Richard Henderson [Wed, 4 Sep 2019 19:30:15 +0000 (12:30 -0700)]
target/arm: Convert packing, unpacking, saturation, and reversal

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-26-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert Parallel addition and subtraction
Richard Henderson [Wed, 4 Sep 2019 19:30:14 +0000 (12:30 -0700)]
target/arm: Convert Parallel addition and subtraction

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-25-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert USAD8, USADA8, SBFX, UBFX, BFC, BFI, UDF
Richard Henderson [Wed, 4 Sep 2019 19:30:13 +0000 (12:30 -0700)]
target/arm: Convert USAD8, USADA8, SBFX, UBFX, BFC, BFI, UDF

In op_bfx, note that tcg_gen_{,s}extract_i32 already checks
for width == 32, so we don't need to special case that here.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-24-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Diagnose UNPREDICTABLE ldrex/strex cases
Richard Henderson [Wed, 4 Sep 2019 19:30:12 +0000 (12:30 -0700)]
target/arm: Diagnose UNPREDICTABLE ldrex/strex cases

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-23-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert Synchronization primitives
Richard Henderson [Wed, 4 Sep 2019 19:30:11 +0000 (12:30 -0700)]
target/arm: Convert Synchronization primitives

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-22-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert load/store (register, immediate, literal)
Richard Henderson [Wed, 4 Sep 2019 19:30:10 +0000 (12:30 -0700)]
target/arm: Convert load/store (register, immediate, literal)

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-21-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert T32 ADDW/SUBW
Richard Henderson [Wed, 4 Sep 2019 19:30:09 +0000 (12:30 -0700)]
target/arm: Convert T32 ADDW/SUBW

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-20-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert the rest of A32 Miscelaneous instructions
Richard Henderson [Wed, 4 Sep 2019 19:30:08 +0000 (12:30 -0700)]
target/arm: Convert the rest of A32 Miscelaneous instructions

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-19-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert ERET
Richard Henderson [Wed, 4 Sep 2019 19:30:07 +0000 (12:30 -0700)]
target/arm: Convert ERET

Pass the T5 encoding of SUBS PC, LR, #IMM through the normal SUBS path
to make it clear exactly what's happening -- we hit ALUExceptionReturn
along that path.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-18-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert CLZ
Richard Henderson [Wed, 4 Sep 2019 19:30:06 +0000 (12:30 -0700)]
target/arm: Convert CLZ

Document our choice about the T32 CONSTRAINED UNPREDICTABLE behaviour.
This matches the undocumented choice made by the legacy decoder.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-17-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert BX, BXJ, BLX (register)
Richard Henderson [Wed, 4 Sep 2019 19:30:05 +0000 (12:30 -0700)]
target/arm: Convert BX, BXJ, BLX (register)

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-16-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert Cyclic Redundancy Check
Richard Henderson [Wed, 4 Sep 2019 19:30:04 +0000 (12:30 -0700)]
target/arm: Convert Cyclic Redundancy Check

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-15-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert MRS/MSR (banked, register)
Richard Henderson [Wed, 4 Sep 2019 19:30:03 +0000 (12:30 -0700)]
target/arm: Convert MRS/MSR (banked, register)

The m-profile and a-profile decodings overlap.  Only return false
for the case of wrong profile; handle UNDEFINED for permission failure
directly.  This ensures that we don't accidentally pass an insn that
applies to the wrong profile.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-14-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert MSR (immediate) and hints
Richard Henderson [Wed, 4 Sep 2019 19:30:02 +0000 (12:30 -0700)]
target/arm: Convert MSR (immediate) and hints

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-13-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Simplify op_smlawx for SMLAW*
Richard Henderson [Wed, 4 Sep 2019 19:30:01 +0000 (12:30 -0700)]
target/arm: Simplify op_smlawx for SMLAW*

By shifting the 16-bit input left by 16, we can align the desired
portion of the 48-bit product and use tcg_gen_muls2_i32.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-12-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Simplify op_smlaxxx for SMLAL*
Richard Henderson [Wed, 4 Sep 2019 19:30:00 +0000 (12:30 -0700)]
target/arm: Simplify op_smlaxxx for SMLAL*

Since all of the inputs and outputs are i32, dispense with
the intermediate promotion to i64 and use tcg_gen_add2_i32.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-11-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert Halfword multiply and multiply accumulate
Richard Henderson [Wed, 4 Sep 2019 19:29:59 +0000 (12:29 -0700)]
target/arm: Convert Halfword multiply and multiply accumulate

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-10-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert Saturating addition and subtraction
Richard Henderson [Wed, 4 Sep 2019 19:29:58 +0000 (12:29 -0700)]
target/arm: Convert Saturating addition and subtraction

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-9-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Simplify UMAAL
Richard Henderson [Wed, 4 Sep 2019 19:29:57 +0000 (12:29 -0700)]
target/arm: Simplify UMAAL

Since all of the inputs and outputs are i32, dispense with
the intermediate promotion to i64 and use tcg_gen_mulu2_i32
and tcg_gen_add2_i32.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-8-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert multiply and multiply accumulate
Richard Henderson [Wed, 4 Sep 2019 19:29:56 +0000 (12:29 -0700)]
target/arm: Convert multiply and multiply accumulate

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-7-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert Data Processing (immediate)
Richard Henderson [Wed, 4 Sep 2019 19:29:55 +0000 (12:29 -0700)]
target/arm: Convert Data Processing (immediate)

Convert the modified immediate form of the data processing insns.
For A32, we can finally remove any code that was intertwined with
the register and register-shifted-register forms.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-6-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert Data Processing (reg-shifted-reg)
Richard Henderson [Wed, 4 Sep 2019 19:29:54 +0000 (12:29 -0700)]
target/arm: Convert Data Processing (reg-shifted-reg)

Convert the register shifted by register form of the data
processing insns.  For A32, we cannot yet remove any code
because the legacy decoder intertwines the immediate form.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-5-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Convert Data Processing (register)
Richard Henderson [Wed, 4 Sep 2019 19:29:53 +0000 (12:29 -0700)]
target/arm: Convert Data Processing (register)

Convert the register shifted by immediate form of the data
processing insns.  For A32, we cannot yet remove any code
because the legacy decoder intertwines the reg-shifted-reg
and immediate forms.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-4-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Add stubs for aa32 decodetree
Richard Henderson [Wed, 4 Sep 2019 19:29:52 +0000 (12:29 -0700)]
target/arm: Add stubs for aa32 decodetree

Add the infrastructure that will become the new decoder.
No instructions adjusted so far.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-3-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/arm: Use store_reg_from_load in thumb2 code
Richard Henderson [Wed, 4 Sep 2019 19:29:51 +0000 (12:29 -0700)]
target/arm: Use store_reg_from_load in thumb2 code

This function already includes the test for an interworking write
to PC from a load.  Change the T32 LDM implementation to match the
A32 LDM implementation.

For LDM, the reordering of the tests does not change valid
behaviour because the only case that differs is has rn == 15,
which is UNPREDICTABLE.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20190904193059.26202-2-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agoqemu-doc: Do not hard-code the name of the QEMU binary
Thomas Huth [Tue, 30 Jul 2019 15:08:26 +0000 (17:08 +0200)]
qemu-doc: Do not hard-code the name of the QEMU binary

In our documentation, we use a mix of "$QEMU", "qemu-system-i386" and
"qemu-system-x86_64" when we give examples to the users how to run
QEMU. Some more consistency would be good here. Also some distributions
use different names for the QEMU binary (e.g. "qemu-kvm" in RHEL), so
providing more flexibility here would also be good. Thus let's define
some variables for the names of the QEMU command and use those in the
documentation instead: @value{qemu_system} for generic examples, and
@value{qemu_system_x86} for examples that only work with the x86
binaries.

Message-Id: <20190828093447.12441-1-thuth@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Reviewed-by: Miroslav Rezanina <mrezanin@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
4 years agotests/vm: Take the J=x setting into account for the vm-boot-ssh targets, too
Thomas Huth [Wed, 24 Jul 2019 09:58:48 +0000 (11:58 +0200)]
tests/vm: Take the J=x setting into account for the vm-boot-ssh targets, too

For testing whether the VMs can deal with multiple CPUs correctly,
it is useful to be able to use the "J=<cpus>" setting for the
vm-boot-ssh targets, too.

Message-Id: <20190726100207.19112-1-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
4 years agotests/libqtest: Use libqtest-single.h in tests that require global_qtest
Thomas Huth [Tue, 3 Sep 2019 05:50:26 +0000 (07:50 +0200)]
tests/libqtest: Use libqtest-single.h in tests that require global_qtest

Tests that require global_qtest or the related wrapper functions now
use the libqtest-single.h header that is dedicated for everything
related to global_qtest. The core libqtest.c and libqtest.h files are
now completely indepedent from global_qtest, so that the core library
is now not depending on a global state anymore.

Message-Id: <20190904130047.25808-7-thuth@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
4 years agotests/libqtest: Move global_test wrapper function into a separate header
Thomas Huth [Tue, 3 Sep 2019 05:39:37 +0000 (07:39 +0200)]
tests/libqtest: Move global_test wrapper function into a separate header

We want libqtest.h to become completely independent from global_qtest
(so that the wrapper functions are not used by accident anymore). As
a first step, move the wrapper functions into a separate header file.

The new header is only included from libqtest.h for now, so that there
is no difference to the users of libqtest.h yet. In the next patch, we
will switch this, so that the users of the global_qtest-related
functions will be using libqtest-single.h directly and libqtest.h
becomes completely independent of this.

Message-Id: <20190904130047.25808-6-thuth@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
4 years agotests: Remove unnecessary global_qtest references
Thomas Huth [Tue, 20 Aug 2019 19:23:56 +0000 (21:23 +0200)]
tests: Remove unnecessary global_qtest references

We are going to remove global_qtest from the main libqtest library
soon, so tests that do not urgently need global_qtest anymore
should be cleaned from the unnecessary references.

Message-Id: <20190904130047.25808-5-thuth@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
4 years agotests/libqos: Replace clock_step with qtest_clock_step in virtio code
Thomas Huth [Tue, 3 Sep 2019 06:18:46 +0000 (08:18 +0200)]
tests/libqos: Replace clock_step with qtest_clock_step in virtio code

Library functions should not rely on functions that require global_qtest
(since they might get used in tests that deal with multiple states).
Commit 1999a70a05ad603d ("Make generic virtio code independent from
global_qtest") already tried to clean the libqos virtio code, but I
missed to replace the clock_step() function. Thus change it now to
qtest_clock_step() instead.
The logic of the qvirtio_wait_config_isr() function is now pushed
to the virtio-mmio.c and virtio-pci.c files instead, since we can
get the QTestState here easily.

Message-Id: <20190904130047.25808-4-thuth@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
4 years agotests/libqos/e1000e: Make e1000e libqos functions independent from global_qtest
Thomas Huth [Tue, 27 Aug 2019 11:17:47 +0000 (13:17 +0200)]
tests/libqos/e1000e: Make e1000e libqos functions independent from global_qtest

libqos library functions should never depend on functions (like memread(),
memwrite() or clock_step()) that require global_qtest to be set, since
library functions might get used in qtests that track multiple states, too.
Thus let's replace the global_qtest-related functions with their independent
counterparts.

Message-Id: <20190904130047.25808-3-thuth@redhat.com>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
4 years agotests/migration: Do not use functions anymore that rely on global_qtest
Thomas Huth [Tue, 20 Aug 2019 14:33:38 +0000 (16:33 +0200)]
tests/migration: Do not use functions anymore that rely on global_qtest

The migration tests deal with multiple test states, so we really should
not use functions here that rely on the single global_qtest variable.
Switch from qtest_start() to qtest_init() to make sure that global_qtest
is not set anymore. This also revealed a regression in the migrate()
function: It has once been converted to use the qtest_qmp() function,
but commit b5bbd3f315d686bd511 ("Clean up string interpolation into QMP,
part 2") accidentally reverted it back to qmp().

Message-Id: <20190904130047.25808-2-thuth@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
4 years agoMerge remote-tracking branch 'remotes/rth/tags/pull-or1k-20190904' into staging
Peter Maydell [Thu, 5 Sep 2019 08:33:01 +0000 (09:33 +0100)]
Merge remote-tracking branch 'remotes/rth/tags/pull-or1k-20190904' into staging

Updates for arch v1.3.

# gpg: Signature made Wed 04 Sep 2019 21:30:41 BST
# gpg:                using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F
# gpg:                issuer "richard.henderson@linaro.org"
# gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" [full]
# Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A  05C0 64DF 38E8 AF7E 215F

* remotes/rth/tags/pull-or1k-20190904:
  target/openrisc: Update cpu "any" to v1.3
  target/openrisc: Implement l.adrp
  target/openrisc: Implement move to/from FPCSR
  target/openrisc: Implement unordered fp comparisons
  target/openrisc: Add support for ORFPX64A32
  target/openrisc: Check CPUCFG_OF32S for float insns
  target/openrisc: Fix lf.ftoi.s
  target/openrisc: Add VR2 and AVR special processor registers
  target/openrisc: Move VR, UPR, DMMCFGR, IMMCFGR to cpu init
  target/openrisc: Make VR and PPC read-only
  target/openrisc: Cache R0 in DisasContext
  target/openrisc: Replace cpu register array with a function
  target/openrisc: Add DisasContext parameter to check_r0_write

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 years agotarget/openrisc: Update cpu "any" to v1.3
Richard Henderson [Mon, 26 Aug 2019 00:33:53 +0000 (17:33 -0700)]
target/openrisc: Update cpu "any" to v1.3

Now that the two updates from v1.3 are implemented,
update the "any" cpu to enable it.

Reviewed-by: Stafford Horne <shorne@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
4 years agotarget/openrisc: Implement l.adrp
Richard Henderson [Mon, 26 Aug 2019 00:31:30 +0000 (17:31 -0700)]
target/openrisc: Implement l.adrp

This was added to the 1.3 spec.

Reviewed-by: Stafford Horne <shorne@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
4 years agotarget/openrisc: Implement move to/from FPCSR
Richard Henderson [Mon, 26 Aug 2019 22:10:10 +0000 (15:10 -0700)]
target/openrisc: Implement move to/from FPCSR

Reviewed-by: Stafford Horne <shorne@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
4 years agotarget/openrisc: Implement unordered fp comparisons
Richard Henderson [Tue, 14 May 2019 13:39:47 +0000 (06:39 -0700)]
target/openrisc: Implement unordered fp comparisons

These were added to the 1.3 spec.  For OF32S, validate AVR.
But OF64A32 is itself new to 1.3 so no extra check needed.

Reviewed-by: Stafford Horne <shorne@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
4 years agotarget/openrisc: Add support for ORFPX64A32
Richard Henderson [Mon, 6 May 2019 21:49:25 +0000 (14:49 -0700)]
target/openrisc: Add support for ORFPX64A32

This is hardware support for double-precision floating-point using
pairs of 32-bit registers.  Fix latent bugs in the heretofore unused
helper_itofd and helper_ftoid.  Include the bit for cpu "any".
Change the default cpu for linux-user to "any".

Reviewed-by: Stafford Horne <shorne@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
4 years agotarget/openrisc: Check CPUCFG_OF32S for float insns
Richard Henderson [Sun, 25 Aug 2019 22:44:11 +0000 (15:44 -0700)]
target/openrisc: Check CPUCFG_OF32S for float insns

Make sure the OF32S insns are enabled before allowing execution.
Include the missing bit for cpu "any".

Reviewed-by: Stafford Horne <shorne@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
4 years agotarget/openrisc: Fix lf.ftoi.s
Richard Henderson [Mon, 26 Aug 2019 22:15:05 +0000 (15:15 -0700)]
target/openrisc: Fix lf.ftoi.s

The specification of this insn is round-to-zero.

Reviewed-by: Stafford Horne <shorne@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
4 years agotarget/openrisc: Add VR2 and AVR special processor registers
Richard Henderson [Sun, 25 Aug 2019 22:23:42 +0000 (15:23 -0700)]
target/openrisc: Add VR2 and AVR special processor registers

Update the CPUCFG bits to arch v1.3.
Include support for AVRP for cpu "any".

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
4 years agotarget/openrisc: Move VR, UPR, DMMCFGR, IMMCFGR to cpu init
Richard Henderson [Sun, 25 Aug 2019 22:02:54 +0000 (15:02 -0700)]
target/openrisc: Move VR, UPR, DMMCFGR, IMMCFGR to cpu init

These registers are read-only and implementation specific.
Initiailize VR for the first time; take the OR1200 values
from the verilog source.

Note that moving fields within CPUOpenRISCState does not
affect migration.

Reviewed-by: Stafford Horne <shorne@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
4 years agotarget/openrisc: Make VR and PPC read-only
Richard Henderson [Sun, 25 Aug 2019 21:28:37 +0000 (14:28 -0700)]
target/openrisc: Make VR and PPC read-only

These SPRs are read-only.  The writes can simply be ignored,
as we already do for other read-only (or missing) registers.
There is no reason to mask the value in env->vr.

Reviewed-by: Stafford Horne <shorne@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
4 years agotarget/openrisc: Cache R0 in DisasContext
Richard Henderson [Mon, 6 May 2019 20:00:06 +0000 (13:00 -0700)]
target/openrisc: Cache R0 in DisasContext

Finish the race condition fix from the previous patch.

Reviewed-by: Stafford Horne <shorne@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
4 years agotarget/openrisc: Replace cpu register array with a function
Richard Henderson [Mon, 6 May 2019 19:50:27 +0000 (12:50 -0700)]
target/openrisc: Replace cpu register array with a function

The writes to cpu_R[0] are now a race across threads, now that we
do code generation in parallel.  Stage the change by introducing
a function to return the temp for R0.

Reviewed-by: Stafford Horne <shorne@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
4 years agotarget/openrisc: Add DisasContext parameter to check_r0_write
Richard Henderson [Mon, 6 May 2019 19:22:42 +0000 (12:22 -0700)]
target/openrisc: Add DisasContext parameter to check_r0_write

We will need this context in the next patch.

Reviewed-by: Stafford Horne <shorne@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>