]> git.proxmox.com Git - mirror_qemu.git/log
mirror_qemu.git
6 years agotarget/arm: Strict alignment for ARMv6-M and ARMv8-M Baseline
Julia Suvorova [Fri, 22 Jun 2018 12:28:41 +0000 (13:28 +0100)]
target/arm: Strict alignment for ARMv6-M and ARMv8-M Baseline

Unlike ARMv7-M, ARMv6-M and ARMv8-M Baseline only supports naturally
aligned memory accesses for load/store instructions.

Signed-off-by: Julia Suvorova <jusual@mail.ru>
Message-id: 20180622080138.17702-3-jusual@mail.ru
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agotarget/arm: Introduce ARM_FEATURE_M_MAIN
Julia Suvorova [Fri, 22 Jun 2018 12:28:41 +0000 (13:28 +0100)]
target/arm: Introduce ARM_FEATURE_M_MAIN

This feature is intended to distinguish ARMv8-M variants: Baseline and
Mainline. ARMv7-M compatibility requires the Main Extension. ARMv6-M
compatibility is provided by all ARMv8-M implementations.

Signed-off-by: Julia Suvorova <jusual@mail.ru>
Message-id: 20180622080138.17702-2-jusual@mail.ru
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agohw/arm/mps2-tz.c: Instantiate MPCs
Peter Maydell [Fri, 22 Jun 2018 12:28:41 +0000 (13:28 +0100)]
hw/arm/mps2-tz.c: Instantiate MPCs

Instantiate and wire up the Memory Protection Controllers
in the MPS2 board itself.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 20180620132032.28865-9-peter.maydell@linaro.org

6 years agohw/arm/iotkit: Wire up MPC interrupt lines
Peter Maydell [Fri, 22 Jun 2018 12:28:40 +0000 (13:28 +0100)]
hw/arm/iotkit: Wire up MPC interrupt lines

The interrupt outputs from the MPC in the IoTKit and the expansion
MPCs in the board must be wired up to the security controller, and
also all ORed together to produce a single line to the NVIC.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 20180620132032.28865-8-peter.maydell@linaro.org

6 years agohw/arm/iotkit: Instantiate MPC
Peter Maydell [Fri, 22 Jun 2018 12:28:40 +0000 (13:28 +0100)]
hw/arm/iotkit: Instantiate MPC

Wire up the one MPC that is part of the IoTKit itself. For the
moment we don't wire up its interrupt line.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 20180620132032.28865-7-peter.maydell@linaro.org

6 years agohw/misc/iotkit-secctl.c: Implement SECMPCINTSTATUS
Peter Maydell [Fri, 22 Jun 2018 12:28:40 +0000 (13:28 +0100)]
hw/misc/iotkit-secctl.c: Implement SECMPCINTSTATUS

Implement the SECMPCINTSTATUS register. This is the only register
in the security controller that deals with Memory Protection
Controllers, and it simply provides a read-only view of the
interrupt lines from the various MPCs in the system.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20180620132032.28865-6-peter.maydell@linaro.org

6 years agohw/misc/tz_mpc.c: Honour the BLK_LUT settings in translate
Peter Maydell [Fri, 22 Jun 2018 12:28:40 +0000 (13:28 +0100)]
hw/misc/tz_mpc.c: Honour the BLK_LUT settings in translate

The final part of the Memory Protection Controller we need to
implement is actually using the BLK_LUT data programmed by the
guest to determine whether to block the transaction or not.

Since this means we now change transaction mappings when
the guest writes to BLK_LUT, we must also call the IOMMU
notifiers at that point.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Message-id: 20180620132032.28865-5-peter.maydell@linaro.org

6 years agohw/misc/tz-mpc.c: Implement correct blocked-access behaviour
Peter Maydell [Fri, 22 Jun 2018 12:28:40 +0000 (13:28 +0100)]
hw/misc/tz-mpc.c: Implement correct blocked-access behaviour

The MPC is guest-configurable for whether blocked accesses:
 * should be RAZ/WI or cause a bus error
 * should generate an interrupt or not

Implement this behaviour in the blocked-access handlers.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Message-id: 20180620132032.28865-4-peter.maydell@linaro.org

6 years agohw/misc/tz-mpc.c: Implement registers
Peter Maydell [Fri, 22 Jun 2018 12:28:39 +0000 (13:28 +0100)]
hw/misc/tz-mpc.c: Implement registers

Implement the missing registers for the TZ MPC.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Message-id: 20180620132032.28865-3-peter.maydell@linaro.org

6 years agohw/misc/tz-mpc.c: Implement the Arm TrustZone Memory Protection Controller
Peter Maydell [Fri, 22 Jun 2018 12:28:39 +0000 (13:28 +0100)]
hw/misc/tz-mpc.c: Implement the Arm TrustZone Memory Protection Controller

Implement the Arm TrustZone Memory Protection Controller, which sits
in front of RAM and allows secure software to configure it to either
pass through or reject transactions.

We implement the MPC as a QEMU IOMMU, which will direct transactions
either through to the devices and memory behind it or to a special
"never works" AddressSpace if they are blocked.

This initial commit implements the skeleton of the device:
 * it always permits accesses
 * it doesn't implement most of the registers
 * it doesn't implement the interrupt or other behaviour
   for blocked transactions

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Message-id: 20180620132032.28865-2-peter.maydell@linaro.org

6 years agoxlnx-zynqmp: Swap Cortex-R5 for Cortex-R5F
Edgar E. Iglesias [Fri, 22 Jun 2018 12:28:38 +0000 (13:28 +0100)]
xlnx-zynqmp: Swap Cortex-R5 for Cortex-R5F

The ZynqMP has Cortex-R5Fs with the optional FPU enabled.

Reviewed-by: KONRAD Frederic <frederic.konrad@adacore.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Message-id: 20180529124707.3025-3-edgar.iglesias@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agotarget-arm: Add the Cortex-R5F
Edgar E. Iglesias [Fri, 22 Jun 2018 12:28:38 +0000 (13:28 +0100)]
target-arm: Add the Cortex-R5F

Add the Cortex-R5F with the optional FPU enabled.

Reviewed-by: KONRAD Frederic <frederic.konrad@adacore.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Message-id: 20180529124707.3025-2-edgar.iglesias@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agohw/arm/virt: Increase max_cpus to 512
Eric Auger [Fri, 22 Jun 2018 12:28:38 +0000 (13:28 +0100)]
hw/arm/virt: Increase max_cpus to 512

