]> git.proxmox.com Git - mirror_qemu.git/log
mirror_qemu.git
5 years agotcg: Promote tcg_out_{dup,dupi}_vec to backend interface
Richard Henderson [Mon, 18 Mar 2019 15:32:44 +0000 (15:32 +0000)]
tcg: Promote tcg_out_{dup,dupi}_vec to backend interface

The i386 backend already has these functions, and the aarch64 backend
could easily split out one.  Nothing is done with these functions yet,
but this will aid register allocation of INDEX_op_dup_vec in a later patch.

Adjust the aarch64 tcg_out_dupi_vec signature to match the new interface.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
5 years agotcg: Support cross-class moves without instruction support
Richard Henderson [Sat, 16 Mar 2019 17:48:32 +0000 (17:48 +0000)]
tcg: Support cross-class moves without instruction support

PowerPC Altivec does not support direct moves between vector registers
and general registers.  So when tcg_out_mov fails, we can use the
backing memory for the temporary to perform the move.

Acked-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
5 years agotcg: Return bool success from tcg_out_mov
Richard Henderson [Sat, 16 Mar 2019 17:48:18 +0000 (17:48 +0000)]
tcg: Return bool success from tcg_out_mov

This patch merely changes the interface, aborting on all failures,
of which there are currently none.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
5 years agotcg/arm: Use tcg_out_mov_reg in tcg_out_mov
Richard Henderson [Wed, 1 May 2019 20:26:46 +0000 (13:26 -0700)]
tcg/arm: Use tcg_out_mov_reg in tcg_out_mov

We have a function that takes an additional condition parameter
over the standard backend interface.  It already takes care of
eliding no-op moves.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
5 years agotcg: Assert fixed_reg is read-only
Richard Henderson [Sat, 16 Mar 2019 17:48:02 +0000 (17:48 +0000)]
tcg: Assert fixed_reg is read-only

The only fixed_reg is cpu_env, and it should not be modified
during any TB.  Therefore code that tries to special-case moves
into a fixed_reg is dead.  Remove it.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
5 years agotcg: Specify optional vector requirements with a list
Richard Henderson [Sun, 17 Mar 2019 00:27:29 +0000 (00:27 +0000)]
tcg: Specify optional vector requirements with a list

Replace the single opcode in .opc with a null-terminated
array in .opt_opc.  We still require that all opcodes be
used with the same .vece.

Validate the contents of this list with CONFIG_DEBUG_TCG.
All tcg_gen_*_vec functions will check any list active
during .fniv expansion.  Swap the active list in and out
as we expand other opcodes, or take control away from the
front-end function.

Convert all existing vector aware front ends.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
5 years agotcg: Allow add_vec, sub_vec, neg_vec, not_vec to be expanded
Richard Henderson [Sat, 16 Mar 2019 21:44:56 +0000 (21:44 +0000)]
tcg: Allow add_vec, sub_vec, neg_vec, not_vec to be expanded

PowerPC Altivec does not support add and subtract of 64-bit elements.
Prepare for that configuration by not assuming the operation is
universally supported.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
5 years agotcg: Do not recreate INDEX_op_neg_vec unless supported
Richard Henderson [Sat, 20 Apr 2019 00:27:24 +0000 (00:27 +0000)]
tcg: Do not recreate INDEX_op_neg_vec unless supported

Use tcg_can_emit_vec_op instead of just TCG_TARGET_HAS_neg_vec,
so that we check the type and vece for the actual operation.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
5 years agotcg: Implement tcg_gen_gvec_3i()
David Hildenbrand [Tue, 16 Apr 2019 18:52:21 +0000 (20:52 +0200)]
tcg: Implement tcg_gen_gvec_3i()

Let's add tcg_gen_gvec_3i(), similar to tcg_gen_gvec_2i(), however
without introducing "gen_helper_gvec_3i *fnoi", as it isn't needed
for now.

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20190416185301.25344-2-david@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
5 years agoMerge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2019-05-13' into...
Peter Maydell [Mon, 13 May 2019 15:52:56 +0000 (16:52 +0100)]
Merge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2019-05-13' into staging

Kconfig settings for the Arm machines

# gpg: Signature made Mon 13 May 2019 09:19:43 BST
# gpg:                using RSA key 2ED9D774FE702DB5
# gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full]
# gpg:                 aka "Thomas Huth <thuth@redhat.com>" [full]
# gpg:                 aka "Thomas Huth <huth@tuxfamily.org>" [full]
# gpg:                 aka "Thomas Huth <th.huth@posteo.de>" [unknown]
# Primary key fingerprint: 27B8 8847 EEE0 2501 18F3  EAB9 2ED9 D774 FE70 2DB5

* remotes/huth-gitlab/tags/pull-request-2019-05-13: (29 commits)
  hw/arm: Remove hard-enablement of the remaining PCI devices
  hw/arm: Express dependencies of the musca machines with Kconfig
  hw/arm: Express dependencies of the xlnx-versal-virt machine with Kconfig
  hw/arm: Express dependencies of the ZynqMP zcu102 machine with Kconfig
  hw/arm: Express dependencies of the microbit / nrf51 machine with Kconfig
  hw/arm: Express dependencies of the remaining IMX boards with Kconfig
  hw/arm: Express dependencies of the MSF2 / EMCRAFT_SF2 machine with Kconfig
  hw/arm: Express dependencies of sabrelite with Kconfig
  hw/arm: Express dependencies of canon-a1100 with Kconfig
  hw/arm: Express dependencies of the raspi machines with Kconfig
  hw/arm: Express dependencies of the MPS2 boards with Kconfig
  hw/arm: Express dependencies of allwinner / cubieboard with Kconfig
  hw/arm: Express dependencies of netduino / stm32f2xx with Kconfig
  hw/arm: Express dependencies of the virt machine with Kconfig
  hw/arm: Express dependencies of the aspeed boards with Kconfig
  hw/arm: Express dependencies of collie with Kconfig
  hw/arm: Express dependencies of xilinx-zynq with Kconfig
  hw/arm: Express dependencies of the PXA2xx machines with Kconfig
  hw/arm: Express dependencies of realview, versatile and vexpress with Kconfig
  hw/arm: Express dependencies of stellaris with Kconfig
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agoMerge remote-tracking branch 'remotes/armbru/tags/pull-misc-2019-05-13' into staging
Peter Maydell [Mon, 13 May 2019 12:55:13 +0000 (13:55 +0100)]
Merge remote-tracking branch 'remotes/armbru/tags/pull-misc-2019-05-13' into staging

Miscellaneous patches for 2019-05-13

# gpg: Signature made Mon 13 May 2019 08:04:02 BST
# gpg:                using RSA key 3870B400EB918653
# 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-misc-2019-05-13:
  Clean up decorations and whitespace around header guards
  Normalize header guard symbol definition.
  Clean up ill-advised or unusual header guards
  Clean up header guards that don't match their file name
  target/xtensa: Clean up core-isa.h header guards
  linux-user/nios2 linux-user/riscv: Clean up header guards
  authz: Normalize #include "authz/trace.h" to "trace.h"
  Use #include "..." for our own headers, <...> for others
  Clean up includes

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agoMerge remote-tracking branch 'remotes/kraxel/tags/input-20190513-v2-pull-request...
Peter Maydell [Mon, 13 May 2019 11:46:47 +0000 (12:46 +0100)]
Merge remote-tracking branch 'remotes/kraxel/tags/input-20190513-v2-pull-request' into staging

