OSDN Git Service

qmiga/qemu.git
3 years agoMakefile: Skip the meson subdir in cscope/TAGS/ctags
Greg Kurz [Thu, 3 Sep 2020 19:47:55 +0000 (21:47 +0200)]
Makefile: Skip the meson subdir in cscope/TAGS/ctags

If the meson submodule is present, we don't really want to index its
source code. Consolidate the find command in a single place and use
it for cscope, ctags and etags. Note that this now causes ctags and
etags to also index assembly files, but this is okay since they both
have been supporting assembly since 2001 at least.

Signed-off-by: Greg Kurz <groug@kaod.org>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <159916247553.691541.10480293747685886851.stgit@bahia.lan>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
3 years agoMakefile: Drop extra phony cscope
Greg Kurz [Thu, 3 Sep 2020 19:47:48 +0000 (21:47 +0200)]
Makefile: Drop extra phony cscope

Commit d79864058a64 added a dedicated phony line for cscope.

Fixes: d79864058a64 ("Makefile: Add back TAGS/ctags/cscope rules")
Signed-off-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <159916246865.691541.16619858522304817323.stgit@bahia.lan>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
3 years agohw/gpio/max7310: Replace disabled printf() by qemu_log_mask(UNIMP)
Philippe Mathieu-Daudé [Tue, 1 Sep 2020 10:42:34 +0000 (12:42 +0200)]
hw/gpio/max7310: Replace disabled printf() by qemu_log_mask(UNIMP)

Replace disabled printf() by qemu_log_mask(UNIMP).

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20200901104234.92159-3-f4bug@amsat.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
3 years agohw/gpio/omap_gpio: Replace fprintf() by qemu_log_mask(GUEST_ERROR)
Philippe Mathieu-Daudé [Tue, 1 Sep 2020 10:42:33 +0000 (12:42 +0200)]
hw/gpio/omap_gpio: Replace fprintf() by qemu_log_mask(GUEST_ERROR)

Replace fprintf() by qemu_log_mask(LOG_GUEST_ERROR).

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20200901104234.92159-2-f4bug@amsat.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
3 years agohw/acpi/tco: Remove unused definitions
Philippe Mathieu-Daudé [Tue, 1 Sep 2020 10:19:50 +0000 (12:19 +0200)]
hw/acpi/tco: Remove unused definitions

TCO_DEBUG() and DEBUG definitions are not used, remove them.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20200901101951.85892-1-f4bug@amsat.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
3 years agohw/isa/isa-bus: Replace hw_error() by assert()
Philippe Mathieu-Daudé [Tue, 1 Sep 2020 10:40:43 +0000 (12:40 +0200)]
hw/isa/isa-bus: Replace hw_error() by assert()

As we can never have more than ISA_NUM_IRQS (16) ISA IRQs,
replace the not very interesting hw_error() call by an
assert() which is more useful to debug condition that can
not happen.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20200901104043.91383-6-f4bug@amsat.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
3 years agohw/mips/fuloong2e: Convert pointless error message to an assert()
Philippe Mathieu-Daudé [Tue, 1 Sep 2020 10:40:40 +0000 (12:40 +0200)]
hw/mips/fuloong2e: Convert pointless error message to an assert()

Displaying "vt82c686b_init error" doesn't give any hint about why
this call failed. As this message targets developers and not users,
replace the pointless error message by a call to assert() which
will provide more useful information.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Huacai Chen <chenhc@lemote.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20200901104043.91383-3-f4bug@amsat.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
3 years agoMerge remote-tracking branch 'remotes/kraxel/tags/sirius/ipxe-20200908-pull-request...
Peter Maydell [Tue, 8 Sep 2020 20:21:13 +0000 (21:21 +0100)]
Merge remote-tracking branch 'remotes/kraxel/tags/sirius/ipxe-20200908-pull-request' into staging

ipxe: update to aug 2020 snapshot.

# gpg: Signature made Tue 08 Sep 2020 07:09:26 BST
# gpg:                using RSA key 4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full]
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>" [full]
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full]
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/sirius/ipxe-20200908-pull-request:
  ipxe: update binaries
  ipxe: drop ia32 efi roms
  ipxe: update submodule

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 years agoMerge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2020-09-08' into staging
Peter Maydell [Tue, 8 Sep 2020 16:23:31 +0000 (17:23 +0100)]
Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2020-09-08' into staging

QAPI patches patches for 2020-09-08

# gpg: Signature made Tue 08 Sep 2020 07:06:52 BST
# gpg:                using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653
# gpg:                issuer "armbru@redhat.com"
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full]
# gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>" [full]
# Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653

* remotes/armbru/tags/pull-qapi-2020-09-08:
  qapi/block-core.json: Fix nbd-server-start docs
  qapi: Fix indentation, again
  qapi/migration.json: Fix indentation
  qapi: Make section headings start a new doc comment block
  qapi: Reject section markup in definition documentation

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 years agoMerge remote-tracking branch 'remotes/dgibson/tags/ppc-for-5.2-20200908' into staging
Peter Maydell [Tue, 8 Sep 2020 15:18:48 +0000 (16:18 +0100)]
Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-5.2-20200908' into staging

ppc patch queue 2020-09-08

This supersedes ppc-for-5.2-20200904, it fixes a couple of bugs in
that PR and adds a few extra patches.

Next pull request for qemu-5.2.  The biggest thing here is the
generalization of ARM's start-powered-off machine property to all
targets.  This can fix a number of odd little edge cases where KVM
could run vcpus before they were properly initialized.  This does
include changes to a number of files that aren't normally in my
purview.  There are suitable Acked-by lines and Peter requested this
come in via my tree, since the most pressing requirement for it is in
pseries machines with the POWER secure virtual machine facility.

In addition we have:
 * Daniel Barboza's rework and clean up of pseries machine NUMA handling
 * Correction to behaviour of the nvdimm= generic machine property on
   pseries
 * An optimization to the allocation of XIVE interrupts on KVM
 * Some fixes for confused behaviour with kernel_irqchip when both
   XICS and XIVE are in play
 * Add HIOMAP comamnd to pnv flash
 * Properly advertise the fact that spapr_vscsi doesn't handle
   hotplugged disks
 * Some assorted minor enhancements

# gpg: Signature made Tue 08 Sep 2020 06:19:34 BST
# gpg:                using RSA key 75F46586AE61A66CC44E87DC6C38CACA20D9B392
# gpg: Good signature from "David Gibson <david@gibson.dropbear.id.au>" [full]
# gpg:                 aka "David Gibson (Red Hat) <dgibson@redhat.com>" [full]
# gpg:                 aka "David Gibson (ozlabs.org) <dgibson@ozlabs.org>" [full]
# gpg:                 aka "David Gibson (kernel.org) <dwg@kernel.org>" [unknown]
# Primary key fingerprint: 75F4 6586 AE61 A66C C44E  87DC 6C38 CACA 20D9 B392

* remotes/dgibson/tags/ppc-for-5.2-20200908: (33 commits)
  spapr_numa: use spapr_numa_get_vcpu_assoc() in home_node hcall
  spapr_numa: create a vcpu associativity helper
  spapr: move h_home_node_associativity to spapr_numa.c
  spapr_numa: move NVLink2 associativity handling to spapr_numa.c
  spapr, spapr_numa: move lookup-arrays handling to spapr_numa.c
  spapr, spapr_numa: handle vcpu ibm,associativity
  spapr: introduce SpaprMachineState::numa_assoc_array
  ppc/spapr_nvdimm: turn spapr_dt_nvdimm() static
  ppc: introducing spapr_numa.c NUMA code helper
  hw/ppc/ppc4xx_pci: Replace pointless warning by assert()
  hw/ppc/ppc4xx_pci: Use ARRAY_SIZE() instead of magic value
  target/s390x: Use start-powered-off CPUState property
  sparc/sun4m: Use start-powered-off CPUState property
  sparc/sun4m: Don't set cs->halted = 0 in main_cpu_reset()
  mips/cps: Use start-powered-off CPUState property
  ppc/e500: Use start-powered-off CPUState property
  ppc/spapr: Use start-powered-off CPUState property
  target/arm: Move setting of CPU halted state to generic code
  target/arm: Move start-powered-off property to generic CPUState
  ppc/spapr_nvdimm: do not enable support with 'nvdimm=off'
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 years agoMerge remote-tracking branch 'remotes/rth/tags/pull-mb-20200907-2' into staging
Peter Maydell [Tue, 8 Sep 2020 14:26:13 +0000 (15:26 +0100)]
Merge remote-tracking branch 'remotes/rth/tags/pull-mb-20200907-2' into staging