virt 3.0 now allows up to 512 vcpus whereas for earlier machine
types, max_cpus was set to 255 and any attempt to start the
machine with vcpus > 255 was rejected at a very early stage,
in vl.c/main level.

512 is the max supported by KVM. Anyway the actual vcpu count
that can be achieved depends on other parameters such as the
acceleration mode, the vgic version, the host kernel version.
Those are discovered later on.

Signed-off-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Message-id: 1529072910-16156-12-git-send-email-eric.auger@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agohw/arm/virt: Use 256MB ECAM region by default
Eric Auger [Fri, 22 Jun 2018 12:28:37 +0000 (13:28 +0100)]
hw/arm/virt: Use 256MB ECAM region by default

With this patch, virt-3.0 machine uses a new 256MB ECAM region
by default instead of the legacy 16MB one, if highmem is set
(LPAE supported by the guest) and (!firmware_loaded || aarch64).

Indeed aarch32 mode FW may not support this high ECAM region.

Signed-off-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Message-id: 1529072910-16156-11-git-send-email-eric.auger@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agohw/arm/virt: Add virt-3.0 machine type
Eric Auger [Fri, 22 Jun 2018 12:28:37 +0000 (13:28 +0100)]
hw/arm/virt: Add virt-3.0 machine type

Add virt-3.0 machine type.

Signed-off-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Message-id: 1529072910-16156-10-git-send-email-eric.auger@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agohw/arm/virt: Add a new 256MB ECAM region
Eric Auger [Fri, 22 Jun 2018 12:28:37 +0000 (13:28 +0100)]
hw/arm/virt: Add a new 256MB ECAM region

This patch defines a new ECAM region located after the 256GB limit.

The virt machine state is augmented with a new highmem_ecam field
which guards the usage of this new ECAM region instead of the legacy
16MB one. With the highmem ECAM region, up to 256 PCIe buses can be
used.

Signed-off-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Message-id: 1529072910-16156-9-git-send-email-eric.auger@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agohw/arm/virt: Register two redistributor regions when necessary
Eric Auger [Fri, 22 Jun 2018 12:28:37 +0000 (13:28 +0100)]
hw/arm/virt: Register two redistributor regions when necessary

With a VGICv3 KVM device, if the number of vcpus exceeds the
capacity of the legacy redistributor region (123 redistributors),
we now attempt to register a second redistributor region. Up to
512 redistributors can fit in this latter on top of the 123 allowed
by the legacy redistributor region.

Registering this second redistributor region is possible if the
host kernel supports the following VGICv3 KVM device group/attribute:
KVM_DEV_ARM_VGIC_GRP_ADDR/KVM_VGIC_V3_ADDR_TYPE_REDIST_REGION.

In case the host kernel does not support the registration of several
redistributor regions and the requested number of vcpus exceeds the
capacity of the legacy redistributor region, the GICv3 device
initialization fails with a proper error message and qemu exits.

At the moment the max number of vcpus still is capped by the
virt machine class max_cpus.

Signed-off-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Message-id: 1529072910-16156-8-git-send-email-eric.auger@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agohw/arm/virt-acpi-build: Advertise one or two GICR structures
Eric Auger [Fri, 22 Jun 2018 12:28:36 +0000 (13:28 +0100)]
hw/arm/virt-acpi-build: Advertise one or two GICR structures

Depending on the number of smp_cpus we now register one or two
GICR structures.

Signed-off-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Message-id: 1529072910-16156-7-git-send-email-eric.auger@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agohw/arm/virt: GICv3 DT node with one or two redistributor regions
Eric Auger [Fri, 22 Jun 2018 12:28:36 +0000 (13:28 +0100)]
hw/arm/virt: GICv3 DT node with one or two redistributor regions

This patch allows the creation of a GICv3 node with 1 or 2
redistributor regions depending on the number of smu_cpus.
The second redistributor region is located just after the
existing RAM region, at 256GB and contains up to up to 512 vcpus.

Please refer to kernel documentation for further node details:
Documentation/devicetree/bindings/interrupt-controller/arm,gic-v3.txt

Signed-off-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Message-id: 1529072910-16156-6-git-send-email-eric.auger@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agohw/intc/arm_gicv3_kvm: Get prepared to handle multiple redist regions
Eric Auger [Fri, 22 Jun 2018 12:28:36 +0000 (13:28 +0100)]
hw/intc/arm_gicv3_kvm: Get prepared to handle multiple redist regions

Let's check if KVM_VGIC_V3_ADDR_TYPE_REDIST_REGION is supported.
If not, we check the number of redist region is equal to 1 and use the
legacy KVM_VGIC_V3_ADDR_TYPE_REDIST attribute. Otherwise we use
the new attribute and allow to register multiple regions to the
KVM device.

Signed-off-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Message-id: 1529072910-16156-5-git-send-email-eric.auger@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agohw/intc/arm_gicv3: Introduce redist-region-count array property
Eric Auger [Fri, 22 Jun 2018 12:28:36 +0000 (13:28 +0100)]
hw/intc/arm_gicv3: Introduce redist-region-count array property

To prepare for multiple redistributor regions, we introduce
an array of uint32_t properties that stores the redistributor
count of each redistributor region.

Non accelerated VGICv3 only supports a single redistributor region.
The capacity of all redist regions is checked against the number of
vcpus.

Machvirt is updated to set those properties, ie. a single
redistributor region with count set to the number of vcpus
capped by 123.

Signed-off-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Message-id: 1529072910-16156-4-git-send-email-eric.auger@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agotarget/arm: Allow KVM device address overwriting
Eric Auger [Fri, 22 Jun 2018 12:28:35 +0000 (13:28 +0100)]
target/arm: Allow KVM device address overwriting

for KVM_VGIC_V3_ADDR_TYPE_REDIST_REGION attribute, the attribute
data pointed to by kvm_device_attr.addr is a OR of the
redistributor region address and other fields such as the index
of the redistributor region and the number of redistributors the
region can contain.

The existing machine init done notifier framework sets the address
field to the actual address of the device and does not allow to OR
this value with other fields.

This patch extends the KVMDevice struct with a new kda_addr_ormask
member. Its value is passed at registration time and OR'ed with the
resolved address on kvm_arm_set_device_addr().

Signed-off-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1529072910-16156-3-git-send-email-eric.auger@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agolinux-headers: Update to kernel mainline commit b357bf602
Eric Auger [Fri, 22 Jun 2018 12:28:35 +0000 (13:28 +0100)]
linux-headers: Update to kernel mainline commit b357bf602

