]> Git Repo - qemu.git/log
qemu.git
4 years agotarget/mips/cpu: Allow the CPU to use dynamic frequencies
Philippe Mathieu-Daudé [Mon, 12 Oct 2020 09:57:54 +0000 (11:57 +0200)]
target/mips/cpu: Allow the CPU to use dynamic frequencies

Use the Clock API and let the CPU object have an input clock.

If no clock is connected, keep using the default frequency of
200 MHz used since the introduction of the 'r4k' machine in
commit 6af0bf9c7c3.

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <20201012095804.3335117[email protected]>

4 years agotarget/mips/cpu: Make cp0_count_rate a property
Philippe Mathieu-Daudé [Mon, 12 Oct 2020 09:57:53 +0000 (11:57 +0200)]
target/mips/cpu: Make cp0_count_rate a property

Since not all CPU implementations use a cores use a CP0 timer
at half the frequency of the CPU, make this variable a property.

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <20201012095804.3335117[email protected]>

4 years agotarget/mips/cpu: Calculate the CP0 timer period using the CPU frequency
Philippe Mathieu-Daudé [Mon, 12 Oct 2020 09:57:52 +0000 (11:57 +0200)]
target/mips/cpu: Calculate the CP0 timer period using the CPU frequency

The CP0 timer period is a function of the CPU frequency.
Start using the default values, which will be replaced by
properties in the next commits.

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Jiaxun Yang <[email protected]>
Message-Id: <20201012095804.3335117[email protected]>

4 years agotarget/mips: Move cp0_count_ns to CPUMIPSState
Philippe Mathieu-Daudé [Mon, 12 Oct 2020 09:57:51 +0000 (11:57 +0200)]
target/mips: Move cp0_count_ns to CPUMIPSState

Currently the CP0 timer period is fixed at 10 ns, corresponding
to a fixed CPU frequency of 200 MHz (using half the speed of the
CPU).

In few commits we will be able to use a different CPU frequency.
In preparation, move the cp0_count_ns variable to CPUMIPSState
so we can modify it.

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Jiaxun Yang <[email protected]>
Message-Id: <20201012095804.3335117[email protected]>

4 years agotarget/mips/cp0_timer: Document TIMER_PERIOD origin
Philippe Mathieu-Daudé [Mon, 12 Oct 2020 09:57:50 +0000 (11:57 +0200)]
target/mips/cp0_timer: Document TIMER_PERIOD origin

TIMER_PERIOD value of '10 ns' can be explained looking at
commit 6af0bf9c7c3doc, where the CPU frequency is 200 MHz
and CP0 default count rate is half the frequency of the
CPU. Document that.

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <20201012095804.3335117[email protected]>

4 years agotarget/mips/cp0_timer: Explicit unit in variable name
Philippe Mathieu-Daudé [Mon, 12 Oct 2020 09:57:49 +0000 (11:57 +0200)]
target/mips/cp0_timer: Explicit unit in variable name

Name variables holding nanoseconds with the '_ns' suffix.

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Aleksandar Markovic <[email protected]>
Message-Id: <20201012095804.3335117[email protected]>

4 years agotarget/mips: Move cpu_mips_get_random() with CP0 helpers
Philippe Mathieu-Daudé [Mon, 12 Oct 2020 09:57:48 +0000 (11:57 +0200)]
target/mips: Move cpu_mips_get_random() with CP0 helpers

The get_random() helper uses the CP0_Wired register, which is
unrelated to the CP0_Count register used as timer.
Commit e16fe40c872 ("Move the MIPS CPU timer in a separate file")
incorrectly moved this get_random() helper with timer specific
code. Move it back to generic CP0 helpers.

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Aleksandar Markovic <[email protected]>
Reviewed-by: Luc Michel <[email protected]>
Message-Id: <20201012095804.3335117[email protected]>

4 years agotarget/mips/op_helper: Log unimplemented cache opcode
Philippe Mathieu-Daudé [Thu, 13 Aug 2020 17:48:32 +0000 (19:48 +0200)]
target/mips/op_helper: Log unimplemented cache opcode

In case the guest uses a cache opcode we are not expecting,
log it to give us a chance to notice it, in case we should
actually do something.

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Reviewed-by: Jiaxun Yang <[email protected]>
Message-Id: <20200813181527[email protected]>

4 years agotarget/mips/op_helper: Document Invalidate/Writeback opcodes as no-op
Philippe Mathieu-Daudé [Thu, 13 Aug 2020 17:49:22 +0000 (19:49 +0200)]
target/mips/op_helper: Document Invalidate/Writeback opcodes as no-op

QEMU does not model caches, so there is not much to do with the
Invalidate/Writeback opcodes. Make it explicit adding a comment.

Suggested-by: Jiaxun Yang <[email protected]>
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Reviewed-by: Jiaxun Yang <[email protected]>
Message-Id: <20200813181527[email protected]>

4 years agotarget/mips/op_helper: Convert multiple if() to switch case
Philippe Mathieu-Daudé [Thu, 13 Aug 2020 17:48:49 +0000 (19:48 +0200)]
target/mips/op_helper: Convert multiple if() to switch case

The cache operation is encoded in bits [20:18] of the instruction.
The 'op' argument of helper_cache() contains the bits [20:16].
Extract the 3 bits and parse them using a switch case. This allow
us to handle multiple cache types (the cache type is encoded in
bits [17:16]).

Previously the if() block was only checking the D-Cache (Primary
Data or Unified Primary). Now we also handle the I-Cache (Primary
Instruction), S-Cache (Secondary) and T-Cache (Terciary).

Reported-by: Jiaxun Yang <[email protected]>
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Reviewed-by: Jiaxun Yang <[email protected]>
Message-Id: <20200813181527[email protected]>

4 years agotarget/mips: Add loongson-ext lsdc2 group of instructions
Jiaxun Yang [Fri, 16 Oct 2020 06:51:56 +0000 (14:51 +0800)]
target/mips: Add loongson-ext lsdc2 group of instructions

LDC2/SDC2 opcodes have been rewritten as "load & store with offset"
group of instructions by loongson-ext ASE.

This patch add implementation of these instructions:

  gslbx: load 1 bytes to GPR
  gslhx: load 2 bytes to GPR
  gslwx: load 4 bytes to GPR
  gsldx: load 8 bytes to GPR
  gslwxc1: load 4 bytes to FPR
  gsldxc1: load 8 bytes to FPR
  gssbx: store 1 bytes from GPR
  gsshx: store 2 bytes from GPR
  gsswx: store 4 bytes from GPR
  gssdx: store 8 bytes from GPR
  gsswxc1: store 4 bytes from FPR
  gssdxc1: store 8 bytes from FPR

Details of Loongson-EXT is here:
https://github.com/FlyGoat/loongson-insn/blob/master/loongson-ext.md

Signed-off-by: Jiaxun Yang <[email protected]>
Signed-off-by: Huacai Chen <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <1602831120[email protected]>

4 years agotarget/mips: Add loongson-ext lswc2 group of instructions (Part 2)
Jiaxun Yang [Fri, 16 Oct 2020 06:51:55 +0000 (14:51 +0800)]
target/mips: Add loongson-ext lswc2 group of instructions (Part 2)

LWC2 & SWC2 have been rewritten by Loongson EXT vendor ASE
as "load/store quad word" and "shifted load/store" groups of
instructions.

This patch add implementation of these instructions:

  gslwlc1: similar to lwl but RT is FPR instead of GPR
  gslwrc1: similar to lwr but RT is FPR instead of GPR
  gsldlc1: similar to ldl but RT is FPR instead of GPR
  gsldrc1: similar to ldr but RT is FPR instead of GPR
  gsswlc1: similar to swl but RT is FPR instead of GPR
  gsswrc1: similar to swr but RT is FPR instead of GPR
  gssdlc1: similar to sdl but RT is FPR instead of GPR
  gssdrc1: similar to sdr but RT is FPR instead of GPR

Details of Loongson-EXT is here:
https://github.com/FlyGoat/loongson-insn/blob/master/loongson-ext.md

Signed-off-by: Jiaxun Yang <[email protected]>
Signed-off-by: Huacai Chen <[email protected]>
Message-Id: <1602831120[email protected]>
[PMD: Reuse t1 on MIPS32, reintroduce t2/fp0]
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
4 years agotarget/mips: Add loongson-ext lswc2 group of instructions (Part 1)
Jiaxun Yang [Fri, 16 Oct 2020 06:51:54 +0000 (14:51 +0800)]
target/mips: Add loongson-ext lswc2 group of instructions (Part 1)

LWC2 & SWC2 have been rewritten by Loongson EXT vendor ASE
as "load/store quad word" and "shifted load/store" groups of
instructions.

This patch add implementation of these instructions:

  gslq: load 16 bytes to GPR
  gssq: store 16 bytes from GPR
  gslqc1: load 16 bytes to FPR
  gssqc1: store 16 bytes from FPR

Details of Loongson-EXT is here:
https://github.com/FlyGoat/loongson-insn/blob/master/loongson-ext.md

Signed-off-by: Jiaxun Yang <[email protected]>
Signed-off-by: Huacai Chen <[email protected]>
Message-Id: <1602831120[email protected]>
[PMD: Restrict t1 variable to TARGET_MIPS64, remove unused t2/fp0]
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
4 years agotarget/mips: Demacro helpers for <MAX|MAXA|MIN|MINA>.<D|S>
Aleksandar Markovic [Wed, 7 Oct 2020 20:37:19 +0000 (22:37 +0200)]
target/mips: Demacro helpers for <MAX|MAXA|MIN|MINA>.<D|S>