Use lookup_and_goto_tb.
Cleanup and fill in VMStateDescription.

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

* remotes/rth/tags/pull-mb-20200907-2:
  configure: Do not set TARGET_ABI32 for microblaze
  target/microblaze: Put MicroBlazeCPUConfig into DisasContext
  target/microblaze: Fill in VMStateDescription for cpu
  target/microblaze: Move mmu parameters to MicroBlazeCPUConfig
  target/microblaze: Treat pvr_regs as constant
  target/microblaze: Move pvr regs to MicroBlazeCPUConfig
  target/microblaze: Reorg MicroBlazeCPUConfig to minimize holes
  target/microblaze: Split out MicroBlazeCPUConfig
  target/microblaze: Diagnose invalid insns in delay slots
  target/microblaze: Use tcg_gen_lookup_and_goto_ptr
  target/microblaze: Force rtid, rted, rtbd to exit
  target/microblaze: Handle DISAS_EXIT_NEXT in delay slot
  target/microblaze: Replace cpustate_changed with DISAS_EXIT_NEXT
  target/microblaze: Introduce DISAS_EXIT_NEXT, DISAS_EXIT_JUMP
  target/microblaze: Rename DISAS_UPDATE to DISAS_EXIT
  target/microblaze: Rename mmu structs
  target/microblaze: Cleanup mb_cpu_do_interrupt
  target/microblaze: Renumber D_FLAG

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 years agoMerge remote-tracking branch 'remotes/bonzini-gitlab/tags/for-upstream' into staging
Peter Maydell [Tue, 8 Sep 2020 12:23:58 +0000 (13:23 +0100)]
Merge remote-tracking branch 'remotes/bonzini-gitlab/tags/for-upstream' into staging

meson related:
* convert unit tests
* bugfixes for mtest2make
* miscellaneous bugfixes
* dead code removal and configure cleanups
* oss-fuzz fixes
* msys fixes

# gpg: Signature made Tue 08 Sep 2020 10:43:27 BST
# 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: (45 commits)
  docs: update build system documentation
  meson: remove linkage of sdl to baum
  meson: Convert undefsym.sh to undefsym.py
  fuzz: Add support for custom fuzzing library
  meson: specify fuzz linker script as a project arg
  oss-fuzz: fix rpath
  configure: update dtc submodule
  docs: suggest Meson replacements for various configure functions
  configure: drop dead variables and functions
  configure: do not include dependency flags in QEMU_CFLAGS and LIBS
  meson: get opengl compilation flags from OPENGL_CFLAGS
  meson: get glib compilation flags from GLIB_CFLAGS
  configure: do not look for install(1)
  configure: remove unnecessary libm test
  configure: move -ldl test to meson
  meson: keep all compiler flags detection together
  configure: move disassembler configuration to meson
  Makefile: inline the relevant parts of rules.mak
  Makefile: remove dead variables and includes
  meson: compute config_all_devices directly
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 years agodocs: update build system documentation
Paolo Bonzini [Mon, 7 Sep 2020 16:39:13 +0000 (18:39 +0200)]
docs: update build system documentation

Most of the Makefile bits are obsolete and can be removed.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
3 years agomeson: remove linkage of sdl to baum
Bruce Rogers [Thu, 3 Sep 2020 15:29:33 +0000 (09:29 -0600)]
meson: remove linkage of sdl to baum

Ever since commit 537fe2d63f744e7c96ff45b60d09486a81958e06 there
has been a 'linkage' to sdl for compiling baum.c. Originally it
had to do with including sdl cflags for any file including sdl
headers. There is no longer any such need for baum.c, but the
association has persisted in the make system, and with the switch
to meson it has now become a hard requirement, which now causes
chardev-baum.so to not be produced if sdl is not configured.
Remove this bogus linkage.

Signed-off-by: Bruce Rogers <brogers@suse.com>
Message-Id: <20200903152933.97838-1-brogers@suse.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
3 years agomeson: Convert undefsym.sh to undefsym.py
Yonggang Luo [Wed, 2 Sep 2020 17:00:50 +0000 (01:00 +0800)]
meson: Convert undefsym.sh to undefsym.py

Shell scripts are not easily invoked from the build process
on MSYS, so convert undefsym.sh to a python script.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Message-Id: <20200902170054.810-3-luoyonggang@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
3 years agofuzz: Add support for custom fuzzing library
Alexander Bulekov [Wed, 2 Sep 2020 17:36:51 +0000 (13:36 -0400)]
fuzz: Add support for custom fuzzing library

On oss-fuzz, we must use the LIB_FUZZING_ENGINE and CFLAGS environment
variables, rather than -fsanitize=fuzzer. With this change, when
LIB_FUZZING_ENGINE is set, the --enable-fuzzing configure option will
use that environment variable during the linking stage, rather than
-fsanitize=fuzzer

Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
Message-Id: <20200902173652.307222-3-alxndr@bu.edu>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
3 years agomeson: specify fuzz linker script as a project arg
Alexander Bulekov [Wed, 2 Sep 2020 17:36:50 +0000 (13:36 -0400)]
meson: specify fuzz linker script as a project arg

With this change, the fuzzer-linker script should be specified outside
any --start-group/--end-group pairs. We need this on oss-fuzz, where
partially applying the linker-script results in a linker failure

Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
Message-Id: <20200902173652.307222-2-alxndr@bu.edu>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
3 years agooss-fuzz: fix rpath
Alexander Bulekov [Wed, 2 Sep 2020 14:26:57 +0000 (10:26 -0400)]
oss-fuzz: fix rpath

Prior to this change,
readelf -d build/out/qemu/qemu-fuzz-i386-target-virtio-net-slirp
...
0x000000000000000f (RPATH)  Library rpath: ['$$ORIGIN/lib':$ORIGIN/migration:$ORIGIN/]

As of 1a4db552d8 ("ninjatool: quote dollars in variables"), we don't
need to manually double the dollars. Also, remove the single-quotes as
they are copied into the rpath.

After this change:
0x000000000000000f (RPATH)  Library rpath: [$ORIGIN/lib:$ORIGIN/migration:$ORIGIN/]

Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
Message-Id: <20200902142657.112879-3-alxndr@bu.edu>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
3 years agoconfigure: update dtc submodule
Yonggang Luo [Wed, 2 Sep 2020 17:00:49 +0000 (01:00 +0800)]
configure: update dtc submodule

Update the dtc submodule in configure already and symlink dtc after
git submodule update, because on win32 symlinks to non-existing folders
are forbidden.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Message-Id: <20200902170054.810-2-luoyonggang@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
3 years agodocs: suggest Meson replacements for various configure functions
Paolo Bonzini [Tue, 1 Sep 2020 10:38:25 +0000 (06:38 -0400)]
docs: suggest Meson replacements for various configure functions

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
3 years agoconfigure: drop dead variables and functions
Paolo Bonzini [Tue, 1 Sep 2020 10:28:38 +0000 (06:28 -0400)]
configure: drop dead variables and functions

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
3 years agoconfigure: do not include dependency flags in QEMU_CFLAGS and LIBS
Paolo Bonzini [Tue, 1 Sep 2020 10:15:41 +0000 (06:15 -0400)]
configure: do not include dependency flags in QEMU_CFLAGS and LIBS

All Meson executables should specify their dependencies explicitly, either
directly or indirectly via declare_dependency.  Makefiles instead did
not propagate dependencies correctly from static libraries, for example.
Therefore, flags for dependencies need not be included in QEMU_CFLAGS.
LIBS is not used at all, so drop that one as well.