Update our kernel headers to mainline commit
b357bf6023a948cf6a9472f07a1b0caac0e4f8e8
("Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm")

Signed-off-by: Eric Auger <eric.auger@redhat.com>
Message-id: 1529072910-16156-2-git-send-email-eric.auger@redhat.com
[PMM:  clarified commit message]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agotarget-arm: fix a segmentation fault due to illegal memory access
Zheng Xiang [Fri, 22 Jun 2018 12:28:35 +0000 (13:28 +0100)]
target-arm: fix a segmentation fault due to illegal memory access

The elements of kvm_devices_head list are freed in kvm_arm_machine_init_done(),
but we still access these illegal memory in kvm_arm_devlistener_del().

This will cause segment fault when booting guest with MALLOC_PERTURB_=1.

Signed-off-by: Zheng Xiang <xiang.zheng@linaro.org>
Message-id: 20180619075821.9884-1-zhengxiang9@huawei.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agotarget/arm: Minor cleanup for ARMv6-M 32-bit instructions
Julia Suvorova [Fri, 22 Jun 2018 12:28:34 +0000 (13:28 +0100)]
target/arm: Minor cleanup for ARMv6-M 32-bit instructions

The arrays were made static, "if" was simplified because V7M and V8M
define V6 feature.

Signed-off-by: Julia Suvorova <jusual@mail.ru>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 20180618214604.6777-1-jusual@mail.ru
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agohw/intc/arm_gicv3: fix an extra left-shift when reading IPRIORITYR
Amol Surati [Fri, 22 Jun 2018 12:28:34 +0000 (13:28 +0100)]
hw/intc/arm_gicv3: fix an extra left-shift when reading IPRIORITYR

When either GICD_IPRIORITYR or GICR_IPRIORITYR is read as a 32-bit
register, the post left-shift operator in the for loop causes an
extra shift after the least significant byte has been placed.

The 32-bit value actually returned is therefore the expected value
shifted left by 8 bits.

Signed-off-by: Amol Surati <suratiamol@gmail.com>
Message-id: 20180614054857.26248-1-suratiamol@gmail.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agoMerge remote-tracking branch 'remotes/stsquad/tags/pull-tcg-testing-revivial-210618...
Peter Maydell [Fri, 22 Jun 2018 09:57:47 +0000 (10:57 +0100)]
Merge remote-tracking branch 'remotes/stsquad/tags/pull-tcg-testing-revivial-210618-2' into staging

Add check-tcg machinary

This restores the ability to run TCG smoke tests by using our docker
infrastructure to support cross building simple tests. It represents
the first step to making better cross-architecture testing available
straight from the source tree ;-)

v2
  - fix quoting of target_compiler
  - make docker.py Py3 safe
  - tweak .travis.yml recipe
  - don't probe docker when HAVE_USER_DOCKER not set

# gpg: Signature made Thu 21 Jun 2018 07:23:45 BST
# gpg:                using RSA key FBD0DB095A9E2A44
# gpg: Good signature from "Alex Bennée (Master Work Key) <alex.bennee@linaro.org>"
# Primary key fingerprint: 6685 AE99 E751 67BC AFC8  DF35 FBD0 DB09 5A9E 2A44

* remotes/stsquad/tags/pull-tcg-testing-revivial-210618-2: (57 commits)
  .travis.yml: add check-tcg test
  tests/docker/Makefile.include: only force SID to NOCACHE if old
  docker: docker.py adding age check command
  tests/Makefile: call sub-makes with SKIP_DOCKER_BUILD=1
  docker: docker.py add check sub-command
  docker: docker.py don't conflate checksums for extra_files
  docker: docker.py use "version" to probe usage
  tests: add top-level make dependency for docker builds
  tests/tcg/i386: extend timeout for runcom test
  tests/tcg: override runners for broken tests
  tests/tcg: add run, diff, and skip helper macros
  tests/Makefile.include: add [build|clean|check]-tcg targets
  Makefile.target: add (clean-/build-)guest-tests targets
  tests/tcg/Makefile: update to be called from Makefile.target
  tests/tcg: enable building for PowerPC
  docker: move debian-powerpc-cross to sid based build
  tests/tcg: enable building for RISCV64
  tests/tcg: enable building for mips64
  tests/tcg: enable building for sparc64
  tests/tcg: enable building for sh4
  ...

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agoMerge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2018-06-20-v2' into staging
Peter Maydell [Fri, 22 Jun 2018 08:58:29 +0000 (09:58 +0100)]
Merge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2018-06-20-v2' into staging

nbd patches for 2018-06-20

Add experimental x-nbd-server-add-bitmap to expose a disabled
bitmap over NBD, in preparation for a pull model incremental
backup scheme. Also fix a corner case protocol issue with
NBD_CMD_BLOCK_STATUS, and add new NBD_CMD_CACHE.

- Eric Blake: tests: Simplify .gitignore
- Eric Blake: nbd/server: Reject 0-length block status request
- Vladimir Sementsov-Ogievskiy: 0/6 NBD export bitmaps
- Vladimir Sementsov-Ogievskiy: nbd/server: introduce NBD_CMD_CACHE

# gpg: Signature made Thu 21 Jun 2018 15:53:55 BST
# gpg:                using RSA key A7A16B4A2527436A
# gpg: Good signature from "Eric Blake <eblake@redhat.com>"
# gpg:                 aka "Eric Blake (Free Software Programmer) <ebb9@byu.net>"
# gpg:                 aka "[jpeg image of size 6874]"
# Primary key fingerprint: 71C2 CC22 B1C4 6029 27D2  F3AA A7A1 6B4A 2527 436A

* remotes/ericb/tags/pull-nbd-2018-06-20-v2:
  nbd/server: introduce NBD_CMD_CACHE
  docs/interop: add nbd.txt
  qapi: new qmp command nbd-server-add-bitmap
  nbd/server: implement dirty bitmap export
  nbd/server: add nbd_meta_empty_or_pattern helper
  nbd/server: refactor NBDExportMetaContexts
  nbd/server: fix trace
  nbd/server: Reject 0-length block status request
  tests: Simplify .gitignore

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agoMerge remote-tracking branch 'remotes/rth/tags/pull-tcg-20180615' into staging
Peter Maydell [Thu, 21 Jun 2018 16:54:26 +0000 (17:54 +0100)]
Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20180615' into staging

TCG patch queue:

Workaround macos assembler lossage.
Eliminate tb_lock.
Fix TB code generation overflow.

