qemu.git
3 days agotarget/mips/mips-defs: Rename ISA_MIPS32R2 as ISA_MIPS_R2
Philippe Mathieu-Daudé [Wed, 16 Dec 2020 11:29:00 +0000 (12:29 +0100)] 
target/mips/mips-defs: Rename ISA_MIPS32R2 as ISA_MIPS_R2

The MIPS ISA release 2 is common to 32/64-bit CPUs.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20210104221154.3127610-13-f4bug@amsat.org>

3 days agotarget/mips/mips-defs: Rename ISA_MIPS32 as ISA_MIPS_R1
Philippe Mathieu-Daudé [Wed, 16 Dec 2020 11:26:56 +0000 (12:26 +0100)] 
target/mips/mips-defs: Rename ISA_MIPS32 as ISA_MIPS_R1

The MIPS ISA release '1' is common to 32/64-bit CPUs.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20210104221154.3127610-12-f4bug@amsat.org>

3 days agotarget/mips/mips-defs: Use ISA_MIPS32R6 definition to check Release 6
Philippe Mathieu-Daudé [Wed, 16 Dec 2020 11:14:00 +0000 (12:14 +0100)] 
target/mips/mips-defs: Use ISA_MIPS32R6 definition to check Release 6

Use the single ISA_MIPS32R6 definition to check if the Release 6
ISA is supported, whether the CPU support 32/64-bit.

For now we keep '32' in the definition name, we will rename it
as ISA_MIPS_R6 in few commits.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20210104221154.3127610-11-f4bug@amsat.org>

3 days agotarget/mips/mips-defs: Use ISA_MIPS32R5 definition to check Release 5
Philippe Mathieu-Daudé [Wed, 16 Dec 2020 11:09:08 +0000 (12:09 +0100)] 
target/mips/mips-defs: Use ISA_MIPS32R5 definition to check Release 5

Use the single ISA_MIPS32R5 definition to check if the Release 5
ISA is supported, whether the CPU support 32/64-bit.

For now we keep '32' in the definition name, we will rename it
as ISA_MIPS_R5 in few commits.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20210104221154.3127610-10-f4bug@amsat.org>

3 days agotarget/mips/mips-defs: Use ISA_MIPS32R3 definition to check Release 3
Philippe Mathieu-Daudé [Wed, 16 Dec 2020 11:08:40 +0000 (12:08 +0100)] 
target/mips/mips-defs: Use ISA_MIPS32R3 definition to check Release 3

Use the single ISA_MIPS32R3 definition to check if the Release 3
ISA is supported, whether the CPU support 32/64-bit.

For now we keep '32' in the definition name, we will rename it
as ISA_MIPS_R3 in few commits.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20210104221154.3127610-9-f4bug@amsat.org>

3 days agotarget/mips/mips-defs: Use ISA_MIPS32R2 definition to check Release 2
Philippe Mathieu-Daudé [Wed, 16 Dec 2020 11:06:51 +0000 (12:06 +0100)] 
target/mips/mips-defs: Use ISA_MIPS32R2 definition to check Release 2

Use the single ISA_MIPS32R2 definition to check if the Release 2
ISA is supported, whether the CPU support 32/64-bit.

For now we keep '32' in the definition name, we will rename it
as ISA_MIPS_R2 in few commits.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20210104221154.3127610-8-f4bug@amsat.org>

3 days agotarget/mips/mips-defs: Use ISA_MIPS32 definition to check Release 1
Philippe Mathieu-Daudé [Wed, 16 Dec 2020 16:23:15 +0000 (17:23 +0100)] 
target/mips/mips-defs: Use ISA_MIPS32 definition to check Release 1

Use the single ISA_MIPS32 definition to check if the Release 1
ISA is supported, whether the CPU support 32/64-bit.

For now we keep '32' in the definition name, we will rename it
as ISA_MIPS_R1 in few commits.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20210104221154.3127610-7-f4bug@amsat.org>

3 days agohw/mips/boston: Check 64-bit support with cpu_type_is_64bit()
Philippe Mathieu-Daudé [Mon, 4 Jan 2021 10:50:15 +0000 (11:50 +0100)] 
hw/mips/boston: Check 64-bit support with cpu_type_is_64bit()

Directly check if the CPU supports 64-bit with the recently
added cpu_type_is_64bit() helper (inlined).

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20210104221154.3127610-6-f4bug@amsat.org>

3 days agotarget/mips/mips-defs: Introduce CPU_MIPS64 and cpu_type_is_64bit()
Philippe Mathieu-Daudé [Wed, 16 Dec 2020 11:41:25 +0000 (12:41 +0100)] 
target/mips/mips-defs: Introduce CPU_MIPS64 and cpu_type_is_64bit()

MIPS 64-bit ISA is introduced with MIPS3.

Introduce the CPU_MIPS64 definition aliased to the MIPS3 ISA,
and the cpu_type_is_64bit() method to check if a CPU supports
this ISA (thus is 64-bit).

Suggested-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20210104221154.3127610-5-f4bug@amsat.org>

3 days agotarget/mips/mips-defs: Rename CPU_MIPSxx Release 1 as CPU_MIPSxxR1
Philippe Mathieu-Daudé [Wed, 16 Dec 2020 22:59:07 +0000 (23:59 +0100)] 
target/mips/mips-defs: Rename CPU_MIPSxx Release 1 as CPU_MIPSxxR1

'CPU_MIPS32' and 'CPU_MIPS64' definitions concern CPUs implementing
the "Release 1" ISA. Rename it with the 'R1' suffix, as the other
CPU definitions do.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20210104221154.3127610-4-f4bug@amsat.org>

3 days agotarget/mips/mips-defs: Reorder CPU_MIPS5 definition
Philippe Mathieu-Daudé [Wed, 16 Dec 2020 11:23:38 +0000 (12:23 +0100)] 
target/mips/mips-defs: Reorder CPU_MIPS5 definition

Move CPU_MIPS5 after CPU_MIPS4 :)

Reviewed-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20210104221154.3127610-3-f4bug@amsat.org>

3 days agotarget/mips/mips-defs: Remove USE_HOST_FLOAT_REGS comment
Philippe Mathieu-Daudé [Wed, 16 Dec 2020 22:56:58 +0000 (23:56 +0100)] 
target/mips/mips-defs: Remove USE_HOST_FLOAT_REGS comment

Remove a comment added 12 years ago but never used (commit
b6d96beda3a: "Use temporary registers for the MIPS FPU emulation").

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20210104221154.3127610-2-f4bug@amsat.org>

3 days agotarget/mips/addr: Add translation helpers for KSEG1
Jiaxun Yang [Tue, 15 Dec 2020 06:45:06 +0000 (14:45 +0800)] 
target/mips/addr: Add translation helpers for KSEG1

