]> git.proxmox.com Git - mirror_qemu.git/log
mirror_qemu.git
2 years agoMerge remote-tracking branch 'remotes/thuth-gitlab/tags/pull-request-2022-02-21'...
Peter Maydell [Tue, 22 Feb 2022 13:07:32 +0000 (13:07 +0000)]
Merge remote-tracking branch 'remotes/thuth-gitlab/tags/pull-request-2022-02-21' into staging

* Improve virtio-net failover test
* Some small fixes for the qtests
* Misc header cleanups by Philippe

# gpg: Signature made Mon 21 Feb 2022 11:40:37 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/thuth-gitlab/tags/pull-request-2022-02-21: (25 commits)
  hw/tricore: Remove unused and incorrect header
  hw/m68k/mcf: Add missing 'exec/hwaddr.h' header
  exec/exec-all: Move 'qemu/log.h' include in units requiring it
  softmmu/runstate: Clean headers
  linux-user: Add missing "qemu/timer.h" include
  target: Add missing "qemu/timer.h" include
  core/ptimers: Remove unnecessary 'sysemu/cpus.h' include
  exec/ramblock: Add missing includes
  qtest: Add missing 'hw/qdev-core.h' include
  hw/acpi/memory_hotplug: Remove unused 'hw/acpi/pc-hotplug.h' header
  hw/remote: Add missing include
  hw/tpm: Clean includes
  scripts: Remove the old switch-timer-api script
  tests/qtest: failover: migration abort test with failover off
  tests/qtest: failover: test migration if the guest doesn't support failover
  tests/qtest: failover: check migration with failover off
  tests/qtest: failover: check missing guest feature
  tests/qtest: failover: check the feature is correctly provided
  tests/qtest: failover: use a macro for check_one_card()
  tests/qtest: failover: clean up pathname of tests
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 years agoMerge remote-tracking branch 'remotes/bonzini-gitlab/tags/for-upstream' into staging
Peter Maydell [Mon, 21 Feb 2022 17:24:05 +0000 (17:24 +0000)]
Merge remote-tracking branch 'remotes/bonzini-gitlab/tags/for-upstream' into staging

* More Meson conversions (0.59.x now required rather than suggested)
* UMIP support for TCG x86
* Fix migration crash
* Restore error output for check-block

# gpg: Signature made Mon 21 Feb 2022 09:35:59 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: (29 commits)
  configure, meson: move CONFIG_IASL to a Meson option
  meson, configure: move ntddscsi API check to meson
  meson: require dynamic linking for VSS support
  qga/vss-win32: require widl/midl, remove pre-built TLB file
  meson: do not make qga/vss-win32/meson.build conditional on C++ presence
  configure, meson: replace VSS SDK checks and options with --enable-vss-sdk
  qga/vss: use standard windows headers location
  qga/vss-win32: use widl if available
  meson: drop --with-win-sdk
  qga/vss-win32: fix midl arguments
  meson: refine check for whether to look for virglrenderer
  configure, meson: move guest-agent, tools to meson
  configure, meson: move smbd options to meson_options.txt
  configure, meson: move coroutine options to meson_options.txt
  configure, meson: move some default-disabled options to meson_options.txt
  meson: define qemu_cflags/qemu_ldflags
  configure, meson: move block layer options to meson_options.txt
  configure, meson: move image format options to meson_options.txt
  configure, meson: cleanup qemu-ga libraries
  configure, meson: move TPM check to meson
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 years agoMerge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20220221-1' into...
Peter Maydell [Mon, 21 Feb 2022 13:32:25 +0000 (13:32 +0000)]
Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20220221-1' into staging

arm, cocoa and misc:
 * MAINTAINERS file updates
 * Mark remaining global TypeInfo instances as const
 * checkpatch: Ensure that TypeInfos are const
 * arm hvf: Handle unknown ID registers as RES0
 * Make KVM -cpu max exactly like -cpu host
 * Fix '-cpu max' for HVF
 * Support PAuth extension for hvf
 * Kconfig: Add I2C_DEVICES device group
 * Kconfig: Add 'imply I2C_DEVICES' on boards with available i2c bus
 * hw/arm/armv7m: Handle disconnected clock inputs
 * osdep.h: pull out various things into new header files
 * hw/timer: fix a9gtimer vmstate
 * hw/arm: add initial mori-bmc board
 * ui/cocoa: Remove allowedFileTypes restriction in SavePanel
 * ui/cocoa: Do not alert even without block devices
 * ui/cocoa: Fix the leak of qemu_console_get_label

# gpg: Signature made Mon 21 Feb 2022 13:30:45 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-20220221-1: (25 commits)
  ui/cocoa: Fix the leak of qemu_console_get_label
  ui/cocoa: Do not alert even without block devices
  ui/cocoa: Remove allowedFileTypes restriction in SavePanel
  hw/arm: add initial mori-bmc board
  hw/timer: fix a9gtimer vmstate
  MAINTAINERS: Add Akihiko Odaki to macOS-relateds
  include: Move hardware version declarations to new qemu/hw-version.h
  include: Move qemu_[id]cache_* declarations to new qemu/cacheinfo.h
  include: Move QEMU_MAP_* constants to mmap-alloc.h
  include: Move qemu_mprotect_*() to new qemu/mprotect.h
  include: Move qemu_madvise() and related #defines to new qemu/madvise.h
  hw/arm/armv7m: Handle disconnected clock inputs
  Kconfig: Add 'imply I2C_DEVICES' on boards with available i2c bus
  Kconfig: Add I2C_DEVICES device group
  target/arm: Support PAuth extension for hvf
  target/arm: Fix '-cpu max' for HVF
  target/arm: Unindent unnecessary else-clause
  target/arm: Make KVM -cpu max exactly like -cpu host
  target/arm: Use aarch64_cpu_register() for 'host' CPU type
  target/arm: Move '-cpu host' code to cpu64.c
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 years agoui/cocoa: Fix the leak of qemu_console_get_label
Akihiko Odaki [Tue, 15 Feb 2022 08:03:05 +0000 (09:03 +0100)]
ui/cocoa: Fix the leak of qemu_console_get_label

Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20220215080307.69550-14-f4bug@amsat.org
Message-Id: <20220213021329.2066-1-akihiko.odaki@gmail.com>
[PMD: Use g_autofree, suggested by Zoltan BALATON]
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 years agoui/cocoa: Do not alert even without block devices
Akihiko Odaki [Tue, 15 Feb 2022 08:03:04 +0000 (09:03 +0100)]
ui/cocoa: Do not alert even without block devices

Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
Message-id: 20220215080307.69550-13-f4bug@amsat.org
Message-Id: <20220213021418.2155-1-akihiko.odaki@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 years agoui/cocoa: Remove allowedFileTypes restriction in SavePanel
Philippe Mathieu-Daudé [Tue, 15 Feb 2022 08:03:02 +0000 (09:03 +0100)]
ui/cocoa: Remove allowedFileTypes restriction in SavePanel

setAllowedFileTypes is deprecated in macOS 12.