input: add vhost-user-input, virtio-input fixes.

# gpg: Signature made Mon 13 May 2019 07:52:39 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/input-20190513-v2-pull-request:
  virtio-input: fix Kconfig dependency and Makefile
  virtio-input-host-pci: cleanup types
  util: simplify unix_listen()
  Add vhost-user-input-pci
  Add vhost-user-backend
  libvhost-user: add PROTOCOL_F_CONFIG if {set, get}_config
  libvhost-user: fix -Waddress-of-packed-member

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agoMerge remote-tracking branch 'remotes/stsquad/tags/pull-demacro-softmmu-100519-1...
Peter Maydell [Mon, 13 May 2019 09:45:15 +0000 (10:45 +0100)]
Merge remote-tracking branch 'remotes/stsquad/tags/pull-demacro-softmmu-100519-1' into staging

Demacrofy the SoftMMU

  - the demacro itself
  - refactor TLB_RECHECK and fix bug
  - move unaligned handler out

# gpg: Signature made Fri 10 May 2019 20:34:14 BST
# gpg:                using RSA key 6685AE99E75167BCAFC8DF35FBD0DB095A9E2A44
# gpg: Good signature from "Alex Bennée (Master Work Key) <alex.bennee@linaro.org>" [full]
# Primary key fingerprint: 6685 AE99 E751 67BC AFC8  DF35 FBD0 DB09 5A9E 2A44

* remotes/stsquad/tags/pull-demacro-softmmu-100519-1:
  cputlb: Do unaligned store recursion to outermost function
  cputlb: Do unaligned load recursion to outermost function
  cputlb: Drop attribute flatten
  cputlb: Move TLB_RECHECK handling into load/store_helper
  accel/tcg: demacro cputlb

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agohw/arm: Remove hard-enablement of the remaining PCI devices
Thomas Huth [Fri, 8 Feb 2019 12:37:12 +0000 (13:37 +0100)]
hw/arm: Remove hard-enablement of the remaining PCI devices

The PCI devices should be pulled in by default if PCI_DEVICES
is set, so there is no need anymore to enforce them in the configs
file.

Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
5 years agohw/arm: Express dependencies of the musca machines with Kconfig
Thomas Huth [Fri, 22 Feb 2019 18:09:51 +0000 (19:09 +0100)]
hw/arm: Express dependencies of the musca machines with Kconfig

Dependencies have been determined with trial-and-error and by
looking at the musca.c source file.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
5 years agohw/arm: Express dependencies of the xlnx-versal-virt machine with Kconfig
Thomas Huth [Sat, 9 Feb 2019 06:16:05 +0000 (07:16 +0100)]
hw/arm: Express dependencies of the xlnx-versal-virt machine with Kconfig

Dependencies have been determined with trial-and-error and by
looking at the xlnx-versal.c source file.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
5 years agohw/arm: Express dependencies of the ZynqMP zcu102 machine with Kconfig
Thomas Huth [Fri, 8 Feb 2019 13:52:40 +0000 (14:52 +0100)]
hw/arm: Express dependencies of the ZynqMP zcu102 machine with Kconfig

This cleans up most settings in default-configs/aarch64-softmmu.mak.

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
5 years agohw/arm: Express dependencies of the microbit / nrf51 machine with Kconfig
Thomas Huth [Fri, 8 Feb 2019 12:33:40 +0000 (13:33 +0100)]
hw/arm: Express dependencies of the microbit / nrf51 machine with Kconfig

Add Kconfig dependencies for the NRF51 / microbit machine.

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
5 years agohw/arm: Express dependencies of the remaining IMX boards with Kconfig
Thomas Huth [Fri, 8 Feb 2019 12:18:31 +0000 (13:18 +0100)]
hw/arm: Express dependencies of the remaining IMX boards with Kconfig

IMX25, IMX7 and IMX6UL were still missing the Kconfig dependencies.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
5 years agohw/arm: Express dependencies of the MSF2 / EMCRAFT_SF2 machine with Kconfig
Thomas Huth [Fri, 8 Feb 2019 11:00:29 +0000 (12:00 +0100)]
hw/arm: Express dependencies of the MSF2 / EMCRAFT_SF2 machine with Kconfig

Add Kconfig dependencies for the emcraft-sf2 machine - we also
distinguish between the machine (CONFIG_EMCRAFT_SF2) and the SoC
(CONFIG_MSF2) now.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
5 years agohw/arm: Express dependencies of sabrelite with Kconfig
Thomas Huth [Fri, 8 Feb 2019 10:28:13 +0000 (11:28 +0100)]
hw/arm: Express dependencies of sabrelite with Kconfig

Add Kconfig dependencies for the Sabrelite / iMX6 machine.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
5 years agohw/arm: Express dependencies of canon-a1100 with Kconfig
Thomas Huth [Fri, 8 Feb 2019 09:55:38 +0000 (10:55 +0100)]
hw/arm: Express dependencies of canon-a1100 with Kconfig

Add Kconfig dependencies for the DIGIC / canon-a1100 machine.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
5 years agohw/arm: Express dependencies of the raspi machines with Kconfig
Thomas Huth [Fri, 8 Feb 2019 09:22:54 +0000 (10:22 +0100)]
hw/arm: Express dependencies of the raspi machines with Kconfig

Most of the code is directly controlled by the CONFIG_RASPI switch,
so not much to add here additionally.

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
5 years agohw/arm: Express dependencies of the MPS2 boards with Kconfig
Thomas Huth [Fri, 8 Feb 2019 09:19:41 +0000 (10:19 +0100)]
hw/arm: Express dependencies of the MPS2 boards with Kconfig

Add Kconfig dependencies for the mps2-an* machines.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
5 years agohw/arm: Express dependencies of allwinner / cubieboard with Kconfig
Thomas Huth [Fri, 8 Feb 2019 09:18:15 +0000 (10:18 +0100)]
hw/arm: Express dependencies of allwinner / cubieboard with Kconfig

Add dependencies for the Cubitech Cubieboard.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
5 years agohw/arm: Express dependencies of netduino / stm32f2xx with Kconfig
Thomas Huth [Fri, 8 Feb 2019 07:52:57 +0000 (08:52 +0100)]
hw/arm: Express dependencies of netduino / stm32f2xx with Kconfig

Netduino only depends on the stm32f205 SoC which in turn depends on
its components.

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
5 years agohw/arm: Express dependencies of the virt machine with Kconfig
Thomas Huth [Fri, 8 Feb 2019 06:17:55 +0000 (07:17 +0100)]
hw/arm: Express dependencies of the virt machine with Kconfig

Dependencies have been determined by looking at hw/arm/virt.c

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
5 years agohw/arm: Express dependencies of the aspeed boards with Kconfig
Thomas Huth [Fri, 8 Feb 2019 05:53:04 +0000 (06:53 +0100)]
hw/arm: Express dependencies of the aspeed boards with Kconfig

Dependencies have been determined by looking at hw/arm/aspeed.c

Reviewed-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
5 years agohw/arm: Express dependencies of collie with Kconfig
Thomas Huth [Fri, 8 Feb 2019 05:39:48 +0000 (06:39 +0100)]
hw/arm: Express dependencies of collie with Kconfig