It's useful for bootloader to do I/O operations.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Huacai Chen <chenhuacai@kernel.org>
Message-Id: <20201215064507.30148-3-jiaxun.yang@flygoat.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
3 days agotarget/mips: Replace CP0_Config0 magic values by proper definitions
Philippe Mathieu-Daudé [Tue, 1 Dec 2020 11:41:39 +0000 (12:41 +0100)] 
target/mips: Replace CP0_Config0 magic values by proper definitions

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20201201132817.2863301-3-f4bug@amsat.org>

3 days agotarget/mips: Add CP0 Config0 register definitions for MIPS3 ISA
Philippe Mathieu-Daudé [Tue, 1 Dec 2020 11:29:22 +0000 (12:29 +0100)] 
target/mips: Add CP0 Config0 register definitions for MIPS3 ISA

The MIPS3 and MIPS32/64 ISA use different definitions
for the CP0 Config0 register.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20201201132817.2863301-2-f4bug@amsat.org>

3 days agoMerge remote-tracking branch 'remotes/rth-gitlab/tags/pull-tcg-20210113' into staging
Peter Maydell [Thu, 14 Jan 2021 09:54:29 +0000 (09:54 +0000)] 
Merge remote-tracking branch 'remotes/rth-gitlab/tags/pull-tcg-20210113' into staging

Improvements to tcg constant handling.
Force utf8 for decodetree.

# gpg: Signature made Thu 14 Jan 2021 02:15:42 GMT
# 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-gitlab/tags/pull-tcg-20210113: (24 commits)
  decodetree: Open files with encoding='utf-8'
  tcg/aarch64: Use tcg_constant_vec with tcg vec expanders
  tcg/ppc: Use tcg_constant_vec with tcg vec expanders
  tcg: Remove tcg_gen_dup{8,16,32,64}i_vec
  tcg/i386: Use tcg_constant_vec with tcg vec expanders
  tcg: Add tcg_reg_alloc_dup2
  tcg: Remove movi and dupi opcodes
  tcg/tci: Add special tci_movi_{i32,i64} opcodes
  tcg: Use tcg_constant_{i32,i64,vec} with gvec expanders
  tcg: Use tcg_constant_{i32,i64} with tcg plugins
  tcg: Use tcg_constant_{i32,i64} with tcg int expanders
  tcg: Use tcg_constant_i32 with icount expander
  tcg: Convert tcg_gen_dupi_vec to TCG_CONST
  tcg/optimize: Use tcg_constant_internal with constant folding
  tcg/optimize: Adjust TempOptInfo allocation
  tcg/optimize: Improve find_better_copy
  tcg: Introduce TYPE_CONST temporaries
  tcg: Expand TempOptInfo to 64-bits
  tcg: Rename struct tcg_temp_info to TempOptInfo
  tcg: Expand TCGTemp.val to 64-bits
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 days agoMerge remote-tracking branch 'remotes/mcayland/tags/qemu-macppc-20210113' into staging
Peter Maydell [Wed, 13 Jan 2021 19:18:28 +0000 (19:18 +0000)] 
Merge remote-tracking branch 'remotes/mcayland/tags/qemu-macppc-20210113' into staging

qemu-macppc updates

# gpg: Signature made Wed 13 Jan 2021 13:02:20 GMT
# gpg:                using RSA key CC621AB98E82200D915CC9C45BC2C56FAE0F321F
# gpg:                issuer "mark.cave-ayland@ilande.co.uk"
# gpg: Good signature from "Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>" [full]
# Primary key fingerprint: CC62 1AB9 8E82 200D 915C  C9C4 5BC2 C56F AE0F 321F

* remotes/mcayland/tags/qemu-macppc-20210113:
  macio: don't set user_creatable to false
  macio: wire macio GPIOs to OpenPIC using sysbus IRQs
  macio: move OpenPIC inside macio-newworld device
  mac_newworld: delay wiring of PCI IRQs in New World machine
  macio: move heathrow PIC inside macio-oldworld device
  mac_oldworld: move initialisation of grackle before heathrow
  mac_oldworld: remove duplicate bus check for PPC_INPUT(env)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 days agodecodetree: Open files with encoding='utf-8'
Philippe Mathieu-Daudé [Sun, 10 Jan 2021 00:02:40 +0000 (01:02 +0100)] 
decodetree: Open files with encoding='utf-8'

When decodetree.py was added in commit 568ae7efae7, QEMU was
using Python 2 which happily reads UTF-8 files in text mode.
Python 3 requires either UTF-8 locale or an explicit encoding
passed to open(). Now that Python 3 is required, explicit
UTF-8 encoding for decodetree source files.

To avoid further problems with the user locale, also explicit
UTF-8 encoding for the generated C files.

Explicit both input/output are plain text by using the 't' mode.

This fixes:

  $ /usr/bin/python3 scripts/decodetree.py test.decode
  Traceback (most recent call last):
    File "scripts/decodetree.py", line 1397, in <module>
      main()
    File "scripts/decodetree.py", line 1308, in main
      parse_file(f, toppat)
    File "scripts/decodetree.py", line 994, in parse_file
      for line in f:
    File "/usr/lib/python3.6/encodings/ascii.py", line 26, in decode
      return codecs.ascii_decode(input, self.errors)[0]
  UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 80:
  ordinal not in range(128)

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Suggested-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20210110000240.761122-1-f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
4 days agotcg/aarch64: Use tcg_constant_vec with tcg vec expanders
Richard Henderson [Tue, 8 Sep 2020 00:47:31 +0000 (00:47 +0000)] 
tcg/aarch64: Use tcg_constant_vec with tcg vec expanders

Improve rotrv_vec to reduce "t1 = -v2, t2 = t1 + c" to
"t1 = -v2, t2 = c - v2".  This avoids a serial dependency
between t1 and t2.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
4 days agotcg/ppc: Use tcg_constant_vec with tcg vec expanders
Richard Henderson [Mon, 7 Sep 2020 23:46:21 +0000 (23:46 +0000)] 
tcg/ppc: Use tcg_constant_vec with tcg vec expanders

Improve expand_vec_shi to use sign-extraction for MO_32.
This allows a single VSPLTISB instruction to load all of
the valid shift constants.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
4 days agotcg: Remove tcg_gen_dup{8,16,32,64}i_vec
Richard Henderson [Wed, 1 Apr 2020 03:10:20 +0000 (20:10 -0700)] 
tcg: Remove tcg_gen_dup{8,16,32,64}i_vec

These interfaces have been replaced by tcg_gen_dupi_vec
and tcg_constant_vec.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
4 days agotcg/i386: Use tcg_constant_vec with tcg vec expanders
Richard Henderson [Wed, 1 Apr 2020 03:03:16 +0000 (20:03 -0700)] 
tcg/i386: Use tcg_constant_vec with tcg vec expanders

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
4 days agotcg: Add tcg_reg_alloc_dup2
Richard Henderson [Tue, 31 Mar 2020 09:33:21 +0000 (02:33 -0700)] 
tcg: Add tcg_reg_alloc_dup2