# gpg: Signature made Fri 15 Jun 2018 20:40:56 BST
# gpg:                using RSA key 64DF38E8AF7E215F
# gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>"
# Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A  05C0 64DF 38E8 AF7E 215F

* remotes/rth/tags/pull-tcg-20180615:
  tcg: Reduce max TB opcode count
  tcg: remove tb_lock
  translate-all: remove tb_lock mention from cpu_restore_state_from_tb
  cputlb: remove tb_lock from tlb_flush functions
  translate-all: protect TB jumps with a per-destination-TB lock
  translate-all: discard TB when tb_link_page returns an existing matching TB
  translate-all: introduce assert_no_pages_locked
  translate-all: add page_locked assertions
  translate-all: use per-page locking in !user-mode
  translate-all: move tb_invalidate_phys_page_range up in the file
  translate-all: work page-by-page in tb_invalidate_phys_range_1
  translate-all: remove hole in PageDesc
  translate-all: make l1_map lockless
  translate-all: iterate over TBs in a page with PAGE_FOR_EACH_TB
  tcg: move tb_ctx.tb_phys_invalidate_count to tcg_ctx
  tcg: track TBs with per-region BST's
  qht: return existing entry when qht_insert fails
  qht: require a default comparison function
  tcg/i386: Use byte form of xgetbv instruction

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agonbd/server: introduce NBD_CMD_CACHE
Vladimir Sementsov-Ogievskiy [Fri, 13 Apr 2018 14:31:56 +0000 (17:31 +0300)]
nbd/server: introduce NBD_CMD_CACHE

Handle nbd CACHE command. Just do read, without sending read data back.
Cache mechanism should be done by exported node driver chain.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20180413143156.11409-1-vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[eblake: fix two missing case labels in switch statements]
Signed-off-by: Eric Blake <eblake@redhat.com>
6 years agodocs/interop: add nbd.txt
Vladimir Sementsov-Ogievskiy [Sat, 9 Jun 2018 15:17:58 +0000 (18:17 +0300)]
docs/interop: add nbd.txt

Describe new metadata namespace: "qemu".

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20180609151758.17343-7-vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[eblake: grammar tweaks]
Signed-off-by: Eric Blake <eblake@redhat.com>
6 years agoqapi: new qmp command nbd-server-add-bitmap
Vladimir Sementsov-Ogievskiy [Sat, 9 Jun 2018 15:17:57 +0000 (18:17 +0300)]
qapi: new qmp command nbd-server-add-bitmap

For now, the actual command ix x-nbd-server-add-bitmap, reflecting
the fact that we are still working on libvirt code that proves the
command works as needed, and also the fact that we may remove
bitmap-export-name (and just require that the exported name be the
bitmap name).

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20180609151758.17343-6-vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[eblake: make the command experimental by adding x- prefix]
Signed-off-by: Eric Blake <eblake@redhat.com>
6 years agonbd/server: implement dirty bitmap export
Vladimir Sementsov-Ogievskiy [Sat, 9 Jun 2018 15:17:56 +0000 (18:17 +0300)]
nbd/server: implement dirty bitmap export

Handle a new NBD meta namespace: "qemu", and corresponding queries:
"qemu:dirty-bitmap:<export bitmap name>".

With the new metadata context negotiated, BLOCK_STATUS query will reply
with dirty-bitmap data, converted to extents. The new public function
nbd_export_bitmap selects which bitmap to export. For now, only one bitmap
may be exported.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20180609151758.17343-5-vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[eblake: wording tweaks, minor cleanups, additional tracing]
Signed-off-by: Eric Blake <eblake@redhat.com>
6 years agonbd/server: add nbd_meta_empty_or_pattern helper
Vladimir Sementsov-Ogievskiy [Tue, 19 Jun 2018 21:55:09 +0000 (16:55 -0500)]
nbd/server: add nbd_meta_empty_or_pattern helper

Add nbd_meta_pattern() and nbd_meta_empty_or_pattern() helpers for
metadata query parsing. nbd_meta_pattern() will be reused for the
"qemu" namespace in following patches.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20180609151758.17343-4-vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[eblake: comment tweaks]
Signed-off-by: Eric Blake <eblake@redhat.com>
6 years agonbd/server: refactor NBDExportMetaContexts
Vladimir Sementsov-Ogievskiy [Sat, 9 Jun 2018 15:17:54 +0000 (18:17 +0300)]
nbd/server: refactor NBDExportMetaContexts

Use NBDExport pointer instead of just export name: there is no need to
store a duplicated name in the struct; moreover, NBDExport will be used
further.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20180609151758.17343-3-vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[eblake: commit message grammar tweak]
Signed-off-by: Eric Blake <eblake@redhat.com>
6 years agonbd/server: fix trace
Vladimir Sementsov-Ogievskiy [Sat, 9 Jun 2018 15:17:53 +0000 (18:17 +0300)]
nbd/server: fix trace

Return code = 1 doesn't mean that we parsed base:allocation. Use
correct traces in both -parsed and -skipped cases.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20180609151758.17343-2-vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[eblake: comment tweaks]
Signed-off-by: Eric Blake <eblake@redhat.com>
6 years agonbd/server: Reject 0-length block status request
Eric Blake [Thu, 21 Jun 2018 12:49:37 +0000 (07:49 -0500)]
nbd/server: Reject 0-length block status request

The NBD spec says that behavior is unspecified if the client
requests 0 length for block status; but since the structured
reply is documenting as returning a non-zero length, it's
easier to just diagnose this with an EINVAL error than to
figure out what to return.

CC: qemu-stable@nongnu.org
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <20180621124937.166549-1-eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
6 years agotests: Simplify .gitignore
Eric Blake [Tue, 19 Jun 2018 20:39:18 +0000 (15:39 -0500)]
tests: Simplify .gitignore

Commit 0bcc8e5b was yet another instance of 'git status' reporting
dirty files after an in-tree build, thanks to the new binary
tests/check-block-qdict.

Instead of piecemeal exemptions of each new binary as they are
added, let's use git's negative globbing feature to exempt ALL
files that have a 'test-' or 'check-' prefix, except for the ones
ending in '.c' or '.sh'.  We still have a couple of generated
files that then need (re-)exclusion, but the overall list is a
LOT shorter, and less prone to needing future edits.

Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <20180619203918.65450-1-eblake@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
6 years ago.travis.yml: add check-tcg test
Alex Bennée [Wed, 18 Apr 2018 15:55:37 +0000 (16:55 +0100)]
.travis.yml: add check-tcg test

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
6 years agotests/docker/Makefile.include: only force SID to NOCACHE if old
Alex Bennée [Tue, 12 Jun 2018 20:29:40 +0000 (21:29 +0100)]
tests/docker/Makefile.include: only force SID to NOCACHE if old