Per Akihiko Odaki [*]:

  An image file, which is being chosen by the panel, can be a
  raw file and have a variety of file extensions and many are not
  covered by the provided list (e.g. "udf"). Other platforms like
  GTK can provide an option to open a file with an extension not
  listed, but Cocoa can't. It forces the user to rename the file
  to give an extension in the list. Moreover, Cocoa does not tell
  which extensions are in the list so the user needs to read the
  source code, which is pretty bad.

Since this code is harming the usability rather than improving it,
simply remove the [NSSavePanel allowedFileTypes:] call, fixing:

  [2789/6622] Compiling Objective-C object libcommon.fa.p/ui_cocoa.m.o
  ui/cocoa.m:1411:16: error: 'setAllowedFileTypes:' is deprecated: first deprecated in macOS 12.0 - Use -allowedContentTypes instead [-Werror,-Wdeprecated-declarations]
      [openPanel setAllowedFileTypes: supportedImageFileTypes];
                 ^
  /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSSavePanel.h:215:49: note: property 'allowedFileTypes' is declared deprecated here
  @property (nullable, copy) NSArray<NSString *> *allowedFileTypes API_DEPRECATED("Use -allowedContentTypes instead", macos(10.3,12.0));
                                                  ^
  /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSSavePanel.h:215:49: note: 'setAllowedFileTypes:' has been explicitly marked deprecated here
  FAILED: libcommon.fa.p/ui_cocoa.m.o

[*] https://lore.kernel.org/qemu-devel/4dde2e66-63cb-4390-9538-c032310db3e3@gmail.com/

Suggested-by: Akihiko Odaki <akihiko.odaki@gmail.com>
Reviewed-by: Roman Bolshakov <r.bolshakov@yadro.com>
Tested-by: Roman Bolshakov <r.bolshakov@yadro.com>
Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20220215080307.69550-11-f4bug@amsat.org
Reviewed by: Cameron Esfahani <dirty@apple.com>
Reviewed-by: Akihiko Odaki <akihiko.odaki@gmail.com>
Tested-by: Akihiko Odaki <akihiko.odaki@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 years agohw/arm: add initial mori-bmc board
Patrick Venture [Tue, 8 Feb 2022 23:31:04 +0000 (15:31 -0800)]
hw/arm: add initial mori-bmc board

This is the BMC attached to the OpenBMC Mori board.

Signed-off-by: Patrick Venture <venture@google.com>
Reviewed-by: Chris Rauer <crauer@google.com>
Reviewed-by: Ilkyun Choi <ikchoi@google.com>
Message-id: 20220208233104.284425-1-venture@google.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 years agohw/timer: fix a9gtimer vmstate
Pavel Dovgalyuk [Mon, 7 Feb 2022 08:44:19 +0000 (11:44 +0300)]
hw/timer: fix a9gtimer vmstate

A9 gtimer includes global control field and number of per-cpu fields.
But only per-cpu ones are migrated. This patch adds a subsection for
global control field migration.

Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru>
Message-id: 164422345976.2186660.1104517592452494510.stgit@pasha-ThinkPad-X280
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 years agoMAINTAINERS: Add Akihiko Odaki to macOS-relateds
Akihiko Odaki [Sun, 13 Feb 2022 02:12:15 +0000 (11:12 +0900)]
MAINTAINERS: Add Akihiko Odaki to macOS-relateds

Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20220213021215.1974-1-akihiko.odaki@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 years agoinclude: Move hardware version declarations to new qemu/hw-version.h
Peter Maydell [Tue, 8 Feb 2022 20:08:56 +0000 (20:08 +0000)]
include: Move hardware version declarations to new qemu/hw-version.h

The "hardware version" machinery (qemu_set_hw_version(),
qemu_hw_version(), and the QEMU_HW_VERSION define) is used by fewer
than 10 files.  Move it out from osdep.h into a new
qemu/hw-version.h.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20220208200856.3558249-6-peter.maydell@linaro.org

2 years agoinclude: Move qemu_[id]cache_* declarations to new qemu/cacheinfo.h
Peter Maydell [Tue, 8 Feb 2022 20:08:55 +0000 (20:08 +0000)]
include: Move qemu_[id]cache_* declarations to new qemu/cacheinfo.h

The qemu_icache_linesize, qemu_icache_linesize_log,
qemu_dcache_linesize, and qemu_dcache_linesize_log variables are not
used in many files.  Move them out of osdep.h to a new
qemu/cacheinfo.h, and document them.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20220208200856.3558249-5-peter.maydell@linaro.org

2 years agoinclude: Move QEMU_MAP_* constants to mmap-alloc.h
Peter Maydell [Tue, 8 Feb 2022 20:08:54 +0000 (20:08 +0000)]
include: Move QEMU_MAP_* constants to mmap-alloc.h

The QEMU_MAP_* constants are used only as arguments to the
qemu_ram_mmap() function.  Move them to mmap-alloc.h, where that
function's prototype is defined.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20220208200856.3558249-4-peter.maydell@linaro.org

2 years agoinclude: Move qemu_mprotect_*() to new qemu/mprotect.h
Peter Maydell [Tue, 8 Feb 2022 20:08:53 +0000 (20:08 +0000)]
include: Move qemu_mprotect_*() to new qemu/mprotect.h

The qemu_mprotect_*() family of functions are used in very few files;
move them from osdep.h to a new qemu/mprotect.h.

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

2 years agoinclude: Move qemu_madvise() and related #defines to new qemu/madvise.h
Peter Maydell [Tue, 8 Feb 2022 20:08:52 +0000 (20:08 +0000)]
include: Move qemu_madvise() and related #defines to new qemu/madvise.h

The function qemu_madvise() and the QEMU_MADV_* constants associated
with it are used in only 10 files.  Move them out of osdep.h to a new
qemu/madvise.h header that is included where it is needed.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20220208200856.3558249-2-peter.maydell@linaro.org

2 years agohw/arm/armv7m: Handle disconnected clock inputs
Peter Maydell [Tue, 8 Feb 2022 17:16:43 +0000 (17:16 +0000)]
hw/arm/armv7m: Handle disconnected clock inputs

In the armv7m object, handle clock inputs that aren't connected.
This is always an error for 'cpuclk'. For 'refclk' it is OK for this
to be disconnected, but we need to handle it by not trying to connect
a sourceless-clock to the systick device.

This fixes a bug where on the mps2-an521 and similar boards (which
do not have a refclk) the systick device incorrectly reset with
SYST_CSR.CLKSOURCE 0 ("use refclk") rather than 1 ("use CPU clock").

Cc: qemu-stable@nongnu.org
Reported-by: Richard Petri <git@rpls.de>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20220208171643.3486277-1-peter.maydell@linaro.org

2 years agoKconfig: Add 'imply I2C_DEVICES' on boards with available i2c bus
Peter Maydell [Tue, 8 Feb 2022 15:59:11 +0000 (15:59 +0000)]
Kconfig: Add 'imply I2C_DEVICES' on boards with available i2c bus