Add Kconfig dependencies for the Strongarm collie machine.
This patch is based on earlier work by Ákos Kovács (i.e.
his "hw/arm/Kconfig: Add ARM Kconfig" patch).

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
5 years agohw/arm: Express dependencies of xilinx-zynq with Kconfig
Thomas Huth [Thu, 7 Feb 2019 19:26:34 +0000 (20:26 +0100)]
hw/arm: Express dependencies of xilinx-zynq with Kconfig

Add Kconfig dependencies for the xilinx-zynq-a9 board.
This patch is based on earlier work by Ákos Kovács (i.e.
his "hw/arm/Kconfig: Add ARM Kconfig" patch).

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
5 years agohw/arm: Express dependencies of the PXA2xx machines with Kconfig
Thomas Huth [Fri, 8 Feb 2019 11:35:26 +0000 (12:35 +0100)]
hw/arm: Express dependencies of the PXA2xx machines with Kconfig

Add Kconfig dependencies for the PXA2xx machines (akita, borzoi,
connex and verdex gumstix, tosa, mainstone, spitz, terrier and z2).
This patch is based on earlier work by Ákos Kovács (i.e.
his "hw/arm/Kconfig: Add ARM Kconfig" patch).

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
5 years agohw/arm: Express dependencies of realview, versatile and vexpress with Kconfig
Thomas Huth [Thu, 7 Feb 2019 19:05:05 +0000 (20:05 +0100)]
hw/arm: Express dependencies of realview, versatile and vexpress with Kconfig

This patch is slightly based on earlier work by Ákos Kovács (i.e.
his "hw/arm/Kconfig: Add ARM Kconfig" patch).

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
5 years agohw/arm: Express dependencies of stellaris with Kconfig
Thomas Huth [Thu, 7 Feb 2019 16:33:50 +0000 (17:33 +0100)]
hw/arm: Express dependencies of stellaris with Kconfig

This patch is slightly based on earlier work by Ákos Kovács (i.e.
his "hw/arm/Kconfig: Add ARM Kconfig" patch).

Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
5 years agohw/arm: Express dependencies of the OMAP machines with Kconfig
Thomas Huth [Thu, 7 Feb 2019 16:12:14 +0000 (17:12 +0100)]
hw/arm: Express dependencies of the OMAP machines with Kconfig

Add Kconfig dependencies for the OMAP machines (cheetah, n800, n810,
sx1 and sx1-v1).
This patch is slightly based on earlier work by Ákos Kovács (i.e.
his "hw/arm/Kconfig: Add ARM Kconfig" patch).

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
5 years agohw/arm: Express dependencies of musicpal with Kconfig
Thomas Huth [Thu, 7 Feb 2019 16:05:38 +0000 (17:05 +0100)]
hw/arm: Express dependencies of musicpal with Kconfig

This patch is slightly based on earlier work by Ákos Kovács (i.e.
his "hw/arm/Kconfig: Add ARM Kconfig" patch).

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
5 years agohw/arm: Express dependencies of the fsl-imx31 machine with Kconfig
Thomas Huth [Thu, 7 Feb 2019 15:51:56 +0000 (16:51 +0100)]
hw/arm: Express dependencies of the fsl-imx31 machine with Kconfig

Add Kconfig dependencies for the fsl-imx31 / kzm machine.
This patch is slightly based on earlier work by Ákos Kovács (i.e.
his "hw/arm/Kconfig: Add ARM Kconfig" patch).

Reviewed-by: Peter Chubb <peter.chubb@data61.csiro.au>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
5 years agohw/arm: Express dependencies of integratorcp with Kconfig
Thomas Huth [Thu, 7 Feb 2019 14:21:27 +0000 (15:21 +0100)]
hw/arm: Express dependencies of integratorcp with Kconfig

This patch is slightly based on earlier work by Ákos Kovács (i.e.
his "hw/arm/Kconfig: Add ARM Kconfig" patch).

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
5 years agohw/arm: Express dependencies of the highbank machines with Kconfig
Thomas Huth [Thu, 7 Feb 2019 09:35:22 +0000 (10:35 +0100)]
hw/arm: Express dependencies of the highbank machines with Kconfig

Add Kconfig dependencies for the highbank machine (and the midway
machine).
This patch is slightly based on earlier work by Ákos Kovács (i.e.
his "hw/arm/Kconfig: Add ARM Kconfig" patch).

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
5 years agohw/arm: Express dependencies of the exynos machines with Kconfig
Thomas Huth [Thu, 7 Feb 2019 09:28:01 +0000 (10:28 +0100)]
hw/arm: Express dependencies of the exynos machines with Kconfig

Add Kconfig dependencies for the Exynos-related boards (nuri and
smdkc210).
This patch is slightly based on earlier work by Ákos Kovács (i.e.
his "hw/arm/Kconfig: Add ARM Kconfig" patch).

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
5 years agohw/ide/ahci: Add a Kconfig switch for the AHCI-ICH9 device
Thomas Huth [Fri, 22 Feb 2019 14:48:11 +0000 (15:48 +0100)]
hw/ide/ahci: Add a Kconfig switch for the AHCI-ICH9 device