Now we can check the age of a docker image we can be a little more
intelligent about re-building Sid images and only force NOCACHE if
it is "old".

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
6 years agodocker: docker.py adding age check command
Alex Bennée [Tue, 12 Jun 2018 20:28:45 +0000 (21:28 +0100)]
docker: docker.py adding age check command

This is useful for querying if an image is too old.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
6 years agotests/Makefile: call sub-makes with SKIP_DOCKER_BUILD=1
Alex Bennée [Fri, 15 Jun 2018 18:20:55 +0000 (19:20 +0100)]
tests/Makefile: call sub-makes with SKIP_DOCKER_BUILD=1

As we now ensure all the images we are going to use are built in the
top level make file lets not over complicate things by running the
full script again. We do run the check script just in case someone
deletes the docker image while we are running.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
6 years agodocker: docker.py add check sub-command
Alex Bennée [Fri, 8 Jun 2018 15:20:48 +0000 (16:20 +0100)]
docker: docker.py add check sub-command

This command allows you to check if we need to re-build a docker
image. If the image isn't in the repository or the checksums don't
match then we return false and some text (for processing in
makefiles).

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
6 years agodocker: docker.py don't conflate checksums for extra_files
Alex Bennée [Fri, 8 Jun 2018 14:20:25 +0000 (15:20 +0100)]
docker: docker.py don't conflate checksums for extra_files

This just gets confusing especially as the helper function doesn't
even take into account any extra files (or the executable). Currently
the actual check just ignores them and also passes the result through
_dockerfile_preprocess so we fix that too.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
6 years agodocker: docker.py use "version" to probe usage
Alex Bennée [Mon, 18 Jun 2018 10:14:40 +0000 (11:14 +0100)]
docker: docker.py use "version" to probe usage

The "images" command is a fairly heavyweight command to run as it
involves searching the whole docker file-system inventory. On a
machine with a lot of images this makes start-up fairly expensive.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
6 years agotests: add top-level make dependency for docker builds
Alex Bennée [Fri, 8 Jun 2018 11:12:46 +0000 (12:12 +0100)]
tests: add top-level make dependency for docker builds

One problem with satisfying your docker dependencies in a sub-make it
you might end up trying to satisfy the dependency multiple times. This
is especially a problem with debian-sid based cross compilers and CI
setups. We solve this by doing a docker build pass at the top level
before any sub-makes are called.

We still need to satisfy dependencies in the Makefile.target call so
people can run tests from individual target directories. We introduce
a new Makefile.probe which gets called for each PROBE_TARGET and
allows us to build up the list. It does require multiply including
config-target.mak which shouldn't cause any issues as it shouldn't
define anything that clashes with config-host.mak. However we undefine
a few key variables each time around.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
6 years agotests/tcg/i386: extend timeout for runcom test
Alex Bennée [Mon, 18 Jun 2018 09:34:20 +0000 (10:34 +0100)]
tests/tcg/i386: extend timeout for runcom test

The Travis hardware can be a little slow and the runcom test is fairly
heavy in calculating pi. Lets double the timeout so we don't trip up
during CI by mistake.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
6 years agotests/tcg: override runners for broken tests
Alex Bennée [Tue, 24 Apr 2018 14:21:50 +0000 (15:21 +0100)]
tests/tcg: override runners for broken tests

To get a clean run of check-tcg these tests are currently skipped:

  - hello-mips for mips
  - linux-test for sparc

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
6 years agotests/tcg: add run, diff, and skip helper macros
Alex Bennée [Mon, 21 May 2018 09:38:37 +0000 (10:38 +0100)]
tests/tcg: add run, diff, and skip helper macros

As we aren't using the default runners for all the test cases it is
easy to miss out things like timeouts. To help with this we add some
helpers and use them so we only need to make core changes in one
place.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
6 years agotests/Makefile.include: add [build|clean|check]-tcg targets
Alex Bennée [Fri, 6 Apr 2018 21:08:36 +0000 (22:08 +0100)]
tests/Makefile.include: add [build|clean|check]-tcg targets

This will ensure all linux-user targets build their guest test
programs and ensure check-tcg will run the respective tests.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
6 years agoMakefile.target: add (clean-/build-)guest-tests targets
Alex Bennée [Fri, 6 Apr 2018 10:08:37 +0000 (11:08 +0100)]
Makefile.target: add (clean-/build-)guest-tests targets

Now all the build infrastructure is in place we can build tests for
each guest that we support. That support mainly depends on having
cross compilers installed or docker setup. To keep all the logic for
that together we put the rules in tests/tcg/Makefile.include and
include it from the main Makefile.target.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
6 years agotests/tcg/Makefile: update to be called from Makefile.target
Alex Bennée [Fri, 6 Apr 2018 12:32:18 +0000 (13:32 +0100)]
tests/tcg/Makefile: update to be called from Makefile.target

This make is now invoked from each individual target make with the
appropriate CC and EXTRA_CFLAGS set for each guest. It then includes
additional Makefile.targets from:

  - tests/tcg/multiarch (always)
  - tests/tcg/$(TARGET_BASE_ARCH) (if available)
  - tests/tcg/$(TARGET_NAME)

The order is important as the later Makefile's may want to suppress
TESTS from its base arch profile. Each included Makefile.target is
responsible for adding TESTS as well as defining any special build
instructions for individual tests.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
6 years agotests/tcg: enable building for PowerPC
Alex Bennée [Thu, 24 May 2018 21:28:45 +0000 (22:28 +0100)]
tests/tcg: enable building for PowerPC

Now we have restored debian-image-powerpc-cross using Debian SID
compilers we can build for 32 bit powerpc. Although PPC32 supports a
range of pages sizes currently only 4k works so the others are
commented out for now.

We can also merge the ppc64 support under the base architecture
directory to avoid too much proliferation of directories.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
6 years agodocker: move debian-powerpc-cross to sid based build
Alex Bennée [Thu, 24 May 2018 21:12:15 +0000 (22:12 +0100)]
docker: move debian-powerpc-cross to sid based build

The original Jessie based cross builder hasn't worked for a while. The
state of the libraries is still perilous for cross-building QEMU but
we can use it for building TCG tests.