Remove function definitions via macros to achieve better code clarity.

Signed-off-by: Aleksandar Markovic <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <1602103041[email protected]>
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
4 years agotarget/mips: Demacro helpers for M<ADD|SUB>F.<D|S>
Aleksandar Markovic [Wed, 7 Oct 2020 20:37:18 +0000 (22:37 +0200)]
target/mips: Demacro helpers for M<ADD|SUB>F.<D|S>

Remove function definitions via macros to achieve better code clarity.

Signed-off-by: Aleksandar Markovic <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <1602103041[email protected]>
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
4 years agotarget/mips: Demacro helpers for <ABS|CHS>.<D|S|PS>
Aleksandar Markovic [Wed, 7 Oct 2020 20:37:17 +0000 (22:37 +0200)]
target/mips: Demacro helpers for <ABS|CHS>.<D|S|PS>

Remove function definitions via macros to achieve better code clarity.

Signed-off-by: Aleksandar Markovic <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <1602103041[email protected]>
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
4 years agotarget/mips: Fix some comment spelling errors
zhaolichang [Fri, 9 Oct 2020 06:44:41 +0000 (14:44 +0800)]
target/mips: Fix some comment spelling errors

There are many spelling errors in the comments in target/mips/.
Use spellcheck to check the spelling errors.

Signed-off-by: zhaolichang <[email protected]>
Reviewed-by: David Edmondson <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <20201009064449[email protected]>
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
4 years agoMerge remote-tracking branch 'remotes/ehabkost/tags/x86-next-pull-request' into staging
Peter Maydell [Fri, 16 Oct 2020 21:46:28 +0000 (22:46 +0100)]
Merge remote-tracking branch 'remotes/ehabkost/tags/x86-next-pull-request' into staging

x86 queue, 2020-10-15

Cleanups:
* Drop x86_cpu_get_supported_feature_word() forward declaration
  (Vitaly Kuznetsov)
* Delete kvm_allows_irq0_override() (Eduardo Habkost)
* Correct documentation of kvm_irqchip_*() (Eduardo Habkost)
* Fix FEATURE_HYPERV_EDX value in hyperv_passthrough case (Zhenyu Wang)

Deprecation:
* CPU model deprecation API (Robert Hoo)
* Mark Icelake-Client CPU models deprecated (Robert Hoo)

Bug fixes:
* Remove core_id assert check in CPUID 0x8000001E (Babu Moger)

# gpg: Signature made Thu 15 Oct 2020 17:43:58 BST
# gpg:                using RSA key 5A322FD5ABC4D3DBACCFD1AA2807936F984DC5A6
# gpg:                issuer "[email protected]"
# gpg: Good signature from "Eduardo Habkost <[email protected]>" [full]
# Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF  D1AA 2807 936F 984D C5A6

* remotes/ehabkost/tags/x86-next-pull-request:
  i386: Mark Icelake-Client CPU models deprecated
  cpu: Introduce CPU model deprecation API
  kvm: Correct documentation of kvm_irqchip_*()
  i386/kvm: Delete kvm_allows_irq0_override()
  i386/kvm: Remove IRQ routing support checks
  i386/kvm: Require KVM_CAP_IRQ_ROUTING
  target/i386: Remove core_id assert check in CPUID 0x8000001E
  i386/kvm: fix FEATURE_HYPERV_EDX value in hyperv_passthrough case
  i386: drop x86_cpu_get_supported_feature_word() forward declaration

Signed-off-by: Peter Maydell <[email protected]>
4 years agohw/core/clock: Add the clock_new helper function
Luc Michel [Mon, 12 Oct 2020 09:57:47 +0000 (11:57 +0200)]
hw/core/clock: Add the clock_new helper function

This function creates a clock and parents it to another object with a
given name. It calls clock_setup_canonical_path before returning the
new clock.

This function is useful to create clocks in devices when one doesn't
want to expose it at the qdev level (as an input or an output).

Suggested-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Luc Michel <[email protected]>
Tested-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <20201010135759[email protected]>
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
4 years agohw/qdev-clock: Display error hint when clock is missing from device
Philippe Mathieu-Daudé [Mon, 12 Oct 2020 09:57:46 +0000 (11:57 +0200)]
hw/qdev-clock: Display error hint when clock is missing from device

Instead of directly aborting, display a hint to help the developer
figure out the problem (likely trying to connect a clock to a device
pre-dating the Clock API, thus not expecting clocks).

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Luc Michel <[email protected]>
Reviewed-by: Damien Hedde <[email protected]>
Reviewed-by: Edgar E. Iglesias <[email protected]>
Message-Id: <20201012095804.3335117[email protected]>

4 years agoutil/cutils: Introduce freq_to_str() to display Hertz units
Philippe Mathieu-Daudé [Mon, 12 Oct 2020 09:57:44 +0000 (11:57 +0200)]
util/cutils: Introduce freq_to_str() to display Hertz units

Introduce freq_to_str() to convert frequency values in human
friendly units using the SI units for Hertz.

Suggested-by: Luc Michel <[email protected]>
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Alistair Francis <[email protected]>
Reviewed-by: Luc Michel <[email protected]>
Message-Id: <20201012095804.3335117[email protected]>

4 years agoMerge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
Peter Maydell [Fri, 16 Oct 2020 16:39:01 +0000 (17:39 +0100)]
Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging

Block layer patches:

- qemu-storage-daemon: Remove QemuOpts from --object parser
- monitor: Fix order in monitor_cleanup()
- Deprecate the sheepdog block driver

# gpg: Signature made Thu 15 Oct 2020 15:48:10 BST
# gpg:                using RSA key DC3DEB159A9AF95D3D7456FE7F09B272C88F2FD6
# gpg:                issuer "[email protected]"
# gpg: Good signature from "Kevin Wolf <[email protected]>" [full]
# Primary key fingerprint: DC3D EB15 9A9A F95D 3D74  56FE 7F09 B272 C88F 2FD6

* remotes/kevin/tags/for-upstream:
  block: deprecate the sheepdog block driver
  block: drop moderated sheepdog mailing list from MAINTAINERS file
  monitor: Fix order in monitor_cleanup()
  qemu-storage-daemon: Remove QemuOpts from --object parser
  qom: Add user_creatable_print_help_from_qdict()
  qom: Factor out helpers from user_creatable_print_help()
  keyval: Parse help options
  keyval: Fix parsing of ',' in value of implied key
  test-keyval: Demonstrate misparse of ',' with implied key
  keyval: Fix and clarify grammar

Signed-off-by: Peter Maydell <[email protected]>
4 years agoMerge remote-tracking branch 'remotes/kraxel/tags/modules-20201015-pull-request'...
Peter Maydell [Thu, 15 Oct 2020 21:20:46 +0000 (22:20 +0100)]
Merge remote-tracking branch 'remotes/kraxel/tags/modules-20201015-pull-request' into staging

modules: misc fixes & tweaks.
modules: build spice chardevs as module.

# gpg: Signature made Thu 15 Oct 2020 13:53:03 BST
# gpg:                using RSA key 4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <[email protected]>" [full]
# gpg:                 aka "Gerd Hoffmann <[email protected]>" [full]
# gpg:                 aka "Gerd Hoffmann (private) <[email protected]>" [full]
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/modules-20201015-pull-request:
  chardev/spice: build spice chardevs as module
  meson: add spice dependency to core spice source files.
  meson: add spice_headers dependency.
  chardev/spice: simplify chardev setup
  chardev/spice: make qemu_chr_open_spice_port static
  ui/spice-app: don't use qemu_chr_open_spice_port directly
  modules: update qom object module comment
  module: silence errors for module_load_qom_all().

Signed-off-by: Peter Maydell <[email protected]>
4 years agoMerge remote-tracking branch 'remotes/rth/tags/pull-mb-20201014' into staging
Peter Maydell [Thu, 15 Oct 2020 19:30:24 +0000 (20:30 +0100)]
Merge remote-tracking branch 'remotes/rth/tags/pull-mb-20201014' into staging

Implement rt signal frames for microblaze-linux-user
Adjust linux-user test for musl

# gpg: Signature made Thu 15 Oct 2020 05:50:00 BST
# gpg:                using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F
# gpg:                issuer "[email protected]"
# gpg: Good signature from "Richard Henderson <[email protected]>" [full]
# Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A  05C0 64DF 38E8 AF7E 215F

* remotes/rth/tags/pull-mb-20201014:
  linux-user/microblaze: Remove non-rt signal frames
  linux-user/microblaze: Implement rt signal frames
  tests/tcg/linux-test: Adjust getsockname for musl

Signed-off-by: Peter Maydell <[email protected]>
4 years agoMerge remote-tracking branch 'remotes/ehabkost/tags/machine-next-pull-request' into...
Peter Maydell [Thu, 15 Oct 2020 15:35:06 +0000 (16:35 +0100)]
Merge remote-tracking branch 'remotes/ehabkost/tags/machine-next-pull-request' into staging

machine + QOM queue, 2020-10-14

* Register some properties as class properties (Eduardo Habkost)
* authz-list-file: Fix crash when filename is not set (Eduardo Habkost)
* can-host-socketcan: Fix crash when 'if' option is not set (Eduardo Habkost)

# gpg: Signature made Wed 14 Oct 2020 15:33:17 BST
# gpg:                using RSA key 5A322FD5ABC4D3DBACCFD1AA2807936F984DC5A6
# gpg:                issuer "[email protected]"
# gpg: Good signature from "Eduardo Habkost <[email protected]>" [full]
# Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF  D1AA 2807 936F 984D C5A6