There are several ways we can expand a vector dup of a 64-bit
element on a 32-bit host.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
4 days agotcg: Remove movi and dupi opcodes
Richard Henderson [Fri, 17 Apr 2020 20:22:43 +0000 (13:22 -0700)] 
tcg: Remove movi and dupi opcodes

These are now completely covered by mov from a
TYPE_CONST temporary.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
4 days agotcg/tci: Add special tci_movi_{i32,i64} opcodes
Richard Henderson [Fri, 17 Apr 2020 20:19:47 +0000 (13:19 -0700)] 
tcg/tci: Add special tci_movi_{i32,i64} opcodes

The normal movi opcodes are going away.  We need something
for TCI to use internally.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
4 days agotcg: Use tcg_constant_{i32,i64,vec} with gvec expanders
Richard Henderson [Fri, 4 Sep 2020 01:18:08 +0000 (18:18 -0700)] 
tcg: Use tcg_constant_{i32,i64,vec} with gvec expanders

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
4 days agotcg: Use tcg_constant_{i32,i64} with tcg plugins
Richard Henderson [Fri, 17 Apr 2020 17:31:49 +0000 (10:31 -0700)] 
tcg: Use tcg_constant_{i32,i64} with tcg plugins

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
4 days agotcg: Use tcg_constant_{i32,i64} with tcg int expanders
Richard Henderson [Mon, 30 Mar 2020 03:07:08 +0000 (20:07 -0700)] 
tcg: Use tcg_constant_{i32,i64} with tcg int expanders

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
4 days agotcg: Use tcg_constant_i32 with icount expander
Richard Henderson [Fri, 17 Apr 2020 16:31:55 +0000 (09:31 -0700)] 
tcg: Use tcg_constant_i32 with icount expander

We must do this before we adjust tcg_out_movi_i32, lest the
under-the-hood poking that we do for icount be broken.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
4 days agotcg: Convert tcg_gen_dupi_vec to TCG_CONST
Richard Henderson [Mon, 7 Sep 2020 00:33:18 +0000 (17:33 -0700)] 
tcg: Convert tcg_gen_dupi_vec to TCG_CONST

Because we now store uint64_t in TCGTemp, we can now always
store the full 64-bit duplicate immediate.  So remove the
difference between 32- and 64-bit hosts.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
4 days agotcg/optimize: Use tcg_constant_internal with constant folding
Richard Henderson [Tue, 31 Mar 2020 03:42:43 +0000 (20:42 -0700)] 
tcg/optimize: Use tcg_constant_internal with constant folding

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
4 days agotcg/optimize: Adjust TempOptInfo allocation
Richard Henderson [Tue, 31 Mar 2020 02:52:02 +0000 (19:52 -0700)] 
tcg/optimize: Adjust TempOptInfo allocation

Do not allocate a large block for indexing.  Instead, allocate
for each temporary as they are seen.

In general, this will use less memory, if we consider that most
TBs do not touch every target register.  This also allows us to
allocate TempOptInfo for new temps created during optimization.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
4 days agotcg/optimize: Improve find_better_copy
Richard Henderson [Thu, 23 Apr 2020 16:02:23 +0000 (09:02 -0700)] 
tcg/optimize: Improve find_better_copy

Prefer TEMP_CONST over anything else.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
4 days agotcg: Introduce TYPE_CONST temporaries
Richard Henderson [Mon, 30 Mar 2020 01:55:52 +0000 (18:55 -0700)] 
tcg: Introduce TYPE_CONST temporaries

These will hold a single constant for the duration of the TB.
They are hashed, so that each value has one temp across the TB.

Not used yet, this is all infrastructure.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
4 days agotcg: Expand TempOptInfo to 64-bits
Richard Henderson [Sun, 6 Sep 2020 23:21:32 +0000 (16:21 -0700)] 
tcg: Expand TempOptInfo to 64-bits

This propagates the extended value of TCGTemp.val that we did before.
In addition, it will be required for vector constants.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
4 days agotcg: Rename struct tcg_temp_info to TempOptInfo
Richard Henderson [Tue, 31 Mar 2020 00:44:30 +0000 (17:44 -0700)] 
tcg: Rename struct tcg_temp_info to TempOptInfo

Fix this name vs our coding style.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
4 days agotcg: Expand TCGTemp.val to 64-bits
Richard Henderson [Sun, 6 Sep 2020 18:31:44 +0000 (11:31 -0700)] 
tcg: Expand TCGTemp.val to 64-bits

This will reduce the differences between 32-bit and 64-bit hosts,
allowing full 64-bit constants to be created with the same interface.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
4 days agotcg: Add temp_readonly
Richard Henderson [Sun, 29 Mar 2020 17:40:49 +0000 (10:40 -0700)] 
tcg: Add temp_readonly

In most, but not all, places that we check for TEMP_FIXED,
we are really testing that we do not modify the temporary.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
4 days agotcg: Consolidate 3 bits into enum TCGTempKind
Richard Henderson [Sun, 29 Mar 2020 17:11:56 +0000 (10:11 -0700)] 
tcg: Consolidate 3 bits into enum TCGTempKind

The temp_fixed, temp_global, temp_local bits are all related.
Combine them into a single enumeration.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
4 days agotcg: Increase tcg_out_dupi_vec immediate to int64_t
Richard Henderson [Tue, 31 Mar 2020 08:02:08 +0000 (01:02 -0700)] 
tcg: Increase tcg_out_dupi_vec immediate to int64_t

While we don't store more than tcg_target_long in TCGTemp,
we shouldn't be limited to that for code generation.  We will
be able to use this for INDEX_op_dup2_vec with 2 constants.

Also pass along the minimal vece that may be said to apply
to the constant.  This allows some simplification in the
various backends.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
4 days agotcg: Use tcg_out_dupi_vec from temp_load
Richard Henderson [Tue, 31 Mar 2020 12:43:23 +0000 (05:43 -0700)] 
tcg: Use tcg_out_dupi_vec from temp_load

Having dupi pass though movi is confusing and arguably wrong.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
4 days agoMerge remote-tracking branch 'remotes/armbru/tags/pull-yank-2021-01-13' into staging
Peter Maydell [Wed, 13 Jan 2021 14:19:24 +0000 (14:19 +0000)] 
Merge remote-tracking branch 'remotes/armbru/tags/pull-yank-2021-01-13' into staging

Yank patches patches for 2021-01-13

# gpg: Signature made Wed 13 Jan 2021 09:25:46 GMT
# gpg:                using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653
# gpg:                issuer "armbru@redhat.com"
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full]
# gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>" [full]
# Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653