In a few cases the dependencies were not yet specified, so add them.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
3 years agomeson: get opengl compilation flags from OPENGL_CFLAGS
Paolo Bonzini [Tue, 1 Sep 2020 12:41:17 +0000 (08:41 -0400)]
meson: get opengl compilation flags from OPENGL_CFLAGS

The opengl compilation flags were added to QEMU_CFLAGS.  We do not
want them to be added to all compilation commands, so export them
also via OPENGL_CFLAGS rather than via QEMU_CFLAGS.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
3 years agomeson: get glib compilation flags from GLIB_CFLAGS
Paolo Bonzini [Tue, 1 Sep 2020 12:41:17 +0000 (08:41 -0400)]
meson: get glib compilation flags from GLIB_CFLAGS

The glib compilation flags were added to QEMU_CFLAGS.  While we still
want them to be added to all compilation commands (at least for now),
do that via GLIB_CFLAGS rather than via QEMU_CFLAGS.  This shows that
glib is a special case and makes it clearer that QEMU_CFLAGS is only
about compiler commands and not dependencies.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
3 years agoconfigure: do not look for install(1)
Paolo Bonzini [Tue, 1 Sep 2020 10:38:04 +0000 (06:38 -0400)]
configure: do not look for install(1)

It is not used anymore, so there is no Solaris-specific check to
perform.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
3 years agoconfigure: remove unnecessary libm test
Paolo Bonzini [Tue, 1 Sep 2020 10:29:11 +0000 (06:29 -0400)]
configure: remove unnecessary libm test

The same test is already performed by meson.build.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
3 years agoconfigure: move -ldl test to meson
Paolo Bonzini [Tue, 1 Sep 2020 10:44:23 +0000 (06:44 -0400)]
configure: move -ldl test to meson

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
3 years agomeson: keep all compiler flags detection together
Paolo Bonzini [Tue, 1 Sep 2020 11:45:54 +0000 (07:45 -0400)]
meson: keep all compiler flags detection together

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
3 years agoconfigure: move disassembler configuration to meson
Paolo Bonzini [Tue, 1 Sep 2020 10:04:28 +0000 (06:04 -0400)]
configure: move disassembler configuration to meson

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
3 years agoMakefile: inline the relevant parts of rules.mak
Paolo Bonzini [Tue, 1 Sep 2020 16:10:05 +0000 (12:10 -0400)]
Makefile: inline the relevant parts of rules.mak

Most of rules.mak is not used anymore, just inline what's needed.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
3 years agoMakefile: remove dead variables and includes
Paolo Bonzini [Tue, 1 Sep 2020 09:31:46 +0000 (05:31 -0400)]
Makefile: remove dead variables and includes

Makefile.objs, the .d files and various CONFIG_* symbols are not
used anymore by the Make side of the build; they are only processed
by Meson.  We can delete them.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
3 years agomeson: compute config_all_devices directly
Paolo Bonzini [Tue, 1 Sep 2020 09:32:23 +0000 (05:32 -0400)]
meson: compute config_all_devices directly

There is no need anymore to produce config-all-devices.mak, compute
the resulting dictionary directly instead of going through grepy.sh.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
3 years agoconfigure: remove dead code for in-tree builds
Paolo Bonzini [Tue, 1 Sep 2020 07:23:47 +0000 (03:23 -0400)]
configure: remove dead code for in-tree builds

The $pwd_is_source_path variable is never "y", since
configure re-executes itself from a build directory.
Remove code that will never run.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
3 years agomeson: convert migration/initrd-stress
Marc-André Lureau [Fri, 28 Aug 2020 11:07:34 +0000 (15:07 +0400)]
meson: convert migration/initrd-stress

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20200828110734.1638685-17-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
3 years agomeson: fix migration/stress compilation with glibc>=2.30
Marc-André Lureau [Fri, 28 Aug 2020 11:07:33 +0000 (15:07 +0400)]
meson: fix migration/stress compilation with glibc>=2.30

gettid() was introduced with glibc 2.30.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20200828110734.1638685-16-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
3 years agotests/migration/stress: remove unused exit_success
Marc-André Lureau [Fri, 28 Aug 2020 11:07:32 +0000 (15:07 +0400)]
tests/migration/stress: remove unused exit_success

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20200828110734.1638685-15-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
3 years agomeson: convert the speed tests
Paolo Bonzini [Wed, 2 Sep 2020 11:25:19 +0000 (07:25 -0400)]
meson: convert the speed tests