The debian-apt-fake.sh script can also be dropped as it is no longer
used.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
6 years agotests/tcg: enable building for RISCV64
Alex Bennée [Tue, 24 Apr 2018 15:41:18 +0000 (16:41 +0100)]
tests/tcg: enable building for RISCV64

As before, using Debian SID compilers.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
6 years agotests/tcg: enable building for mips64
Alex Bennée [Mon, 23 Apr 2018 15:57:48 +0000 (16:57 +0100)]
tests/tcg: enable building for mips64

As before, using Debian SID compilers.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
6 years agotests/tcg: enable building for sparc64
Alex Bennée [Mon, 23 Apr 2018 15:49:09 +0000 (16:49 +0100)]
tests/tcg: enable building for sparc64

As before, using Debian SID compilers.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
6 years agotests/tcg: enable building for sh4
Alex Bennée [Mon, 23 Apr 2018 15:25:06 +0000 (16:25 +0100)]
tests/tcg: enable building for sh4

As before, using Debian SID compilers. While the compiler can be
coerced into generating big-endian code it seems the linker can't deal
with it so we only enable the building for little endian SH4.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
6 years agotests/tcg: enable building for m68k
Alex Bennée [Mon, 23 Apr 2018 15:08:36 +0000 (16:08 +0100)]
tests/tcg: enable building for m68k

As before, using Debian SID compilers.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
6 years agotests/tcg: enable building for HPPA
Alex Bennée [Mon, 23 Apr 2018 15:00:13 +0000 (16:00 +0100)]
tests/tcg: enable building for HPPA

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
6 years agotests/tcg/alpha: add Alpha specific tests
Alex Bennée [Mon, 23 Apr 2018 14:48:06 +0000 (15:48 +0100)]
tests/tcg/alpha: add Alpha specific tests

These tests did use their own crt.o stub however that is a little
stone age so we drop crt.S and just statically link to the cross
compilers libraries.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
6 years agotests/tcg: enable building for Alpha
Alex Bennée [Mon, 23 Apr 2018 12:54:09 +0000 (13:54 +0100)]
tests/tcg: enable building for Alpha

We can't use our normal Debian based compilers as Alpha isn't an
officially supported architecture. However it is available as a port
and fortunately cross compilers for all these targets are included in
Debian Sid, the perpetual rolling/unstable/testing version of Debian.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
6 years agotests/tcg: enable building for ppc64
Alex Bennée [Tue, 10 Apr 2018 16:45:56 +0000 (17:45 +0100)]
tests/tcg: enable building for ppc64

Currently this just enables building the multiarch tests.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
6 years agotests/tcg: enable building for s390x
Alex Bennée [Fri, 6 Apr 2018 20:43:57 +0000 (21:43 +0100)]
tests/tcg: enable building for s390x

This doesn't add any additional tests but enables building the
multiarch tests for s390x.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Acked-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: David Hildenbrand <david@redhat.com>
6 years agotests/tcg/mips: include common mips hello-mips
Alex Bennée [Tue, 17 Apr 2018 10:31:02 +0000 (11:31 +0100)]
tests/tcg/mips: include common mips hello-mips

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
6 years agotests/docker/Makefile.include: fix mipsel-cross dependancy
Alex Bennée [Mon, 11 Jun 2018 10:17:13 +0000 (11:17 +0100)]
tests/docker/Makefile.include: fix mipsel-cross dependancy

This got broken in commit 4319db7 but generally only shows up when you
try and do massive parallel builds on fresh machines.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
6 years agotests/tcg: enable building for MIPS
Alex Bennée [Tue, 17 Apr 2018 13:55:17 +0000 (14:55 +0100)]
tests/tcg: enable building for MIPS

This doesn't add any additional tests but enables building the
multiarch tests for MIPS using docker cross compilers. We don't have a
cross compiler for mips64 big endian though.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
6 years agotests/tcg: move MIPS specific tests into subdir
Alex Bennée [Thu, 5 Apr 2018 14:50:08 +0000 (15:50 +0100)]
tests/tcg: move MIPS specific tests into subdir

These only need to be built for MIPS guests.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
6 years agotests/tcg/arm: add fcvt test cases for AArch32/64
Alex Bennée [Fri, 13 Apr 2018 16:08:26 +0000 (17:08 +0100)]
tests/tcg/arm: add fcvt test cases for AArch32/64

This runs through the usual float to float conversions and crucially
also runs with ARM Alternative Half Precision Format.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
6 years agotests/tcg: enable building for AArch64
Alex Bennée [Wed, 9 May 2018 09:31:30 +0000 (10:31 +0100)]
tests/tcg: enable building for AArch64

We only have compilers for the (default) little endian variants.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
6 years agotests/tcg/arm: fix up test-arm-iwmmxt test
Alex Bennée [Fri, 13 Apr 2018 13:56:17 +0000 (14:56 +0100)]
tests/tcg/arm: fix up test-arm-iwmmxt test

We need to rename the source file to a .S so we can do a single-line
assemble and link invocation. We also specify the additional CFLAGS
for the compile as it's a non-standard ARM binary.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
[rth: force fpu configuration]
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
6 years agotests/tcg: enable building for ARM
Alex Bennée [Mon, 7 May 2018 20:53:43 +0000 (21:53 +0100)]
tests/tcg: enable building for ARM

This allows us to use the docker cross compiler image to build these
tests.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
6 years agotests/tcg: move ARM specific tests into subdir
Alex Bennée [Thu, 5 Apr 2018 14:45:32 +0000 (15:45 +0100)]
tests/tcg: move ARM specific tests into subdir

These only need to be built for ARM guests.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
6 years agotests/tcg/i386/test-i386: fix printf format
Alex Bennée [Fri, 13 Apr 2018 16:17:37 +0000 (17:17 +0100)]
tests/tcg/i386/test-i386: fix printf format

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
6 years agotests/tcg/i386/test-i386: use modern vector_size attributes
Alex Bennée [Fri, 13 Apr 2018 16:16:00 +0000 (17:16 +0100)]
tests/tcg/i386/test-i386: use modern vector_size attributes

The compiler complains about the old __mode__ style attributes.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
6 years agotests/tcg/x86_64: add Makefile.target
Alex Bennée [Tue, 17 Apr 2018 10:14:37 +0000 (11:14 +0100)]
tests/tcg/x86_64: add Makefile.target