* remotes/armbru/tags/pull-yank-2021-01-13:
  tests/test-char.c: Wait for the chardev to connect in char_socket_client_dupid_test
  io: Document qmp oob suitability of qio_channel_shutdown and io_shutdown
  io/channel-tls.c: make qio_channel_tls_shutdown thread-safe
  migration: Add yank feature
  chardev/char-socket.c: Add yank feature
  block/nbd.c: Add yank feature
  Introduce yank feature

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 days agomacio: don't set user_creatable to false
Mark Cave-Ayland [Tue, 29 Dec 2020 17:56:19 +0000 (17:56 +0000)] 
macio: don't set user_creatable to false

Now that all of the object property links to the heathrow PIC and OpenPIC have
been removed from the macio devices, it is safe to allow the macio-oldworld
and macio-neworld devices to be marked as user_creatable.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-Id: <20201229175619.6051-8-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
4 days agomacio: wire macio GPIOs to OpenPIC using sysbus IRQs
Mark Cave-Ayland [Tue, 29 Dec 2020 17:56:18 +0000 (17:56 +0000)] 
macio: wire macio GPIOs to OpenPIC using sysbus IRQs

This both allows the wiring to be done as Ben suggested in his original comment in
gpio.c and also enables the OpenPIC object property link to be removed.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-Id: <20201229175619.6051-7-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
4 days agomacio: move OpenPIC inside macio-newworld device
Mark Cave-Ayland [Tue, 29 Dec 2020 17:56:17 +0000 (17:56 +0000)] 
macio: move OpenPIC inside macio-newworld device

The OpenPIC device is located within the macio device on real hardware so make it
a child of the macio-newworld device. This also removes the need for setting and
checking a separate PIC object property link on the macio-newworld device which
currently causes the automated QOM introspection tests to fail.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20201229175619.6051-6-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
4 days agomac_newworld: delay wiring of PCI IRQs in New World machine
Mark Cave-Ayland [Tue, 29 Dec 2020 17:56:16 +0000 (17:56 +0000)] 
mac_newworld: delay wiring of PCI IRQs in New World machine

In order to move the OpenPIC device to the macio device, the PCI bus needs to be
initialised before the macio device and also before wiring the OpenPIC IRQs.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20201229175619.6051-5-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
4 days agomacio: move heathrow PIC inside macio-oldworld device
Mark Cave-Ayland [Tue, 29 Dec 2020 17:56:15 +0000 (17:56 +0000)] 
macio: move heathrow PIC inside macio-oldworld device

The heathrow PIC is located within the macio device on real hardware so make it
a child of the macio-oldworld device. This also removes the need for setting and
checking a separate PIC object property link on the macio-oldworld device which
currently causes the automated QOM introspection tests to fail.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20201229175619.6051-4-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
4 days agomac_oldworld: move initialisation of grackle before heathrow
Mark Cave-Ayland [Tue, 29 Dec 2020 17:56:14 +0000 (17:56 +0000)] 
mac_oldworld: move initialisation of grackle before heathrow

In order to move the heathrow PIC to the macio device, the PCI bus needs to be
initialised before the macio device and also before wiring the PIC IRQs.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20201229175619.6051-3-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
4 days agomac_oldworld: remove duplicate bus check for PPC_INPUT(env)
Mark Cave-Ayland [Tue, 29 Dec 2020 17:56:13 +0000 (17:56 +0000)] 
mac_oldworld: remove duplicate bus check for PPC_INPUT(env)

This condition will have already been caught when wiring the heathrow PIC
IRQs to the CPU.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20201229175619.6051-2-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
4 days agotests/test-char.c: Wait for the chardev to connect in char_socket_client_dupid_test
Lukas Straub [Mon, 28 Dec 2020 15:09:02 +0000 (16:09 +0100)] 
tests/test-char.c: Wait for the chardev to connect in char_socket_client_dupid_test

A connecting chardev object has an additional reference by the connecting
thread, so if the chardev is still connecting by the end of the test,
then the chardev object won't be freed. This in turn means that the yank
instance won't be unregistered and when running the next test-case
yank_register_instance will abort, because the yank instance is
already/still registered.

Signed-off-by: Lukas Straub <lukasstraub2@web.de>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <1445e97a5800e3f2ba024ad52b500a0315701632.1609167865.git.lukasstraub2@web.de>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
4 days agoio: Document qmp oob suitability of qio_channel_shutdown and io_shutdown
Lukas Straub [Mon, 28 Dec 2020 15:08:59 +0000 (16:08 +0100)] 
io: Document qmp oob suitability of qio_channel_shutdown and io_shutdown

Migration and yank code assume that qio_channel_shutdown is thread
-safe and can be called from qmp oob handler. Document this after
checking the code.

Signed-off-by: Lukas Straub <lukasstraub2@web.de>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <32b8c27e256da043f0f00db05bd7ab8fbc506070.1609167865.git.lukasstraub2@web.de>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
4 days agoio/channel-tls.c: make qio_channel_tls_shutdown thread-safe
Lukas Straub [Mon, 28 Dec 2020 15:08:55 +0000 (16:08 +0100)] 
io/channel-tls.c: make qio_channel_tls_shutdown thread-safe

Make qio_channel_tls_shutdown thread-safe by using atomics when
accessing tioc->shutdown.

Signed-off-by: Lukas Straub <lukasstraub2@web.de>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <5bd8733f583f3558b32250fd0eb576b7aa756485.1609167865.git.lukasstraub2@web.de>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
4 days agomigration: Add yank feature
Lukas Straub [Mon, 28 Dec 2020 15:08:52 +0000 (16:08 +0100)] 
migration: Add yank feature

Register yank functions on sockets to shut them down.

Signed-off-by: Lukas Straub <lukasstraub2@web.de>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <484c6a14cc2506bebedd5a237259b91363ff8f88.1609167865.git.lukasstraub2@web.de>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
4 days agochardev/char-socket.c: Add yank feature
Lukas Straub [Mon, 28 Dec 2020 15:08:48 +0000 (16:08 +0100)] 
chardev/char-socket.c: Add yank feature

Register a yank function to shutdown the socket on yank.

Signed-off-by: Lukas Straub <lukasstraub2@web.de>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <1f4eeed1d066c6cbb8d05ffa9585f6e87b34aac6.1609167865.git.lukasstraub2@web.de>
Acked-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
4 days agoblock/nbd.c: Add yank feature
Lukas Straub [Mon, 28 Dec 2020 15:08:44 +0000 (16:08 +0100)] 
block/nbd.c: Add yank feature

Register a yank function which shuts down the socket and sets
s->state = NBD_CLIENT_QUIT. This is the same behaviour as if an
error occured.