Use meson benchmark() for them, adjust mtest2make.py for that.
A new target "make bench" can be used to run all benchmarks.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20200828110734.1638685-14-marcandre.lureau@redhat.com>
[Rewrite mtest2make part. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
3 years agotests: do not print benchmark output to stdout
Marc-André Lureau [Fri, 28 Aug 2020 11:07:30 +0000 (15:07 +0400)]
tests: do not print benchmark output to stdout

As this makes the TAP output invalid. Use g_test_message().

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20200828110734.1638685-13-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
3 years agomeson: convert atomic*-bench
Marc-André Lureau [Fri, 28 Aug 2020 11:07:28 +0000 (15:07 +0400)]
meson: convert atomic*-bench

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20200828110734.1638685-11-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
3 years agomeson: convert vhost-user-bridge
Marc-André Lureau [Fri, 28 Aug 2020 11:07:27 +0000 (15:07 +0400)]
meson: convert vhost-user-bridge

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20200828110734.1638685-10-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
3 years agomeson: remove old socket_scm_helper rule
Marc-André Lureau [Fri, 28 Aug 2020 11:07:26 +0000 (15:07 +0400)]
meson: remove old socket_scm_helper rule

It was covered already in commit d3ca592b3c10 ("meson: convert check-block")

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20200828110734.1638685-9-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
3 years agomeson: move keyutils dependency check
Marc-André Lureau [Fri, 28 Aug 2020 11:07:25 +0000 (15:07 +0400)]
meson: move keyutils dependency check

Since there is not minimum version specified, and it's a test-only
dependency, it's fair to depend on a version that ships with a .pc I
suppose.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20200828110734.1638685-8-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
3 years agomeson: convert the unit tests
Marc-André Lureau [Mon, 3 Aug 2020 07:05:54 +0000 (09:05 +0200)]
meson: convert the unit tests

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20200828110734.1638685-7-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
3 years agoipxe: update binaries
Gerd Hoffmann [Wed, 22 Jul 2020 10:53:09 +0000 (12:53 +0200)]
ipxe: update binaries

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
3 years agoipxe: drop ia32 efi roms
Gerd Hoffmann [Wed, 22 Jul 2020 10:24:35 +0000 (12:24 +0200)]
ipxe: drop ia32 efi roms

UEFI on ia32 never really took off.  Basically the BIOS -> UEFI shift
came too late, x64 was widespread already, so vendors went from BIOS
straight to UEFI on x64.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
3 years agoipxe: update submodule
Gerd Hoffmann [Wed, 22 Jul 2020 10:22:37 +0000 (12:22 +0200)]
ipxe: update submodule

master snapshot, most recent commit from Aug 23th

shortlog
========

Andrew Grasso (1):
      [intel] Add INTEL_NO_PHY_RST for I218LM

Ben Bleything (1):
      [intel] Set INTEL_NO_PHY_RST on i218v

Bobby Lockwood (1):
      [libgcc] Change __divmoddi4 from int64 [unknown] to int64_t

Bruce Rogers (1):
      [build] Be explicit about -fcommon compiler directive

Christian Nilsson (1):
      [intel] Add PCI ID for I219-V and -LM 6 to 9

Daniel Johnson (1):
      [deflate] Fix typo in comment describing length codes

David Decotigny (2):
      [pcbios] Fix "out of memory" detection when expanding bottom area
      [pcbios] Take alignment into account when checking for available space

Dentcho Ludmilov Bankov (1):
      [comboot] Fix stack pointer retrieval after COM32 binary returns

Ignat Korchagin (3):
      [snp] Try promiscuous multicast receive filter if the regular one fails
      [snp] Set EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST bit as per UEFI spec
      [efi] Check the status code from AllocatePool()

Joe Groocock (1):
      [cmdline] Add "--timeout" parameter to "ifconf" command

Joseph Wong (1):
      [bnxt] Add driver support for Broadcom NetXtreme-E Adapters

LaDerrick H (1):
      [sfc] Add PCI ID for Solarflare SFC9120 and Solarflare SFC9140

Michael Brown (105):
      [init] Show startup and shutdown function names in debug messages
      [efi] Blacklist the Dell Ip4ConfigDxe driver
      [tls] Support stateful session resumption
      [tls] Fix incorrectly duplicated error number
      [tls] Support stateless session resumption
      [crypto] Use x509_name() in validator debug messages
      [tls] Display cross-certificate and OCSP status messages
      [tls] Display validator messages only while validation is in progress
      [tcp] Display "connecting" status until connection is established
      [ocsp] Accept response certID with missing hashAlgorithm parameters
      [pci] Add support for PCI MSI-X interrupts
      [vlan] Provide vlan_netdev_rx() and vlan_netdev_rx_err()
      [intelxl] Use VLAN tag in receive descriptor if present
      [intelxl] Allow for virtual function admin queue register maps
      [intelxl] Use one admin queue buffer per admin queue descriptor
      [intelxl] Allow admin queues to be reinitialised
      [intelxl] Allow admin cookie to hold extended opcode and return code
      [intelxl] Provide a mechanism for handling "send to VF" events
      [intelxl] Use 32-byte receive descriptors
      [intelxl] Allow for arbitrary placement of ring tail registers
      [intelxl] Split out ring creation from context programming
      [intelxl] Allow for arbitrary placement of interrupt control register
      [intelxl] Expose functions required by virtual function driver
      [intelxl] Choose to operate in non-PXE mode
      [intelxl] Add driver for Intel 40 Gigabit Ethernet NIC virtual functions
      [build] Fix use of inline assembly on GCC 8 ARM64 builds
      [arm] Provide dummy implementations for {in,out}[s]{b,w,l}
      [efi] Return only registered EFI devices from efidev_parent()
      [fdt] Add ability to parse a MAC address from a flattened device tree
      [efi] Register a device tree if provided by the platform firmware
      [smsc95xx] Fetch MAC from device tree for Raspberry Pi
      [build] Add named configuration for Raspberry Pi
      [smscusb] Fetch MAC from device tree for Raspberry Pi Model B+
      [build] Do not apply WORKAROUND_CFLAGS for host compiler
      [build] Move predefined all-drivers build shortcut to Makefile
      [build] Add predefined shortcut for Raspberry Pi builds
      [process] Add PROC_INIT() for initialising static processes
      [peerdist] Start block download timers from within opener methods
      [peerdist] Limit number of concurrent raw block downloads
      [tls] Add missing call to tls_tx_resume() when restarting negotiation
      [crypto] Drag in configured digestInfo prefixes for any use of RSA
      [crypto] Profile the various stages of modular multiplication
      [coverity] Override assumptions about wcrtomb() and hmac_init()
      [ethernet] Avoid false positive Coverity warning
      [golan] Fix address-of-pointer bug for multicast attach/detach
      [efi] Report failed control transfers as expected by the USB core
      [efi] Do not attempt EFI_USB_IO_PROTOCOL transfers during shutdown
      [lan78xx] Always enable automatic speed and duplex detection
      [peerdist] Allow PeerDist to be globally enabled or disabled
      [peerdist] Allow for the use of a hosted cache server
      [build] Construct full version number automatically from git revision
      [travis] Ensure that most recent tag is always available
      [tftp] Eliminate unnecessary variable-length stack allocation
      [infiniband] Eliminate variable-length stack allocation
      [slam] Eliminate variable-length stack allocation
      [slam] Allow for the possibility of IPv6 multicast addresses
      [settings] Eliminate variable-length stack allocation
      [iscsi] Eliminate variable-length stack allocations in CHAP handlers
      [iscsi] Eliminate variable-length stack allocation in URI parsing
      [bios] Define macros for constructing partition table entries
      [int13con] Create log partition only when CONSOLE_INT13 is enabled
      [efi] Disambiguate errors returned by ConnectController
      [png] Fix potential integer overflow
      [efi] Work around UEFI specification bug in LoadImage
      [efi] Work around UEFI specification bug in LoadImage for SAN boot
      [uri] Avoid appearing to access final byte of a potentially empty string
      [efi] Attempt to connect our driver directly if ConnectController fails
      [tls] Allow a minimum TLS protocol version to be specified
      [tls] Default to supporting only TLSv1.1 or above
      [crypto] Allow algorithms to be included without being OID-identifiable
      [crypto] Ensure that test code drags in required ASN.1 object identifiers
      [crypto] Disable MD5 as an OID-identifiable algorithm by default
      [snp] Retry initialisation if link is reported as down
      [util] Treat empty integer strings as invalid
      [parseopt] Treat empty integer strings in user input as invalid
      [efi] Enable stack protection where possible
      [ocsp] Accept SHA1 certID responses even if SHA1 is not enabled
      [intel] Avoid spurious compiler warning on GCC 10
      [golan] Add explicit type casts for nodnic_queue_pair_type
      [build] Disable position-independent code for ARM64 EFI builds
      [efi] Detect and disable seriously broken EFI_RNG_PROTOCOL implementations
      [efi] Raise TPL during driver entry point
      [axge] Handle non-gigabit link speeds
      [usb] Clear device endpoint halt before resetting host endpoint
      [usb] Add missing usb_recycle() for completed hub interrupt transfers
      [usb] Do not attempt to disable USB3 hub ports
      [xhci] Set link state to RxDetect after disabling USB3 root hub port
      [usb] Avoid unnecessary calls to usb_hub_set_drvdata()
      [xhci] Increase link state settling delay to 100ms
      [axge] Reapply USB device configuration when opening network device
      [usb] Leave port enabled after a failed device registration
      [crypto] Avoid temporarily setting direction flag in bigint_is_geq()
      [libc] Provide an unoptimised generic_memcpy_reverse()
      [efi] Avoid setting direction flag on EFI platforms
      [libc] Add bit-rotation functions for unsigned long values
      [efi] Distribute available entropy within stack cookie
      [efi] Ensure NUL byte is at lowest address within stack cookie
      [efi] Claim SNP devices early in efi_download_start()
      [xfer] Remove address family from definition of a socket opener
      [dns] Use all configured DNS servers
      [wpa] Fix erroneous debug message in wpa_derive_ptk
      [efi] Match EDK2 numbering for USB ports
      [efi] Use device path to locate filesystem from which we were loaded
      [efi] Attempt NII initialisation both with and without cable detection
      [build] Fix building on older versions of gcc

Michael J. Bazzinotti (1):
      [libc] Fix memcmp() to return proper values

Mohammed (1):
      [golan] Add various new PCI device IDs

Rob Taglang (1):
      [intelx] Added PCI_ROM entry for Intel x553/x557-AT and x553 (SFP+) NICs

Tobias Kortkamp (1):
      [build] Fix a GNUism that FreeBSD's sed(1) cannot deal with

Valentine Barshak (2):
      [build] Fix "'%s' directive argument is null" error
      [build] Workaround compilation error with gcc 9.1

bit (1):
      [build] Fix default target in sdsk image

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
3 years agomeson: convert qht-bench
Marc-André Lureau [Fri, 28 Aug 2020 11:07:22 +0000 (15:07 +0400)]
meson: convert qht-bench

This is required by test-qht-par unit test.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20200828110734.1638685-5-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
3 years agomeson: declare keyutils dependency
Marc-André Lureau [Fri, 28 Aug 2020 11:07:21 +0000 (15:07 +0400)]
meson: declare keyutils dependency

Rename the variable to be more explicit. A further clean-up patch will
move the actual to dependency check to meson entirely.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20200828110734.1638685-4-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
3 years agomeson: declare tasn1 dependency
Marc-André Lureau [Fri, 28 Aug 2020 11:07:20 +0000 (15:07 +0400)]
meson: declare tasn1 dependency

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20200828110734.1638685-3-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
3 years agomeson: build qapi tests library
Marc-André Lureau [Fri, 28 Aug 2020 11:07:19 +0000 (15:07 +0400)]
meson: build qapi tests library

- builds QAPI builtins types/visitor to fix a linking issue with
  unresolved symbols in the static library.

- work around a meson limitation on generated file output directories.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20200828110734.1638685-2-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
3 years agomeson: fix libqos linking
Paolo Bonzini [Wed, 2 Sep 2020 10:30:40 +0000 (06:30 -0400)]
meson: fix libqos linking

Add genh to the sources to avoid race conditions between QAPI
file generation and libqos compilation.

Make the name_suffix .fa for consistency with other link_whole
static libraries and to work around a Meson issue where
lots of linker flags are placed between -Wl,--start-group and
-Wl,--end-group and this breaks the fork-fuzz.ld linker script.

Reported-by: Claudio Fontana <cfontana@suse.de>
Reported-by: Alexander Bulekov <alxndr@bu.edu>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
3 years agoninjatool: use constant names for stamp files
Paolo Bonzini [Tue, 1 Sep 2020 11:13:16 +0000 (07:13 -0400)]
ninjatool: use constant names for stamp files

Numbering files according to rules causes confusion, because
CUSTOM_COMMAND3.stamp from a previous build might represent
completely different targets after Makefile.ninja is regenerated.
As a result, the new targets are not rebuilt and compilation
fails.

Use the targets to build a SHA1 hash; the chances for collision
are one in 2^24 even with a 12-character prefix of the hash.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
3 years agoconfigure: include cross sdl2-config in meson cross file
Paolo Bonzini [Tue, 1 Sep 2020 12:06:28 +0000 (08:06 -0400)]
configure: include cross sdl2-config in meson cross file

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
3 years agoconfigure: do not include absolute paths in -I and -L paths
Paolo Bonzini [Wed, 2 Sep 2020 11:57:30 +0000 (07:57 -0400)]
configure: do not include absolute paths in -I and -L paths

On msys2, paths such as -L/e/path/to/qemu are not recognized by
the linker.  Fortunately we do not need absolute paths at all in a
non-recursive build system.

Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
3 years agomeson: remove b_lundef option
Paolo Bonzini [Tue, 1 Sep 2020 16:48:00 +0000 (12:48 -0400)]
meson: remove b_lundef option

Meson automatically adds "-undefined dynamic_lookup" to
shared_module build targets; b_lundef is only needed for
executables.  Therefore, we can remove this option.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
3 years agomtest2make: unify tests that appear in multiple suites
Paolo Bonzini [Wed, 2 Sep 2020 11:19:43 +0000 (07:19 -0400)]
mtest2make: unify tests that appear in multiple suites

Whenever a test appears in multiple suites, the rules generated
by mtest2make are currently running it twice.  Instead, after
this patch we generate a phony target for each test and we have
a generic "run-tests" target depend on all the tests that were
chosen on the command line.  Tests that appear in multiple suites
will be added to the prerequisites just once.

This has other advantages: it removes the handling of -k and
it increases parallelism.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
3 years agomtest2make: hide output of successful tests
Paolo Bonzini [Tue, 1 Sep 2020 13:14:41 +0000 (09:14 -0400)]
mtest2make: hide output of successful tests

The softfloat tests are quite noisy; before the Meson conversion
they buffered the output in a file and emitted the output only
if the test failed.  Tweak mtest2make.py so that the courtesy
is extended to all non-TAP tests.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
3 years agomtest2make: split working directory from test command
Paolo Bonzini [Tue, 1 Sep 2020 13:58:48 +0000 (09:58 -0400)]
mtest2make: split working directory from test command

Pass the working directory and test command in separate macro arguments,
so that we will be able to insert a test driver in the next patch.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
3 years agomtest2make: split environment from test command
Paolo Bonzini [Tue, 1 Sep 2020 13:58:48 +0000 (09:58 -0400)]
mtest2make: split environment from test command

Pass the environment and test command in separate macro arguments,
so that we will be able to insert a test driver in the next patch.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
3 years agoqemu-iotests: move check-block back to Makefiles
Paolo Bonzini [Tue, 1 Sep 2020 13:31:56 +0000 (09:31 -0400)]
qemu-iotests: move check-block back to Makefiles

check-block has its own test harness, unlike every other test.  If
we capture its output, as is in general nicer to do without V=1,
there will be no sign of progress.  So for lack of a better option
just move the invocation of the test back to Makefile rules.

As a side effect, this will also fix "make check" in --disable-tools
builds, as they were trying to run qemu-iotests without having
made qemu-img before.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
3 years agospapr_numa: use spapr_numa_get_vcpu_assoc() in home_node hcall
Daniel Henrique Barboza [Fri, 4 Sep 2020 17:24:22 +0000 (14:24 -0300)]
spapr_numa: use spapr_numa_get_vcpu_assoc() in home_node hcall

The current implementation of h_home_node_associativity hard codes
the values of associativity domains of the vcpus. Let's make
it consider the values already initialized in spapr->numa_assoc_array,
via the spapr_numa_get_vcpu_assoc() helper.

We want to set it and forget it, and for that we also need to
assert that we don't overflow the registers of the hypercall.
>From R4 to R9 we can squeeze in 12 associativity domains for
vcpus, so let's assert that VCPU_ASSOC_SIZE -1 isn't greater
than that.

Reviewed-by: Greg Kurz <groug@kaod.org>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20200904172422.617460-4-danielhb413@gmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
3 years agospapr_numa: create a vcpu associativity helper
Daniel Henrique Barboza [Fri, 4 Sep 2020 17:24:21 +0000 (14:24 -0300)]
spapr_numa: create a vcpu associativity helper

The work to be done in h_home_node_associativity() intersects
with what is already done in spapr_numa_fixup_cpu_dt(). This
patch creates a new helper, spapr_numa_get_vcpu_assoc(), to
be used for both spapr_numa_fixup_cpu_dt() and
h_home_node_associativity().

While we're at it, use memcpy() instead of loop assignment
to created the returned array.

Reviewed-by: Greg Kurz <groug@kaod.org>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20200904172422.617460-3-danielhb413@gmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
3 years agospapr: move h_home_node_associativity to spapr_numa.c
Daniel Henrique Barboza [Fri, 4 Sep 2020 17:24:20 +0000 (14:24 -0300)]
spapr: move h_home_node_associativity to spapr_numa.c

The implementation of this hypercall will be modified to use
spapr->numa_assoc_arrays input. Moving it to spapr_numa.c makes
make more sense.

Reviewed-by: Greg Kurz <groug@kaod.org>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20200904172422.617460-2-danielhb413@gmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
3 years agospapr_numa: move NVLink2 associativity handling to spapr_numa.c
Daniel Henrique Barboza [Thu, 3 Sep 2020 22:06:36 +0000 (19:06 -0300)]
spapr_numa: move NVLink2 associativity handling to spapr_numa.c

The NVLink2 GPUs works like a regular NUMA node with its
own associativity values, regardless of user input.

This can be handled inside spapr_numa_associativity_init(),
initializing NVGPU_MAX_NUM associativity arrays that can
be used by the GPUs.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20200903220639.563090-5-danielhb413@gmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
3 years agospapr, spapr_numa: move lookup-arrays handling to spapr_numa.c
Daniel Henrique Barboza [Thu, 3 Sep 2020 22:06:35 +0000 (19:06 -0300)]
spapr, spapr_numa: move lookup-arrays handling to spapr_numa.c

In a similar fashion as the previous patch, let's move the
handling of ibm,associativity-lookup-arrays from spapr.c to
spapr_numa.c. A spapr_numa_write_assoc_lookup_arrays() helper was
created, and spapr_dt_dynamic_reconfiguration_memory() can now
use it to advertise the lookup-arrays.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20200903220639.563090-4-danielhb413@gmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
3 years agospapr, spapr_numa: handle vcpu ibm,associativity
Daniel Henrique Barboza [Thu, 3 Sep 2020 22:06:34 +0000 (19:06 -0300)]
spapr, spapr_numa: handle vcpu ibm,associativity

Vcpus have an additional paramenter to be appended, vcpu_id. This
also changes the size of the of property itself, which is being
represented in index 0 of numa_assoc_array[cpu->node_id],
and defaults to MAX_DISTANCE_REF_POINTS for all cases but
vcpus.

All this logic makes more sense in spapr_numa.c, where we handle
everything NUMA and associativity. A new helper spapr_numa_fixup_cpu_dt()
was added, and spapr.c uses it the same way as it was using the former
spapr_fixup_cpu_numa_dt().

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20200903220639.563090-3-danielhb413@gmail.com>
[dwg: Correct uint to int type, which can break windows builds]
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
3 years agospapr: introduce SpaprMachineState::numa_assoc_array
Daniel Henrique Barboza [Thu, 3 Sep 2020 22:06:33 +0000 (19:06 -0300)]
spapr: introduce SpaprMachineState::numa_assoc_array

The next step to centralize all NUMA/associativity handling in
the spapr machine is to create a 'one stop place' for all
things ibm,associativity.

This patch introduces numa_assoc_array, a 2 dimensional array
that will store all ibm,associativity arrays of all NUMA nodes.
This array is initialized in a new spapr_numa_associativity_init()
function, called in spapr_machine_init(). It is being initialized
with the same values used in other ibm,associativity properties
around spapr files (i.e. all zeros, last value is node_id).
The idea is to remove all hardcoded definitions and FDT writes
of ibm,associativity arrays, doing instead a call to the new
helper spapr_numa_write_associativity_dt() helper, that will
be able to write the DT with the correct values.

We'll start small, handling the trivial cases first. The
remaining instances of ibm,associativity will be handled
next.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20200903220639.563090-2-danielhb413@gmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
3 years agoppc/spapr_nvdimm: turn spapr_dt_nvdimm() static
Daniel Henrique Barboza [Tue, 1 Sep 2020 12:56:40 +0000 (09:56 -0300)]
ppc/spapr_nvdimm: turn spapr_dt_nvdimm() static

This function is only used inside spapr_nvdimm.c.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20200901125645.118026-3-danielhb413@gmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
3 years agoppc: introducing spapr_numa.c NUMA code helper
Daniel Henrique Barboza [Tue, 1 Sep 2020 12:56:39 +0000 (09:56 -0300)]
ppc: introducing spapr_numa.c NUMA code helper

We're going to make changes in how spapr handles all
ibm,associativity* related properties to enhance our current NUMA
support.

At this moment we have associativity code scattered all around
spapr_* files, with hardcoded values and array sizes. This
makes it harder to change any NUMA specific parameters in
the future. Having everything in the same place allows not
only for easier tuning, but also easier understanding since all
NUMA related code is on the same file.

This patch introduces a new file to gather all NUMA/associativity
handling code in spapr, spapr_numa.c. To get things started, let's
remove associativity-reference-points and max-associativity-domains
code from spapr_dt_rtas() to a new helper called spapr_numa_write_rtas_dt().
This will decouple spapr_dt_rtas() from the NUMA changes that
are going to happen in those two properties.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20200901125645.118026-2-danielhb413@gmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
3 years agohw/ppc/ppc4xx_pci: Replace pointless warning by assert()
Philippe Mathieu-Daudé [Tue, 1 Sep 2020 10:40:42 +0000 (12:40 +0200)]
hw/ppc/ppc4xx_pci: Replace pointless warning by assert()

We call pci_register_root_bus() to register 4 IRQs with the
ppc4xx_pci_set_irq() handler. As it can only be called with
values in the [0-4[ range, replace the pointless warning by
an assert().

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20200901104043.91383-5-f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
3 years agohw/ppc/ppc4xx_pci: Use ARRAY_SIZE() instead of magic value
Philippe Mathieu-Daudé [Tue, 1 Sep 2020 10:40:41 +0000 (12:40 +0200)]
hw/ppc/ppc4xx_pci: Use ARRAY_SIZE() instead of magic value

Replace the magic '4' by ARRAY_SIZE(s->irq) which is more explicit.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20200901104043.91383-4-f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
3 years agotarget/s390x: Use start-powered-off CPUState property
Thiago Jung Bauermann [Wed, 26 Aug 2020 05:55:35 +0000 (02:55 -0300)]
target/s390x: Use start-powered-off CPUState property

Instead of setting CPUState::halted to 1 in s390_cpu_initfn(), use the
start-powered-off property which makes cpu_common_reset() initialize it
to 1 in common code.

Note that this changes behavior by setting cs->halted to 1 on reset, which
didn't happen before.

Acked-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
Message-Id: <20200826055535.951207-9-bauerman@linux.ibm.com>
[dwg: Fix from Laurent Vivier for user only case]
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
3 years agosparc/sun4m: Use start-powered-off CPUState property
Thiago Jung Bauermann [Wed, 26 Aug 2020 05:55:34 +0000 (02:55 -0300)]
sparc/sun4m: Use start-powered-off CPUState property

Instead of setting CPUState::halted to 1 in secondary_cpu_reset(), use the
start-powered-off property which makes cpu_common_reset() initialize it
to 1 in common code.

Now secondary_cpu_reset() becomes equivalent to main_cpu_reset() so rename
the function to sun4m_cpu_reset().

Also remove setting of cs->halted from cpu_devinit(), which seems out of
place when compared to similar code in other architectures (e.g.,
ppce500_init() in hw/ppc/e500.c).

Finally, change creation of CPU object from cpu_create() to object_new()
and qdev_realize_and_unref() because cpu_create() realizes the CPU and it's
not possible to set a property after the object is realized.

Suggested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
Message-Id: <20200826055535.951207-8-bauerman@linux.ibm.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
3 years agosparc/sun4m: Don't set cs->halted = 0 in main_cpu_reset()
Thiago Jung Bauermann [Wed, 26 Aug 2020 05:55:33 +0000 (02:55 -0300)]
sparc/sun4m: Don't set cs->halted = 0 in main_cpu_reset()

We rely on cpu_common_reset() to set cs->halted to 0, it's redundant to do
it in main_cpu_reset().

Signed-off-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
Message-Id: <20200826055535.951207-7-bauerman@linux.ibm.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
3 years agomips/cps: Use start-powered-off CPUState property
Thiago Jung Bauermann [Wed, 26 Aug 2020 05:55:32 +0000 (02:55 -0300)]
mips/cps: Use start-powered-off CPUState property

Instead of setting CPUState::halted to 1 in main_cpu_reset(), use the
start-powered-off property which makes cpu_common_reset() initialize it
to 1 in common code.

Also change creation of CPU object from cpu_create() to object_new() and
qdev_realize_and_unref() because cpu_create() realizes the CPU and it's not
possible to set a property after the object is realized.

Signed-off-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
Message-Id: <20200826055535.951207-6-bauerman@linux.ibm.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
3 years agoppc/e500: Use start-powered-off CPUState property
Thiago Jung Bauermann [Wed, 26 Aug 2020 05:55:31 +0000 (02:55 -0300)]
ppc/e500: Use start-powered-off CPUState property

Instead of setting CPUState::halted to 1 in ppce500_cpu_reset_sec(), use
the start-powered-off property which makes cpu_common_reset() initialize it
to 1 in common code.

Also change creation of CPU object from cpu_create() to object_new() and
qdev_realize_and_unref() because cpu_create() realizes the CPU and it's not
possible to set a property after the object is realized.

Signed-off-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
Message-Id: <20200826055535.951207-5-bauerman@linux.ibm.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
3 years agoppc/spapr: Use start-powered-off CPUState property
Thiago Jung Bauermann [Wed, 26 Aug 2020 05:55:30 +0000 (02:55 -0300)]
ppc/spapr: Use start-powered-off CPUState property

PowerPC sPAPR CPUs start in the halted state, and spapr_reset_vcpu()
attempts to implement this by setting CPUState::halted to 1. But that's too
late for the case of hotplugged CPUs in a machine configure with 2 or more
threads per core.

By then, other parts of QEMU have already caused the vCPU to run in an
unitialized state a couple of times. For example, ppc_cpu_reset() calls
ppc_tlb_invalidate_all(), which ends up calling async_run_on_cpu(). This
kicks the new vCPU while it has CPUState::halted = 0, causing QEMU to issue
a KVM_RUN ioctl on the new vCPU before the guest is able to make the
start-cpu RTAS call to initialize its register state.

This problem doesn't seem to cause visible issues for regular guests, but
on a secure guest running under the Ultravisor it does. The Ultravisor
relies on being able to snoop on the start-cpu RTAS call to map vCPUs to
guests, and this issue causes it to see a stray vCPU that doesn't belong to
any guest.

Fix by setting the start-powered-off CPUState property in
spapr_create_vcpu(), which makes cpu_common_reset() initialize
CPUState::halted to 1 at an earlier moment.

Suggested-by: Eduardo Habkost <ehabkost@redhat.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Greg Kurz <groug@kaod.org>
Signed-off-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
Message-Id: <20200826055535.951207-4-bauerman@linux.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
3 years agotarget/arm: Move setting of CPU halted state to generic code
Thiago Jung Bauermann [Wed, 26 Aug 2020 05:55:29 +0000 (02:55 -0300)]
target/arm: Move setting of CPU halted state to generic code

This change is in a separate patch because it's not so obvious that it
won't cause a regression.

Suggested-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Greg Kurz <groug@kaod.org>
Signed-off-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
Message-Id: <20200826055535.951207-3-bauerman@linux.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
3 years agotarget/arm: Move start-powered-off property to generic CPUState
Thiago Jung Bauermann [Wed, 26 Aug 2020 05:55:28 +0000 (02:55 -0300)]
target/arm: Move start-powered-off property to generic CPUState

There are other platforms which also have CPUs that start powered off, so
generalize the start-powered-off property so that it can be used by them.

Note that ARMv7MState also has a property of the same name but this patch
doesn't change it because that class isn't a subclass of CPUState so it
wouldn't be a trivial change.

This change should not cause any change in behavior.

Suggested-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Greg Kurz <groug@kaod.org>
Signed-off-by: Thiago Jung Bauermann <bauerman@linux.ibm.com>
Message-Id: <20200826055535.951207-2-bauerman@linux.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
3 years agoppc/spapr_nvdimm: do not enable support with 'nvdimm=off'
Daniel Henrique Barboza [Tue, 25 Aug 2020 21:57:49 +0000 (18:57 -0300)]
ppc/spapr_nvdimm: do not enable support with 'nvdimm=off'

The NVDIMM support for pSeries was introduced in 5.1, but it
didn't contemplate the 'nvdimm' machine option that other
archs uses. For every other arch, if no '-machine nvdimm(=on)'
is present, it is assumed that the NVDIMM support is disabled.
The user must explictly inform that the machine supports
NVDIMM. For pseries-5.1 the 'nvdimm' option is completely
ignored, and support is always assumed to exist. This
leads to situations where the user is able to set 'nvdimm=off'
but the guest boots up with the NVDIMMs anyway.

Fixing this now, after 5.1 launch, can put the overall NVDIMM
support for pseries in a strange place regarding this 'nvdimm'
machine option. If we force everything to be like other archs,
existing pseries-5.1 guests that didn't use 'nvdimm' to use NVDIMM
devices will break. If we attempt to make the newer pseries
machines (5.2+) behave like everyone else, but keep pseries-5.1
untouched, we'll have consistency problems on machine upgrade
(5.1 will have different default values for NVDIMM support than
5.2).

The common ground here is, if the user sets 'nvdimm=off', we
must comply regardless of being 5.1 or 5.2+. This patch
changes spapr_nvdimm_validate() to verify if the user set
NVDIMM support off in the machine options and, in that
case, error out if we have a NVDIMM device. The default
value for 5.2+ pseries machines will still be 'nvdimm=on'
when there is no 'nvdimm' option declared, just like it is today
with pseries-5.1. In the end we'll have different default
semantics from everyone else in the absence of the 'nvdimm'
machine option, but this boat has sailed.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1848887
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20200825215749.213536-4-danielhb413@gmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
3 years agospapr, spapr_nvdimm: fold NVDIMM validation in the same place
Daniel Henrique Barboza [Tue, 25 Aug 2020 21:57:48 +0000 (18:57 -0300)]
spapr, spapr_nvdimm: fold NVDIMM validation in the same place

NVDIMM has different contraints and conditions than the regular
DIMM and we'll need to add at least one more.

Instead of relying on 'if (nvdimm)' conditionals in the body of
spapr_memory_pre_plug(), use the existing spapr_nvdimm_validate_opts()
and put all NVDIMM handling code there. Rename it to
spapr_nvdimm_validate() to reflect that the function is now checking
more than the nvdimm device options. This makes spapr_memory_pre_plug()
a bit easier to follow, and we can tune in NVDIMM parameters
and validation in the same place.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20200825215749.213536-3-danielhb413@gmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
3 years agoppc/spapr_nvdimm: use g_autofree in spapr_nvdimm_validate_opts()
Daniel Henrique Barboza [Tue, 25 Aug 2020 21:57:47 +0000 (18:57 -0300)]
ppc/spapr_nvdimm: use g_autofree in spapr_nvdimm_validate_opts()

Since we're using the string just once, just use g_autofree and
avoid leaking it without calling g_free().

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20200825215749.213536-2-danielhb413@gmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
3 years agospapr/xive: Allocate vCPU IPIs from the vCPU contexts
Cédric Le Goater [Thu, 20 Aug 2020 13:45:47 +0000 (15:45 +0200)]
spapr/xive: Allocate vCPU IPIs from the vCPU contexts

When QEMU switches to the XIVE interrupt mode, it creates all the
guest interrupts at the level of the KVM device. These interrupts are
backed by real HW interrupts from the IPI interrupt pool of the XIVE
controller.

Currently, this is done from the QEMU main thread, which results in
allocating all interrupts from the chip on which QEMU is running. IPIs
are not distributed across the system and the load is not well
balanced across the interrupt controllers.

Change the vCPU IPI allocation to run from the vCPU context. The
associated XIVE IPI interrupt will be allocated on the chip on which
the vCPU is running and improve distribution of the IPIs in the system.
When the vCPUs are pinned, this will make the IPI local to the chip of
the vCPU. It will reduce rerouting between interrupt controllers and
gives better performance.

Device interrupts are still treated the same. To improve placement, we
would need some information on the chip owning the virtual source or
the HW source in case of a passthrough device but this reuires
changes in PAPR.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20200820134547.2355743-5-clg@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
3 years agospapr/xive: Allocate IPIs independently from the other sources
Cédric Le Goater [Thu, 20 Aug 2020 13:45:46 +0000 (15:45 +0200)]
spapr/xive: Allocate IPIs independently from the other sources

The vCPU IPIs are now allocated in kvmppc_xive_cpu_connect() when the
vCPU connects to the KVM device and not when all the sources are reset
in kvmppc_xive_source_reset()

This requires extra care for hotplug vCPUs and VM restore.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20200820134547.2355743-4-clg@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
3 years agospapr/xive: Use kvmppc_xive_source_reset() in post_load
Cédric Le Goater [Thu, 20 Aug 2020 13:45:45 +0000 (15:45 +0200)]
spapr/xive: Use kvmppc_xive_source_reset() in post_load

This is doing an extra loop but should be equivalent.

It also differentiate the reset of the sources from the restore of the
sources configuration. This will help in allocating the vCPU IPIs
independently.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20200820134547.2355743-3-clg@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
3 years agospapr/xive: Modify kvm_cpu_is_enabled() interface
Cédric Le Goater [Thu, 20 Aug 2020 13:45:44 +0000 (15:45 +0200)]
spapr/xive: Modify kvm_cpu_is_enabled() interface

We will use to check if a vCPU IPI has been created.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20200820134547.2355743-2-clg@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
3 years agospapr/xive: Use the xics flag to check for XIVE-only IRQ backends
Cédric Le Goater [Thu, 20 Aug 2020 14:01:06 +0000 (16:01 +0200)]
spapr/xive: Use the xics flag to check for XIVE-only IRQ backends

The sPAPR machine has four different IRQ backends, each implementing
the XICS or XIVE interrupt mode or both in the case of the 'dual'
backend.

If a machine is started in P8 compat mode, QEMU should necessarily
support the XICS interrupt mode and in that case, the XIVE-only IRQ
backend is invalid. Currently, spapr_irq_check() tests the pointer
value to the IRQ backend to check for this condition, instead use the
'xics' flag. It's equivalent and it will ease the introduction of new
XIVE-only IRQ backends if needed.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20200820140106.2357228-1-clg@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
3 years agospapr_vscsi: do not allow device hotplug
Daniel Henrique Barboza [Thu, 20 Aug 2020 19:06:35 +0000 (16:06 -0300)]
spapr_vscsi: do not allow device hotplug

We do not implement hotplug in the vscsi bus, but we forgot to
tell qdev about it. The result is that users are able to hotplug
devices in the vscsi bus, the devices appear in qdev, but they
aren't usable by the guest OS unless the user reboots it first.

Setting qbus hotplug_handler to NULL will tell qdev-monitor, via
qbus_is_hotpluggable(), that we do not support hotplug operations
in spapr_vscsi.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1862059

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20200820190635.379657-1-danielhb413@gmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
3 years agoppc/pnv: Add a HIOMAP erase command
Cédric Le Goater [Thu, 20 Aug 2020 16:46:38 +0000 (18:46 +0200)]
ppc/pnv: Add a HIOMAP erase command

The OPAL test suite runs a read-erase-write test on the PNOR :

  https://github.com/open-power/op-test/blob/master/testcases/OpTestPNOR.py

which revealed that the IPMI HIOMAP handlers didn't support
HIOMAP_C_ERASE. Implement the sector erase command by writing 0xFF in
the PNOR memory region.

Cc: Corey Minyard <cminyard@mvista.com>
Reported-by: Klaus Heinrich Kiwi <klaus@linux.vnet.ibm.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20200820164638.2515681-1-clg@kaod.org>
Acked-by: Corey Minyard <cminyard@mvista.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
3 years agospapr/xive: Add a 'hv-prio' property to represent the KVM escalation priority
Cédric Le Goater [Wed, 19 Aug 2020 13:08:36 +0000 (15:08 +0200)]
spapr/xive: Add a 'hv-prio' property to represent the KVM escalation priority

On POWER9, the KVM XIVE device uses priority 7 for the escalation
interrupts. On POWER10, the host can use a reduced set of priorities
and KVM will configure the escalation priority to a lower number. In
any case, the guest is allowed to use priorities in a single range :

    [ 0 .. (maxprio - 1) ].

Introduce a 'hv-prio' property to represent the escalation priority
number and use it to compute the "ibm,plat-res-int-priorities"
property defining the priority ranges reserved by the hypervisor.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20200819130843.2230799-2-clg@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
3 years agospapr: Remove unnecessary DRC type-checker macros
David Gibson [Tue, 25 Aug 2020 10:51:11 +0000 (20:51 +1000)]
spapr: Remove unnecessary DRC type-checker macros

spapr_drc.h includes typechecker macro boilerplate for the many different
DRC subclasses.  However, most of these types don't actually have different
data in their class and/or instance, making these unneeded, unused, and in
fact a bad idea.  Remove them.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Greg Kurz <groug@kaod.org>
3 years agoppc/pnv: Fix TypeInfo of PnvLpcController abstract class
Cédric Le Goater [Sat, 22 Aug 2020 08:39:20 +0000 (10:39 +0200)]
ppc/pnv: Fix TypeInfo of PnvLpcController abstract class

It was missing the instance_size field.

Cc: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20200822083920.2668930-1-clg@kaod.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
3 years agoadb: Correct class size on TYPE_ADB_DEVICE
David Gibson [Tue, 25 Aug 2020 10:28:51 +0000 (20:28 +1000)]
adb: Correct class size on TYPE_ADB_DEVICE

The TypeInfo incorrectly just lets the class size be inherited.  It won't
actually break things, since the class is abstract, but we should get it
right.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
3 years agoMerge remote-tracking branch 'remotes/hdeller/tags/target-hppa-pull-request' into...
Peter Maydell [Mon, 7 Sep 2020 20:50:29 +0000 (21:50 +0100)]
Merge remote-tracking branch 'remotes/hdeller/tags/target-hppa-pull-request' into staging

hppa power button support, graphics updates and firmware fixes

# gpg: Signature made Mon 07 Sep 2020 20:09:49 BST
# gpg:                using EDDSA key BCE9123E1AD29F07C049BBDEF712B510A23A0F5F
# gpg: Good signature from "Helge Deller <deller@gmx.de>" [unknown]
# gpg:                 aka "Helge Deller <deller@kernel.org>" [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: 4544 8228 2CD9 10DB EF3D  25F8 3E5F 3D04 A7A2 4603
#      Subkey fingerprint: BCE9 123E 1AD2 9F07 C049  BBDE F712 B510 A23A 0F5F

* remotes/hdeller/tags/target-hppa-pull-request:
  hw/display/artist: Allow screen size up to 2048 lines
  hw/display/artist: Refactor x/y coordination extraction
  hw/display/artist: Verify artist screen resolution
  target/hppa: Fix boot with old Linux installation CDs
  hw/hppa: Add power button emulation
  hw/hppa: Tell SeaBIOS port address of fw_cfg
  hw/hppa: Change fw_cfg port address
  hw/hppa: Store boot device in fw_cfg section
  hw/hppa: Make number of TLB and BTLB entries configurable
  seabios-hppa: Update SeaBIOS to hppa-qemu-5.2-2 tag

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 years agoconfigure: Do not set TARGET_ABI32 for microblaze
Richard Henderson [Fri, 4 Sep 2020 18:38:40 +0000 (11:38 -0700)]
configure: Do not set TARGET_ABI32 for microblaze

In 19f27b6c2493 TARGET_ABI_LONG was reduced to 32 bits for
CONFIG_USER_ONLY.  There is no need to set this by hand; it will
now be set automatically by include/exec/user/abitypes.h.

Tested-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
3 years agotarget/microblaze: Put MicroBlazeCPUConfig into DisasContext
Richard Henderson [Fri, 4 Sep 2020 18:49:13 +0000 (11:49 -0700)]
target/microblaze: Put MicroBlazeCPUConfig into DisasContext

The bulk of the translator should not have access to the
complete cpu state, to avoid the temptation to examine bits
that are in run time, but not translation time context.

We do need access to the constant cpu configuration, and
that is sufficient, so put that into DisasContext.

Tested-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
3 years agotarget/microblaze: Fill in VMStateDescription for cpu
Richard Henderson [Thu, 3 Sep 2020 04:41:00 +0000 (21:41 -0700)]
target/microblaze: Fill in VMStateDescription for cpu

Tested-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
3 years agotarget/microblaze: Move mmu parameters to MicroBlazeCPUConfig
Richard Henderson [Fri, 4 Sep 2020 18:31:57 +0000 (11:31 -0700)]
target/microblaze: Move mmu parameters to MicroBlazeCPUConfig

The final 4 fields in MicroBlazeMMU are configuration constants.
Move them into MicroBlazeCPUConfig where they belong.

Remove the leading "c_" from the member names, as that presumably
implied "config", and that should not be explicit in the location.

Tested-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
3 years agotarget/microblaze: Treat pvr_regs as constant
Richard Henderson [Fri, 4 Sep 2020 18:12:49 +0000 (11:12 -0700)]
target/microblaze: Treat pvr_regs as constant

Do not allow gdb to set the values, and don't bother dumping
unchanging values with -d cpu.

Tested-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
3 years agotarget/microblaze: Move pvr regs to MicroBlazeCPUConfig
Richard Henderson [Fri, 4 Sep 2020 18:11:28 +0000 (11:11 -0700)]
target/microblaze: Move pvr regs to MicroBlazeCPUConfig

These values are constant, and are derived from the other
configuration knobs.  Move them into MicroBlazeCPUConfig
to emphasize that they are not variable.

Tested-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>