The sources for x86_64 are shared in the i386 directory which will be
included thanks to TARGET_BASE_ARCH. However not all sources build so
we need to filter out the ones we can't build in the 64 bit world and
those that can't be built for 32 bit.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
6 years agotests/tcg/i386: add runner for test-i386-fprem
Alex Bennée [Tue, 10 Apr 2018 14:23:29 +0000 (15:23 +0100)]
tests/tcg/i386: add runner for test-i386-fprem

The runner needs to compare against a reference run. We also only run
this test when SPEED=slow as it takes a while.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
6 years agotests/tcg/i386: fix test-i386
Alex Bennée [Tue, 10 Apr 2018 14:16:45 +0000 (15:16 +0100)]
tests/tcg/i386: fix test-i386

We don't include anything from qemu itself for the build.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
6 years agotests/tcg/i386: Build fix for hello-i386
Fam Zheng [Fri, 8 Sep 2017 09:16:57 +0000 (17:16 +0800)]
tests/tcg/i386: Build fix for hello-i386

We have -Werror=missing-prototype, add a dummy prototype to avoid that
warning.

Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
6 years agotests/tcg: enable building for i386
Alex Bennée [Tue, 17 Apr 2018 13:56:39 +0000 (14:56 +0100)]
tests/tcg: enable building for i386

While you can construct a compile command that does work using the
x86_64 host compiler that most people use this is flakey. Different
distros handle this is different ways so we default to using a known
good i386 compiler via docker.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
6 years agotests/tcg: move i386 specific tests into subdir
Alex Bennée [Thu, 5 Apr 2018 14:35:11 +0000 (15:35 +0100)]
tests/tcg: move i386 specific tests into subdir

These only need to be built for i386 guests. This includes a stub
tests/tcg/i386/Makfile.target which absorbs some of what was in
tests/tcg/Makefile.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
6 years agotests/tcg/multiarch: move most output to stdout
Alex Bennée [Tue, 24 Apr 2018 13:00:46 +0000 (14:00 +0100)]
tests/tcg/multiarch: move most output to stdout

The default test run outputs to stdout so it can be re-directed.
Errors are still reported to stderr.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
6 years agotests/tcg/multiarch: don't hard code paths/ports for linux-test
Alex Bennée [Fri, 8 Jun 2018 19:15:03 +0000 (20:15 +0100)]
tests/tcg/multiarch: don't hard code paths/ports for linux-test

The fixed path and ports get in the way of running our tests and
builds in parallel. Instead of using TESTPATH we use mkdtemp() and
instead of a fixed port we allow the kernel to assign one and query it
afterwards.

Ideally test directory creation should be common functionally across
all TCG tests but this could complicate an already huge patch series
so we mark it as a TODO for next time.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
6 years agotests/tcg/multiarch: enable additional linux-test tests
Alex Bennée [Thu, 19 Apr 2018 13:02:04 +0000 (14:02 +0100)]
tests/tcg/multiarch: enable additional linux-test tests

Un-comment the remaining tests.

I removed the itimer value tests because I'm fairly sure a re-arming
timer will always have a different value in it when you grab it.

I've also fixed up the clone thread flags as QEMU will only allow a
clone to use flags which match glibc. However the test is still racey
so it remains disabled by default - it can be run by passing any
additional parameters on the command line.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
6 years agotests/tcg/multiarch: Build fix for linux-test
Fam Zheng [Fri, 8 Sep 2017 09:16:58 +0000 (17:16 +0800)]
tests/tcg/multiarch: Build fix for linux-test

To keep the compiler happy, and to fit in our buildsys flags:

- Make local functions "static"
- #ifdef out unused functions
- drop cutils/osdep dependencies

Signed-off-by: Fam Zheng <famz@redhat.com>
[AJB: drop cutils/osdep dependencies]
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
6 years agotests/tcg: move architecture independent tests into subdir
Alex Bennée [Thu, 5 Apr 2018 14:03:22 +0000 (15:03 +0100)]
tests/tcg: move architecture independent tests into subdir

We will want to build these for all supported guest architectures so
lets move them all into one place. We also drop test_path at this
point because it needs qemu utils and glib bits which is hard to
support for cross compiling.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
6 years agodocker: Makefile.include introduce DOCKER_SCRIPT
Alex Bennée [Fri, 6 Apr 2018 15:25:39 +0000 (16:25 +0100)]
docker: Makefile.include introduce DOCKER_SCRIPT

Define this in one place to make it easy to re-use.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
6 years agodocker: allow "cc" command to run in user context
Alex Bennée [Fri, 6 Apr 2018 15:23:26 +0000 (16:23 +0100)]
docker: allow "cc" command to run in user context

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
6 years agodocker: extend "cc" command to accept compiler
Alex Bennée [Thu, 12 Apr 2018 16:18:12 +0000 (17:18 +0100)]
docker: extend "cc" command to accept compiler

When calling our cross-compilation images we want to call something
other than the default cc.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Fam Zheng <famz@redhat.com>
6 years agodocker: Add "cc" subcommand
Alex Bennée [Thu, 12 Apr 2018 15:49:11 +0000 (16:49 +0100)]
docker: Add "cc" subcommand

Signed-off-by: Fam Zheng <famz@redhat.com>
[AJB: add if args.paths check]
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
6 years agoconfigure: set cross_cc_FOO for host compiler
Alex Bennée [Fri, 13 Apr 2018 15:15:07 +0000 (16:15 +0100)]
configure: set cross_cc_FOO for host compiler

We can build tests for the host system with the compiler that we have
selected.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
6 years agoconfigure: allow user to specify --cross-cc-cflags-foo=
Alex Bennée [Fri, 13 Apr 2018 10:07:58 +0000 (11:07 +0100)]
configure: allow user to specify --cross-cc-cflags-foo=

As an individual compiler may be able to support several targets with
the appropriate flags we need to expose this to the user as well.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
6 years agoconfigure: move i386_cc to cross_cc_i386
Alex Bennée [Tue, 10 Apr 2018 11:19:40 +0000 (12:19 +0100)]
configure: move i386_cc to cross_cc_i386

Also dont assume x86_64 compiler can build i386 binaries.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
6 years agoconfigure: add support for --cross-cc-FOO
Alex Bennée [Wed, 4 Apr 2018 19:27:05 +0000 (20:27 +0100)]
configure: add support for --cross-cc-FOO

This allows us to specify cross compilers for our guests. This is
useful for building test images/programs. Currently we re-run the
compile test for each target. I couldn't think of a way to cache the
value for a given arch without getting messier configure code.