Signed-off-by: Lukas Straub <lukasstraub2@web.de>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <b73eb07db6d1fcd00667beb13ae6117260f002c3.1609167865.git.lukasstraub2@web.de>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
4 days agoIntroduce yank feature
Lukas Straub [Mon, 28 Dec 2020 15:08:41 +0000 (16:08 +0100)] 
Introduce yank feature

The yank feature allows to recover from hanging qemu by "yanking"
at various parts. Other qemu systems can register themselves and
multiple yank functions. Then all yank functions for selected
instances can be called by the 'yank' out-of-band qmp command.
Available instances can be queried by a 'query-yank' oob command.

Signed-off-by: Lukas Straub <lukasstraub2@web.de>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <69934ceacfd33a7dfe53db145ecc630ad39ee47c.1609167865.git.lukasstraub2@web.de>
Acked-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
4 days agoMerge remote-tracking branch 'remotes/bonzini-gitlab/tags/for-upstream' into staging
Peter Maydell [Tue, 12 Jan 2021 23:22:53 +0000 (23:22 +0000)] 
Merge remote-tracking branch 'remotes/bonzini-gitlab/tags/for-upstream' into staging

* UI configury cleanups and Meson conversion
* scripts/gdb improvements
* WHPX cleanups and fixes
* cirrus win32 CI improvements
* meson gnutls workaround

# gpg: Signature made Tue 12 Jan 2021 16:05:19 GMT
# gpg:                using RSA key F13338574B662389866C7682BFFBD25F78C7AE83
# gpg:                issuer "pbonzini@redhat.com"
# gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full]
# gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>" [full]
# Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
#      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83

* remotes/bonzini-gitlab/tags/for-upstream:
  target/i386: Use X86Seg enum for segment registers
  configure: quote command line arguments in config.status
  configure: move Cocoa incompatibility checks to Meson
  configure: move GTK+ detection to Meson
  configure: move X11 detection to Meson
  gtk: remove CONFIG_GTK_GL
  cocoa: do not enable coreaudio automatically
  virtio-scsi: trace events
  meson: Propagate gnutls dependency
  Docs/RCU: Correct sample code of qatomic_rcu_set
  scripts/gdb: implement 'qemu bt'
  scripts/gdb: fix 'qemu coroutine' when users selects a non topmost stack frame
  meson: fix Cocoa option in summary
  whpx: move whpx_lapic_state from header to c file
  maintainers: Add me as Windows Hosted Continuous Integration maintainer
  cirrus/msys2: Cache msys2 mingw in a better way.
  cirrus/msys2: Exit powershell with $LastExitCode
  whpx: move internal definitions to whpx-internal.h
  whpx: rename whp-dispatch to whpx-internal.h
  meson: do not use CONFIG_VIRTFS

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 days agoMerge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20210112-1' into...
Peter Maydell [Tue, 12 Jan 2021 21:23:25 +0000 (21:23 +0000)] 
Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20210112-1' into staging

target-arm queue:
 * arm: Support emulation of ARMv8.4-TTST extension
 * arm: Update cpu.h ID register field definitions
 * arm: Fix breakage of XScale instruction emulation
 * hw/net/lan9118: Fix RX Status FIFO PEEK value
 * npcm7xx: Add ADC and PWM emulation
 * ui/cocoa: Make "open docs" help menu entry work again when binary
   is run from the build tree
 * ui/cocoa: Fix openFile: deprecation on Big Sur
 * docs: Add qemu-storage-daemon(1) manpage to meson.build

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