For arm boards with an i2c bus which a user could reasonably
want to plug arbitrary devices, add 'imply I2C_DEVICES' to the
Kconfig stanza.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Hao Wu <wuhaotsh@google.com>
Message-id: 20220208155911.3408455-3-peter.maydell@linaro.org

2 years agoKconfig: Add I2C_DEVICES device group
Peter Maydell [Tue, 8 Feb 2022 15:59:10 +0000 (15:59 +0000)]
Kconfig: Add I2C_DEVICES device group

Currently there is no way for a board model's Kconfig stanza to
say "I have an i2c bus which the user can plug an i2c device into,
build all the free-standing i2c devices". The Kconfig mechanism
for this is the "device group". Add an I2C_DEVICES group along
the same lines as the existing PCI_DEVICES. Simple free-standing
i2c devices which a user might plausibly want to be able to
plug in on the QEMU commandline should have
   default y if I2C_DEVICES
and board models which have an i2c bus that is user-accessible
should use
   imply I2C_DEVICES
to cause those pluggable devices to be built.

In this commit we mark only a fairly conservative set of i2c devices
as belonging to the I2C_DEVICES group: the simple sensors and RTCs
(not including PMBus devices or devices which need GPIO lines to be
connected).

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Hao Wu <wuhaotsh@google.com>
Message-id: 20220208155911.3408455-2-peter.maydell@linaro.org

2 years agotarget/arm: Support PAuth extension for hvf
Peter Maydell [Fri, 4 Feb 2022 16:55:06 +0000 (16:55 +0000)]
target/arm: Support PAuth extension for hvf

Currently we don't allow guests under hvf to use the PAuth extension,
because we didn't have any special code to handle that, and therefore
in arm_cpu_pauth_finalize() we will sanitize the ID_AA64ISAR1 value
the guest sees to clear the PAuth related fields.

Add support for this in the same way that KVM does it, by defaulting
to "PAuth enabled" if the host CPU has it and allowing the user to
disable it via '-cpu pauth=no' on the command line.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Reviewed-by: Alexander Graf <agraf@csgraf.de>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20220204165506.2846058-7-peter.maydell@linaro.org

2 years agotarget/arm: Fix '-cpu max' for HVF
Peter Maydell [Fri, 4 Feb 2022 16:55:05 +0000 (16:55 +0000)]
target/arm: Fix '-cpu max' for HVF

Currently when using hvf we mishandle '-cpu max': we fall through to
the TCG version of its initfn, which then sets a lot of feature bits
that the real host CPU doesn't have. The hvf accelerator code then
exposes these bogus ID register values to the guest because it
doesn't check that the host really has the features.

Make '-cpu host' be like '-cpu max' for hvf, as we do with kvm.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Reviewed-by: Alexander Graf <agraf@csgraf.de>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20220204165506.2846058-6-peter.maydell@linaro.org

2 years agotarget/arm: Unindent unnecessary else-clause
Peter Maydell [Fri, 4 Feb 2022 16:55:04 +0000 (16:55 +0000)]
target/arm: Unindent unnecessary else-clause

Now that the if() branch of the condition in aarch64_max_initfn()
returns early, we don't need to keep the rest of the code in
the function inside an else block. Remove the else, unindenting
that code.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Reviewed-by: Alexander Graf <agraf@csgraf.de>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20220204165506.2846058-5-peter.maydell@linaro.org

2 years agotarget/arm: Make KVM -cpu max exactly like -cpu host
Peter Maydell [Fri, 4 Feb 2022 16:55:03 +0000 (16:55 +0000)]
target/arm: Make KVM -cpu max exactly like -cpu host

Currently for KVM the intention is that '-cpu max' and '-cpu host'
are the same thing, but because we did this with two separate
pieces of code they have got a little bit out of sync. Specifically,
'max' has a 'sve-max-vq' property, and 'host' does not.

Bring the two together by having the initfn for 'max' actually
call the initfn for 'host'. This will result in 'max' no longer
exposing the 'sve-max-vq' property when using KVM.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Reviewed-by: Alexander Graf <agraf@csgraf.de>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20220204165506.2846058-4-peter.maydell@linaro.org

2 years agotarget/arm: Use aarch64_cpu_register() for 'host' CPU type
Peter Maydell [Fri, 4 Feb 2022 16:55:02 +0000 (16:55 +0000)]
target/arm: Use aarch64_cpu_register() for 'host' CPU type

Use the aarch64_cpu_register() machinery to register the 'host' CPU
type.  This doesn't gain us anything functionally, but it does mean
that the code for initializing it looks more like that for the other
CPU types, in that its initfn then doesn't need to call
arm_cpu_post_init() (because aarch64_cpu_instance_init() does that
for it).

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Reviewed-by: Alexander Graf <agraf@csgraf.de>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20220204165506.2846058-3-peter.maydell@linaro.org

2 years agotarget/arm: Move '-cpu host' code to cpu64.c
Peter Maydell [Fri, 4 Feb 2022 16:55:01 +0000 (16:55 +0000)]
target/arm: Move '-cpu host' code to cpu64.c

Now that KVM has dropped AArch32 host support, the 'host' CPU type is
always AArch64, and we can move it to cpu64.c.  This move will allow
us to share code between it and '-cpu max', which should behave
the same as '-cpu host' when using KVM or HVF.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Reviewed-by: Alexander Graf <agraf@csgraf.de>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20220204165506.2846058-2-peter.maydell@linaro.org

2 years agocheckpatch: Ensure that TypeInfos are const
Bernhard Beschow [Mon, 17 Jan 2022 14:58:05 +0000 (15:58 +0100)]
checkpatch: Ensure that TypeInfos are const

Now that all static TypeInfo instances are declared const, prevent that
new non-const instances are created.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20220117145805.173070-3-shentey@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 years agoMark remaining global TypeInfo instances as const
Bernhard Beschow [Mon, 17 Jan 2022 14:58:04 +0000 (15:58 +0100)]
Mark remaining global TypeInfo instances as const

More than 1k of TypeInfo instances are already marked as const. Mark the
remaining ones, too.

This commit was created with:
  git grep -z -l 'static TypeInfo' -- '*.c' | \
  xargs -0 sed -i 's/static TypeInfo/static const TypeInfo/'

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Acked-by: Corey Minyard <cminyard@mvista.com>
Message-id: 20220117145805.173070-2-shentey@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 years agohvf: arm: Handle unknown ID registers as RES0
Alexander Graf [Wed, 9 Feb 2022 12:41:35 +0000 (13:41 +0100)]
hvf: arm: Handle unknown ID registers as RES0

Recent Linux versions added support to read ID_AA64ISAR2_EL1. On M1,
those reads trap into QEMU which handles them as faults.

However, AArch64 ID registers should always read as RES0. Let's
handle them accordingly.

This fixes booting Linux 5.17 guests.