Some of our machines (like the ARM cubieboard) use CONFIG_AHCI for an AHCI
sysbus device, but do not use CONFIG_PCI since they do not feature a PCI
bus. With CONFIG_AHCI but without CONFIG_PCI, currently linking fails:

    ../hw/ide/ich.o: In function `pci_ich9_ahci_realize':
    hw/ide/ich.c:124: undefined reference to `pci_allocate_irq'
    hw/ide/ich.c:126: undefined reference to `pci_register_bar'
    hw/ide/ich.c:128: undefined reference to `pci_register_bar'
    hw/ide/ich.c:131: undefined reference to `pci_add_capability'
    hw/ide/ich.c:147: undefined reference to `msi_init'
    ../hw/ide/ich.o: In function `pci_ich9_uninit':
    hw/ide/ich.c:158: undefined reference to `msi_uninit'
    ../hw/ide/ich.o:(.data.rel+0x50): undefined reference to `vmstate_pci_device'

We must only compile ich.c if CONFIG_PCI is available, too, so introduce a
new config switch for this device.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Acked-by: John Snow <jsnow@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
5 years agoMakefile: Fix inclusion of the config-devices.mak.d Kconfig dependencies
Thomas Huth [Fri, 10 May 2019 08:11:59 +0000 (10:11 +0200)]
Makefile: Fix inclusion of the config-devices.mak.d Kconfig dependencies

The Makefile tries to include device Kconfig dependencies via

 -include $(SUBDIR_DEVICES_MAK_DEP)

and thus expects files that match *-softmmu/config-devices.mak.d ...
however, the minikconf script currently generates files a la
"*-softmmu-config.devices.mak.d" instead, so the dependency files
simply got ignored so far. For example, after a "touch hw/arm/Kconfig",
the arm-softmmu/config-devices.mak file is currently not re-generated.
Fix it by putting the dependency files in the *-softmmu folders now.

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
5 years agohw/pci/pci-stub: Add msi_enabled() and msi_notify() to the pci stubs
Thomas Huth [Tue, 19 Feb 2019 16:00:10 +0000 (17:00 +0100)]
hw/pci/pci-stub: Add msi_enabled() and msi_notify() to the pci stubs

Some machines have an AHCI adapter, but no PCI. To be able to
compile hw/ide/ahci.c without CONFIG_PCI, we still need the two
functions msi_enabled() and msi_notify() for linking.
This is required for the new Kconfig-like build system, if a user
wants to compile a QEMU binary with just one machine that has AHCI,
but no PCI, like the ARM "cubieboard" for example.

Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
5 years agoClean up decorations and whitespace around header guards
Markus Armbruster [Fri, 15 Mar 2019 14:51:23 +0000 (15:51 +0100)]
Clean up decorations and whitespace around header guards

Cleaned up with scripts/clean-header-guards.pl.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20190315145123.28030-9-armbru@redhat.com>

5 years agoNormalize header guard symbol definition.
Markus Armbruster [Fri, 15 Mar 2019 14:51:22 +0000 (15:51 +0100)]
Normalize header guard symbol definition.

We commonly define the header guard symbol without an explicit value.
Normalize the exceptions.

Done with scripts/clean-header-guards.pl.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20190315145123.28030-8-armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
5 years agoClean up ill-advised or unusual header guards
Markus Armbruster [Fri, 15 Mar 2019 14:51:21 +0000 (15:51 +0100)]
Clean up ill-advised or unusual header guards

Leading underscores are ill-advised because such identifiers are
reserved.  Trailing underscores are merely ugly.  Strip both.

Our header guards commonly end in _H.  Normalize the exceptions.

Done with scripts/clean-header-guards.pl.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20190315145123.28030-7-armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
[Changes to slirp/ dropped, as we're about to spin it off]

5 years agoClean up header guards that don't match their file name
Markus Armbruster [Fri, 15 Mar 2019 14:51:20 +0000 (15:51 +0100)]
Clean up header guards that don't match their file name

Header guard symbols should match their file name to make guard
collisions less likely.

Cleaned up with scripts/clean-header-guards.pl, followed by some
renaming of new guard symbols picked by the script to better ones.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20190315145123.28030-6-armbru@redhat.com>
[Rebase to master: update include/hw/net/ne2000-isa.h]

5 years agotarget/xtensa: Clean up core-isa.h header guards
Markus Armbruster [Fri, 15 Mar 2019 14:51:19 +0000 (15:51 +0100)]
target/xtensa: Clean up core-isa.h header guards

scripts/clean-header-guards.pl warns these headers use reserved
identifier _XTENSA_CORE_CONFIGURATION_H as header guard symbol.  It
additionally warns the guard doesn't match the file name.

Reuse of the same guard symbol in multiple headers is okay as long as
they cannot be included together.

Since we can avoid guard symbol reuse easily, do so: use the guard
symbol scripts/clean-header-guards.pl picks, less the TARGET_ prefix.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20190315145123.28030-5-armbru@redhat.com>

5 years agolinux-user/nios2 linux-user/riscv: Clean up header guards
Markus Armbruster [Fri, 15 Mar 2019 14:51:18 +0000 (15:51 +0100)]
linux-user/nios2 linux-user/riscv: Clean up header guards

Reuse of the same guard symbol in multiple headers is okay as long as
they cannot be included together.  scripts/clean-header-guards.pl
can't tell, so it warns.

Since we can avoid guard symbol reuse easily, do so: use guard symbol
${target^^}_${fname^^} for linux-user/$target/$fname, just like we did
in commit a9c94277f0..3500385697.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20190315145123.28030-4-armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
5 years agoauthz: Normalize #include "authz/trace.h" to "trace.h"
Markus Armbruster [Fri, 15 Mar 2019 14:51:17 +0000 (15:51 +0100)]
authz: Normalize #include "authz/trace.h" to "trace.h"

Include the generated trace.h the same way as we do everywhere else.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20190315145123.28030-3-armbru@redhat.com>
Acked-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
5 years agoUse #include "..." for our own headers, <...> for others
Markus Armbruster [Fri, 15 Mar 2019 14:51:16 +0000 (15:51 +0100)]
Use #include "..." for our own headers, <...> for others

Also delete a few redundant #include.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20190315145123.28030-2-armbru@redhat.com>

5 years agoClean up includes
Markus Armbruster [Wed, 13 Mar 2019 16:28:12 +0000 (17:28 +0100)]
Clean up includes

Clean up includes so that osdep.h is included first and headers
which it implies are not included manually.

This commit was created with scripts/clean-includes, with the changes
to the following files manually reverted:

    contrib/libvhost-user/libvhost-user-glib.h
    contrib/libvhost-user/libvhost-user.c
    contrib/libvhost-user/libvhost-user.h
    linux-user/mips64/cpu_loop.c
    linux-user/mips64/signal.c
    linux-user/sparc64/cpu_loop.c
    linux-user/sparc64/signal.c
    linux-user/x86_64/cpu_loop.c
    linux-user/x86_64/signal.c
    slirp/src/*
    target/s390x/gen-features.c
    tests/fp/platform.h
    tests/migration/s390x/a-b-bios.c
    tests/test-rcu-simpleq.c
    tests/test-rcu-tailq.c
    tests/uefi-test-tools/UefiTestToolsPkg/BiosTablesTest/BiosTablesTest.c

We're in the process of spinning out slirp/.  tests/fp/platform.h is
has to include qemu/osdep.h because tests/fp/berkeley-softfloat-3/ and
tests/fp/berkeley-testfloat-3/ don't.  tests/uefi-test-tools/ is guest
software.  The remaining reverts are the same as in commit
b7d89466dde.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20190313162812.8885-1-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[Revert change to tests/fp/platform.h, adjust commit message]

5 years agovirtio-input: fix Kconfig dependency and Makefile
Gerd Hoffmann [Fri, 10 May 2019 10:51:37 +0000 (12:51 +0200)]
virtio-input: fix Kconfig dependency and Makefile

Make VIRTIO_INPUT_HOST depend on VIRTIO_INPUT.
Use CONFIG_VIRTIO_INPUT_HOST in Makefile.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-id: 20190510105137.17481-2-kraxel@redhat.com

5 years agovirtio-input-host-pci: cleanup types
Gerd Hoffmann [Fri, 10 May 2019 10:51:36 +0000 (12:51 +0200)]
virtio-input-host-pci: cleanup types

virtio input is virtio-1.0 only, so we don't need the -transitional and
-non-transitional variants.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-id: 20190510105137.17481-1-kraxel@redhat.com

5 years agocputlb: Do unaligned store recursion to outermost function
Richard Henderson [Fri, 26 Apr 2019 04:12:59 +0000 (21:12 -0700)]
cputlb: Do unaligned store recursion to outermost function

This is less tricky than for loads, because we always fall
back to single byte stores to implement unaligned stores.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
5 years agocputlb: Do unaligned load recursion to outermost function
Richard Henderson [Fri, 26 Apr 2019 03:48:57 +0000 (20:48 -0700)]
cputlb: Do unaligned load recursion to outermost function

If we attempt to recurse from load_helper back to load_helper,
even via intermediary, we do not get all of the constants
expanded away as desired.

But if we recurse back to the original helper (or a shim that
has a consistent function signature), the operands are folded
away as desired.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
5 years agocputlb: Drop attribute flatten
Richard Henderson [Fri, 26 Apr 2019 03:01:37 +0000 (20:01 -0700)]
cputlb: Drop attribute flatten

Going to approach this problem via __attribute__((always_inline))
instead, but full conversion will take several steps.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
5 years agocputlb: Move TLB_RECHECK handling into load/store_helper
Richard Henderson [Thu, 25 Apr 2019 21:16:34 +0000 (14:16 -0700)]
cputlb: Move TLB_RECHECK handling into load/store_helper

Having this in io_readx/io_writex meant that we forgot to
re-compute index after tlb_fill.  It also means we can use
the normal aligned memory load path.  It also fixes a bug
in that we had cached a use of index across a tlb_fill.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
5 years agoaccel/tcg: demacro cputlb
Alex Bennée [Fri, 15 Feb 2019 14:31:13 +0000 (14:31 +0000)]
accel/tcg: demacro cputlb

Instead of expanding a series of macros to generate the load/store
helpers we move stuff into common functions and rely on the compiler
to eliminate the dead code for each variant.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
5 years agoMerge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
Peter Maydell [Fri, 10 May 2019 17:44:59 +0000 (18:44 +0100)]
Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging

Block layer patches:

- block: Remove bdrv_read() and bdrv_write()
- qemu-img: Allow rebase with no input base
- blockjob: Fix coroutine thread after AioContext change
- MAINTAINERS updates for pflash, curl and gluster

# gpg: Signature made Fri 10 May 2019 16:39:54 BST
# gpg:                using RSA key 7F09B272C88F2FD6
# gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" [full]
# Primary key fingerprint: DC3D EB15 9A9A F95D 3D74  56FE 7F09 B272 C88F 2FD6

* remotes/kevin/tags/for-upstream:
  iotests: Add test for rebase without input base
  qemu-img: Use zero writes after source backing EOF
  qemu-img: Allow rebase with no input base
  qcow2: Remove BDRVQcow2State.cluster_sectors
  block: Remove bdrv_read() and bdrv_write()
  vvfat: Replace bdrv_{read,write}() with bdrv_{pread,pwrite}()
  vdi: Replace bdrv_{read,write}() with bdrv_{pread,pwrite}()
  qcow2: Replace bdrv_write() with bdrv_pwrite()
  qemu-img: Use IEC binary prefixes for size constants
  test-block-iothread: Job coroutine thread after AioContext switch
  blockjob: Fix coroutine thread after AioContext change
  qemu-iotests: Fix cleanup for 192
  MAINTAINERS: Add an entry for the Parallel NOR Flash devices
  MAINTAINERS: Downgrade status of block sections without "M:" to "Odd Fixes"
  block: remove bs from lists before closing

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agoiotests: Add test for rebase without input base
Max Reitz [Thu, 9 May 2019 17:52:37 +0000 (19:52 +0200)]
iotests: Add test for rebase without input base

This patch adds a test for rebasing an image that currently does not
have a backing file.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
5 years agoqemu-img: Use zero writes after source backing EOF
Max Reitz [Thu, 9 May 2019 17:52:36 +0000 (19:52 +0200)]
qemu-img: Use zero writes after source backing EOF

Past the end of the source backing file, we memset() buf_old to zero, so
it is clearly easy to use blk_pwrite_zeroes() instead of blk_pwrite()
then.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
5 years agoqemu-img: Allow rebase with no input base
Max Reitz [Thu, 9 May 2019 17:52:35 +0000 (19:52 +0200)]
qemu-img: Allow rebase with no input base

Currently, without -u, you cannot add a backing file to an image when it
currently has none:

$ qemu-img rebase -b base.qcow2 foo.qcow2
qemu-img: Could not open old backing file '': The 'file' block driver
requires a file name

It is really simple to allow this, though (effectively by setting
old_backing_size to 0), so this patch does just that.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
5 years agoqcow2: Remove BDRVQcow2State.cluster_sectors
Alberto Garcia [Wed, 1 May 2019 18:13:59 +0000 (21:13 +0300)]
qcow2: Remove BDRVQcow2State.cluster_sectors

The last user of this field disappeared when we replace the
sector-based bdrv_write() with the byte-based bdrv_pwrite().

Signed-off-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
5 years agoblock: Remove bdrv_read() and bdrv_write()
Alberto Garcia [Wed, 1 May 2019 18:13:58 +0000 (21:13 +0300)]
block: Remove bdrv_read() and bdrv_write()

No one is using these functions anymore, all callers have switched to
the byte-based bdrv_pread() and bdrv_pwrite()

Signed-off-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
5 years agovvfat: Replace bdrv_{read,write}() with bdrv_{pread,pwrite}()
Alberto Garcia [Wed, 1 May 2019 18:13:57 +0000 (21:13 +0300)]
vvfat: Replace bdrv_{read,write}() with bdrv_{pread,pwrite}()

There's only a couple of bdrv_read() and bdrv_write() calls left in
the vvfat code, and they can be trivially replaced with the byte-based
bdrv_pread() and bdrv_pwrite().

Signed-off-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
5 years agovdi: Replace bdrv_{read,write}() with bdrv_{pread,pwrite}()
Alberto Garcia [Wed, 1 May 2019 18:13:56 +0000 (21:13 +0300)]
vdi: Replace bdrv_{read,write}() with bdrv_{pread,pwrite}()

There's only a couple of bdrv_read() and bdrv_write() calls left in
the vdi code, and they can be trivially replaced with the byte-based
bdrv_pread() and bdrv_pwrite().

Signed-off-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
5 years agoqcow2: Replace bdrv_write() with bdrv_pwrite()
Alberto Garcia [Wed, 1 May 2019 18:13:55 +0000 (21:13 +0300)]
qcow2: Replace bdrv_write() with bdrv_pwrite()

There's only one bdrv_write() call left in the qcow2 code, and it can
be trivially replaced with the byte-based bdrv_pwrite().

Signed-off-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
5 years agoqemu-img: Use IEC binary prefixes for size constants
Stefano Garzarella [Wed, 8 May 2019 10:43:24 +0000 (12:43 +0200)]
qemu-img: Use IEC binary prefixes for size constants

Using IEC binary prefixes in order to make the code more readable.

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
5 years agotest-block-iothread: Job coroutine thread after AioContext switch
Kevin Wolf [Fri, 3 May 2019 17:17:44 +0000 (19:17 +0200)]
test-block-iothread: Job coroutine thread after AioContext switch

This tests that a job coroutine always runs in the right iothread after
the AioContext of its main node has changed.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
5 years agoblockjob: Fix coroutine thread after AioContext change
Kevin Wolf [Fri, 3 May 2019 17:17:43 +0000 (19:17 +0200)]
blockjob: Fix coroutine thread after AioContext change

Commit 463e0be10 ('blockjob: add AioContext attached callback') tried to
make block jobs robust against AioContext changes of their main node,
but it never made sure that the job coroutine actually runs in the new
thread.

Instead of waking up the job coroutine in whatever thread it ran before,
let's always pass the AioContext where it should be running now.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
5 years agoqemu-iotests: Fix cleanup for 192
Kevin Wolf [Wed, 8 May 2019 12:00:44 +0000 (14:00 +0200)]
qemu-iotests: Fix cleanup for 192

Test case 192 calls _launch_qemu, so it also needs to _cleanup_qemu when
it's done, otherwise the QMP FIFOs stay around in scratch/. It also
creates a temporary NBD socket that needs to be removed as well at the
end of the test case.

Reported-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Tested-by: Thomas Huth <thuth@redhat.com>
5 years agoMAINTAINERS: Add an entry for the Parallel NOR Flash devices
Philippe Mathieu-Daudé [Sun, 5 May 2019 22:47:37 +0000 (00:47 +0200)]
MAINTAINERS: Add an entry for the Parallel NOR Flash devices

Step in to maintain it, since I have some familiarity with
the technology.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
5 years agoMAINTAINERS: Downgrade status of block sections without "M:" to "Odd Fixes"
Thomas Huth [Mon, 6 May 2019 06:18:54 +0000 (08:18 +0200)]
MAINTAINERS: Downgrade status of block sections without "M:" to "Odd Fixes"

Fixes might still get picked up via the qemu-block mailing list,
so the status is not "Orphan" yet.
Also add the gluster mailing list as suggested by Niels here:

 https://patchwork.kernel.org/patch/10613297/#22409943

Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
5 years agoblock: remove bs from lists before closing
Anton Kuchin [Tue, 7 May 2019 08:12:56 +0000 (11:12 +0300)]
block: remove bs from lists before closing

Close involves flush that can be performed asynchronously and bs
must be protected from being referenced before it is deleted.

Signed-off-by: Anton Kuchin <antonkuchin@yandex-team.ru>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
5 years agoMerge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging
Peter Maydell [Fri, 10 May 2019 13:49:36 +0000 (14:49 +0100)]
Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging

Pull request

# gpg: Signature made Fri 10 May 2019 14:02:22 BST
# gpg:                using RSA key 8695A8BFD3F97CDAAC35775A9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" [full]
# gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>" [full]
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8

* remotes/stefanha/tags/block-pull-request:
  docs: add Security chapter to the documentation
  docs: add Secure Coding Practices to developer docs
  aio-posix: ensure poll mode is left when aio_notify is called
  block/io.c: fix for the allocation failure
  block: Add coroutine_fn to bdrv_check_co_entry
  util/readline: Add braces to fix checkpatch errors
  util: readline: replace tab indent by four spaces to fix checkpatch errors
  util/readline: add a space to fix errors by checkpatch tool

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agoutil: simplify unix_listen()
Marc-André Lureau [Fri, 3 May 2019 13:00:33 +0000 (15:00 +0200)]
util: simplify unix_listen()

The only caller of unix_listen() left is qga/channel-posix.c.

There is no need to deal with legacy coma-trailing options ",...".

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-id: 20190503130034.24916-6-marcandre.lureau@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agoAdd vhost-user-input-pci
Marc-André Lureau [Fri, 3 May 2019 13:00:32 +0000 (15:00 +0200)]
Add vhost-user-input-pci

Add a new virtio-input device, which connects to a vhost-user
backend.

Instead of reading configuration directly from an input device /
evdev (like virtio-input-host), it reads it over vhost-user protocol
with {SET,GET}_CONFIG messages. The vhost-user-backend handles the
queues & events setup.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-id: 20190503130034.24916-5-marcandre.lureau@redhat.com

[ kraxel: drop -{non-,}transitional variants ]
[ kraxel: fix "make check" on !linux ]

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agoMerge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-4.1-pull-request...
Peter Maydell [Fri, 10 May 2019 11:49:13 +0000 (12:49 +0100)]
Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-4.1-pull-request' into staging

GPROF fixes, GCC9 fixes, SIOCGIFNAME fix, new IPV6 sockopts, elf fix

# gpg: Signature made Fri 10 May 2019 11:45:23 BST
# gpg:                using RSA key F30C38BD3F2FBE3C
# gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full]
# gpg:                 aka "Laurent Vivier <laurent@vivier.eu>" [full]
# gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [full]
# Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C

* remotes/vivier2/tags/linux-user-for-4.1-pull-request:
  linux-user: fix GPROF build failure
  linux-user: avoid treading on gprof's SIGPROF signals
  linux-user: elf: Map empty PT_LOAD segments
  The ioctl(SIOCGIFNAME) call requires a struct ifreq.
  linux-user: avoid string truncation warnings in uname field copying
  linux-user/elfload: Fix GCC 9 build warnings
  linux-user: Add missing IPV6 sockopts

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agoAdd vhost-user-backend
Marc-André Lureau [Fri, 3 May 2019 13:00:31 +0000 (15:00 +0200)]
Add vhost-user-backend

Create a vhost-user-backend object that holds a connection to a
vhost-user backend (or "slave" process) and can be referenced from
virtio devices that support it. See later patches for input & gpu
usage.

Note: a previous iteration of this object made it user-creatable, and
allowed managed sub-process spawning, but that has been dropped for
now.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-id: 20190503130034.24916-4-marcandre.lureau@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agolibvhost-user: add PROTOCOL_F_CONFIG if {set, get}_config
Marc-André Lureau [Fri, 3 May 2019 13:00:30 +0000 (15:00 +0200)]
libvhost-user: add PROTOCOL_F_CONFIG if {set, get}_config

Add the config protocol feature bit if the set_config & get_config
callbacks are implemented.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-id: 20190503130034.24916-3-marcandre.lureau@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agolibvhost-user: fix -Waddress-of-packed-member
Marc-André Lureau [Fri, 3 May 2019 13:00:29 +0000 (15:00 +0200)]
libvhost-user: fix -Waddress-of-packed-member

/home/elmarco/src/qemu/contrib/libvhost-user/libvhost-user.c: In function ‘vu_set_mem_table_exec_postcopy’:
/home/elmarco/src/qemu/contrib/libvhost-user/libvhost-user.c:546:31: warning: taking address of packed member of ‘struct VhostUserMsg’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  546 |     VhostUserMemory *memory = &vmsg->payload.memory;
      |                               ^~~~~~~~~~~~~~~~~~~~~
/home/elmarco/src/qemu/contrib/libvhost-user/libvhost-user.c: In function ‘vu_set_mem_table_exec’:
/home/elmarco/src/qemu/contrib/libvhost-user/libvhost-user.c:688:31: warning: taking address of packed member of ‘struct VhostUserMsg’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  688 |     VhostUserMemory *memory = &vmsg->payload.memory;
      |                               ^~~~~~~~~~~~~~~~~~~~~
/home/elmarco/src/qemu/contrib/libvhost-user/libvhost-user.c: In function ‘vu_set_vring_addr_exec’:
/home/elmarco/src/qemu/contrib/libvhost-user/libvhost-user.c:817:36: warning: taking address of packed member of ‘struct VhostUserMsg’ may result in an unaligned pointer value [-Waddress-of-packed-member]
  817 |     struct vhost_vring_addr *vra = &vmsg->payload.addr;
      |                                    ^~~~~~~~~~~~~~~~~~~

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-id: 20190503130034.24916-2-marcandre.lureau@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
5 years agolinux-user: fix GPROF build failure
Alex Bennée [Thu, 2 May 2019 09:27:28 +0000 (10:27 +0100)]
linux-user: fix GPROF build failure

When linux-user/exit was introduced we failed to move the gprof
include at the same time. The CI didn't notice because it only builds
system emulation. Fix it for those that still find gprof useful.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Laurent Desnogues <laurent.desnogues@gmail.com>
Message-Id: <20190502092728.32727-1-alex.bennee@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
5 years agolinux-user: avoid treading on gprof's SIGPROF signals
Alex Bennée [Thu, 2 May 2019 14:58:46 +0000 (15:58 +0100)]
linux-user: avoid treading on gprof's SIGPROF signals

The guest tends to get confused when it receives signals it doesn't
know about. Given the gprof magic has also set up it's own handler we
would do well to avoid stomping on it as well.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20190502145846.26226-1-alex.bennee@linaro.org>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
5 years agolinux-user: elf: Map empty PT_LOAD segments
Giuseppe Musacchio [Fri, 3 May 2019 12:20:07 +0000 (14:20 +0200)]
linux-user: elf: Map empty PT_LOAD segments

Some PT_LOAD segments may be completely zeroed out and their p_filesize
is zero, in that case the loader should just allocate a page that's at
least p_memsz bytes large (plus eventual alignment padding).

Calling zero_bss does this job for us, all we have to do is make sure we
don't try to mmap a zero-length page.

Signed-off-by: Giuseppe Musacchio <thatlemon@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20190503122007.lkjsvztgt4ycovac@debian>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
5 years agoThe ioctl(SIOCGIFNAME) call requires a struct ifreq.
Erik Kline [Tue, 23 Apr 2019 22:20:05 +0000 (15:20 -0700)]
The ioctl(SIOCGIFNAME) call requires a struct ifreq.

Signed-off-by: Erik Kline <ek@google.com>
Buglink: https://bugs.launchpad.net/qemu/+bug/1814352
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20190423222005.246981-1-ek@google.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
5 years agodocs: add Security chapter to the documentation
Stefan Hajnoczi [Thu, 9 May 2019 12:18:20 +0000 (13:18 +0100)]
docs: add Security chapter to the documentation

This new chapter in the QEMU documentation covers the security
requirements that QEMU is designed to meet and principles for securely
deploying QEMU.

It is just a starting point that can be extended in the future with more
information.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Acked-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Message-id: 20190509121820.16294-3-stefanha@redhat.com
Message-Id: <20190509121820.16294-3-stefanha@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
5 years agodocs: add Secure Coding Practices to developer docs
Stefan Hajnoczi [Thu, 9 May 2019 12:18:19 +0000 (13:18 +0100)]
docs: add Secure Coding Practices to developer docs

At KVM Forum 2018 I gave a presentation on security in QEMU:
https://www.youtube.com/watch?v=YAdRf_hwxU8 (video)
https://vmsplice.net/~stefan/stefanha-kvm-forum-2018.pdf (slides)

This patch adds a guide to secure coding practices.  This document
covers things that developers should know about security in QEMU.  It is
just a starting point that we can expand on later.  I hope it will be
useful as a resource for new contributors and will save code reviewers
from explaining the same concepts many times.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Acked-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Message-id: 20190509121820.16294-2-stefanha@redhat.com
Message-Id: <20190509121820.16294-2-stefanha@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
5 years agoaio-posix: ensure poll mode is left when aio_notify is called
Paolo Bonzini [Tue, 9 Apr 2019 12:28:23 +0000 (14:28 +0200)]
aio-posix: ensure poll mode is left when aio_notify is called

With aio=thread, adaptive polling makes latency worse rather than
better, because it delays the execution of the ThreadPool's
completion bottom half.

event_notifier_poll() does run while polling, detecting that
a bottom half was scheduled by a worker thread, but because
ctx->notifier is explicitly ignored in run_poll_handlers_once(),
scheduling the BH does not count as making progress and
run_poll_handlers() keeps running.  Fix this by recomputing
the deadline after *timeout could have changed.

With this change, ThreadPool still cannot participate in polling
but at least it does not suffer from extra latency.

Reported-by: Sergio Lopez <slp@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 20190409122823.12416-1-pbonzini@redhat.com
Cc: Stefan Hajnoczi <stefanha@gmail.com>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: qemu-block@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <1553692145-86728-1-git-send-email-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20190409122823.12416-1-pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
5 years agoblock/io.c: fix for the allocation failure
Andrey Shinkevich [Fri, 5 Apr 2019 14:24:04 +0000 (17:24 +0300)]
block/io.c: fix for the allocation failure

On a file system used by the customer, fallocate() returns an error
if the block is not properly aligned. So, bdrv_co_pwrite_zeroes()
fails. We can handle that case the same way as it is done for the
unsupported cases, namely, call to bdrv_driver_pwritev() that writes
zeroes to an image for the unaligned chunk of the block.

Suggested-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Message-id: 1554474244-553661-1-git-send-email-andrey.shinkevich@virtuozzo.com
Message-Id: <1554474244-553661-1-git-send-email-andrey.shinkevich@virtuozzo.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
5 years agoblock: Add coroutine_fn to bdrv_check_co_entry
Nikita Alekseev [Mon, 1 Apr 2019 09:30:51 +0000 (12:30 +0300)]
block: Add coroutine_fn to bdrv_check_co_entry

bdrv_check_co_entry calls bdrv_co_check, which is a coroutine function.
Thus, it also needs to be marked as a coroutine.

Signed-off-by: Nikita Alekseev <n.alekseev2104@gmail.com>
Message-id: 20190401093051.16488-1-n.alekseev2104@gmail.com
Message-Id: <20190401093051.16488-1-n.alekseev2104@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
5 years agoutil/readline: Add braces to fix checkpatch errors
Jules Irenge [Sat, 30 Mar 2019 11:21:42 +0000 (11:21 +0000)]
util/readline: Add braces to fix checkpatch errors

Add braces to fix errors issued by checkpatch.pl tool
"ERROR: braces {} are necessary for all arms of this statement"
Within "util/readline.c" file
Message-Id: <20190330112142.14082-1-jbi.octave@gmail.com>

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
5 years agoutil: readline: replace tab indent by four spaces to fix checkpatch errors
Jules Irenge [Mon, 1 Apr 2019 02:44:06 +0000 (03:44 +0100)]
util: readline: replace tab indent by four spaces to fix checkpatch errors

Replace tab indent by four spaces to fix errors issued by checkpatch.pl tool
"ERROR: code indent should never use tabs" within "util/readline.c" file.

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-id: 20190401024406.10819-3-jbi.octave@gmail.com
Message-Id: <20190401024406.10819-3-jbi.octave@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
5 years agoutil/readline: add a space to fix errors by checkpatch tool
Jules Irenge [Mon, 1 Apr 2019 02:44:05 +0000 (03:44 +0100)]
util/readline: add a space to fix errors by checkpatch tool

util/readline: add a space to fix errors reported by checkpatch.pl tool
"ERROR: space required before the open parenthesis"
"ERROR: space required after that ..."
within "util/redline.c" file

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-id: 20190401024406.10819-2-jbi.octave@gmail.com
Message-Id: <20190401024406.10819-2-jbi.octave@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
5 years agoMerge remote-tracking branch 'remotes/maxreitz/tags/pull-block-2019-05-07' into staging
Peter Maydell [Thu, 9 May 2019 15:31:12 +0000 (16:31 +0100)]
Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-2019-05-07' into staging

Block patches:
- Fixes to qcow2's implementation of qemu-img check
- Our SSH driver now supports bdrv_refresh_filename()
- Miscellaneous fixes

# gpg: Signature made Tue 07 May 2019 16:16:58 BST
# gpg:                using RSA key F407DB0061D5CF40
# gpg: Good signature from "Max Reitz <mreitz@redhat.com>" [full]
# Primary key fingerprint: 91BE B60A 30DB 3E88 57D1  1829 F407 DB00 61D5 CF40

* remotes/maxreitz/tags/pull-block-2019-05-07:
  iotests: Fix iotests 110 and 126
  commit: Use bdrv_append() in commit_start()
  block: Assert that drv->bdrv_child_perm is set in bdrv_child_perm()
  block/ssh: Implement .bdrv_dirname()
  block/ssh: Implement .bdrv_refresh_filename()
  qcow2: discard bitmap when removed
  qcow2-refcount: don't mask corruptions under internal errors
  qcow2-refcount: check_refcounts_l2: don't count fixed cluster as allocated
  qcow2-refcount: check_refcounts_l2: reduce ignored overlaps
  qcow2-refcount: avoid eating RAM
  qcow2-refcount: fix check_oflag_copied

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agolinux-user: avoid string truncation warnings in uname field copying
Daniel P. Berrangé [Wed, 1 May 2019 14:46:46 +0000 (15:46 +0100)]
linux-user: avoid string truncation warnings in uname field copying

In file included from /usr/include/string.h:494,
                 from include/qemu/osdep.h:101,
                 from linux-user/uname.c:20:
In function ‘strncpy’,
    inlined from ‘sys_uname’ at linux-user/uname.c:94:3:
/usr/include/bits/string_fortified.h:106:10: warning: ‘__builtin_strncpy’ output may be truncated copying 64 bytes from a string of length 64 [-Wstringop-truncation]
  106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

We don't care where the NUL terminator in the original uname
field was. It suffices to copy the entire original field and
simply force a NUL terminator at the end of the new field.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20190501144646.4851-1-berrange@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
5 years agolinux-user/elfload: Fix GCC 9 build warnings
Alistair Francis [Tue, 30 Apr 2019 23:29:01 +0000 (23:29 +0000)]
linux-user/elfload: Fix GCC 9 build warnings

Fix this warning when building with GCC9 on Fedora 30:
In function ‘strncpy’,
    inlined from ‘fill_psinfo’ at /home/alistair/qemu/linux-user/elfload.c:3208:12,
    inlined from ‘fill_note_info’ at /home/alistair/qemu/linux-user/elfload.c:3390:5,
    inlined from ‘elf_core_dump’ at /home/alistair/qemu/linux-user/elfload.c:3539:9:
/usr/include/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ specified bound 16 equals destination size [-Werror=stringop-truncation]
  106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <c4d2b1de9efadcf1c900b91361af9302823a72a9.1556666645.git.alistair.francis@wdc.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
5 years agolinux-user: Add missing IPV6 sockopts
Helge Deller [Sun, 10 Mar 2019 11:12:16 +0000 (12:12 +0100)]
linux-user: Add missing IPV6 sockopts

When running ssh over IPv6 with linux-user I faced this warning:
 Unsupported setsockopt level=41 optname=67
 setsockopt IPV6_TCLASS 32: Protocol not available:

This patch adds code to the linux-user emulatation for setting and
retrieving of a few missing IPV6 options, including IPV6_TCLASS.

Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
5 years agoMerge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2019-05-09' into...
Peter Maydell [Thu, 9 May 2019 14:43:41 +0000 (15:43 +0100)]
Merge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2019-05-09' into staging

- Fix "make check" problem that occurred with LANG=C and Python 3.5 / 3.6
- Get rid of some more dependencies on the global_qtest variable in the qtests
- Some other small test clean-ups
- Some copyright statement clarifications
- Mark TARGET_FMT_lu as poisoned

# gpg: Signature made Thu 09 May 2019 08:45:47 BST
# gpg:                using RSA key 2ED9D774FE702DB5
# gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full]
# gpg:                 aka "Thomas Huth <thuth@redhat.com>" [full]
# gpg:                 aka "Thomas Huth <huth@tuxfamily.org>" [full]
# gpg:                 aka "Thomas Huth <th.huth@posteo.de>" [unknown]
# Primary key fingerprint: 27B8 8847 EEE0 2501 18F3  EAB9 2ED9 D774 FE70 2DB5

* remotes/huth-gitlab/tags/pull-request-2019-05-09:
  include/exec/poison: Mark TARGET_FMT_lu as poisoned, too
  target/sh4: Fix LGPL information in the file headers
  target/openrisc: Fix LGPL information in the file headers
  hw/i2c/smbus_ich9: Fix the confusing contributions-after-2012 statement
  tests: qpci_unplug_acpi_device_test() should not rely on global_qtest
  tests/drive_del-test: Use qtest_init() instead of qtest_start()
  tests/Makefile: Remove unused test-obj-y variable
  tests/tpm-tests: Use g_test_skip() to mark skipped tests
  tests/ide-test: Make test independent of global_qtest
  tests/test-hmp: Use qtest_init() instead of qtest_start()
  tests/qmp-cmd-test: Use qtest_init() instead of qtest_start()
  tests/megasas: Make test independent of global_qtest
  tests/tco: Make test independent of global_qtest
  tests: Force Python I/O encoding for check-qapi-schema

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agoMerge remote-tracking branch 'remotes/vivier2/tags/trivial-branch-pull-request' into...
Peter Maydell [Thu, 9 May 2019 12:36:10 +0000 (13:36 +0100)]
Merge remote-tracking branch 'remotes/vivier2/tags/trivial-branch-pull-request' into staging

Pull request trivial branch 2019-05-03

# gpg: Signature made Fri 03 May 2019 12:26:34 BST
# gpg:                using RSA key F30C38BD3F2FBE3C
# gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full]
# gpg:                 aka "Laurent Vivier <laurent@vivier.eu>" [full]
# gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [full]
# Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C

* remotes/vivier2/tags/trivial-branch-pull-request:
  sockets: avoid string truncation warnings when copying UNIX path
  hw/sparc/leon3: Allow load of uImage firmwares
  Makefile: Let the 'clean' rule remove qemu-ga.exe on Windows hosts
  net: Print output of "-net nic, model=help" to stdout instead of stderr
  Header cleanups
  Update configure
  configure: fix pam test warning
  qom: use object_new_with_type in object_new_with_propv
  doc: fix the configuration path
  CODING_STYLE: indent example code as all others
  CODING_STYLE: specify the indent rule for multiline code
  hw/net/pcnet: Use qemu_log_mask(GUEST_ERROR) instead of printf

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
5 years agoMerge remote-tracking branch 'remotes/thibault/tags/samuel-thibault' into staging
Peter Maydell [Thu, 9 May 2019 08:58:41 +0000 (09:58 +0100)]
Merge remote-tracking branch 'remotes/thibault/tags/samuel-thibault' into staging

Update slirp submodule

Samuel Thibault (1):
  Update upstream slirp
  Adds gitignore, README file, and fixes ident protocol parsing.

# gpg: Signature made Thu 09 May 2019 09:00:30 BST
# gpg:                using RSA key E61DBB15D4172BDEC97E92D9DB550E89F0FA54F3
# gpg: Good signature from "Samuel Thibault <samuel.thibault@aquilenet.fr>" [unknown]
# gpg:                 aka "Samuel Thibault <sthibault@debian.org>" [marginal]
# gpg:                 aka "Samuel Thibault <samuel.thibault@gnu.org>" [unknown]
# gpg:                 aka "Samuel Thibault <samuel.thibault@inria.fr>" [marginal]
# gpg:                 aka "Samuel Thibault <samuel.thibault@labri.fr>" [marginal]
# gpg:                 aka "Samuel Thibault <samuel.thibault@ens-lyon.org>" [marginal]
# gpg:                 aka "Samuel Thibault <samuel.thibault@u-bordeaux.fr>" [unknown]
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg:          It is not certain that the signature belongs to the owner.
# Primary key fingerprint: 900C B024 B679 31D4 0F82  304B D017 8C76 7D06 9EE6
#      Subkey fingerprint: E61D BB15 D417 2BDE C97E  92D9 DB55 0E89 F0FA 54F3

* remotes/thibault/tags/samuel-thibault:
  Update upstream slirp

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>