* remotes/ehabkost/tags/machine-next-pull-request:
  can-host-socketcan: Fix crash when 'if' option is not set
  authz-list-file: Fix crash when filename is not set
  vhost-user: Register "chardev" as class property
  vga-pci: Register "big-endian-framebuffer" as class property
  i386: Register most CPU properties as class properties
  input-barrier: Register properties as class properties
  input-linux: Register properties as class properties
  rng: Register "opened" as class property
  rng-random: register "filename" as class property
  rng-egd: Register "chardev" as class property

Signed-off-by: Peter Maydell <[email protected]>
4 years agoblock: deprecate the sheepdog block driver
Daniel P. Berrangé [Fri, 2 Oct 2020 11:32:43 +0000 (12:32 +0100)]
block: deprecate the sheepdog block driver

This thread from a little over a year ago:

  http://lists.wpkg.org/pipermail/sheepdog/2019-March/thread.html

states that sheepdog is no longer actively developed. The only mentioned
users are some companies who are said to have it for legacy reasons with
plans to replace it by Ceph. There is talk about cutting out existing
features to turn it into a simple demo of how to write a distributed
block service. There is no evidence of anyone working on that idea:

  https://github.com/sheepdog/sheepdog/commits/master

No real commits to git since Jan 2018, and before then just some minor
technical debt cleanup.

There is essentially no activity on the mailing list aside from
patches to QEMU that get CC'd due to our MAINTAINERS entry.

Fedora packages for sheepdog failed to build from upstream source
because of the more strict linker that no longer merges duplicate
global symbols. Fedora patches it to add the missing "extern"
annotations and presumably other distros do to, but upstream source
remains broken.

There is only basic compile testing, no functional testing of the
driver.

Since there are no build pre-requisites the sheepdog driver is currently
enabled unconditionally. This would result in configure issuing a
deprecation warning by default for all users. Thus the configure default
is changed to disable it, requiring users to pass --enable-sheepdog to
build the driver.

Reviewed-by: Markus Armbruster <[email protected]>
Reviewed-by: Thomas Huth <[email protected]>
Reviewed-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Daniel P. Berrangé <[email protected]>
Message-Id: <20201002113243.2347710[email protected]>
Reviewed-by: Neal Gompa <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
4 years agoblock: drop moderated sheepdog mailing list from MAINTAINERS file
Daniel P. Berrangé [Fri, 2 Oct 2020 11:32:42 +0000 (12:32 +0100)]
block: drop moderated sheepdog mailing list from MAINTAINERS file

The sheepdog mailing list is setup to stop and queue messages from
non-subscribers, pending moderator approval. Unfortunately it seems
that the moderation queue is not actively dealt with. Even when messages
are approved, the sender is never added to the whitelist, so every
future mail from the same sender continues to get stopped for moderation.

MAINTAINERS entries should be responsive and not unneccessarily block
mails from QEMU contributors, so drop the sheepdog mailing list.

Reviewed-by: Thomas Huth <[email protected]>
Reviewed-by: Vladimir Sementsov-Ogievskiy <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Daniel P. Berrangé <[email protected]>
Message-Id: <20201002113243.2347710[email protected]>
Reviewed-by: Neal Gompa <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
4 years agomonitor: Fix order in monitor_cleanup()
Kevin Wolf [Tue, 13 Oct 2020 12:50:27 +0000 (14:50 +0200)]
monitor: Fix order in monitor_cleanup()

We can only destroy Monitor objects after we're sure that they are not
in use by the dispatcher coroutine any more. This fixes crashes like the
following where we tried to destroy a monitor mutex while the dispatcher
coroutine still holds it:

 (gdb) bt
 #0  0x00007fe541cf4bc5 in raise () at /lib64/libc.so.6
 #1  0x00007fe541cdd8a4 in abort () at /lib64/libc.so.6
 #2  0x000055c24e965327 in error_exit (err=16, msg=0x55c24eead3a0 <__func__.33> "qemu_mutex_destroy") at ../util/qemu-thread-posix.c:37
 #3  0x000055c24e9654c3 in qemu_mutex_destroy (mutex=0x55c25133e0f0) at ../util/qemu-thread-posix.c:70
 #4  0x000055c24e7cfaf1 in monitor_data_destroy_qmp (mon=0x55c25133dfd0) at ../monitor/qmp.c:439
 #5  0x000055c24e7d23bc in monitor_data_destroy (mon=0x55c25133dfd0) at ../monitor/monitor.c:615
 #6  0x000055c24e7d253a in monitor_cleanup () at ../monitor/monitor.c:644
 #7  0x000055c24e6cb002 in qemu_cleanup () at ../softmmu/vl.c:4549
 #8  0x000055c24e0d259b in main (argc=24, argv=0x7ffff66b0d58, envp=0x7ffff66b0e20) at ../softmmu/main.c:51

Reported-by: Alex Bennée <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
Message-Id: <20201013125027[email protected]>
Tested-by: Ben Widawsky <[email protected]>
Tested-by: Alex Bennée <[email protected]>
Reviewed-by: Alex Bennée <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
4 years agoqemu-storage-daemon: Remove QemuOpts from --object parser
Kevin Wolf [Wed, 7 Oct 2020 16:49:03 +0000 (18:49 +0200)]
qemu-storage-daemon: Remove QemuOpts from --object parser

The command line parser for --object parses the input twice: Once into
QemuOpts just for detecting help options, and then again into a QDict
using the keyval parser for actually creating the object.

Now that the keyval parser can also detect help options, we can simplify
this and remove the QemuOpts part.