Cc: qemu-stable@nongnu.org
Reported-by: Ivan Babrou <ivan@cloudflare.com>
Signed-off-by: Alexander Graf <agraf@csgraf.de>
Message-id: 20220209124135.69183-2-agraf@csgraf.de
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 years agohvf: arm: Use macros for sysreg shift/masking
Alexander Graf [Wed, 9 Feb 2022 12:41:34 +0000 (13:41 +0100)]
hvf: arm: Use macros for sysreg shift/masking

We are parsing the syndrome field for sysregs in multiple places across
the hvf code, but repeat shift/mask operations with hard coded constants
every time. This is an error prone approach and makes it harder to reason
about the correctness of these operations.

Let's introduce macros that allow us to unify the constants used as well
as create new helpers to extract fields from the sysreg value.

Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Alexander Graf <agraf@csgraf.de>
Reviewed-by: Cameron Esfahani <dirty@apple.com <mailto:dirty@apple.com>>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20220209124135.69183-1-agraf@csgraf.de
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 years agohw/tricore: Remove unused and incorrect header
Philippe Mathieu-Daudé [Mon, 14 Feb 2022 18:31:33 +0000 (19:31 +0100)]
hw/tricore: Remove unused and incorrect header

TriCore boards certainly don't need the ARM loader API :)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20220214183144.27402-4-f4bug@amsat.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2 years agoconfigure, meson: move CONFIG_IASL to a Meson option
Paolo Bonzini [Wed, 13 Oct 2021 11:19:00 +0000 (13:19 +0200)]
configure, meson: move CONFIG_IASL to a Meson option

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 years agomeson, configure: move ntddscsi API check to meson
Marc-André Lureau [Wed, 2 Feb 2022 09:19:04 +0000 (10:19 +0100)]
meson, configure: move ntddscsi API check to meson

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 years agomeson: require dynamic linking for VSS support
Marc-André Lureau [Wed, 2 Feb 2022 09:14:49 +0000 (10:14 +0100)]
meson: require dynamic linking for VSS support

The glib_dynamic detection does not work because the dependency is
overridden in the main meson.build.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
[Rewritten commit message, added requirement in qga/meson.build - Paolo]
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 years agoqga/vss-win32: require widl/midl, remove pre-built TLB file
Marc-André Lureau [Tue, 1 Feb 2022 08:55:21 +0000 (12:55 +0400)]
qga/vss-win32: require widl/midl, remove pre-built TLB file

There are no good reason anymore to keep a pre-built file in the repository.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 years agomeson: do not make qga/vss-win32/meson.build conditional on C++ presence
Marc-André Lureau [Tue, 1 Feb 2022 20:23:33 +0000 (00:23 +0400)]
meson: do not make qga/vss-win32/meson.build conditional on C++ presence

C++ presence is checked by the qga/ directory, so it can be assumed
when building VSS module.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 years agoconfigure, meson: replace VSS SDK checks and options with --enable-vss-sdk
Marc-André Lureau [Tue, 1 Feb 2022 12:53:43 +0000 (16:53 +0400)]
configure, meson: replace VSS SDK checks and options with --enable-vss-sdk

The VSS headers are part of standard MS VS SDK, at least since version
15, and probably before that.

They are also included with MinGW, although currently broken.