The cross compiler for the guest is visible to each target as
CROSS_CC_GUEST in config-target.mak. This is quoted to handle the case
of --cc="ccache gcc".

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
6 years agodocker: docker.py wrap StringIO import for python3
Alex Bennée [Wed, 20 Jun 2018 14:45:42 +0000 (15:45 +0100)]
docker: docker.py wrap StringIO import for python3

Although the docker.py is nominally python2 we actually invoke it with
the configured python from the configure script.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
6 years agoMerge remote-tracking branch 'remotes/cohuck/tags/s390x-20180619' into staging
Peter Maydell [Wed, 20 Jun 2018 08:51:30 +0000 (09:51 +0100)]
Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20180619' into staging

- cleanup in virtio-ccw
- accommodate guests using vfio-ccw without specifying unlimited
  prefetch, but actually working fine
- add cpu model for the z14 Model ZR1
- add support for pxelinux.cfg-style network booting to the s390x
  firmware

# gpg: Signature made Tue 19 Jun 2018 10:33:06 BST
# gpg:                using RSA key DECF6B93C6F02FAF
# gpg: Good signature from "Cornelia Huck <conny@cornelia-huck.de>"
# gpg:                 aka "Cornelia Huck <huckc@linux.vnet.ibm.com>"
# gpg:                 aka "Cornelia Huck <cornelia.huck@de.ibm.com>"
# gpg:                 aka "Cornelia Huck <cohuck@kernel.org>"
# gpg:                 aka "Cornelia Huck <cohuck@redhat.com>"
# Primary key fingerprint: C3D0 D66D C362 4FF6 A8C0  18CE DECF 6B93 C6F0 2FAF

* remotes/cohuck/tags/s390x-20180619:
  pc-bios/s390-ccw: Update the s390-netboot.img binary
  pc-bios/s390-ccw: Optimize the s390-netboot.img for size
  pc-bios/s390-ccw/net: Try to load pxelinux.cfg file accoring to the UUID
  pc-bios/s390-ccw/net: Add support for pxelinux-style config files
  pc-bios/s390-ccw/net: Update code for the latest changes in SLOF
  roms: Update SLOF submodule to current status
  pc-bios/s390-ccw: define loadparm length
  s390x/cpumodels: add z14 Model ZR1
  s390x/ipl: Try to detect Linux vs non Linux for initial IPL PSW
  vfio-ccw: remove orb.c64 (64 bit data addresses) check
  vfio-ccw: add force unlimited prefetch property
  virtio-ccw: clean up notify

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agoMerge remote-tracking branch 'remotes/mcayland/tags/qemu-openbios-20180618' into...
Peter Maydell [Tue, 19 Jun 2018 17:29:16 +0000 (18:29 +0100)]
Merge remote-tracking branch 'remotes/mcayland/tags/qemu-openbios-20180618' into staging

qemu-openbios queue

# gpg: Signature made Mon 18 Jun 2018 19:28:08 BST
# gpg:                using RSA key 5BC2C56FAE0F321F
# gpg: Good signature from "Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>"
# Primary key fingerprint: CC62 1AB9 8E82 200D 915C  C9C4 5BC2 C56F AE0F 321F

* remotes/mcayland/tags/qemu-openbios-20180618:
  Update OpenBIOS images to 8fe6f5f96f built from submodule.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agoMerge remote-tracking branch 'remotes/mcayland/tags/qemu-sparc-20180618' into staging
Peter Maydell [Tue, 19 Jun 2018 16:42:50 +0000 (17:42 +0100)]
Merge remote-tracking branch 'remotes/mcayland/tags/qemu-sparc-20180618' into staging

qemu-sparc queue

# gpg: Signature made Mon 18 Jun 2018 18:43:24 BST
# gpg:                using RSA key 5BC2C56FAE0F321F
# gpg: Good signature from "Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>"
# Primary key fingerprint: CC62 1AB9 8E82 200D 915C  C9C4 5BC2 C56F AE0F 321F

* remotes/mcayland/tags/qemu-sparc-20180618:
  SPARC64: add icount support
  hw/sparc/sun4m: Fix problems with device introspection
  hw/sparc64/sun4u: Fix introspection by converting prom instance_init to realize

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agoMerge remote-tracking branch 'remotes/rth/tags/pull-axp-20180618' into staging
Peter Maydell [Tue, 19 Jun 2018 15:57:43 +0000 (16:57 +0100)]
Merge remote-tracking branch 'remotes/rth/tags/pull-axp-20180618' into staging

Place parallel device properly, fixing vga

# gpg: Signature made Mon 18 Jun 2018 17:45:50 BST
# gpg:                using RSA key 64DF38E8AF7E215F
# gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>"
# Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A  05C0 64DF 38E8 AF7E 215F

* remotes/rth/tags/pull-axp-20180618:
  hw/isa/smc37c669: Change the parallel I/O base to 378H

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
6 years agoMerge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
Peter Maydell [Tue, 19 Jun 2018 15:04:43 +0000 (16:04 +0100)]
Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging

Block layer patches:

- Active mirror (blockdev-mirror copy-mode=write-blocking)
- bdrv_drain_*() fixes and test cases
- Fix crash with scsi-hd and drive_del

# gpg: Signature made Mon 18 Jun 2018 17:44:10 BST
# gpg:                using RSA key 7F09B272C88F2FD6
# gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>"
# Primary key fingerprint: DC3D EB15 9A9A F95D 3D74  56FE 7F09 B272 C88F 2FD6

* remotes/kevin/tags/for-upstream: (35 commits)
  iotests: Add test for active mirroring
  block/mirror: Add copy mode QAPI interface
  block/mirror: Add active mirroring
  job: Add job_progress_increase_remaining()
  block/mirror: Add MirrorBDSOpaque
  block/dirty-bitmap: Add bdrv_dirty_iter_next_area
  test-hbitmap: Add non-advancing iter_next tests
  hbitmap: Add @advance param to hbitmap_iter_next()
  block: Generalize should_update_child() rule
  block/mirror: Use source as a BdrvChild
  block/mirror: Wait for in-flight op conflicts
  block/mirror: Use CoQueue to wait on in-flight ops
  block/mirror: Convert to coroutines
  block/mirror: Pull out mirror_perform()
  block: fix QEMU crash with scsi-hd and drive_del
  test-bdrv-drain: Test graph changes in drain_all section
  block: Allow graph changes in bdrv_drain_all_begin/end sections
  block: ignore_bds_parents parameter for drain functions
  block: Move bdrv_drain_all_begin() out of coroutine context
  block: Allow AIO_WAIT_WHILE with NULL ctx
  ...

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