Signed-off-by: Kevin Wolf <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
Message-Id: <20201007164903[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
4 years agoqom: Add user_creatable_print_help_from_qdict()
Kevin Wolf [Wed, 7 Oct 2020 16:49:02 +0000 (18:49 +0200)]
qom: Add user_creatable_print_help_from_qdict()

This adds a function that, given a QDict of non-help options, prints
help for user creatable objects.

Signed-off-by: Kevin Wolf <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
Message-Id: <20201007164903[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
4 years agoqom: Factor out helpers from user_creatable_print_help()
Kevin Wolf [Wed, 7 Oct 2020 16:49:01 +0000 (18:49 +0200)]
qom: Factor out helpers from user_creatable_print_help()

This creates separate helper functions for printing a list of user
creatable object types and for printing a list of properties of a given
type. This will allow using these parts without having a QemuOpts.

Signed-off-by: Kevin Wolf <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: Markus Armbruster <[email protected]>
Message-Id: <20201007164903[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
4 years agokeyval: Parse help options
Kevin Wolf [Sun, 11 Oct 2020 07:35:02 +0000 (09:35 +0200)]
keyval: Parse help options

This adds a special meaning for 'help' and '?' as options to the keyval
parser. Instead of being an error (because of a missing value) or a
value for an implied key, they now request help, which is a new boolean
output of the parser in addition to the QDict.

A new parameter 'p_help' is added to keyval_parse() that contains on
return whether help was requested. If NULL is passed, requesting help
results in an error and all other cases work like before.

Turning previous error cases into help is a compatible extension. The
behaviour potentially changes for implied keys: They could previously
get 'help' as their value, which is now interpreted as requesting help.

This is not a problem in practice because 'help' and '?' are not a valid
values for the implied key of any option parsed with keyval_parse():

* audiodev: union Audiodev, implied key "driver" is enum AudiodevDriver,
  "help" and "?" are not among its values

* display: union DisplayOptions, implied key "type" is enum
  DisplayType, "help" and "?" are not among its values

* blockdev: union BlockdevOptions, implied key "driver is enum
  BlockdevDriver, "help" and "?" are not among its values

* export: union BlockExport, implied key "type" is enum BlockExportType,
  "help" and "?" are not among its values

* monitor: struct MonitorOptions, implied key "mode" is enum MonitorMode,
  "help" and "?" are not among its values

* nbd-server: struct NbdServerOptions, no implied key.

Signed-off-by: Kevin Wolf <[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
Message-Id: <20201011073505.1185335[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
4 years agokeyval: Fix parsing of ',' in value of implied key
Markus Armbruster [Sun, 11 Oct 2020 07:35:01 +0000 (09:35 +0200)]
keyval: Fix parsing of ',' in value of implied key

The previous commit demonstrated documentation and code disagree on
parsing of ',' in the value of an implied key.  Fix the code to match
the documentation.

This breaks uses of keyval_parse() that pass an implied key and accept
a value containing ','.  None of the existing uses does:

* audiodev: implied key "driver" is enum AudiodevDriver, none of the
  values contains ','

* display: implied key "type" is enum DisplayType, none of the values
  contains ','

* blockdev: implied key "driver is enum BlockdevDriver, none of the
  values contains ','

* export: implied key "type" is enum BlockExportType, none of the
  values contains ','

* monitor: implied key "mode" is enum MonitorMode, none of the values
  contains ','

* nbd-server: no implied key.

Signed-off-by: Markus Armbruster <[email protected]>
Message-Id: <20201011073505.1185335[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
4 years agotest-keyval: Demonstrate misparse of ',' with implied key
Markus Armbruster [Sun, 11 Oct 2020 07:35:00 +0000 (09:35 +0200)]
test-keyval: Demonstrate misparse of ',' with implied key

Add a test for "val,,ue" with implied key.  Documentation says this
should parse as implied key with value "val", then fail.  The code
parses it as implied key with value "val,ue", then succeeds.  The next
commit will fix it.

Signed-off-by: Markus Armbruster <[email protected]>
Message-Id: <20201011073505.1185335[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
4 years agokeyval: Fix and clarify grammar
Markus Armbruster [Sun, 11 Oct 2020 07:34:59 +0000 (09:34 +0200)]
keyval: Fix and clarify grammar

The grammar has a few issues:

* key-fragment = / [^=,.]* /

  Prose restricts key fragments: they "must be valid QAPI names or
  consist only of decimal digits".  Technically, '' consists only of
  decimal digits.  The code rejects that.  Fix the grammar.

* val          = { / [^,]* / | ',,' }

  Use + instead of *.  Accepts the same language.

* val-no-key   = / [^=,]* /

  The code rejects an empty value.  Fix the grammar.

* Section "Additional syntax for use with an implied key" is
  confusing.  Rewrite it.

Signed-off-by: Markus Armbruster <[email protected]>
Message-Id: <20201011073505.1185335[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
4 years agochardev/spice: build spice chardevs as module
Gerd Hoffmann [Wed, 14 Oct 2020 12:11:20 +0000 (14:11 +0200)]
chardev/spice: build spice chardevs as module

Signed-off-by: Gerd Hoffmann <[email protected]>
Message-id: 20201014121120[email protected]

4 years agomeson: add spice dependency to core spice source files.
Gerd Hoffmann [Wed, 14 Oct 2020 12:11:19 +0000 (14:11 +0200)]
meson: add spice dependency to core spice source files.

Right now it happens to work by pure luck because the spice chardevs
add the spice dependency to the softmmu source set.  That'll change
though once we start building spice chardevs as module, so lets fix
it properly.

Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-id: 20201014121120[email protected]

4 years agomeson: add spice_headers dependency.
Gerd Hoffmann [Wed, 14 Oct 2020 12:11:18 +0000 (14:11 +0200)]
meson: add spice_headers dependency.

Used for files which (with CONFIG_SPICE=y) depend on spice header files
to pick up some enum, but which do not depend on on the actual spice
shared library.

Signed-off-by: Gerd Hoffmann <[email protected]>
Message-id: 20201014121120[email protected]

4 years agochardev/spice: simplify chardev setup
Gerd Hoffmann [Wed, 14 Oct 2020 12:11:17 +0000 (14:11 +0200)]
chardev/spice: simplify chardev setup

Initialize spice before chardevs.  That allows to register the spice
chardevs directly in the init function and removes the need to maintain
a linked list of chardevs just for registration.

Signed-off-by: Gerd Hoffmann <[email protected]>
Message-id: 20201014121120[email protected]

4 years agochardev/spice: make qemu_chr_open_spice_port static
Gerd Hoffmann [Wed, 14 Oct 2020 12:11:16 +0000 (14:11 +0200)]
chardev/spice: make qemu_chr_open_spice_port static

Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-id: 20201014121120[email protected]

4 years agoui/spice-app: don't use qemu_chr_open_spice_port directly
Gerd Hoffmann [Wed, 14 Oct 2020 12:11:15 +0000 (14:11 +0200)]
ui/spice-app: don't use qemu_chr_open_spice_port directly

Save the parent object's open function pointer in the (new)
VCChardevClass struct instead before overwriting it, so we
can look it up when needed.

Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-id: 20201014121120[email protected]

4 years agomodules: update qom object module comment
Gerd Hoffmann [Wed, 23 Sep 2020 10:37:28 +0000 (12:37 +0200)]
modules: update qom object module comment

Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-id: 20200923103728[email protected]

4 years agomodule: silence errors for module_load_qom_all().
Gerd Hoffmann [Wed, 23 Sep 2020 09:12:17 +0000 (11:12 +0200)]
module: silence errors for module_load_qom_all().

Add mayfail bool parameter to module loading functions.  Set it to true
for module_load_qom_all() because device modules might not load into all
system emulation variants.  qemu-system-s390x for example will not load
qxl because it lacks vga support.  Makes "make check" less chatty.

Drop module_loaded_qom_all check in module_load_qom_one to make sure we
see errors for explicit load requests, i.e. module_load_qom_one("qxl")
failing will log an error no matter whenever module_load_qom_all() was
called before or not.

Signed-off-by: Gerd Hoffmann <[email protected]>
Acked-by: Paolo Bonzini <[email protected]>
Message-id: 20200923091217[email protected]

4 years agolinux-user/microblaze: Remove non-rt signal frames
Richard Henderson [Sat, 10 Oct 2020 17:27:41 +0000 (12:27 -0500)]
linux-user/microblaze: Remove non-rt signal frames

The microblaze kernel does not support these, and uses
only rt style signal frames.

Tested-by: Edgar E. Iglesias <[email protected]>
Reviewed-by: Edgar E. Iglesias <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
4 years agolinux-user/microblaze: Implement rt signal frames
Richard Henderson [Sat, 10 Oct 2020 17:04:32 +0000 (12:04 -0500)]
linux-user/microblaze: Implement rt signal frames

Allows microblaze to pass tests/tcg/multiarch/linux-test.c.

Tested-by: Edgar E. Iglesias <[email protected]>
Reviewed-by: Edgar E. Iglesias <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
4 years agotests/tcg/linux-test: Adjust getsockname for musl
Richard Henderson [Mon, 5 Oct 2020 16:41:26 +0000 (11:41 -0500)]
tests/tcg/linux-test: Adjust getsockname for musl

Unlike glibc, musl does not use transparent unions to hide
the different structures that overlap struct sockaddr.

Add an explicit cast to work around this.

Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
4 years agoi386: Mark Icelake-Client CPU models deprecated
Robert Hoo [Tue, 22 Sep 2020 07:14:15 +0000 (15:14 +0800)]
i386: Mark Icelake-Client CPU models deprecated

Icelake-Client CPU models will be removed in the future.

Signed-off-by: Robert Hoo <[email protected]>
Message-Id: <1600758855[email protected]>
[ehabkost: reword deprecation note, fix version in doc]
Signed-off-by: Eduardo Habkost <[email protected]>
4 years agocpu: Introduce CPU model deprecation API
Robert Hoo [Tue, 22 Sep 2020 07:14:14 +0000 (15:14 +0800)]
cpu: Introduce CPU model deprecation API

Implement the ability of marking some versions deprecated. When
that CPU model is chosen, print a warning.  The warning message
can be customized, e.g. suggesting an alternative CPU model to be
used instead.

The deprecation message will be printed by x86_cpu_list_entry(),
e.g. '-cpu help'.

QMP command 'query-cpu-definitions' will return a bool value
indicating the deprecation status.

Signed-off-by: Robert Hoo <[email protected]>
Message-Id: <1600758855[email protected]>
[ehabkost: reword commit message]
[ehabkost: Handle NULL cpu_type]
Signed-off-by: Eduardo Habkost <[email protected]>
4 years agokvm: Correct documentation of kvm_irqchip_*()
Eduardo Habkost [Tue, 22 Sep 2020 20:36:12 +0000 (16:36 -0400)]
kvm: Correct documentation of kvm_irqchip_*()

When split irqchip support was introduced, the meaning of
kvm_irqchip_in_kernel() changed: now it only means the LAPIC is
in kernel.  The PIC, IOAPIC, and PIT might be in userspace if
irqchip=split was set.  Update the doc comment to reflect that.

While at it, remove the "the user asked us" part in
kvm_irqchip_is_split() doc comment.  That macro has nothing to do
with existence of explicit user-provided options.

Signed-off-by: Eduardo Habkost <[email protected]>
Acked-by: Paolo Bonzini <[email protected]>
Message-Id: <20200922203612.2178370[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
4 years agoi386/kvm: Delete kvm_allows_irq0_override()
Eduardo Habkost [Tue, 22 Sep 2020 20:19:22 +0000 (16:19 -0400)]
i386/kvm: Delete kvm_allows_irq0_override()

As IRQ routing is always available on x86,
kvm_allows_irq0_override() will always return true, so we don't
need the function anymore.

Signed-off-by: Eduardo Habkost <[email protected]>
Acked-by: Paolo Bonzini <[email protected]>
Message-Id: <20200922201922.2153598[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
4 years agoi386/kvm: Remove IRQ routing support checks
Eduardo Habkost [Tue, 22 Sep 2020 20:19:21 +0000 (16:19 -0400)]
i386/kvm: Remove IRQ routing support checks

KVM_CAP_IRQ_ROUTING is always available on x86, so replace checks
for kvm_has_gsi_routing() and KVM_CAP_IRQ_ROUTING with asserts.

Signed-off-by: Eduardo Habkost <[email protected]>
Acked-by: Paolo Bonzini <[email protected]>
Message-Id: <20200922201922.2153598[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
4 years agoi386/kvm: Require KVM_CAP_IRQ_ROUTING
Eduardo Habkost [Tue, 22 Sep 2020 20:19:20 +0000 (16:19 -0400)]
i386/kvm: Require KVM_CAP_IRQ_ROUTING

KVM_CAP_IRQ_ROUTING is available since 2009 (Linux v2.6.30), so
it's safe to just make it a requirement on x86.

Signed-off-by: Eduardo Habkost <[email protected]>
Acked-by: Paolo Bonzini <[email protected]>
Message-Id: <20200922201922.2153598[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
4 years agotarget/i386: Remove core_id assert check in CPUID 0x8000001E
Babu Moger [Mon, 21 Sep 2020 22:47:28 +0000 (17:47 -0500)]
target/i386: Remove core_id assert check in CPUID 0x8000001E

With x2apic enabled, configurations can have more that 255 cores.
Noticed the device add test is hitting an assert when during cpu
hotplug with core_id > 255. This is due to assert check in the
CPUID 0x8000001E.

Remove the assert check and fix the problem.

Fixes the bug:
Link: https://bugzilla.redhat.com/show_bug.cgi?id=1834200
Signed-off-by: Babu Moger <[email protected]>
Message-Id: <160072824160.9666.8890355282135970684[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
4 years agoi386/kvm: fix FEATURE_HYPERV_EDX value in hyperv_passthrough case
Zhenyu Wang [Tue, 20 Aug 2019 10:30:30 +0000 (18:30 +0800)]
i386/kvm: fix FEATURE_HYPERV_EDX value in hyperv_passthrough case

Fix typo to use correct edx value for FEATURE_HYPERV_EDX when
hyperv_passthrough is enabled.

Signed-off-by: Zhenyu Wang <[email protected]>
Message-Id: <20190820103030[email protected]>
Fixes: e48ddcc6ce13 ("i386/kvm: implement 'hv-passthrough' mode")
Signed-off-by: Eduardo Habkost <[email protected]>
4 years agoi386: drop x86_cpu_get_supported_feature_word() forward declaration
Vitaly Kuznetsov [Fri, 4 Sep 2020 14:54:11 +0000 (16:54 +0200)]
i386: drop x86_cpu_get_supported_feature_word() forward declaration

We only use x86_cpu_get_supported_feature_word() after its implementation,
no forward declaration needed.

Signed-off-by: Vitaly Kuznetsov <[email protected]>
Message-Id: <20200904145431[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
4 years agoMerge remote-tracking branch 'remotes/kraxel/tags/ui-20201014-pull-request' into...
Peter Maydell [Wed, 14 Oct 2020 12:56:06 +0000 (13:56 +0100)]
Merge remote-tracking branch 'remotes/kraxel/tags/ui-20201014-pull-request' into staging

ui: fixes for sdl, curses, vnc, input-linux.

# gpg: Signature made Wed 14 Oct 2020 09:21:35 BST
# gpg:                using RSA key 4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <[email protected]>" [full]
# gpg:                 aka "Gerd Hoffmann <[email protected]>" [full]
# gpg:                 aka "Gerd Hoffmann (private) <[email protected]>" [full]
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/ui-20201014-pull-request:
  ui: Fix default window_id value
  input-linux: Reset il->fd handler before closing it
  SDL: enable OpenGL context creation
  vnc-stubs: Allow -vnc none
  configure: Fixes ncursesw detection under msys2/mingw by convert them to meson
  win32: Simplify gmtime_r detection not depends on if _POSIX_C_SOURCE are defined on msys2/mingw
  curses: Fixes curses compiling errors.
  curses: Fixes compiler error that complain don't have langinfo.h on msys2/mingw
  qemu-edid: drop cast

Signed-off-by: Peter Maydell <[email protected]>
4 years agoui: Fix default window_id value
Samuel Thibault [Mon, 14 Sep 2020 10:06:37 +0000 (12:06 +0200)]
ui: Fix default window_id value

./chardev/baum.c expects the default window_id value to be -1, and not 0
which could be confused with a proper window id (when numbered from 0 by
the ui backend).

This fixes getting Braille output with the curses and gtk frontends.

Fixes: f29b3431f62 ("console: move window ID code from baum to sdl")
Signed-off-by: Samuel Thibault <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <20200914100637.eeommoflirxrgaeh@function>
Signed-off-by: Gerd Hoffmann <[email protected]>
4 years agoinput-linux: Reset il->fd handler before closing it
Colin Xu [Fri, 25 Sep 2020 02:18:08 +0000 (10:18 +0800)]
input-linux: Reset il->fd handler before closing it

If object-del input-linux object on-the-fly, instance finalize will
close evdev fd without resetting it. However the main thread is still
trying to lock_acquire/lock_release during ppoll, which leads to a very
high CPU utilization.

Signed-off-by: Colin Xu <[email protected]>
Reviewed-by: Li Qiang <[email protected]>
Message-id: 20200925021808[email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
4 years agoSDL: enable OpenGL context creation
Jan Henrik Weinstock [Sun, 4 Oct 2020 10:42:21 +0000 (12:42 +0200)]
SDL: enable OpenGL context creation

We need to specify SDL_WINDOW_OPENGL if we want to create an OpenGL context on it, i.e. when using '-device virtio-gpu-pci,virgl=on'

Signed-off-by: Jan Henrik Weinstock <[email protected]>
Message-id: b2ba98b3-2975-0d4d-1c56-f659923c714d@rwth-aachen.de
Signed-off-by: Gerd Hoffmann <[email protected]>
4 years agovnc-stubs: Allow -vnc none
Jason Andryuk [Fri, 9 Oct 2020 01:40:32 +0000 (21:40 -0400)]
vnc-stubs: Allow -vnc none

Currently `-vnc none` is fatal when built with `--disable-vnc`.  Make
vnc_parse accept "none", so QEMU still run without using vnc.

Signed-off-by: Jason Andryuk <[email protected]>
Message-id: 20201009014032[email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
4 years agoconfigure: Fixes ncursesw detection under msys2/mingw by convert them to meson
Yonggang Luo [Mon, 12 Oct 2020 23:43:48 +0000 (07:43 +0800)]
configure: Fixes ncursesw detection under msys2/mingw by convert them to meson

The mingw pkg-config are showing following absolute path and contains : as the separator,

-D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=199506L -IC:/CI-Tools/msys64/mingw64/include/ncursesw:-I/usr/include/ncursesw:
-DNCURSES_WIDECHAR -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=199506L -IC -pipe -lncursesw -lgnurx -ltre -lintl -liconv
-DNCURSES_WIDECHAR -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=199506L -IC -lncursesw
-DNCURSES_WIDECHAR -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=199506L -IC -lcursesw
-DNCURSES_WIDECHAR /CI-Tools/msys64/mingw64/include/ncursesw -pipe -lncursesw -lgnurx -ltre -lintl -liconv
-DNCURSES_WIDECHAR /CI-Tools/msys64/mingw64/include/ncursesw -lncursesw
-DNCURSES_WIDECHAR /CI-Tools/msys64/mingw64/include/ncursesw -lcursesw
-DNCURSES_WIDECHAR -I/usr/include/ncursesw -pipe -lncursesw -lgnurx -ltre -lintl -liconv
-DNCURSES_WIDECHAR -I/usr/include/ncursesw -lncursesw
-DNCURSES_WIDECHAR -I/usr/include/ncursesw -lcursesw

Signed-off-by: Yonggang Luo <[email protected]>
Reviewed-by: Gerd Hoffmann <[email protected]>
Message-id: 20201012234348[email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
4 years agowin32: Simplify gmtime_r detection not depends on if _POSIX_C_SOURCE are defined...
Yonggang Luo [Mon, 12 Oct 2020 23:43:47 +0000 (07:43 +0800)]
win32: Simplify gmtime_r detection not depends on if _POSIX_C_SOURCE are defined on msys2/mingw

We remove the CONFIG_LOCALTIME_R detection option in configure, and move the check
existence of gmtime_r from configure into C header and source directly by using macro
`_POSIX_THREAD_SAFE_FUNCTIONS`.
Before this patch, the configure script are always assume the compiler doesn't define
_POSIX_C_SOURCE macro at all, but that's not true, because thirdparty library such
as ncursesw may define -D_POSIX_C_SOURCE in it's pkg-config file. And that C Flags will
added -D_POSIX_C_SOURCE into each QEMU_CFLAGS. And that's causing the following compiling error:
n file included from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../softmmu/main.c:25:
C:/work/xemu/qemu/include/sysemu/os-win32.h:53:12: error: redundant redeclaration of 'gmtime_r' [-Werror=redundant-decls]
   53 | struct tm *gmtime_r(const time_t *timep, struct tm *result);
      |            ^~~~~~~~
In file included from C:/work/xemu/qemu/include/qemu/osdep.h:94,
                 from ../softmmu/main.c:25:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/time.h:284:36: note: previous definition of 'gmtime_r' was here
  284 | __forceinline struct tm *__CRTDECL gmtime_r(const time_t *_Time, struct tm *_Tm) {
      |                                    ^~~~~~~~
In file included from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../softmmu/main.c:25:
C:/work/xemu/qemu/include/sysemu/os-win32.h:55:12: error: redundant redeclaration of 'localtime_r' [-Werror=redundant-decls]
   55 | struct tm *localtime_r(const time_t *timep, struct tm *result);
      |            ^~~~~~~~~~~
In file included from C:/work/xemu/qemu/include/qemu/osdep.h:94,
                 from ../softmmu/main.c:25:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/time.h:281:36: note: previous definition of 'localtime_r' was here
  281 | __forceinline struct tm *__CRTDECL localtime_r(const time_t *_Time, struct tm *_Tm) {
      |                                    ^~~~~~~~~~~
Compiling C object libcommon.fa.p/hw_gpio_zaurus.c.obj
In file included from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../hw/i2c/smbus_slave.c:16:
C:/work/xemu/qemu/include/sysemu/os-win32.h:53:12: error: redundant redeclaration of 'gmtime_r' [-Werror=redundant-decls]
   53 | struct tm *gmtime_r(const time_t *timep, struct tm *result);
      |            ^~~~~~~~
In file included from C:/work/xemu/qemu/include/qemu/osdep.h:94,
                 from ../hw/i2c/smbus_slave.c:16:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/time.h:284:36: note: previous definition of 'gmtime_r' was here
  284 | __forceinline struct tm *__CRTDECL gmtime_r(const time_t *_Time, struct tm *_Tm) {
      |                                    ^~~~~~~~
In file included from C:/work/xemu/qemu/include/qemu/osdep.h:119,
                 from ../hw/i2c/smbus_slave.c:16:
C:/work/xemu/qemu/include/sysemu/os-win32.h:55:12: error: redundant redeclaration of 'localtime_r' [-Werror=redundant-decls]
   55 | struct tm *localtime_r(const time_t *timep, struct tm *result);
      |            ^~~~~~~~~~~
In file included from C:/work/xemu/qemu/include/qemu/osdep.h:94,
                 from ../hw/i2c/smbus_slave.c:16:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/time.h:281:36: note: previous definition of 'localtime_r' was here
  281 | __forceinline struct tm *__CRTDECL localtime_r(const time_t *_Time, struct tm *_Tm) {
      |                                    ^~~~~~~~~~~
Compiling C object libcommon.fa.p/hw_dma_xilinx_axidma.c.obj

After this patch, whenever ncursesw or other thirdparty libraries tried to define or not
define  _POSIX_C_SOURCE, the source will building properly. Because now, we don't make any
assumption if _POSIX_C_SOURCE are defined. We solely relied on if the macro `_POSIX_THREAD_SAFE_FUNCTIONS`
are defined in msys2/mingw header.

The _POSIX_THREAD_SAFE_FUNCTIONS are defined in mingw header like this:

```
#if defined(_POSIX_C_SOURCE) && !defined(_POSIX_THREAD_SAFE_FUNCTIONS)
#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L
#endif

#ifdef _POSIX_THREAD_SAFE_FUNCTIONS
__forceinline struct tm *__CRTDECL localtime_r(const time_t *_Time, struct tm *_Tm) {
  return localtime_s(_Tm, _Time) ? NULL : _Tm;
}
__forceinline struct tm *__CRTDECL gmtime_r(const time_t *_Time, struct tm *_Tm) {
  return gmtime_s(_Tm, _Time) ? NULL : _Tm;
}
__forceinline char *__CRTDECL ctime_r(const time_t *_Time, char *_Str) {
  return ctime_s(_Str, 0x7fffffff, _Time) ? NULL : _Str;
}
__forceinline char *__CRTDECL asctime_r(const struct tm *_Tm, char * _Str) {
  return asctime_s(_Str, 0x7fffffff, _Tm) ? NULL : _Str;
}
#endif
```

Signed-off-by: Yonggang Luo <[email protected]>
Reviewed-by: Daniel P. Berrangé <[email protected]>
Message-id: 20201012234348[email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
4 years agocurses: Fixes curses compiling errors.
Yonggang Luo [Mon, 12 Oct 2020 23:43:46 +0000 (07:43 +0800)]
curses: Fixes curses compiling errors.

This is the compiling error:
../ui/curses.c: In function 'curses_refresh':
../ui/curses.c:256:5: error: 'next_maybe_keycode' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  256 |     curses2foo(_curses2keycode, _curseskey2keycode, chr, maybe_keycode)
      |     ^~~~~~~~~~
../ui/curses.c:302:32: note: 'next_maybe_keycode' was declared here
  302 |             enum maybe_keycode next_maybe_keycode;
      |                                ^~~~~~~~~~~~~~~~~~
../ui/curses.c:256:5: error: 'maybe_keycode' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  256 |     curses2foo(_curses2keycode, _curseskey2keycode, chr, maybe_keycode)
      |     ^~~~~~~~~~
../ui/curses.c:265:24: note: 'maybe_keycode' was declared here
  265 |     enum maybe_keycode maybe_keycode;
      |                        ^~~~~~~~~~~~~
cc1.exe: all warnings being treated as errors

gcc version 10.2.0 (Rev1, Built by MSYS2 project)

Signed-off-by: Yonggang Luo <[email protected]>
Reviewed-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Daniel P. Berrangé <[email protected]>
Message-id: 20201012234348[email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
4 years agocurses: Fixes compiler error that complain don't have langinfo.h on msys2/mingw
Yonggang Luo [Mon, 12 Oct 2020 23:43:45 +0000 (07:43 +0800)]
curses: Fixes compiler error that complain don't have langinfo.h on msys2/mingw

msys2/mingw lacks the POSIX-required langinfo.h.

gcc test.c -DNCURSES_WIDECHAR -I/mingw64/include/ncursesw -pipe -lncursesw -lgnurx -ltre -lintl -liconv
test.c:4:10: fatal error: langinfo.h: No such file or directory
    4 | #include <langinfo.h>
      |          ^~~~~~~~~~~~
compilation terminated.

So we using g_get_codeset instead of nl_langinfo(CODESET)

Signed-off-by: Yonggang Luo <[email protected]>
Reviewed-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Daniel P. Berrangé <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-id: 20201012234348[email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
4 years agoqemu-edid: drop cast
Gerd Hoffmann [Tue, 13 Oct 2020 09:16:15 +0000 (11:16 +0200)]
qemu-edid: drop cast

Not needed and makes some compilers error out with:

qemu-edid.c:15:1: error: initializer element is not constant

Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Daniel P. Berrangé <[email protected]>
Message-id: 20201013091615[email protected]

4 years agocan-host-socketcan: Fix crash when 'if' option is not set
Eduardo Habkost [Thu, 8 Oct 2020 20:27:12 +0000 (16:27 -0400)]
can-host-socketcan: Fix crash when 'if' option is not set

Fix the following crash:

  $ qemu-system-x86_64 -object can-host-socketcan,id=obj0
  Segmentation fault (core dumped)

Signed-off-by: Eduardo Habkost <[email protected]>
Reviewed-by: Li Qiang <[email protected]>
Acked-by: Pavel Pisa <[email protected]>
Message-Id: <20201008202713.1416823[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
4 years agoauthz-list-file: Fix crash when filename is not set
Eduardo Habkost [Thu, 8 Oct 2020 20:27:11 +0000 (16:27 -0400)]
authz-list-file: Fix crash when filename is not set

Fix the following crash:

  $ qemu-system-x86_64 -object authz-list-file,id=obj0
  qemu-system-x86_64: -object authz-list-file,id=obj0: GLib: g_file_get_contents: assertion 'filename != NULL' failed
  Segmentation fault (core dumped)

Signed-off-by: Eduardo Habkost <[email protected]>
Reviewed-by: Daniel P. Berrangé <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Li Qiang <[email protected]>
Message-Id: <20201008202713.1416823[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
4 years agovhost-user: Register "chardev" as class property
Eduardo Habkost [Mon, 21 Sep 2020 22:10:26 +0000 (18:10 -0400)]
vhost-user: Register "chardev" as class property

Class properties make QOM introspection simpler and easier, as
they don't require an object to be instantiated.

Signed-off-by: Eduardo Habkost <[email protected]>
Reviewed-by: Marc-André Lureau <[email protected]>
Message-Id: <20200921221045[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
4 years agovga-pci: Register "big-endian-framebuffer" as class property
Eduardo Habkost [Mon, 21 Sep 2020 22:10:42 +0000 (18:10 -0400)]
vga-pci: Register "big-endian-framebuffer" as class property

Class properties make QOM introspection simpler and easier, as
they don't require an object to be instantiated.

Signed-off-by: Eduardo Habkost <[email protected]>
Reviewed-by: Marc-André Lureau <[email protected]>
Message-Id: <20200921221045[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
4 years agoi386: Register most CPU properties as class properties
Eduardo Habkost [Mon, 21 Sep 2020 22:10:34 +0000 (18:10 -0400)]
i386: Register most CPU properties as class properties

Class properties make QOM introspection simpler and easier, as
they don't require an object to be instantiated.

Signed-off-by: Eduardo Habkost <[email protected]>
Reviewed-by: Igor Mammedov <[email protected]>
Message-Id: <20200921221045[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
4 years agoinput-barrier: Register properties as class properties
Eduardo Habkost [Mon, 21 Sep 2020 22:10:31 +0000 (18:10 -0400)]
input-barrier: Register properties as class properties

Class properties make QOM introspection simpler and easier, as
they don't require an object to be instantiated.

Signed-off-by: Eduardo Habkost <[email protected]>
Reviewed-by: Daniel P. Berrangé <[email protected]>
Message-Id: <20200921221045[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
4 years agoinput-linux: Register properties as class properties
Eduardo Habkost [Mon, 21 Sep 2020 22:10:30 +0000 (18:10 -0400)]
input-linux: Register properties as class properties

Class properties make QOM introspection simpler and easier, as
they don't require an object to be instantiated.

Signed-off-by: Eduardo Habkost <[email protected]>
Reviewed-by: Daniel P. Berrangé <[email protected]>
Message-Id: <20200921221045[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
4 years agorng: Register "opened" as class property
Eduardo Habkost [Mon, 21 Sep 2020 22:10:28 +0000 (18:10 -0400)]
rng: Register "opened" as class property

Class properties make QOM introspection simpler and easier, as
they don't require an object to be instantiated.

Signed-off-by: Eduardo Habkost <[email protected]>
Reviewed-by: Daniel P. Berrangé <[email protected]>
Message-Id: <20200921221045[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
4 years agorng-random: register "filename" as class property
Eduardo Habkost [Mon, 21 Sep 2020 22:10:25 +0000 (18:10 -0400)]
rng-random: register "filename" as class property

Class properties make QOM introspection simpler and easier, as
they don't require an object to be instantiated.

Signed-off-by: Eduardo Habkost <[email protected]>
Reviewed-by: Daniel P. Berrangé <[email protected]>
Message-Id: <20200921221045[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
4 years agorng-egd: Register "chardev" as class property
Eduardo Habkost [Mon, 21 Sep 2020 22:10:24 +0000 (18:10 -0400)]
rng-egd: Register "chardev" as class property

Class properties make QOM introspection simpler and easier, as
they don't require an object to be instantiated.

Signed-off-by: Eduardo Habkost <[email protected]>
Reviewed-by: Daniel P. Berrangé <[email protected]>
Message-Id: <20200921221045[email protected]>
Signed-off-by: Eduardo Habkost <[email protected]>
4 years agoMerge remote-tracking branch 'remotes/vivier2/tags/trivial-branch-for-5.2-pull-reques...
Peter Maydell [Tue, 13 Oct 2020 13:06:21 +0000 (14:06 +0100)]
Merge remote-tracking branch 'remotes/vivier2/tags/trivial-branch-for-5.2-pull-request' into staging

Trivial Patches Pull request 20201013

# gpg: Signature made Tue 13 Oct 2020 12:49:59 BST
# gpg:                using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C
# gpg:                issuer "[email protected]"
# gpg: Good signature from "Laurent Vivier <[email protected]>" [full]
# gpg:                 aka "Laurent Vivier <[email protected]>" [full]
# gpg:                 aka "Laurent Vivier (Red Hat) <[email protected]>" [full]
# Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C

* remotes/vivier2/tags/trivial-branch-for-5.2-pull-request:
  meson.build: drop duplicate 'sparc64' entry
  mingw: fix error __USE_MINGW_ANSI_STDIO redefined
  target/sparc/int32_helper: Remove duplicated 'Tag Overflow' entry
  goldfish_rtc: change MemoryRegionOps endianness to DEVICE_NATIVE_ENDIAN
  hw/char/serial: remove duplicate .class_init in serial_mm_info
  block/blkdebug: fix memory leak
  hw/pci: Fix typo in PCI hot-plug error message
  softmmu/memory: Log invalid memory accesses
  hw/acpi/piix4: Rename piix4_pm_add_propeties() to piix4_pm_add_properties()
  vmdk: fix maybe uninitialized warnings
  tests/test-char: Use a proper fallthrough comment
  hw/block/nvme: Simplify timestamp sum
  target/i386/cpu: Update comment that mentions Texinfo
  qemu-img-cmds.hx: Update comment that mentions Texinfo

Signed-off-by: Peter Maydell <[email protected]>
4 years agoMerge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2020-10-13' into...
Peter Maydell [Tue, 13 Oct 2020 11:46:26 +0000 (12:46 +0100)]
Merge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2020-10-13' into staging

* qtest improvements (test for crash found with the fuzzer, increase
  downtime in migration test, less verbose output when running w/o KVM)
* Improve handling of acceptance tests in the Gitlab-CI
* Run checkpatch.pl in the Gitlab-CI
* Improve the gitlab-pipeline-status script
* Misc patches (mark 'moxie' as deprecated, remove stale .gitignore files, ...)

# gpg: Signature made Tue 13 Oct 2020 11:49:06 BST
# gpg:                using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5
# gpg:                issuer "[email protected]"
# gpg: Good signature from "Thomas Huth <[email protected]>" [full]
# gpg:                 aka "Thomas Huth <[email protected]>" [full]
# gpg:                 aka "Thomas Huth <[email protected]>" [full]
# gpg:                 aka "Thomas Huth <[email protected]>" [unknown]
# Primary key fingerprint: 27B8 8847 EEE0 2501 18F3  EAB9 2ED9 D774 FE70 2DB5

* remotes/huth-gitlab/tags/pull-request-2020-10-13: (23 commits)
  scripts/ci/gitlab-pipeline-status: wait for pipeline creation
  scripts/ci/gitlab-pipeline-status: use more descriptive exceptions
  scripts/ci/gitlab-pipeline-status: handle keyboard interrupts
  scripts/ci/gitlab-pipeline-status: refactor parser creation
  scripts/ci/gitlab-pipeline-status: give early feedback on running pipelines
  scripts/ci/gitlab-pipeline-status: improve message regarding timeout
  scripts/ci/gitlab-pipeline-status: make branch name configurable
  gitlab: assign python helper files to GitLab maintainers section
  gitlab: add a CI job to validate the DCO sign off
  gitlab: add a CI job for running checkpatch.pl
  configure: fixes indent of $meson setup
  docs/system/deprecated: Mark the 'moxie' CPU as deprecated
  Remove superfluous .gitignore files
  MAINTAINERS: Ignore bios-tables-test in the qtest section
  Add a comment in bios-tables-test.c to clarify the reason behind approach
  softmmu/vl: Be less verbose about missing KVM when running the qtests
  tests/migration: Allow longer timeouts
  qtest: add fuzz test case
  Acceptance tests: show test report on GitLab CI
  Acceptance tests: do not show canceled test logs on GitLab CI
  ...

Signed-off-by: Peter Maydell <[email protected]>
4 years agomeson.build: drop duplicate 'sparc64' entry
Sergei Trofimovich [Mon, 12 Oct 2020 17:57:19 +0000 (18:57 +0100)]
meson.build: drop duplicate 'sparc64' entry

CC: Laurent Vivier <[email protected]>
CC: [email protected]
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Sergei Trofimovich <[email protected]>
Message-Id: <20201012175719.2573367[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
4 years agomingw: fix error __USE_MINGW_ANSI_STDIO redefined
Marc-André Lureau [Thu, 8 Oct 2020 16:59:53 +0000 (20:59 +0400)]
mingw: fix error __USE_MINGW_ANSI_STDIO redefined

Always put osdep.h first, and remove redundant stdlib.h include.

Signed-off-by: Marc-André Lureau <[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
Reviewed-by: Stefan Weil <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <20201008165953[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
4 years agotarget/sparc/int32_helper: Remove duplicated 'Tag Overflow' entry
Philippe Mathieu-Daudé [Sun, 11 Oct 2020 20:01:12 +0000 (22:01 +0200)]
target/sparc/int32_helper: Remove duplicated 'Tag Overflow' entry

Commit 0b09be2b2f ("Nicer debug output for exceptions") added
twice the same "Tag Overflow" entry, remove the extra one.

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Mark Cave-Ayland <[email protected]>
Message-Id: <20201011200112.3222822[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
4 years agogoldfish_rtc: change MemoryRegionOps endianness to DEVICE_NATIVE_ENDIAN
Laurent Vivier [Fri, 9 Oct 2020 11:38:43 +0000 (13:38 +0200)]
goldfish_rtc: change MemoryRegionOps endianness to DEVICE_NATIVE_ENDIAN

The doc [1] doesn't define the endianness, but the kernel driver
uses readl() to access the registers, so we can guess it depends
on the architecture endianness.

As riscv architecture endianness is little it might not change anything
for it.

Moreover, android implementation uses DEVICE_NATIVE_ENDIAN [2]

[1] https://android.googlesource.com/platform/external/qemu/+/master/docs/GOLDFISH-VIRTUAL-HARDWARE.TXT
[2] https://android.googlesource.com/platform/external/qemu/+/refs/heads/emu-master-dev/hw/timer/goldfish_timer.c#177

Fixes: 9a5b40b84279 ("hw: rtc: Add Goldfish RTC device")
Cc: [email protected]
Signed-off-by: Laurent Vivier <[email protected]>
Reviewed-by: Alistair Francis <[email protected]>
Message-Id: <20201009113843[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
4 years agohw/char/serial: remove duplicate .class_init in serial_mm_info
Laurent Vivier [Fri, 9 Oct 2020 11:38:42 +0000 (13:38 +0200)]
hw/char/serial: remove duplicate .class_init in serial_mm_info

.class_init is already set to serial_mm_class_init.

Remove the duplicate entry.

Fixes: 17fd1a6490b1 ("serial-mm: add "regshift" property")
Cc: [email protected]
Signed-off-by: Laurent Vivier <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Li Qiang <[email protected]>
Reviewed-by: Alistair Francis <[email protected]>
Message-Id: <20201009113843[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
4 years agoblock/blkdebug: fix memory leak
Elena Afanasova [Fri, 9 Oct 2020 19:09:59 +0000 (12:09 -0700)]
block/blkdebug: fix memory leak

Spotted by PVS-Studio

Signed-off-by: Elena Afanasova <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Message-Id: <1e903f928eb3da332cc95e2a6f87243bd9fe66e4[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
4 years agohw/pci: Fix typo in PCI hot-plug error message
Julia Suvorova [Tue, 6 Oct 2020 13:39:58 +0000 (15:39 +0200)]
hw/pci: Fix typo in PCI hot-plug error message

'occupied' is spelled like 'ocuppied' in the message.

Signed-off-by: Julia Suvorova <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <20201006133958[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
4 years agosoftmmu/memory: Log invalid memory accesses
Philippe Mathieu-Daudé [Mon, 5 Oct 2020 15:27:25 +0000 (17:27 +0200)]
softmmu/memory: Log invalid memory accesses

Log invalid memory accesses with as GUEST_ERROR.

This is particularly useful since commit 5d971f9e67 which reverted
("memory: accept mismatching sizes in memory_region_access_valid").

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Message-Id: <20201005152725.2143444[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
4 years agohw/acpi/piix4: Rename piix4_pm_add_propeties() to piix4_pm_add_properties()
Greg Kurz [Fri, 2 Oct 2020 16:06:07 +0000 (18:06 +0200)]
hw/acpi/piix4: Rename piix4_pm_add_propeties() to piix4_pm_add_properties()

Signed-off-by: Greg Kurz <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Li Qiang <[email protected]>
Message-Id: <160165476743.57452.2128307974125615413[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
4 years agovmdk: fix maybe uninitialized warnings
Christian Borntraeger [Wed, 30 Sep 2020 15:58:56 +0000 (17:58 +0200)]
vmdk: fix maybe uninitialized warnings

Fedora 32 gcc 10 seems to give false positives:

Compiling C object libblock.fa.p/block_vmdk.c.o
../block/vmdk.c: In function ‘vmdk_parse_extents’:
../block/vmdk.c:587:5: error: ‘extent’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
  587 |     g_free(extent->l1_table);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~
../block/vmdk.c:754:17: note: ‘extent’ was declared here
  754 |     VmdkExtent *extent;
      |                 ^~~~~~
../block/vmdk.c:620:11: error: ‘extent’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
  620 |     ret = vmdk_init_tables(bs, extent, errp);
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../block/vmdk.c:598:17: note: ‘extent’ was declared here
  598 |     VmdkExtent *extent;
      |                 ^~~~~~
../block/vmdk.c:1178:39: error: ‘extent’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
 1178 |             extent->flat_start_offset = flat_offset << 9;
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
../block/vmdk.c: In function ‘vmdk_open_vmdk4’:
../block/vmdk.c:581:22: error: ‘extent’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
  581 |     extent->l2_cache =
      |     ~~~~~~~~~~~~~~~~~^
  582 |         g_malloc(extent->entry_size * extent->l2_size * L2_CACHE_SIZE);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../block/vmdk.c:872:17: note: ‘extent’ was declared here
  872 |     VmdkExtent *extent;
      |                 ^~~~~~
../block/vmdk.c: In function ‘vmdk_open’:
../block/vmdk.c:620:11: error: ‘extent’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
  620 |     ret = vmdk_init_tables(bs, extent, errp);
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../block/vmdk.c:598:17: note: ‘extent’ was declared here
  598 |     VmdkExtent *extent;
      |                 ^~~~~~
cc1: all warnings being treated as errors
make: *** [Makefile.ninja:884: libblock.fa.p/block_vmdk.c.o] Error 1

fix them by assigning a default value.

Signed-off-by: Christian Borntraeger <[email protected]>
Reviewed-by: Fam Zheng <[email protected]>
Message-Id: <20200930155859[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
4 years agotests/test-char: Use a proper fallthrough comment
Thomas Huth [Fri, 2 Oct 2020 17:13:43 +0000 (19:13 +0200)]
tests/test-char: Use a proper fallthrough comment

For being able to compile with -Werror=implicit-fallthrough we need
to use comments that the compiler recognizes. Use "fallthrough" instead
of "no break" here.

Signed-off-by: Thomas Huth <[email protected]>
Reviewed-by: Marc-André Lureau <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Tested-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <20201002171343[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
4 years agohw/block/nvme: Simplify timestamp sum
Philippe Mathieu-Daudé [Fri, 2 Oct 2020 07:57:16 +0000 (09:57 +0200)]
hw/block/nvme: Simplify timestamp sum

As the 'timestamp' variable is declared as a 48-bit bitfield,
we do not need to wrap the sum result.

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Klaus Jensen <[email protected]>
Message-Id: <20201002075716.1657849[email protected]>
Signed-off-by: Laurent Vivier <[email protected]>
4 years agoscripts/ci/gitlab-pipeline-status: wait for pipeline creation
Cleber Rosa [Fri, 4 Sep 2020 16:42:58 +0000 (12:42 -0400)]
scripts/ci/gitlab-pipeline-status: wait for pipeline creation

When called in wait mode, this script will also wait for the pipeline
to be get to a "running" state.  Because many more status may be seen
until a pipeline gets to "running", and those need to be handle too.

Reference: https://docs.gitlab.com/ee/api/pipelines.html#list-project-pipelines
Signed-off-by: Cleber Rosa <[email protected]>
Message-Id: <20200904164258[email protected]>
Signed-off-by: Thomas Huth <[email protected]>
4 years agoscripts/ci/gitlab-pipeline-status: use more descriptive exceptions
Cleber Rosa [Fri, 4 Sep 2020 16:42:57 +0000 (12:42 -0400)]
scripts/ci/gitlab-pipeline-status: use more descriptive exceptions

For two very different error conditions.

Signed-off-by: Cleber Rosa <[email protected]>
Message-Id: <20200904164258[email protected]>
Signed-off-by: Thomas Huth <[email protected]>
4 years agoscripts/ci/gitlab-pipeline-status: handle keyboard interrupts
Cleber Rosa [Fri, 4 Sep 2020 16:42:56 +0000 (12:42 -0400)]
scripts/ci/gitlab-pipeline-status: handle keyboard interrupts

So that exits based on user requests are handled more gracefully.

Signed-off-by: Cleber Rosa <[email protected]>
Message-Id: <20200904164258[email protected]>
Signed-off-by: Thomas Huth <[email protected]>
4 years agoscripts/ci/gitlab-pipeline-status: refactor parser creation
Cleber Rosa [Fri, 4 Sep 2020 16:42:55 +0000 (12:42 -0400)]
scripts/ci/gitlab-pipeline-status: refactor parser creation

Out of the main function.

Signed-off-by: Cleber Rosa <[email protected]>
Message-Id: <20200904164258[email protected]>
Signed-off-by: Thomas Huth <[email protected]>
4 years agoscripts/ci/gitlab-pipeline-status: give early feedback on running pipelines
Cleber Rosa [Fri, 4 Sep 2020 16:42:54 +0000 (12:42 -0400)]
scripts/ci/gitlab-pipeline-status: give early feedback on running pipelines

When waiting for a pipeline to run and finish, it's better to give
early feedback, and then sleep and wait, than the other wait around.

Specially for the first iteration, it's frustrating to see nothing
while the script is sleeping.

Signed-off-by: Cleber Rosa <[email protected]>
Message-Id: <20200904164258[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Thomas Huth <[email protected]>
4 years agoscripts/ci/gitlab-pipeline-status: improve message regarding timeout
Cleber Rosa [Fri, 4 Sep 2020 16:42:53 +0000 (12:42 -0400)]
scripts/ci/gitlab-pipeline-status: improve message regarding timeout

The script has its own timeout, which is about how long the script
will wait (when called with --wait) for the pipeline to complete, and
not necessarily for the pipeline to complete.

Hopefully this new wording will be clearer.

Signed-off-by: Cleber Rosa <[email protected]>
Message-Id: <20200904164258[email protected]>
Signed-off-by: Thomas Huth <[email protected]>
4 years agoscripts/ci/gitlab-pipeline-status: make branch name configurable
Cleber Rosa [Fri, 4 Sep 2020 16:42:52 +0000 (12:42 -0400)]
scripts/ci/gitlab-pipeline-status: make branch name configurable

With the utility function `get_local_staging_branch_commit()`, the
name of the branch is hard coded (including in the function name).

For extensibility reasons, let's make that configurable.

Signed-off-by: Cleber Rosa <[email protected]>
Message-Id: <20200904164258[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Thomas Huth <[email protected]>
4 years agogitlab: assign python helper files to GitLab maintainers section
Daniel P. Berrangé [Fri, 18 Sep 2020 13:29:03 +0000 (14:29 +0100)]
gitlab: assign python helper files to GitLab maintainers section

Signed-off-by: Daniel P. Berrangé <[email protected]>
Message-Id: <20200918132903.1848939[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Thomas Huth <[email protected]>
4 years agogitlab: add a CI job to validate the DCO sign off
Daniel P. Berrangé [Fri, 18 Sep 2020 13:29:02 +0000 (14:29 +0100)]
gitlab: add a CI job to validate the DCO sign off

While checkpatch.pl can validate DCO sign off that job must always be
advisory only since it is expected that certain patches will fail some
code style rules.

We require the DCO sign off to be mandatory for all commits though, so
it benefits from being validated in a standalone job.

Signed-off-by: Daniel P. Berrangé <[email protected]>
Message-Id: <20200918132903.1848939[email protected]>
[thuth: Use "stage: build" to let it run earlier]
Signed-off-by: Thomas Huth <[email protected]>
4 years agogitlab: add a CI job for running checkpatch.pl
Daniel P. Berrangé [Fri, 18 Sep 2020 13:29:01 +0000 (14:29 +0100)]
gitlab: add a CI job for running checkpatch.pl

This job is advisory since it is expected that certain patches will fail
the style checks and checkpatch.pl provides no way to mark exceptions to
the rules.

Signed-off-by: Daniel P. Berrangé <[email protected]>
Message-Id: <20200918132903.1848939[email protected]>
[thuth: Use "stage: build" to let it run earlier]
Signed-off-by: Thomas Huth <[email protected]>
4 years agoconfigure: fixes indent of $meson setup
Yonggang Luo [Mon, 12 Oct 2020 23:43:44 +0000 (07:43 +0800)]
configure: fixes indent of $meson setup

convert these line from tab to space

Signed-off-by: Yonggang Luo <[email protected]>
Reviewed-by: Daniel P. Berrangé <[email protected]>
Message-Id: <20201012234348[email protected]>
Signed-off-by: Thomas Huth <[email protected]>
This page took 0.109966 seconds and 4 git commands to generate.