Let's streamline a bit the options, by not making it so special, and
instead rely on proper system headers configuration or user
--extra-cxxflags. This still requires some extra step to cross-build
with MinGW as described in the meson.build file now.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
[Use a "feature"-type option. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 years agoqga/vss: use standard windows headers location
Marc-André Lureau [Mon, 31 Jan 2022 19:47:37 +0000 (23:47 +0400)]
qga/vss: use standard windows headers location

Stop using special paths with outdated headers from an old SDK.

Instead, use standard include paths.

You can still build against the old SDK by running configure with
--extra-cxxflags="-isystem /path/to/inc/win2003/"

(this also allows to build against MinGW headers, which are currently
broken as in 9.0)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 years agoqga/vss-win32: use widl if available
Marc-André Lureau [Tue, 1 Feb 2022 08:53:15 +0000 (12:53 +0400)]
qga/vss-win32: use widl if available

widl from mingw64-tools and wine can compile a TLB file.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 years agomeson: drop --with-win-sdk
Marc-André Lureau [Tue, 1 Feb 2022 12:29:22 +0000 (16:29 +0400)]
meson: drop --with-win-sdk

It's no longer used.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 years agoqga/vss-win32: fix midl arguments
Marc-André Lureau [Tue, 1 Feb 2022 12:21:47 +0000 (16:21 +0400)]
qga/vss-win32: fix midl arguments

Microsoft midl compiler doesn't take "-options" form, nor does it take
OUTPUT filename. The -I option seems needless as well (at least with
VS15).

It's not clear what was actually used when it was introduced in commit
b39297aedfabe9.

strings says "Created by MIDL version 7.00.0555 at Fri Dec 21 13:36:39
2012".

I doubt the makefile rule actually ever worked.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 years agomeson: refine check for whether to look for virglrenderer
Paolo Bonzini [Fri, 17 Dec 2021 11:36:26 +0000 (12:36 +0100)]
meson: refine check for whether to look for virglrenderer

The check should be performed even if !have_system, as long as there is some hope that
vhost-user-gpu will be built.  Store into have_vhost_user_gpu whether vhost-user-gpu
will be built; we will also use the variable to decide whether to look for libepoxy.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 years agoconfigure, meson: move guest-agent, tools to meson
Paolo Bonzini [Fri, 15 Oct 2021 14:47:43 +0000 (16:47 +0200)]
configure, meson: move guest-agent, tools to meson

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 years agoconfigure, meson: move smbd options to meson_options.txt
Paolo Bonzini [Wed, 13 Oct 2021 11:43:36 +0000 (13:43 +0200)]
configure, meson: move smbd options to meson_options.txt

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 years agoconfigure, meson: move coroutine options to meson_options.txt
Paolo Bonzini [Wed, 13 Oct 2021 09:52:03 +0000 (11:52 +0200)]
configure, meson: move coroutine options to meson_options.txt

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 years agoconfigure, meson: move some default-disabled options to meson_options.txt
Paolo Bonzini [Wed, 13 Oct 2021 09:46:09 +0000 (11:46 +0200)]
configure, meson: move some default-disabled options to meson_options.txt

These do not depend on --with-default-features, so they become
booleans in meson too.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 years agomeson: define qemu_cflags/qemu_ldflags
Paolo Bonzini [Mon, 8 Nov 2021 11:36:29 +0000 (12:36 +0100)]
meson: define qemu_cflags/qemu_ldflags

Prepare for moving more compiler tests to Meson.  If the full set
of compiler flags is needed in a cc.compiles/cc.links test, it will
be handy to have a variable analogous to QEMU_CFLAGS.

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 years agoconfigure, meson: move block layer options to meson_options.txt
Paolo Bonzini [Wed, 13 Oct 2021 09:43:54 +0000 (11:43 +0200)]
configure, meson: move block layer options to meson_options.txt

Unlike image formats, these also require an entry in config-host.h.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 years agoconfigure, meson: move image format options to meson_options.txt
Paolo Bonzini [Wed, 13 Oct 2021 09:42:25 +0000 (11:42 +0200)]
configure, meson: move image format options to meson_options.txt

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 years agoconfigure, meson: cleanup qemu-ga libraries
Paolo Bonzini [Fri, 15 Oct 2021 14:28:29 +0000 (16:28 +0200)]
configure, meson: cleanup qemu-ga libraries

Move LIBS_QGA to meson.build, remove dead QGA_VSS_PROVIDER variable.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 years agoconfigure, meson: move TPM check to meson
Paolo Bonzini [Tue, 21 Dec 2021 11:38:27 +0000 (12:38 +0100)]
configure, meson: move TPM check to meson

The check is simply for a POSIX system.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 years agoconfigure, meson: move libnuma detection to meson
Paolo Bonzini [Tue, 21 Dec 2021 11:38:27 +0000 (12:38 +0100)]
configure, meson: move libnuma detection to meson

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 years agoconfigure, meson: move AF_ALG test to meson
Paolo Bonzini [Mon, 8 Nov 2021 13:02:42 +0000 (14:02 +0100)]
configure, meson: move AF_ALG test to meson

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2 years agohw/m68k/mcf: Add missing 'exec/hwaddr.h' header
Philippe Mathieu-Daudé [Wed, 9 Feb 2022 21:54:33 +0000 (22:54 +0100)]
hw/m68k/mcf: Add missing 'exec/hwaddr.h' header

hwaddr type is defined in "exec/hwaddr.h".

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20220209215446.58402-3-f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2 years agoexec/exec-all: Move 'qemu/log.h' include in units requiring it
Philippe Mathieu-Daudé [Mon, 7 Feb 2022 08:27:56 +0000 (09:27 +0100)]
exec/exec-all: Move 'qemu/log.h' include in units requiring it

Many files use "qemu/log.h" declarations but neglect to include
it (they inherit it via "exec/exec-all.h"). "exec/exec-all.h" is
a core component and shouldn't be used that way. Move the
"qemu/log.h" inclusion locally to each unit requiring it.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Acked-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20220207082756.82600-10-f4bug@amsat.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2 years agosoftmmu/runstate: Clean headers
Philippe Mathieu-Daudé [Mon, 7 Feb 2022 07:54:18 +0000 (08:54 +0100)]
softmmu/runstate: Clean headers

Add the missing 'qemu/log.h' header and remove the
unused 'exec/exec-all.h' one.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20220207075426.81934-14-f4bug@amsat.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2 years agolinux-user: Add missing "qemu/timer.h" include
Philippe Mathieu-Daudé [Mon, 7 Feb 2022 08:27:55 +0000 (09:27 +0100)]
linux-user: Add missing "qemu/timer.h" include

"qemu/timer.h" declares cpu_get_host_ticks().

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220207082756.82600-9-f4bug@amsat.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2 years agotarget: Add missing "qemu/timer.h" include
Philippe Mathieu-Daudé [Mon, 7 Feb 2022 08:27:54 +0000 (09:27 +0100)]
target: Add missing "qemu/timer.h" include

timer_new_ns(), cpu_get_host_ticks() and NANOSECONDS_PER_SECOND are
declared in "qemu/timer.h".

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-Id: <20220207082756.82600-8-f4bug@amsat.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2 years agocore/ptimers: Remove unnecessary 'sysemu/cpus.h' include
Philippe Mathieu-Daudé [Mon, 7 Feb 2022 08:27:53 +0000 (09:27 +0100)]
core/ptimers: Remove unnecessary 'sysemu/cpus.h' include

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220207082756.82600-7-f4bug@amsat.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2 years agoexec/ramblock: Add missing includes
Philippe Mathieu-Daudé [Mon, 7 Feb 2022 08:27:52 +0000 (09:27 +0100)]
exec/ramblock: Add missing includes

"exec/ramblock.h" requires "qemu/rcu.h" for the definition of
rcu_head, and "exec/ramlist.h" for the definition of RAMBlockNotifier.
Add them to avoid when when refactoring include/:

  include/exec/ramblock.h:26:21: error: field has incomplete type 'struct rcu_head'
    struct rcu_head rcu;
                    ^

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220207082756.82600-6-f4bug@amsat.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2 years agoqtest: Add missing 'hw/qdev-core.h' include
Philippe Mathieu-Daudé [Mon, 7 Feb 2022 08:27:51 +0000 (09:27 +0100)]
qtest: Add missing 'hw/qdev-core.h' include

Add "hw/qdev-core.h" to avoid when refactoring include/:

  softmmu/qtest.c:404:9: error: use of undeclared identifier 'NamedGPIOList'
        NamedGPIOList *ngl;
        ^

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220207082756.82600-5-f4bug@amsat.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2 years agohw/acpi/memory_hotplug: Remove unused 'hw/acpi/pc-hotplug.h' header
Philippe Mathieu-Daudé [Mon, 7 Feb 2022 08:27:50 +0000 (09:27 +0100)]
hw/acpi/memory_hotplug: Remove unused 'hw/acpi/pc-hotplug.h' header

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <20220207082756.82600-4-f4bug@amsat.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2 years agohw/remote: Add missing include
Philippe Mathieu-Daudé [Mon, 7 Feb 2022 08:27:49 +0000 (09:27 +0100)]
hw/remote: Add missing include

Currently "qemu/error-report.h" is implicitly included, however
if headers in include/ get refactored, we get:

  hw/remote/proxy-memory-listener.c: In function ‘proxy_memory_listener_commit’:
  hw/remote/proxy-memory-listener.c:183:9: error: implicit declaration of function ‘error_report’; did you mean ‘error_report_err’? [-Werror=implicit-function-declaration]
    183 |         error_report("Number of fds is more than %d", REMOTE_MAX_FDS);
        |         ^~~~~~~~~~~~
        |         error_report_err

Add the missing "qemu/error-report.h" header to avoid that.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Jagannathan Raman <jag.raman@oracle.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220207082756.82600-3-f4bug@amsat.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2 years agohw/tpm: Clean includes
Philippe Mathieu-Daudé [Mon, 7 Feb 2022 08:27:48 +0000 (09:27 +0100)]
hw/tpm: Clean includes

"tpm_ppi.h" only requires to include "exec/memory.h" to get
the MemoryRegion declaration.

tpm_ppi.c requires "hw/qdev-core.h" to use the DEVICE() macro,
tpm_crb.c is the only source file requiring "exec/address-spaces.h".

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220207082756.82600-2-f4bug@amsat.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2 years agoscripts: Remove the old switch-timer-api script
Thomas Huth [Mon, 24 Jan 2022 10:20:01 +0000 (11:20 +0100)]
scripts: Remove the old switch-timer-api script

This script has been useful for the timer API rewrite in 2013, but
it is of no use anymore today. Let's remove it now.

Message-Id: <20220124102001.35930-1-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2 years agotests/qtest: failover: migration abort test with failover off
Laurent Vivier [Thu, 3 Feb 2022 14:15:37 +0000 (15:15 +0100)]
tests/qtest: failover: migration abort test with failover off

Test abort during active migration when failover is disabled from QEMU
or from guest side.

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Message-Id: <20220203141537.972317-8-lvivier@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2 years agotests/qtest: failover: test migration if the guest doesn't support failover
Laurent Vivier [Thu, 3 Feb 2022 14:15:36 +0000 (15:15 +0100)]
tests/qtest: failover: test migration if the guest doesn't support failover

The primary device is not plugged and the migration is done only with
the standby device

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Message-Id: <20220203141537.972317-7-lvivier@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2 years agotests/qtest: failover: check migration with failover off
Laurent Vivier [Thu, 3 Feb 2022 14:15:35 +0000 (15:15 +0100)]
tests/qtest: failover: check migration with failover off

If failover is off, the primary device is not plugged and
the migration is done only with the standby device.

On destination, the primary device must not be plugged.

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Message-Id: <20220203141537.972317-6-lvivier@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2 years agotests/qtest: failover: check missing guest feature
Laurent Vivier [Thu, 3 Feb 2022 14:15:34 +0000 (15:15 +0100)]
tests/qtest: failover: check missing guest feature

If QEMU provides the VIRTIO_NET_F_STANDBY feature but the guest doesn't
the primary device must be kept hidden

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Message-Id: <20220203141537.972317-5-lvivier@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2 years agotests/qtest: failover: check the feature is correctly provided
Laurent Vivier [Thu, 3 Feb 2022 14:15:33 +0000 (15:15 +0100)]
tests/qtest: failover: check the feature is correctly provided

Check QEMU provides the VIRTIO_NET_F_STANDBY if failover is on,
and doesn't if failover is off

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Message-Id: <20220203141537.972317-4-lvivier@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2 years agotests/qtest: failover: use a macro for check_one_card()
Laurent Vivier [Thu, 3 Feb 2022 14:15:32 +0000 (15:15 +0100)]
tests/qtest: failover: use a macro for check_one_card()

This allows g_assert() to correctly report the line number of the error
in the test case.

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Message-Id: <20220203141537.972317-3-lvivier@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2 years agotests/qtest: failover: clean up pathname of tests
Laurent Vivier [Thu, 3 Feb 2022 14:15:31 +0000 (15:15 +0100)]
tests/qtest: failover: clean up pathname of tests

clearly indentify parameters, hotplug and migration tests

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Message-Id: <20220203141537.972317-2-lvivier@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2 years agotests/qtest/ide-test: Remove bad retry_isa test
Thomas Huth [Fri, 21 Jan 2022 12:06:35 +0000 (13:06 +0100)]
tests/qtest/ide-test: Remove bad retry_isa test

The retry_isa test is not doing what it was intended for: The
test_retry_flush() function ignores the machine parameter completely
and thus this test does not get run with the "isapc" machine.
Moreover, in the course of time, the test_retry_flush() has been
changed to depend on PCI-related functions, so this also cannot
be fixed by simply using the machine parameter now. The correct
fix would be to switch the whole test to libqos, but until someone
has time to do this, let's simply drop the retry_isa test for now.

Message-Id: <20220121120635.220644-1-thuth@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2 years agotests/qtest/vhost-user-test.c: Use vhostforce=on
Eric Auger [Thu, 10 Feb 2022 14:52:50 +0000 (15:52 +0100)]
tests/qtest/vhost-user-test.c: Use vhostforce=on

-netdev vhost-user,vhostforce is deprecated and vhostforce=on
should be used instead.

Signed-off-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20220210145254.157790-2-eric.auger@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2 years agoerst: drop cast to long long
Michael S. Tsirkin [Sun, 6 Feb 2022 09:35:57 +0000 (04:35 -0500)]
erst: drop cast to long long

The way to print uint64_t is with PRIx64, not with
a cast to long long.

Message-Id: <20220206093547.1282513-1-mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2 years agotests/x86: Use 'pc' machine type for hotplug tests
Dr. David Alan Gilbert [Tue, 15 Feb 2022 16:25:32 +0000 (16:25 +0000)]
tests/x86: Use 'pc' machine type for hotplug tests

Hotplug tests need a bridge setting up on q35, for now
keep them on 'pc'.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20220215162537.605030-3-dgilbert@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2 years agotests/x86: Use 'pc' machine type for old hardware tests
Dr. David Alan Gilbert [Tue, 15 Feb 2022 16:25:31 +0000 (16:25 +0000)]
tests/x86: Use 'pc' machine type for old hardware tests

For tests that rely on old hardware, e.g. floppies or IDE drives,
explicitly select the 'pc' machine type.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20220215162537.605030-2-dgilbert@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2 years agoMAINTAINERS: Adding myself as a reviewer of some components
Ani Sinha [Mon, 31 Jan 2022 12:20:01 +0000 (17:50 +0530)]
MAINTAINERS: Adding myself as a reviewer of some components

Added myself as a reviewer of vmgenid, unimplemented device and empty slot.

Signed-off-by: Ani Sinha <ani@anisinha.ca>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20220131122001.1476101-1-ani@anisinha.ca
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 years agoMerge remote-tracking branch 'remotes/legoater/tags/pull-ppc-20220218' into staging
Peter Maydell [Sun, 20 Feb 2022 15:05:41 +0000 (15:05 +0000)]
Merge remote-tracking branch 'remotes/legoater/tags/pull-ppc-20220218' into staging

ppc-7.0 queue

* target/ppc: SPR registration cleanups (Fabiano)
* ppc: nested KVM HV for spapr virtual hypervisor (Nicholas)
* spapr: nvdimm: Introduce spapr-nvdimm device (Shivaprasad)

# gpg: Signature made Fri 18 Feb 2022 07:59:29 GMT
# gpg:                using RSA key A0F66548F04895EBFE6B0B6051A343C7CFFBECA1
# gpg: Good signature from "Cédric Le Goater <clg@kaod.org>" [undefined]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: A0F6 6548 F048 95EB FE6B  0B60 51A3 43C7 CFFB ECA1

* remotes/legoater/tags/pull-ppc-20220218: (39 commits)
  target/ppc: Move common SPR functions out of cpu_init
  target/ppc: cpu_init: Move check_pow and QOM macros to a header
  target/ppc: cpu_init: Move SPR registration macros to a header
  target/ppc: cpu_init: Expose some SPR registration helpers
  target/ppc: Rename spr_tcg.h to spr_common.h
  target/ppc: cpu_init: Remove register_usprg3_sprs
  target/ppc: cpu_init: Rename register_ne_601_sprs
  target/ppc: cpu_init: Reuse init_proc_745 for the 755
  target/ppc: cpu_init: Reuse init_proc_604 for the 604e
  target/ppc: cpu_init: Reuse init_proc_603 for the e300
  target/ppc: cpu_init: Move 604e SPR registration into a function
  target/ppc: cpu_init: Move e300 SPR registration into a function
  target/ppc: cpu_init: Move 755 L2 cache SPRs into a function
  target/ppc: cpu_init: Deduplicate 7xx SPR registration
  target/ppc: cpu_init: Deduplicate 745/755 SPR registration
  target/ppc: cpu_init: Deduplicate 604 SPR registration
  target/ppc: cpu_init: Deduplicate 603 SPR registration
  target/ppc: cpu_init: Deduplicate 440 SPR registration
  target/ppc: cpu_init: Decouple 74xx SPR registration from 7xx
  target/ppc: cpu_init: Decouple G2 SPR registration from 755
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 years agoMerge remote-tracking branch 'remotes/dgilbert-gitlab/tags/pull-virtiofs-20220217b...
Peter Maydell [Sat, 19 Feb 2022 15:24:12 +0000 (15:24 +0000)]
Merge remote-tracking branch 'remotes/dgilbert-gitlab/tags/pull-virtiofs-20220217b' into staging

V3: virtiofs pull 2022-02-17

Security label improvements from Vivek
  - includes a fix for building against new kernel headers
  [V3: checkpatch style fixes]
  [V2: Fix building on old Linux]
Blocking flock disable from Sebastian
SYNCFS support from Greg

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
# gpg: Signature made Thu 17 Feb 2022 17:24:25 GMT
# gpg:                using RSA key 45F5C71B4A0CB7FB977A9FA90516331EBC5BFDE7
# gpg: Good signature from "Dr. David Alan Gilbert (RH2) <dgilbert@redhat.com>" [full]
# Primary key fingerprint: 45F5 C71B 4A0C B7FB 977A  9FA9 0516 331E BC5B FDE7

* remotes/dgilbert-gitlab/tags/pull-virtiofs-20220217b:
  virtiofsd: Add basic support for FUSE_SYNCFS request
  virtiofsd: Add an option to enable/disable security label
  virtiofsd: Create new file using O_TMPFILE and set security context
  virtiofsd: Create new file with security context
  virtiofsd: Add helpers to work with /proc/self/task/tid/attr/fscreate
  virtiofsd: Move core file creation code in separate function
  virtiofsd, fuse_lowlevel.c: Add capability to parse security context
  virtiofsd: Extend size of fuse_conn_info->capable and ->want fields
  virtiofsd: Parse extended "struct fuse_init_in"
  linux-headers: Update headers to v5.17-rc1
  virtiofsd: Fix breakage due to fuse_init_in size change
  virtiofsd: Do not support blocking flock

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 years agoMerge remote-tracking branch 'remotes/cschoenebeck/tags/pull-9p-20220217' into staging
Peter Maydell [Sat, 19 Feb 2022 12:59:38 +0000 (12:59 +0000)]
Merge remote-tracking branch 'remotes/cschoenebeck/tags/pull-9p-20220217' into staging

9pfs: fixes and cleanup

* Fifth patch fixes a 9pfs server crash that happened on some systems due
  to incorrect (system dependant) handling of struct dirent size.

* Tests: Second patch fixes a test error that happened on some systems due
  mkdir() being called twice for creating the test directory for the 9p
  'local' tests.

* Tests: Third patch fixes a memory leak.

* Tests: The remaining two patches are code cleanup.

# gpg: Signature made Thu 17 Feb 2022 16:19:25 GMT
# gpg:                using RSA key 96D8D110CF7AF8084F88590134C2B58765A47395
# gpg:                issuer "qemu_oss@crudebyte.com"
# gpg: Good signature from "Christian Schoenebeck <qemu_oss@crudebyte.com>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: ECAB 1A45 4014 1413 BA38  4926 30DB 47C3 A012 D5F4
#      Subkey fingerprint: 96D8 D110 CF7A F808 4F88  5901 34C2 B587 65A4 7395

* remotes/cschoenebeck/tags/pull-9p-20220217:
  9pfs: Fix segfault in do_readdir_many caused by struct dirent overread
  tests/9pfs: Use g_autofree and g_autoptr where possible
  tests/9pfs: Fix leak of local_test_path
  tests/9pfs: fix mkdir() being called twice
  tests/9pfs: use g_autofree where possible

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2 years agotarget/ppc: Move common SPR functions out of cpu_init
Fabiano Rosas [Fri, 18 Feb 2022 07:34:15 +0000 (08:34 +0100)]
target/ppc: Move common SPR functions out of cpu_init

Let's leave cpu_init with just generic CPU initialization and
QOM-related functions.

The rest of the SPR registration functions will be moved in the
following patches along with the code that uses them. These are only
the commonly used ones.

Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20220216162426.1885923-28-farosas@linux.ibm.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
2 years agotarget/ppc: cpu_init: Move check_pow and QOM macros to a header
Fabiano Rosas [Fri, 18 Feb 2022 07:34:15 +0000 (08:34 +0100)]
target/ppc: cpu_init: Move check_pow and QOM macros to a header

These will need to be accessed from other files once we move the CPUs
code to separate files.

The check_pow_hid0 and check_pow_hid0_74xx are too specific to be
moved to a header so I'll deal with them later when splitting this
code between the multiple CPU families.

Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20220216162426.1885923-27-farosas@linux.ibm.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
2 years agotarget/ppc: cpu_init: Move SPR registration macros to a header
Fabiano Rosas [Fri, 18 Feb 2022 07:34:15 +0000 (08:34 +0100)]
target/ppc: cpu_init: Move SPR registration macros to a header

Put the SPR registration macros in a header that is accessible outside
of cpu_init.c. The following patches will move CPU-specific code to
separate files and will need to access it.

Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20220216162426.1885923-26-farosas@linux.ibm.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
2 years agotarget/ppc: cpu_init: Expose some SPR registration helpers
Fabiano Rosas [Fri, 18 Feb 2022 07:34:15 +0000 (08:34 +0100)]
target/ppc: cpu_init: Expose some SPR registration helpers

The following patches will move CPU-specific code into separate files,
so expose the most used SPR registration functions:

register_sdr1_sprs         | 22 callers
register_low_BATs          | 20 callers
register_non_embedded_sprs | 19 callers
register_high_BATs         | 10 callers
register_thrm_sprs         | 8 callers
register_usprgh_sprs       | 6 callers
register_6xx_7xx_soft_tlb  | only 3 callers, but it helps to
                             keep the soft TLB code consistent.

Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20220216162426.1885923-25-farosas@linux.ibm.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
2 years agotarget/ppc: Rename spr_tcg.h to spr_common.h
Fabiano Rosas [Fri, 18 Feb 2022 07:34:15 +0000 (08:34 +0100)]
target/ppc: Rename spr_tcg.h to spr_common.h

Initial intent for the spr_tcg header was to expose the spr_read|write
callbacks that are only used by TCG code. However, although these
routines are TCG-specific, the KVM code needs access to env->sprs
which creation is currently coupled to the callback registration.

We are probably not going to decouple SPR creation and TCG callback
registration any time soon, so let's rename the header to spr_common
to accomodate the register_*_sprs functions that will be moved out of
cpu_init.c in the following patches.

Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20220216162426.1885923-24-farosas@linux.ibm.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
2 years agotarget/ppc: cpu_init: Remove register_usprg3_sprs
Fabiano Rosas [Fri, 18 Feb 2022 07:34:15 +0000 (08:34 +0100)]
target/ppc: cpu_init: Remove register_usprg3_sprs

This function registers just one SPR and has only two callers, so open
code it.

Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20220216162426.1885923-23-farosas@linux.ibm.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
2 years agotarget/ppc: cpu_init: Rename register_ne_601_sprs
Fabiano Rosas [Fri, 18 Feb 2022 07:34:15 +0000 (08:34 +0100)]
target/ppc: cpu_init: Rename register_ne_601_sprs

The important part of this function is that it applies to non-embedded
CPUs, not that it also applies to the 601. We removed support for the
601 anyway, so rename this function.

Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20220216162426.1885923-22-farosas@linux.ibm.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
2 years agotarget/ppc: cpu_init: Reuse init_proc_745 for the 755
Fabiano Rosas [Fri, 18 Feb 2022 07:34:15 +0000 (08:34 +0100)]
target/ppc: cpu_init: Reuse init_proc_745 for the 755

The init_proc_755 function is identical to the 745 one except for the
755-specific registers. I think it is worth it to make them share
code.

Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20220216162426.1885923-21-farosas@linux.ibm.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
2 years agotarget/ppc: cpu_init: Reuse init_proc_604 for the 604e
Fabiano Rosas [Fri, 18 Feb 2022 07:34:15 +0000 (08:34 +0100)]
target/ppc: cpu_init: Reuse init_proc_604 for the 604e

Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20220216162426.1885923-20-farosas@linux.ibm.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
2 years agotarget/ppc: cpu_init: Reuse init_proc_603 for the e300
Fabiano Rosas [Fri, 18 Feb 2022 07:34:15 +0000 (08:34 +0100)]
target/ppc: cpu_init: Reuse init_proc_603 for the e300

init_proc_603 is defined after init_proc_e300, so I had to move some
code around to make it work.

Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20220216162426.1885923-19-farosas@linux.ibm.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
2 years agotarget/ppc: cpu_init: Move 604e SPR registration into a function
Fabiano Rosas [Fri, 18 Feb 2022 07:34:15 +0000 (08:34 +0100)]
target/ppc: cpu_init: Move 604e SPR registration into a function

This is done to improve init_proc readability and to make subsequent
patches that touch this code a bit cleaner.

Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20220216162426.1885923-18-farosas@linux.ibm.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
2 years agotarget/ppc: cpu_init: Move e300 SPR registration into a function
Fabiano Rosas [Fri, 18 Feb 2022 07:34:15 +0000 (08:34 +0100)]
target/ppc: cpu_init: Move e300 SPR registration into a function

This is done to improve init_proc readability and to make subsequent
patches that touch this code a bit cleaner.

Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20220216162426.1885923-17-farosas@linux.ibm.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
2 years agotarget/ppc: cpu_init: Move 755 L2 cache SPRs into a function
Fabiano Rosas [Fri, 18 Feb 2022 07:34:15 +0000 (08:34 +0100)]
target/ppc: cpu_init: Move 755 L2 cache SPRs into a function

This is just to have 755-specific registers contained into a function,
intead of leaving them open-coded in init_proc_755. It makes init_proc
easier to read and keeps later patches that touch this code a bit
cleaner.

Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20220216162426.1885923-16-farosas@linux.ibm.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
2 years agotarget/ppc: cpu_init: Deduplicate 7xx SPR registration
Fabiano Rosas [Fri, 18 Feb 2022 07:34:15 +0000 (08:34 +0100)]
target/ppc: cpu_init: Deduplicate 7xx SPR registration

Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20220216162426.1885923-15-farosas@linux.ibm.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
2 years agotarget/ppc: cpu_init: Deduplicate 745/755 SPR registration
Fabiano Rosas [Fri, 18 Feb 2022 07:34:15 +0000 (08:34 +0100)]
target/ppc: cpu_init: Deduplicate 745/755 SPR registration

The 745 and 755 can share the HID registration, so move it all into
register_755_sprs, which applies for both CPUs.

Also rename that function to register_745_sprs, since the 745 is the
earliest of the two. This will help with separating 755-specific
registers in a subsequent patch.

Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20220216162426.1885923-14-farosas@linux.ibm.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
2 years agotarget/ppc: cpu_init: Deduplicate 604 SPR registration
Fabiano Rosas [Fri, 18 Feb 2022 07:34:15 +0000 (08:34 +0100)]
target/ppc: cpu_init: Deduplicate 604 SPR registration

Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20220216162426.1885923-13-farosas@linux.ibm.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
2 years agotarget/ppc: cpu_init: Deduplicate 603 SPR registration
Fabiano Rosas [Fri, 18 Feb 2022 07:34:15 +0000 (08:34 +0100)]
target/ppc: cpu_init: Deduplicate 603 SPR registration

Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20220216162426.1885923-12-farosas@linux.ibm.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
2 years agotarget/ppc: cpu_init: Deduplicate 440 SPR registration
Fabiano Rosas [Fri, 18 Feb 2022 07:34:15 +0000 (08:34 +0100)]
target/ppc: cpu_init: Deduplicate 440 SPR registration

Move some of the 440 registers that are being repeated in the 440*
CPUs to register_440_sprs.

Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20220216162426.1885923-11-farosas@linux.ibm.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
2 years agotarget/ppc: cpu_init: Decouple 74xx SPR registration from 7xx
Fabiano Rosas [Fri, 18 Feb 2022 07:34:14 +0000 (08:34 +0100)]
target/ppc: cpu_init: Decouple 74xx SPR registration from 7xx

We're considering these two to be from different CPU families, so
duplicate some code to keep them separate.

Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20220216162426.1885923-10-farosas@linux.ibm.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
2 years agotarget/ppc: cpu_init: Decouple G2 SPR registration from 755
Fabiano Rosas [Fri, 18 Feb 2022 07:34:14 +0000 (08:34 +0100)]
target/ppc: cpu_init: Decouple G2 SPR registration from 755

We're considering these two to be in different CPU families (6xx and
7xx), so keep their SPR registration separate.

The code was copied into register_G2_sprs and the common function was
renamed to apply only to the 755.

Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20220216162426.1885923-9-farosas@linux.ibm.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
2 years agotarget/ppc: cpu_init: Move G2 SPRs into register_G2_sprs
Fabiano Rosas [Fri, 18 Feb 2022 07:34:14 +0000 (08:34 +0100)]
target/ppc: cpu_init: Move G2 SPRs into register_G2_sprs

Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20220216162426.1885923-8-farosas@linux.ibm.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
2 years agotarget/ppc: cpu_init: Move 405 SPRs into register_405_sprs
Fabiano Rosas [Fri, 18 Feb 2022 07:34:14 +0000 (08:34 +0100)]
target/ppc: cpu_init: Move 405 SPRs into register_405_sprs

Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Message-Id: <20220216162426.1885923-7-farosas@linux.ibm.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>