* remotes/pmaydell/tags/pull-target-arm-20210112-1:
  ui/cocoa: Fix openFile: deprecation on Big Sur
  hw/*: Use type casting for SysBusDevice in NPCM7XX
  hw/misc: Add QTest for NPCM7XX PWM Module
  hw/misc: Add a PWM module for NPCM7XX
  hw/adc: Add an ADC module for NPCM7XX
  hw/timer: Refactor NPCM7XX Timer to use CLK clock
  hw/misc: Add clock converter in NPCM7XX CLK module
  hw/net/lan9118: Add symbolic constants for register offsets
  hw/net/lan9118: Fix RX Status FIFO PEEK value
  target/arm: Don't decode insns in the XScale/iWMMXt space as cp insns
  docs: Add qemu-storage-daemon(1) manpage to meson.build
  ui/cocoa: Update path to docs in build tree
  target/arm: add aarch32 ID register fields to cpu.h
  target/arm: add aarch64 ID register fields to cpu.h
  target/arm: add descriptions of CLIDR_EL1, CCSIDR_EL1, CTR_EL0 to cpu.h
  target/arm: make ARMCPU.ctr 64-bit
  target/arm: make ARMCPU.clidr 64-bit
  target/arm: fix typo in cpu.h ID_AA64PFR1 field name
  target/arm: enable Small Translation tables in max CPU
  target/arm: ARMv8.4-TTST extension

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 days agoui/cocoa: Fix openFile: deprecation on Big Sur
Roman Bolshakov [Sat, 2 Jan 2021 15:07:21 +0000 (18:07 +0300)] 
ui/cocoa: Fix openFile: deprecation on Big Sur

ui/cocoa.m:1188:44: warning: 'openFile:' is deprecated: first deprecated in macOS 11.0 - Use -[NSWorkspace openURL:] instead.
      [-Wdeprecated-declarations]
        if ([[NSWorkspace sharedWorkspace] openFile: full_file_path] == YES) {
                                           ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSWorkspace.h:350:1: note:
      'openFile:' has been explicitly marked deprecated here
- (BOOL)openFile:(NSString *)fullPath API_DEPRECATED("Use -[NSWorkspace openURL:] instead.", macos(10.0, 11.0));
^

Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20210102150718.47618-1-r.bolshakov@yadro.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 days agohw/*: Use type casting for SysBusDevice in NPCM7XX
Hao Wu [Fri, 8 Jan 2021 19:09:45 +0000 (11:09 -0800)] 
hw/*: Use type casting for SysBusDevice in NPCM7XX

A device shouldn't access its parent object which is QOM internal.
Instead it should use type cast for this purporse. This patch fixes this
issue for all NPCM7XX Devices.

Signed-off-by: Hao Wu <wuhaotsh@google.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20210108190945.949196-7-wuhaotsh@google.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 days agohw/misc: Add QTest for NPCM7XX PWM Module
Hao Wu [Fri, 8 Jan 2021 19:09:44 +0000 (11:09 -0800)] 
hw/misc: Add QTest for NPCM7XX PWM Module

We add a qtest for the PWM in the previous patch. It proves it works as
expected.

Reviewed-by: Havard Skinnemoen <hskinnemoen@google.com>
Reviewed-by: Tyrone Ting <kfting@nuvoton.com>
Signed-off-by: Hao Wu <wuhaotsh@google.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20210108190945.949196-6-wuhaotsh@google.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 days agohw/misc: Add a PWM module for NPCM7XX
Hao Wu [Fri, 8 Jan 2021 19:09:43 +0000 (11:09 -0800)] 
hw/misc: Add a PWM module for NPCM7XX

The PWM module is part of NPCM7XX module. Each NPCM7XX module has two
identical PWM modules. Each module contains 4 PWM entries. Each PWM has
two outputs: frequency and duty_cycle. Both are computed using inputs
from software side.

This module does not model detail pulse signals since it is expensive.
It also does not model interrupts and watchdogs that are dependant on
the detail models. The interfaces for these are left in the module so
that anyone in need for these functionalities can implement on their
own.

The user can read the duty cycle and frequency using qom-get command.

Reviewed-by: Havard Skinnemoen <hskinnemoen@google.com>
Reviewed-by: Tyrone Ting <kfting@nuvoton.com>
Signed-off-by: Hao Wu <wuhaotsh@google.com>
Message-id: 20210108190945.949196-5-wuhaotsh@google.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 days agohw/adc: Add an ADC module for NPCM7XX
Hao Wu [Fri, 8 Jan 2021 19:09:42 +0000 (11:09 -0800)] 
hw/adc: Add an ADC module for NPCM7XX

The ADC is part of NPCM7XX Module. Its behavior is controled by the
ADC_CON register. It converts one of the eight analog inputs into a
digital input and stores it in the ADC_DATA register when enabled.

Users can alter input value by using qom-set QMP command.

Reviewed-by: Havard Skinnemoen <hskinnemoen@google.com>
Reviewed-by: Tyrone Ting <kfting@nuvoton.com>
Signed-off-by: Hao Wu <wuhaotsh@google.com>
Message-id: 20210108190945.949196-4-wuhaotsh@google.com
[PMM: Added missing hw/adc/trace.h file]
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 days agohw/timer: Refactor NPCM7XX Timer to use CLK clock
Hao Wu [Fri, 8 Jan 2021 19:09:41 +0000 (11:09 -0800)] 
hw/timer: Refactor NPCM7XX Timer to use CLK clock

This patch makes NPCM7XX Timer to use a the timer clock generated by the
CLK module instead of the magic number TIMER_REF_HZ.

Reviewed-by: Havard Skinnemoen <hskinnemoen@google.com>
Reviewed-by: Tyrone Ting <kfting@nuvoton.com>
Signed-off-by: Hao Wu <wuhaotsh@google.com>
Message-id: 20210108190945.949196-3-wuhaotsh@google.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 days agohw/misc: Add clock converter in NPCM7XX CLK module
Hao Wu [Fri, 8 Jan 2021 19:09:40 +0000 (11:09 -0800)] 
hw/misc: Add clock converter in NPCM7XX CLK module

This patch allows NPCM7XX CLK module to compute clocks that are used by
other NPCM7XX modules.

Add a new struct NPCM7xxClockConverterState which represents a
single converter.  Each clock converter in CLK module represents one
converter in NPCM7XX CLK Module(PLL, SEL or Divider). Each converter
takes one or more input clocks and converts them into one output clock.
They form a clock hierarchy in the CLK module and are responsible for
outputing clocks for various other modules in an NPCM7XX SoC.

Each converter has a function pointer called "convert" which represents
the unique logic for that converter.

The clock contains two initialization information: ConverterInitInfo and
ConverterConnectionInfo. They represent the vertices and edges in the
clock diagram respectively.

Reviewed-by: Havard Skinnemoen <hskinnemoen@google.com>
Reviewed-by: Tyrone Ting <kfting@nuvoton.com>
Signed-off-by: Hao Wu <wuhaotsh@google.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20210108190945.949196-2-wuhaotsh@google.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
4 days agohw/net/lan9118: Add symbolic constants for register offsets
Peter Maydell [Fri, 8 Jan 2021 18:04:01 +0000 (18:04 +0000)] 
hw/net/lan9118: Add symbolic constants for register offsets

The lan9118 code mostly uses symbolic constants for register offsets;
the exceptions are those which the datasheet doesn't give an official
symbolic name to.

Add some names for the registers which don't already have them, based
on the longer names they are given in the memory map.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20210108180401.2263-3-peter.maydell@linaro.org

4 days agohw/net/lan9118: Fix RX Status FIFO PEEK value
Peter Maydell [Fri, 8 Jan 2021 18:04:00 +0000 (18:04 +0000)] 
hw/net/lan9118: Fix RX Status FIFO PEEK value

A copy-and-paste error meant that the return value for register offset 0x44
(the RX Status FIFO PEEK register) returned a byte from a bogus offset in
the rx status FIFO. Fix the typo.

Cc: qemu-stable@nongnu.org
Fixes: https://bugs.launchpad.net/qemu/+bug/1904954
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20210108180401.2263-2-peter.maydell@linaro.org

4 days agotarget/arm: Don't decode insns in the XScale/iWMMXt space as cp insns
Peter Maydell [Fri, 8 Jan 2021 19:51:57 +0000 (19:51 +0000)] 
target/arm: Don't decode insns in the XScale/iWMMXt space as cp insns

In commit cd8be50e58f63413c0 we converted the A32 coprocessor
insns to decodetree. This accidentally broke XScale/iWMMXt insns,
because it moved the handling of "cp insns which are handled
by looking up the cp register in the hashtable" from after the
call to the legacy disas_xscale_insn() decode to before it,
with the result that all XScale/iWMMXt insns now UNDEF.

Update valid_cp() so that it knows that on XScale cp 0 and 1
are not standard coprocessor instructions; this will cause
the decodetree trans_ functions to ignore them, so that
execution will correctly get through to the legacy decode again.

Cc: qemu-stable@nongnu.org
Reported-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Message-id: 20210108195157.32067-1-peter.maydell@linaro.org

5 days agotarget/i386: Use X86Seg enum for segment registers
Philippe Mathieu-Daudé [Sat, 9 Jan 2021 23:34:27 +0000 (00:34 +0100)] 
target/i386: Use X86Seg enum for segment registers

Use the dedicated X86Seg enum type for segment registers.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20210109233427.749748-1-f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 days agoconfigure: quote command line arguments in config.status
Paolo Bonzini [Tue, 8 Sep 2020 11:20:45 +0000 (13:20 +0200)] 
configure: quote command line arguments in config.status

Make config.status generation a bit more robust.  (The quote_sh
function will also be reused to parse configure's command line
arguments in an external script driven by Meson build option
introspection).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 days agoconfigure: move Cocoa incompatibility checks to Meson
Paolo Bonzini [Thu, 7 Jan 2021 13:04:00 +0000 (14:04 +0100)] 
configure: move Cocoa incompatibility checks to Meson

The cocoa UI code currently assumes it is always the active UI
and does not interact well with other UI frontend code.  Move
the relevant checks to Meson now that all other frontends
have become Meson options.  This way, SDL/GTK+/Cocoa can be
parsed entirely by scripts/configure-parse-buildoptions.pl.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 days agoconfigure: move GTK+ detection to Meson
Paolo Bonzini [Thu, 7 Jan 2021 13:02:29 +0000 (14:02 +0100)] 
configure: move GTK+ detection to Meson

This also allows removing CONFIG_NEED_X11, all the ingredients
can be computed easily in meson.build.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 days agoconfigure: move X11 detection to Meson
Paolo Bonzini [Thu, 7 Jan 2021 12:54:22 +0000 (13:54 +0100)] 
configure: move X11 detection to Meson

For now move the logic verbatim.  GTK+ actually has a hard requirement
on X11 if gtk+x11 is present, but we will sort that out later.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 days agogtk: remove CONFIG_GTK_GL
Paolo Bonzini [Thu, 7 Jan 2021 12:46:32 +0000 (13:46 +0100)] 
gtk: remove CONFIG_GTK_GL

CONFIG_GTK_GL is defined if OpenGL is present and GTK+
is 3.16 or newer.  Since GTK+ 3.22 is the minimum supported
version, just use CONFIG_OPENGL instead.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 days agococoa: do not enable coreaudio automatically
Paolo Bonzini [Thu, 7 Jan 2021 12:32:12 +0000 (13:32 +0100)] 
cocoa: do not enable coreaudio automatically

Remove the automagic connection between --enable-cocoa
and enabling coreaudio in audio_drv_list.  It can be
overridden anyway just by placing --enable-cocoa before
--audio-drv-list.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 days agovirtio-scsi: trace events
Hannes Reinecke [Mon, 16 Nov 2020 18:31:12 +0000 (19:31 +0100)] 
virtio-scsi: trace events

Add trace events for virtio command and response tracing.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Message-Id: <20201116183114.55703-2-hare@suse.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 days agomeson: Propagate gnutls dependency
Roman Bolshakov [Sat, 2 Jan 2021 12:52:13 +0000 (15:52 +0300)] 
meson: Propagate gnutls dependency

crypto/tlscreds.h includes GnuTLS headers if CONFIG_GNUTLS is set, but
GNUTLS_CFLAGS, that describe include path, are not propagated
transitively to all users of crypto and build fails if GnuTLS headers
reside in non-standard directory (which is a case for homebrew on Apple
Silicon).

Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
Message-Id: <20210102125213.41279-1-r.bolshakov@yadro.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 days agoDocs/RCU: Correct sample code of qatomic_rcu_set
Keqian Zhu [Wed, 6 Jan 2021 07:17:10 +0000 (15:17 +0800)] 
Docs/RCU: Correct sample code of qatomic_rcu_set

Correct sample code to avoid confusing readers.

Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
Cc: qemu-trivial@nongnu.org
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Message-Id: <20210106071710.15836-1-zhukeqian1@huawei.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 days agoscripts/gdb: implement 'qemu bt'
Maxim Levitsky [Thu, 17 Dec 2020 15:54:36 +0000 (17:54 +0200)] 
scripts/gdb: implement 'qemu bt'

This script first runs the regular gdb's 'bt' command, and then if we are in a
coroutine it prints the coroutines backtraces in the order in which they
were called.

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
Message-Id: <20201217155436.927320-3-mlevitsk@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 days agoscripts/gdb: fix 'qemu coroutine' when users selects a non topmost stack frame
Maxim Levitsky [Thu, 17 Dec 2020 15:54:35 +0000 (17:54 +0200)] 
scripts/gdb: fix 'qemu coroutine' when users selects a non topmost stack frame

The code that dumps the stack frame works like that:
* save current registers
* overwrite current registers (including rip/rsp) with coroutine snapshot
  in the jmpbuf
* print backtrace
* restore the saved registers.

If the user has currently selected a non topmost stack frame in gdb,
the above code will still restore the selected frame registers,
but the gdb will then lose the selected frame index, which makes it impossible
to switch back to frame 0, to continue debugging the executable.

Therefore switch temporarily to the topmost frame of the stack
for the above code.

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
Message-Id: <20201217155436.927320-2-mlevitsk@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 days agomeson: fix Cocoa option in summary
Chris Hofstaedtler [Wed, 30 Dec 2020 22:16:23 +0000 (23:16 +0100)] 
meson: fix Cocoa option in summary

Cocoa support was always shown as "no", even it if was enabled.

Fixes: b4e312e953b ("configure: move cocoa option to Meson")
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Chris Hofstaedtler <chris@hofstaedtler.name>
Message-Id: <20201230221623.60423-1-chris@hofstaedtler.name>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 days agowhpx: move whpx_lapic_state from header to c file
Yonggang Luo [Thu, 7 Jan 2021 10:19:19 +0000 (02:19 -0800)] 
whpx: move whpx_lapic_state from header to c file

This struct only used in whpx-apic.c, there is no need
expose it in whpx.h.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Message-Id: <20210107101919.80-6-luoyonggang@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 days agomaintainers: Add me as Windows Hosted Continuous Integration maintainer
Yonggang Luo [Thu, 7 Jan 2021 10:19:17 +0000 (02:19 -0800)] 
maintainers: Add me as Windows Hosted Continuous Integration maintainer

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210107101919.80-4-luoyonggang@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 days agocirrus/msys2: Cache msys2 mingw in a better way.
Yonggang Luo [Thu, 7 Jan 2021 10:19:16 +0000 (02:19 -0800)] 
cirrus/msys2: Cache msys2 mingw in a better way.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Message-Id: <20210107101919.80-3-luoyonggang@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 days agocirrus/msys2: Exit powershell with $LastExitCode
Yonggang Luo [Thu, 7 Jan 2021 10:19:15 +0000 (02:19 -0800)] 
cirrus/msys2: Exit powershell with $LastExitCode

Currently if we don't exit with $LastExitCode manually,
the cirrus would not report the build/testing failure.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210107101919.80-2-luoyonggang@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 days agowhpx: move internal definitions to whpx-internal.h
Paolo Bonzini [Sat, 19 Dec 2020 09:06:37 +0000 (04:06 -0500)] 
whpx: move internal definitions to whpx-internal.h

Only leave the external interface in sysemu/whpx.h.  whpx_apic_in_platform
is moved to a .c file because it needs whpx_state.

Reported-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20201219090637.1700900-3-pbonzini@redhat.com>

5 days agowhpx: rename whp-dispatch to whpx-internal.h
Paolo Bonzini [Sat, 19 Dec 2020 09:06:36 +0000 (04:06 -0500)] 
whpx: rename whp-dispatch to whpx-internal.h

Rename the file in preparation for moving more implementation-internal
definitions to it.  The build is still broken though.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20201219090637.1700900-2-pbonzini@redhat.com>

5 days agomeson: do not use CONFIG_VIRTFS
Paolo Bonzini [Thu, 7 Jan 2021 14:57:18 +0000 (15:57 +0100)] 
meson: do not use CONFIG_VIRTFS

CONFIG_VIRTFS is not anymore part of the config_host dictionary.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
5 days agodocs: Add qemu-storage-daemon(1) manpage to meson.build
Peter Maydell [Fri, 8 Jan 2021 16:14:15 +0000 (16:14 +0000)] 
docs: Add qemu-storage-daemon(1) manpage to meson.build

In commit 1982e1602d15 we added a new qemu-storage-daemon(1) manpage.
At the moment new manpages have to be listed both in the conf.py for
Sphinx and also in docs/meson.build for Meson. We forgot the second
of those -- correct the omission.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 20210108161416.21129-2-peter.maydell@linaro.org

5 days agoui/cocoa: Update path to docs in build tree
Roman Bolshakov [Fri, 8 Jan 2021 21:38:15 +0000 (00:38 +0300)] 
ui/cocoa: Update path to docs in build tree

QEMU documentation can't be opened if QEMU is run from build tree
because executables are placed in the top of build tree after conversion
to meson.

Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20210108213815.64678-1-r.bolshakov@yadro.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 days agotarget/arm: add aarch32 ID register fields to cpu.h
Leif Lindholm [Fri, 8 Jan 2021 18:51:54 +0000 (18:51 +0000)] 
target/arm: add aarch32 ID register fields to cpu.h

Add entries present in ARM DDI 0487F.c (August 2020).

Signed-off-by: Leif Lindholm <leif@nuviainc.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Message-id: 20210108185154.8108-7-leif@nuviainc.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 days agotarget/arm: add aarch64 ID register fields to cpu.h
Leif Lindholm [Fri, 8 Jan 2021 18:51:53 +0000 (18:51 +0000)] 
target/arm: add aarch64 ID register fields to cpu.h

Add entries present in ARM DDI 0487F.c (August 2020).

Signed-off-by: Leif Lindholm <leif@nuviainc.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Message-id: 20210108185154.8108-6-leif@nuviainc.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 days agotarget/arm: add descriptions of CLIDR_EL1, CCSIDR_EL1, CTR_EL0 to cpu.h
Leif Lindholm [Fri, 8 Jan 2021 18:51:52 +0000 (18:51 +0000)] 
target/arm: add descriptions of CLIDR_EL1, CCSIDR_EL1, CTR_EL0 to cpu.h

Signed-off-by: Leif Lindholm <leif@nuviainc.com>
Reviewed-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Message-id: 20210108185154.8108-5-leif@nuviainc.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 days agotarget/arm: make ARMCPU.ctr 64-bit
Leif Lindholm [Fri, 8 Jan 2021 18:51:51 +0000 (18:51 +0000)] 
target/arm: make ARMCPU.ctr 64-bit

When FEAT_MTE is implemented, the AArch64 view of CTR_EL0 adds the
TminLine field in bits [37:32].
Extend the ctr field to be able to hold this context.

Signed-off-by: Leif Lindholm <leif@nuviainc.com>
Reviewed-by: Hao Wu <wuhaotsh@google.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Message-id: 20210108185154.8108-4-leif@nuviainc.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 days agotarget/arm: make ARMCPU.clidr 64-bit
Leif Lindholm [Fri, 8 Jan 2021 18:51:50 +0000 (18:51 +0000)] 
target/arm: make ARMCPU.clidr 64-bit

The AArch64 view of CLIDR_EL1 extends the ICB field to include also bit
32, as well as adding a Ttype<n> field when FEAT_MTE is implemented.
Extend the clidr field to be able to hold this context.

Signed-off-by: Leif Lindholm <leif@nuviainc.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Message-id: 20210108185154.8108-3-leif@nuviainc.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 days agotarget/arm: fix typo in cpu.h ID_AA64PFR1 field name
Leif Lindholm [Fri, 8 Jan 2021 18:51:49 +0000 (18:51 +0000)] 
target/arm: fix typo in cpu.h ID_AA64PFR1 field name

SBSS -> SSBS

Signed-off-by: Leif Lindholm <leif@nuviainc.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Message-id: 20210108185154.8108-2-leif@nuviainc.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 days agotarget/arm: enable Small Translation tables in max CPU
Rémi Denis-Courmont [Fri, 8 Jan 2021 09:08:17 +0000 (11:08 +0200)] 
target/arm: enable Small Translation tables in max CPU

Signed-off-by: Rémi Denis-Courmont <remi.denis.courmont@huawei.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 days agotarget/arm: ARMv8.4-TTST extension
Rémi Denis-Courmont [Fri, 8 Jan 2021 09:08:16 +0000 (11:08 +0200)] 
target/arm: ARMv8.4-TTST extension

This adds for the Small Translation tables extension in AArch64 state.

Signed-off-by: Rémi Denis-Courmont <remi.denis.courmont@huawei.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 days agoMerge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2021-01-11v2...
Peter Maydell [Mon, 11 Jan 2021 15:15:35 +0000 (15:15 +0000)] 
Merge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2021-01-11v2' into staging

* Fuzzer improvements
* Add OpenSUSE leap to the gitlab-CI
* Some fixes to get our CI "green" again
* Some initial patches to update bsd-user

# gpg: Signature made Mon 11 Jan 2021 14:00:07 GMT
# 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-2021-01-11v2:
  fuzz: map all BARs and enable PCI devices
  tests/acceptance: Fix race conditions in s390x tests & skip fedora on gitlab-CI
  bsd-user: Update strace.list for FreeBSD's latest syscalls
  bsd-user: move strace OS/arch dependent code to host/arch dirs
  bsd-user: regenerate FreeBSD's system call numbers
  fuzz: heuristic split write based on past IOs
  fuzz: add minimization options
  fuzz: set bits in operand of write/out to zero
  fuzz: remove IO commands iteratively
  fuzz: split write operand using binary approach
  fuzz: double the IOs to remove for every loop
  fuzz: accelerate non-crash detection
  util/oslib-win32: Fix _aligned_malloc() arguments order
  qtest/libqtest: fix heap-buffer-overflow in qtest_cb_for_every_machine()
  gitlab-ci.yml: Add openSUSE Leap 15.2 for gitlab CI/CD

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 days agofuzz: map all BARs and enable PCI devices
Alexander Bulekov [Mon, 21 Dec 2020 18:12:03 +0000 (13:12 -0500)] 
fuzz: map all BARs and enable PCI devices

Prior to this patch, the fuzzer found inputs to map PCI device BARs and
enable the device. While it is nice that the fuzzer can do this, it
added significant overhead, since the fuzzer needs to map all the
BARs (regenerating the memory topology), at the start of each input.
With this patch, we do this once, before fuzzing, mitigating some of
this overhead.

Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20201221181203.1853-1-alxndr@bu.edu>
Signed-off-by: Thomas Huth <thuth@redhat.com>